Connection Information
Universal Messaging's admin API provides real time asynchronous information on all objects within a realm server. By creating an nRealmNode (see
nRealmNode), and connecting to a realm, information is automatically delivered to the realm node from the realm. This information is delivered periodically in summary form, and also as and when the state changes for one or all of the objects managed within a realm.
Before reading this section it may be useful to look at the management information available via the Universal Messaging enterprise manager. A full description of all Realm management screens is available in the enterprise manager guide. All functionality seen in the enterprise manager can be easily added to bespoke admin and monitoring processes as it is written entirely using the Universal Messaging Admin API.
This section will discuss the connection information that is available through the nAdmin API for the nRealmNode, the nLeafNode and the nServiceNode objects:
nRealmNode Connections
The nRealmNode provides the ability to be notified of connections to the realm, and when connections are closed. When a client attempts a connection, a callback will be made that gives the details of the connection, such as the user name, hostname, protocol and connection id. When a user connection is closed, again, you will receive notification. This information can be useful for monitoring activity on a realm.
In order to receive this kind of information, you need to implement the nConnectionListener class. This class defines 2 methods, newConnection and delConnection. To receive notifications, you can use the following method:
Java, C#, C++:
realm.addConnectionListener(this);
Assuming 'this' is the instance of the class implementing nConnectionListener, then the implementation of the newConnection and delConnection methods will be notified when connections are made or closed with the realm.
nLeafNode Connections
Universal Messaging provides the ability to issue notifications of connections to leaf nodes. Connections to leaf nodes correspond to subscriptions on a channel, so when a user subscribes to a channel or removes the subscription, you can be notified. Notification is via a callback that contains the details of the connection, such as the user name, hostname, protocol, connection id, durable name and subscription filter.
In order to receive this kind of information, you need to implement the nConnectionListener class. This class defines 2 methods, newConnection and delConnection. To receive notifications, you can use the following method:
Java, C#:
leafaddListener(this);
C++:
leaf->addListener(this);
Assuming 'this' is the instance of the class implementing nConnectionListener, then the implementation of the newConnection and delConnection methods will be notified when channel subscriptions are made or removed.
nServiceNode Connections
Universal Messaging provides the ability to issue notifications of connections to service nodes. Connections to service nodes correspond to p2p client connections, so when a user connects to a service or closes the service, you can be notified. Notification is via a callback that contains the details of the connection, such as the user name, hostname, protocol, connection id.
In order to receive this kind of information, you need to implement the nConnectionListener class. This class defines 2 methods, newConnection and delConnection. To receive notifications, you can use the following method:
Java, C#:
service.addListener(this);
C++:
service->addListener(this);
Assuming 'this' is the instance of the class implementing nConnectionListener, then the implementation of the newConnection and delConnection methods will be notified when service connections are made or closed.
See the code example "Monitor Realms for Client Connections Coming and Going" for an illustration of usage.
For information on monitoring realm connections using the enterprise manager or channel/queue connections please see the enterprise manager guide (see
Realm Connections and
Channel Connections). In addition monitor panels (see
Top) are available to show TOP like functionality on realm usage.
For more information on Universal Messaging Administration, please see the API documentation, and the Enterprise Manager Guide.