Skip to main content
Skip table of contents

Creating an Admin Connection

The first step in using AdminService involves obtaining a handle to an Admin connection. The handle to an Admin connection is obtained as by entering:

JAVA
Hashtable env = new Hashtable();
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "passwd");
env.put(Context.PROVIDER_URL, "http://localhost:1856");
env.put(Context.INITIAL_CONTEXT_FACTORY, "fiorano.jms.runtime.naming.FioranoInitialContextFactory");

InitialContext ic = new InitialContext(env);
System.out.println("Created InitialContext :: " + ic);

MQAdminConnectionFactory acf = (MQAdminConnectionFactory) ic.lookup("primaryACF");
System.out.println("Looked up MQAdminConnectionMetaData :: " + acf.getMetaData());
System.out.println("Looked up MQAdminConnectionFactory :: " + acf);

MQAdminConnection ac = acf.createMQAdminConnection("admin", "passwd");
System.out.println("Created Admin Connection :: " + ac);


The default Admin password is set to "passwd". FioranoMQ administrators can change "passwd" using the changePassword API. MQAdminConnection can be used to obtain handles to the FioranoMQ administrative services discussed in the preceding sections.

Once the admin connection has been made to the MQ server, the administrator has access to services explained in the following sub-sections.

MQNamingService

FioranoMQ Naming Services provide a JNDI implementation to lookup all the Administered Objects. By default, the Administered Objects are stored in FioranoMQ's persistent store.

JAVA
MQNamingService namingService = ac.getMQNamingService();


Upon execution of this step, the User can invoke all APIs avaliable in MQNamingService.

For example:

JAVA
Object lookup(String adminObjectName);
boolean bind(String adminObjectName, Object data);
Note: For details of available, APIs, please refer to API documentation available at %FIORANO_HOME%\fmq\docs\api\index.html

MQAdminService

MQAdminService allows the MQ Administrator to create/delete/edit administered objects such as Destinations and ConnectionFactories.

JAVA
MQAdminService adminService = ac.getMQAdminService();


Upon execution of this step, the User can invoke all APIs available in MQAdminService.
For example:

JAVA
// CREATION OF TOPICS
System.out.println("\n ** Creating Topics ** \n");
try {
	// TOPIC #1
	//Create the TopicMetaData with the desired Topics
	TopicMetaData metadata1 = new TopicMetaData();
	metadata1.setName("Mytopictest1");
	adminService.createTopic(metadata1);
	System.out.println("Successfully created Topic:: " + metadata1.getName());
} catch (JMSException e) {
	System.out.println(e);
}
Note: For details of available APIs, please refer to API documentation available at %FIORANO_HOME%\fmq\docs\api\index.html

MQRealmService

RealmServices provide complete integration with existing NT/Solaris realms. Topic ACL/ACE settings for Users can be set and viewed using MQRealmService APIs. In addition to ACL creation, a Realm service can be used for user management. The sample below demonstrates the logic for the creation of new Users in FioranoMQ:

JAVA
MQRealmService realmservice = ac.getMQRealmService();


Upon execution of this step, the User can invoke all APIs avaliable in MQRealmService.
For example:

JAVA
// CREATION OF USERS
System.out.println("\n ** Creating Users ** \n");
try {
	Principal user1 = realmservice.createUser("Bill", "Clinton");
	Principal user2 = realmservice.createUser("Rod", "Steward");
	System.out.println("Created Users");
} catch (JMSException e) {
	System.out.println(e);
}
Note: For details of available, APIs please refer to API documentation available at %FIORANO_HOME%\fmq\docs\api\index.html

MQSnooperService

MQ Administrator can install snoopers on selected topics/Queues. By using MQSnooperService APIs, details of all the published messages can be viewed. Destinations can be registered and unregistered for snooping at runtime using the APIs in MQSnooperService.

JAVA
MQSnooperService snooperService = ac.getMQSnooperService();


Upon execution of this step, the User can invoke all APIs available in MQSnooperService.
For example:
The following API checks if the given JMS destination has been registered for Snooping.

JAVA
boolean isDestinationRegistered(String destinationName);
Note: For details of available, APIs please refer to API documentation available at %FIORANO_HOME%\fmq\docs\api\index.html

MQDispatcherService

MQDispatcherService APIs allow the MQ Administrator to set up the Server as a dispatcher, route requests to FioranoMQ Servers in a cluster and view dispatcher status. The DispatcherService allows the administrator to add/remove Servers to the Cluster, locating the Preferred Server in the Cluster at runtime.

JAVA
MQDispatcherService dispatcherService = ac.getMQDispatcherService();


Upon execution of this step, the User can invoke all APIs available in MQDispatcherService.
For example:

JAVA
ServerMetaData getPreferredServer();
Note: For details of available, APIs please refer to API documentation available at %FIORANO_HOME%\fmq\docsapiindex.html

MQMonitoringService

MQMonitoringService APIs allow the FioranoMQ administrator to control the events that are used to monitor the status of the FioranoMQ Server. It is possible to start and stop monitoring events using this service. Additionally, monitoring for specific events can be added and removed.

JAVA
MQMonitoringService dispatcherService = ac.getMQMonitoringService();


Upon execution of this step, the User can invoke all APIs available in MQMonitoringService.
For example:

JAVA
void startSystemEvents();
Note: For details of available, APIs please refer to API documentation available at %FIORANO_HOME%\fmq\docs\api\index.html
Note: Samples illustrating the use of Admin APIs can be found in the %FIORANO_HOME%\fmq\samples folder of the FioranoMQ installation directory.
MQTraceService and MQLogService are not supported by FioranoMQ upwards.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.