Adding new set of attrs with old attrs values

Our DS architecture has changed and we need to change a node in our DS which holds information about our applications.So, we need to add new attributes for all the entries in this node and have these new attributes reflect the value of the old attributes and then remove the old attributes.
If anyone has done this before or has snippets of code please let us know.
thx

here is code that I have. It compiles runs but does not even enter the while loop at all. Could someone please take look tell me what thinks I have overlooked.
import javax.naming.Context;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.DirContext;
import javax.naming.directory.Attributes;
import javax.naming.NamingException;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.directory.SearchControls;
import java.util.*;
import javax.naming.*;
public class WriteAttributes
public static void main(String[] args)
String filter = "cn=DummyApp1"; // change value to * to retrieve all entries
String dn = "ou=Applications,o=company.com,o=sds";
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.PROVIDER_URL, "ldap://XXXXXXX");
env.put(Context.SECURITY_PRINCIPAL, "cn=Directory Manager");
env.put(Context.SECURITY_CREDENTIALS, "XXXXXX");
try {
DirContext ctx = new InitialDirContext(env);
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
NamingEnumeration results = ctx.search("", filter, constraints);
Attributes attrs = ctx.getAttributes(filter+","+dn);
// it doesn't enter this loop, jumps tp last print stmt.
while (results != null && results.hasMore())
System.out.println("Entered while loop");
SearchResult si = (SearchResult)results.next();
/* print its name, cn , and for each one add objectclass and asscociated attributes*/
System.out.println(si.getName());
Attributes my_attrs = new BasicAttributes(true);
Attribute objclass = new BasicAttribute("objectclass");
objclass.add("applicationEntity");
objclass.add("applicationResource");
my_attrs.put("abbreviation", (String)attrs.get("seg-abbreviation").get());
my_attrs.put(objclass);
ctx.modifyAttributes(filter,ctx.ADD_ATTRIBUTE,my_attrs);
Attributes _attrs = si.getAttributes();
if (attrs == null) {
System.out.println("No attributes");
} else {
/* print each attribute */
for (NamingEnumeration ae = _attrs.getAll();
ae.hasMoreElements();) {
Attribute attr = (Attribute)ae.next();
String attrId = attr.getID();
/* print each value */
for (Enumeration vals = attr.getAll();
vals.hasMoreElements();
System.out.println(attrId + ": " + vals.nextElement()))
System.out.println("-------------------------------");
} catch (NamingException e) {
System.err.println("Search failed.");
e.printStackTrace();

Similar Messages

  • I'm useing lvwutil32.dll and am getting a "Error 10" (New I/O attempted with old I/O in progress), help :-(

    Like my question says, I'm trying to use a buntch of vi's I had gotten about 3 years ago. They work with windows and managing them, along with other standard PC events. I have no problem with the implementation of these vi's into any of my diagrams nor while running the application where my IDE is installed. However, when I try to compile it, I get the "Error 10 occurred at C:\Program File\...\user.lib\lvwutil32.dll". It states 2 possible causes: 1) LabVIEW: Duplicate path & 2) NI-488: New I/O attempted with old I/O in progress".

    It has to do with the way you have your build file constructed. The source and destination can't be the same because the application builder attempts to copy the dll into the build directory-which causes the error.
    To fix the problem, create a directory containing the dlls you will be using in the build. Specify the dlls in this directory as the source file. Next, after adding all the dlls to the project, click on the "Custom Destinations..." button and for each of the dlls you've added, specify the "Windows System Directory" as the destination WITH NO RELATIVE PATH.
    The build should now work...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Sir, I have lost my iphone4 yesterday. Before my warranty expires I bought a new piece in exchange with old one die to so software prob. I have imei number of my old phone but didn't remember new ones.How could I retrieve IMEI no. of my new one to traceit

    sir, I have lost my iphone4 yesterday. Before my warranty expires I bought a new piece in exchange with old one die to so software prob. I have imei number of my old phone but didn't remember new ones.How could I retrieve IMEI no. of my new one to trace it.

    You can't use the IMEI number for tracking it, you can only potentially do that if you had Find My iPhone enabled on it - if you did then you can try locating it via http://icloud.com or the Find My iPhone app on another iOS device.
    For the IMEI number, do you have you got the phone's box or have a backup of the phone on your computer's iTunes : http://support.apple.com/kb/HT4061 ?
    If it was stolen then you should report it to the police. You should also change your iTunes account password, your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.

  • Addons - new versions of addon with old versions of B1

    Hi guys,
    Does anyone know if new versions of addons work with old versions of SAP B1?
    I have a client who is asking for the latest Payment Engine (PL70) but they are on SAPB1 2005A SP01 PL12 which has the Payment Engine PL30.
    My thinking is that you will need to upgrade the B1 app to PL34, if you want to use the latest addon?
    or am i way out and infact the addons work independently of B1 and will therefore work on an old patch of B1?
    TIA,
    John Treweeks

    Hi John,
    Patches are bug fixes and do not change functionality (unless the functionality was broken of course ). Addons communicate through the UI and DI APIs which are installed as part of the patch. Therefore, the theory should be that addons are pretty much patch independent.
    But, as has been pointed out above, it's really difficult to predict exactly what results you'll get. I guess sometimes an addon patch could have been released in order to correct a problem that was both addon and DI API related. In that case, you'd need to install the addon patch and the SBO patch.
    I never recommend you go to the latest patch until it has been around for a few weeks. However, going to a patch that is dated just prior to the addon patch release sounds like a sensible policy. In any case, testing is vital, prior to installation on a production site.
    Kind Regards,
    Owen

  • New Text Messages Jumbled with Old Ones

    I am on Verizon, and previously had the Samsung Galaxy S3.  Shortly after the HTC One was released on VZW I picked it up.  I've got a friend on T-Mobile who I text with a lot, probably 25 - 50 messages a day.  Starting shortly after I got the HTC one she started getting new messages merged and "jumbled" as we call it together with old messages.  Messages that weren't even sent with my HTC one - they were sent from my old Samsung.  This leads me to believe it's got to be that VZW somehow has these old messages on their servers, and they are somehow matching (ID's or however they are stored) with the new ones and merging together.
    At first this was happening maybe once a week or so, at this point it's happening multiple times a day.  What's interesting is that it's certainly content based.  I'll send her a text and she will reply back "jumbled message" - if I copy and paste that same message she will get it all jumbled up over and over - every time I send that same content.  I end up either screen shotting and emailing her, or I'll re-word the message.  Now I'll give an example of what happens:
    Original Message:  I'm not really sure, I'll have to check with him in the morning.  Do you mind waiting until then?
    New Message: Haha, sure... I'll get right on that... nope
    That New Message won't get sent correctly, instead what she will receive is:
    Jumbled Message: Haha, sure... I'll get right on that... nope him in the morning.  Do you mind waiting until then?
    OR
    Jumbled Message: I'm not really sure, I'll have to check with him in the morning.  Do sure... I'll get right on that... nope
    I haven't seen a rhyme or reason as to whether it places the old first or the new first... and though my example was with a short message I *believe* they have all been with long (160+) character messages.
    Additional:  I've used Handcent SMS with both of these phones, she uses GoSMS (though they show up jumbled in her default app as well).  T-Mobile displays the message whole, not chopped into 160 blocks.
    Help!?

    FYI, I removed handcent and have had the issue happen twice today with the stock messaging application.  It may not be a *common* problem but other people are certainly having it: https://community.verizonwireless.com/message/1006501
    What I'd like to point out is this.  If I'm using the stock messaging application - and my messages are getting mixed together with messages I sent over 6 months ago from a DIFFERENT phone, how can the issue be phone related at all?  I don't see a way that this isn't somehow on the verizon server side.  I believe that when the server splits up multi-part messages (over 160 characters) and puts them back together it's somehow putting them together with old message parts stored / cached on the server side.

  • Adding new characteristics to cube with data

    Hi Gurus,
    i need to add some characteristics to a cube already in production, this cube is customized version of material stocks/movements cube (0ic_c03).
    i am looking for a way to add the new characteristics without having to do reinitialisation (opening stock,...), i am thinking about a loopback process but how do i manage to get the new characteristics populated for the historical data?
    Thank you.

    Hi,
    If you want to load historial data, you must take ECC down time and re-intialization is required.Becasue you are adding new object in Cube and for that you need to change the Update rules, then need to load historical data, so without down time and reinitialization it is not possible.
    Check like below.
    You have data in PSA, so try to delete data from Cube and then load from PSA. Because you may write code in Update rules on;y I think. So in that case, it may work.
    Thanks
    Reddy

  • Problems setting up WDS with old AX and new AEBS

    Hi all,
    after buying a new AEBS last week, I want to put my old AX back into service. Here's what I have planned:
    The cable modem sits in the living room near my stereo. The AX should connect to the cable modem and the stereo and be the main station in a WDS network with the AEBS. The AEBS will be in my study as a remote station to the AX.
    Sounds trivial, but apparently it isn't I have spent the evening setting up the two base stations again and again. For some reason, the Airport Utility cannot see both stations at once as soon as they are configured. The AEBS won't find the AX even though the MAC address is correct.
    I tried with and without WPA/WPA2, but I cannot figure out what's wrong
    Could someone please give me a step by step guide of what to do? I am quite desperate by now...
    Cheers from Switzerland
    Daniel

    Well, what can I say... Of course, I could not give up
    Finally I got it to work. For future reference, here's how:
    I first set up the AEBS to create a network, then used the Wizard of the Airport Utilitiy to add the AX as a WDS-device (it sets up the whole WDS automatically). Then I flipped the settings - set the AX to be main and the AEBS to be the remote.
    I also had to adapt the Internet-Settings. Both base stations were set to bridge-mode, which doesn't work in my case because I only get two IPs from my ISP. So, I set the AX (the main) to share an internet connection and get its IP by DHCP. The AEBS on the other hand needed to get an IP manually (outside of the address space of the DHCP server created by the AX, but within its subnet).
    After that it all worked - even AirTunes The AEBS now sits on my desk and the AX provides internet from the living room.
    Cheers,
    Daniel

  • Help!! adding new pages to doc with logo!!!

    I've posted various questions for a couple hours now, none are answered.  Is everyone sleeping or does no one know how to use Pages??  I'm near tears and I've read the manual about 10 times and don't understand it.  I've tried to Google it but I'm not even sure what exactly to Google.
    I have an 18 page document in Pages.  It's just a plain old word processing document.  A list of Gluten Free restaurants in my area.  I add new restaurants to this list all the time so it needs to re-order itself as it does as a plain word processing document.
    I want to brand it more so I'm putting my logo and a little design in the bottom left corner of each page, or at least thats how I'd like it to look.
    So I set up page one, saved it as a template, captured it, done everything I can think of. But when I copy the document and paste it into the text boxt on the first page of the new document with the little logo on the page, all the subsequent pages do NOT have that logo on them.  Just the first page. 
    IF I set up 18 pages with the logo, and then paste it just adds 17 blank pages after that first page with the logo.  And those 17 pages that I set up prior to pasting are after the pages it added after the paste that have no logo.
    How do it get this to add a page with the logo in the corner??
    So when I add 5 new restaurants and it has to add a page to fit them it it will have that logo.  This can't be that hard to do.  I need the doucment to automatically add new pages when text is add and those pages need to have the logo,
    Please help me!!!
    Susan

    I'm sorry you think that Peter and it isn't true.  Maybe you are testy because its 2 am.
    I spent hours trying to figure it out on my own.  I looked all over these forums, I Googled it, I went to other Apple tips and forums I am familar with, went thru the manual.  I tried a lot of places first so I really don't think I'm demanding and I'm sorry if I came off that way. 
    I was just super frustrated.  Not being very computer savvy can be super frustrating, often I find what I "think" might be the answer for something I'm looking for and I can't even understand the answer.  I try, I follow the steps but some of the terms I don't know and then have to google and follow more steps and blah blah. 
    I'm sorry but I didn't just come here without doing research first for the answer, so its not fair to say I expected others to do the work for me.  I did try.  I agree the information here us beyond useful, I never could have done anything without out in the past, I've used it many times.  But you can shoot the messenger if you want but the response time does seem slower.  Not sure why you take that personally. 
    I'm sorry to **** you off so much. 

  • New P55-GD65 System with old already installeWindows 7 doesn't boot, Blue screen

    I just built my new system with these specs
    1. Core i5
    2. P55-GD65
    3. Kingston 2x2gb 1333Mhz DDR3
    4. MSI N275GTX Twin FROZR
    5. 650watt PSU
    6. Sony DVD/CD RW+
    7. BIOS Ver 1.2
    I had a 500gb SATA WD HDD which i used with my old system, with windows 7 ultimate 32bit and windows xp 64bit installed. It was working pretty fine with that system. When i built this new rig, i installed the same HDD with it but wt i now face is that my win7 doesn't boot. Soon after windows 7's logo appears, the system reboots after a short blue screen. On reboot win7 asks for a startup repair . . . when i go for it, it fails to repair. I get the following thing in error;
    Problem event name: StartupRepairOffline
    Problem Signature 01: (win 7's version is listed here - the same goes for Prob Signature 02)
    Problem Signature 03: Unknown
    Problem Signature 04: 21201167
    Problem Signature 05: AutoFailover
    Problem Signature 06: 6
    Problem Signature 07: CorruptAcl
    Locale ID: 1033
    I even tried to go for Repair through Windows 7 CD but in vain.
    Can anybody help me here. I really don't want to go for a fresh installation.
    Regards,
    Bkee
    P.S
    My XP 64bit works pretty fine wid it although some drivers for "SM BUS Controller" and "Base System Cannot" can't be found.. The problem is only wid win7.

    Quote
    will give a try to install msi drivers using my old system and then connecting the HDD back to this new rig.... Hope it will work...!!!!
    That activity is pointless.  You cannot install drivers for stuff that is not there on your old system.
    Please do yourself a favour and stop dancing around this whole problem (which seems like a pseudo-problem to me).  Putting on a fresh installation of the operating system is the first thing that should be done on a new system configuration.  Even if you manage to get stuff working without reinstalling, you are working with a potential driver mess and a confused Windows Registry that may throw problems at you that you may currently not be an issue.

  • Adding new infoobject to cube with data

    Hi experts
    Our cube contains data and is fully compressed (E-table), there is are no requests in F-table.
    We need to add 2 key figures and 2 characteristics.
    The characteristics get a new dimension table.
    We don't use the remodel technique. We add these new infoobjects.
    There is no need for a reload of historical data for these new objects.
    We only need data starting from the first load date after the changes occured.
    Are there any errors in this approach?
    Thanks

    Thomas,
    When you are adding a new dimension to your cube - you are adding a primary key to your E and F Fact tables - therefore when your transport goes it - it will reorganize your cube tables.
    For this - assuming that you are collecting the changes in the normal way and not changing any settings ....
    1. Check the UNDO table space in target system , the UNDO table space should have enought free space available that will be greater than the size of your E and F Fact table sizes - because , the way the transport moves is that a copy of the table is taken in the undo table space in the database and then the tables are adjusted - if your undo table space is insufficient - the transport will fail after some time
    2. If this is a big cube - then the transport will take time to go in - if BASIS imports transport requests in sequence - then this transport will hold the queue and might delay others whi have smaller transports.... make sure that your transport goes in last if there are others waiting for you to complete
    3. Also inform BASIS that the transport is going to take time - sometimes long running transports can get the BASIS team excited :-)
    These are not technical but some bases that can be covered in advance...
    Hope this helps.,...

  • IPhone 4: connecting to TV for the 1st time with new "Composite AV Cable" only plays sound, not video on TV. However, this new cable works fine with old iPod to play videos on TV. Suggestions?

    I'm trying to connect my iPhone 4 to my TV to play videos via use of a new "Composite AV Cable" but only sound will play off TV, not video.  I've tried every yellow/red/white input on the TV but to no avail.  Any suggestions?

    The iPhone 4, unlike iPod, doesn't ask you to set for PAL or NTSC.  In fact, in the SETTINGS/Video menu it only asks if you want to "Start Playing From Beginning", "Closed Captioning" and "Home Sharing".  I was surprised it had no settings like the iPod at all.

  • Does the new smart cover work with old iPad?

    Hello,
    as the subject
    Does it work? because I'm very interested about it!

    As much as I am also disappointed with this, I just had to remind myself that the original Apple iPad cover gives you the same features of standing it up and typing angle... Again, I wish it did too but I know I'm not missing out on functionality with my old iPad case...

  • My new Macbook Air came with old OS

    I bought a new Macbook Air 13" (mid-2012) a few weeks back but it came with Lion installed instead of Mountain Lion. It seems that Apple has also closed their free update program page. Do you know if there is any way to get a free upgrade to Mountain Lion as it seems strange not to have it installed.

    Yeah - just spend the $20 - much easier than wasting your time trying to figure out how to get the free upgrade.
    I'm sure your time is worth more than the $20 you'll be spending.
    I'll give you a little pointer - before you download and install Mountain Lion - invest $10 on a 8GB USB Stick.
    Once you download Mountain Lion - it will try to install - cancel the install and create a USB Mountain Lion installer - that way, if you ever need to reinstall Mountain Lion in the future - you don't have to download it again.
    Click on the link below on how to create one.
    http://appducate.com/2012/12/install-os-x-mountain-lion-from-usb-flash-drive/

  • Sync new Apple ID pruchases with old Apple ID

    I created a new Apple ID (that was the easy part), but now none of my thousands of purchases (Apps, Songs, Books, etc.) don't show under the new Apple ID. Is there was way to sync them?

    No, there is no way to do that. All your purchased items under an Apple ID are permanently attached to that Apple ID. You will need to contact Apple and see if they can help you.
    Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
    To contact product and tech support: Contacting Apple for support and service - this includes
    international calling numbers..
    For Mac App Store: Apple - Support - Mac App Store.
    For iTunes: Apple - Support - iTunes.

  • Are new MyBooks still compatible with old G5s?

    Hi,
    I've just filled up my MyBook and I want to add another one so I can continue to regualary back up my data, but I'm worried MyBooks have moved on while I'm still using my 1.8 Ghz PowerPC G5 (OS 10.5.8).
    If I buy a shiny new MyBook and daisychain (?) it to my existing MyBook, will it work?
    Sorry to be a ditz. I used to have a boyfriend who did this stuff for me. Should have listened and learned while I had the chance. My bad.

    Hello Jesus S., and a warm welcome to the forums!
    It can be hard to sometimes find where to start a New Topic, so here's the link for 10.5 installing...
    http://discussions.apple.com/post!default.jspa?forumID=1219
    The problem is, if there's Categories showing, you must drill down to a single one before you get the :Post New Topic Link"!
    Yeah, it can be confusing as to where to find the Post New Topic button on this forum.
    The reason it's hard to find that Post New Topic link, is because if there are any categories at the top, you must choose one first, like...
    http://discussions.apple.com/category.jspa?categoryID=177
    But say chose the Using Mac OS X Tiger and you get...
    http://discussions.apple.com/forum.jspa?forumID=758&start=0
    Clicking the Post New Topic link gets you here...
    http://discussions.apple.com/post!default.jspa?forumID=758
    that even holds crazy ones like iCal that have but one Category... iCal!
    http://discussions.apple.com/category.jspa?categoryID=166

Maybe you are looking for

  • Error in updating DPS Desktop Tools CS6 32.0.0 and Photoshop Camera Raw 8.7.1 (CS6)

    When I tried to update DPS Desktop Tools CS6 32.0.0 and Photoshop Camera Raw 8.7.1 (CS6) in Adobe Photoshop I get the following errors in the error log: DPS Desktop Tools CS6 32.0.0 Update There was an error installing this update. Please quit and tr

  • What is the best video converter for DVD to iMovie? Either free or to purchase.

    What is the best video converter for DVD to iMovie? Either free or to purchase.  And one that is 'fool-proof' and very easy to use.  Many thanks, anyone who can advise.

  • Boolean data element in ABAP Dictionary

    Dear friends, Is it possible to have a Boolean variable defined in the domain without having the value range ??? Regards, Vivek K

  • File adapter receiver channel is not initialized.

    Hi iam wrking idoc-file scenario, as per the requirement i have created 4datatypes  4 mapping in IR with 4 communaction chanles in ID. the scenarios is working fine with 3 mappings.but in 4 the scenario the file genaraing properly , i have cheked in

  • JSF & JSP

    DEAR SIR/MADAM, can u tell me what is major difference between jsf & jsp? because i need to planning develop web application. which is a best for design/deploy/performance. i don't know how to choose which one ? best regards boris