Using the Object Manager Utility

The Message Queue Object Manager utility (imqobjmgr) allows you to create and manage
administered objects. The imqobjmgr command provides the following subcommands for performing various operations
on administered objects:

add

Add an administered object to an object store

delete

Delete an administered object from an object store

list

List existing administered objects in an object store

query

Display information about an administered object

update

Modify the attributes of an administered object

See Object Manager Utility for reference information about the syntax, subcommands, and options of the
imqobjmgr command.

Most Object Manager operations require you to specify the following information as options
to the imqobjmgr command:

The JNDI lookup name (-l) of the administered object

This is the logical name by which client applications can look up the administered object in the object store, using the Java Naming and Directory Interface.

The attributes of the JNDI object store (-j)

See Object Stores for information on the possible attributes and their values.

Connecting to a Secured LDAP Server (ldaps)

When using imqobjmgr utility to connect to a secured LDAP server that uses
the ldaps protocol, you might first have to install the LDAP server's certificate
in the JDK keystore. To perform this task, use the Java SE keytool
utility; for example:

Then, when you run the imqobjmgr utility, make sure to specify the same
Java installation where the certificate was imported; for example:

imqobjmgr -javahome IMQ_JAVAHOME ...

Adding Administered Objects

The imqobjmgr command’s add subcommand adds administered objects for connection factories and topic
or queue destinations to the object store. Administered objects stored in an LDAP
object store must have lookup names beginning with the prefix cn=; lookup names in
a file-system object store need not begin with any particular prefix, but must
not include the slash character (/).

Note - The Object Manager lists and displays only Message Queue administered objects. If an
object store contains a non–Message Queue object with the same lookup name as
an administered object that you wish to add, you will receive an error
when you attempt the add operation.

Adding a Connection Factory

To enable client applications to create broker connections, add a connection factory administered
object for the type of connection to be created: a queue connection factory
or a topic connection factory, as the case may be. Example 11-1 shows
a command to add a queue connection factory (administered object type qf) to an
LDAP object store. The object has lookup name cn=myQCF and connects to
a broker running on host myHost at port number 7272, using the jms
connection service.

Adding a Destination

When creating an administered object representing a destination, it is good practice to
create the physical destination first, before adding the administered object to the object
store. Use the Command utility (imqcmd) to create the physical destination, as
described in Creating and Destroying Physical Destinations.

The command shown in Example 11-2 adds an administered object to an LDAP object
store representing a topic destination with lookup name myTopic and physical destination name physTopic.
The command for adding a queue destination would be similar, except that the
administered object type (-t option) would be q (for “queue destination”) instead of
t (for “topic destination”).

Deleting Administered Objects

To delete an administered object from the object store, use the imqobjmgrdelete subcommand, specifying the lookup name, type, and location of the object to
be deleted. The command shown in Example 11-4 deletes the object that was added
in Adding a Destination above.

Listing Administered Objects

You can use the imqobjmgrlist subcommand to get a list of all
administered objects in an object store or those of a specific type. Example 11-5
shows how to list all administered objects on an LDAP server.

Viewing Administered Object Information

The imqobjmgrquery subcommand displays information about a specified administered object, identified by its
lookup name and the attributes of the object store containing it. Example 11-7
displays information about an object whose lookup name is cn=myTopic.

Using Command Files

The -i option to the imqobjmgr command allows you to specify the name
of a command file that uses Java property file syntax to represent all
or part of the subcommand clause. This feature is especially useful for specifying
object store attributes, which typically require a lot of typing and are likely
to be the same across multiple invocations of imqobjmgr. Using a command file
can also allow you to avoid exceeding the maximum number of characters allowed
for the command line.

Example 11-9 shows the general syntax for an Object Manager command file. Note that
the version property is not a command line option: it refers to the
version of the command file itself (not that of the Message Queue product)
and must be set to the value 2.0.

As an example, consider the Object Manager command shown earlier in Example 11-1,
which adds a queue connection factory to an LDAP object store. This command
can be encapsulated in a command file as shown in Example 11-10. If the command
file is named MyCmdFile, you can then execute the command with the command
line

A command file can also be used to specify only part of
the imqobjmgr subcommand clause, with the remainder supplied directly on the command line.
For example, the command file shown in Example 11-11 specifies only the attribute
values for an LDAP object store.