ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting LDAP through Java code rather than through JMSAdmin

Post new topic  Reply to topic
 Setting LDAP through Java code rather than through JMSAdmin « View previous topic :: View next topic » 
Author Message
JohnRodey
PostPosted: Thu Jun 09, 2005 11:37 am    Post subject: Setting LDAP through Java code rather than through JMSAdmin Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 09, 2005 12:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
JohnRodey
PostPosted: Thu Jun 09, 2005 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 09, 2005 12:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting LDAP through Java code rather than through JMSAdmin
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.