|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Setting LDAP through Java code rather than through JMSAdmin |
« View previous topic :: View next topic » |
Author |
Message
|
JohnRodey |
Posted: Thu Jun 09, 2005 11:37 am Post subject: Setting LDAP through Java code rather than through JMSAdmin |
|
|
 Centurion
Joined: 13 Apr 2005 Posts: 103
|
We are trying to find a way to add queues into LDAP during runtime.
Our code can create queues during runtime using pcf messages, although we would need to update ldap in order for those queues to be seen by our JMS apps.
One possiblity is to use an exec() to kick off the JMSAdmin script and pipe in a file that will have our JMSAdmin commands in it.
Although we are looking to get away from using a script and to this completely through java.
One way to do this is to simply call JMSAdmin.main() and pass in the config file, although then JMSAdmin will request commands from the command prompt rather than from a command file. I cannot think of a way to pipe in a command file through java code.
I'm sure this can be done.
Does anyone know of any examples of doing this, or any ideas how to do this? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jun 09, 2005 12:14 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Can you manipulate the context? Are you granted the permissions to do so?
Enjoy  |
|
Back to top |
|
 |
JohnRodey |
Posted: Thu Jun 09, 2005 12:25 pm Post subject: |
|
|
 Centurion
Joined: 13 Apr 2005 Posts: 103
|
Quote: |
Can you manipulate the context? |
The LDAP Context? Yes, It has permissions to edit and add entries into the ldap.
I have created an app that calls JMSAdmin.main("-cfg", "jmsadmin.config");
Although after the connection is established then JMSAdmin sits at the "InitCtx>" prompt waiting for user input. I would like to get rid of this user input but can't seem to find a way without calling a script so I can pipe in this input.
Does anyone know if the JMSAdmin source code is available? |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jun 09, 2005 12:52 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Using JMSAdmin is not manipulating the context from your environment.
Check out the java classes on context and the implementation of your context factory.
After having created your queue you should be able to manipulate the context to add it:
Code: |
Queue myqueue = queuesession.createqueue();
Context ctx = new InitialContext();
ctx.addToEnvironment("myjndiname", myqueue); |
Enjoy  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|