org.objectweb.joram.mom.dest
Class AdminTopicImpl

java.lang.Object
  extended by org.objectweb.joram.mom.dest.DestinationImpl
      extended by org.objectweb.joram.mom.dest.TopicImpl
          extended by org.objectweb.joram.mom.dest.AdminTopicImpl
All Implemented Interfaces:
java.io.Serializable, AdminTopicImplMBean, DestinationImplMBean, TopicImplMBean

public final class AdminTopicImpl
extends TopicImpl
implements AdminTopicImplMBean

The AdminTopicImpl class implements the administration topic behavior, basically processing administration requests.

It receives administration requests from the client encapsulated in JMS messages:

(*) Currently the getRights reply is handled differently as it needs the transformation of the user list. This behavior should disappear with the role based mechanism.

See Also:
Serialized Form

Nested Class Summary
static class AdminTopicImpl.DestinationDesc
           
 
Field Summary
private  java.util.Map destinationsTable
          Table holding the local server's destinations names.
private  long msgCounter
          Counter of messages produced by this AdminTopic.
private  java.util.Map proxiesTable
          Table holding the TCP users proxies identifiers.
private static AdminTopicImpl ref
          Reference of the server's local AdminTopicImpl instance.
private  java.util.Map requestsTable
          Table keeping the administrator's requests.
private static long serialVersionUID
          define serialVersionUID for interoperability
private  int serverId
          Identifier of the server this topic is deployed on.
private  java.util.Map usersTable
          Table holding the TCP users identifications.
 
Fields inherited from class org.objectweb.joram.mom.dest.TopicImpl
alreadySentLocally, fatherId, friends, selectors, subscribers
 
Fields inherited from class org.objectweb.joram.mom.dest.DestinationImpl
_rights, agent, clients, creationDate, dmqId, freeReading, freeWriting, logger, nbMsgsDeliverSinceCreation, nbMsgsReceiveSinceCreation, nbMsgsSentToDMQSinceCreation, READ, READWRITE, strbuf, WAKEUP_PERIOD, WRITE
 
Constructor Summary
AdminTopicImpl(AgentId topicId)
          Constructs an AdminTopicImpl instance.
 
Method Summary
 void AdminNotification(AdminNotification adminNot)
          Method implementing the reaction to a AdminNotification notification notifying of the creation of an administrator proxy.
 void AdminReply(AdminReplyNot not)
          Method implementing the reaction to a org.objectweb.joram.mom.notifications.AdminReply notification replying to an administration request.
private  void broadcastRequest(AdminRequest request, int avoidServerId, AgentId replyTo, java.lang.String msgId)
          Sends the administration request to AdminTopic of all servers except the given one.
private  boolean checkServerId(int serverId)
          Returns true if a given server identification corresponds to the local server's.
 void clusterAck(AgentId from, ClusterAck ack)
          Overrides this TopicImpl method; a ClusterAck is not expected by an AdminTopic.
 void clusterNot(AgentId from, ClusterNot not)
          Overrides this TopicImpl method; if this AdminTopic is on server0, new cluster fellow is notified to other fellows and other fellows are notified to it.
 void clusterTest(AgentId from, ClusterTest request)
          Overrides this TopicImpl method; AdminTopics do not accept to join clusters other than their admin topics cluster.
 AdminTopicImpl.DestinationDesc createDestination(java.lang.String destName, AgentId adminId, java.util.Properties properties, byte type, java.lang.String className, java.lang.String requestClassName, java.lang.StringBuffer strbuf)
          Instantiating the destination class or retrieving the destination.
private  java.lang.String createMessageId()
           
 void createQueue(java.lang.String name)
          Creates a new queue on the local server.
 void createQueue(java.lang.String name, int serverId)
          Creates a new queue on the selected server.
 void createQueue(java.lang.String name, java.lang.String queueClassName, int serverId)
          Creates a new queue on the selected server.
 void createTopic(java.lang.String name)
          Creates a new topic on the local server.
 void createTopic(java.lang.String name, int serverId)
          Creates a new topic on the selected server.
 void createTopic(java.lang.String name, java.lang.String topicClassName, int serverId)
          Creates a new topic on the selected server.
 void createUser(java.lang.String user, java.lang.String passwd)
          Creates a new user on the local server.
 void createUser(java.lang.String user, java.lang.String passwd, int serverId)
          Creates a new user on the selected server.
 void createUser(java.lang.String user, java.lang.String passwd, int serverId, java.lang.String identityClassName)
          Creates a new user on the selected server.
 void deleteNot(AgentId from, DeleteNot not)
          Overrides this DestinationImpl method.
static void deleteUser(java.lang.String userName)
           
private  void distributeReply(AgentId to, java.lang.String msgId, AdminReply reply)
          Actually sends an AdminReply object to an identified destination.
private  void doProcess(AddDomainRequest request, AgentId replyTo, java.lang.String msgId, AgentId from)
          Adds a new domain to the configuration.
private  void doProcess(AddServerRequest request, AgentId replyTo, java.lang.String msgId, AgentId from)
          Adds a server to the configuration.
private  void doProcess(AgentId replyTo, java.lang.String msgId)
           
private  void doProcess(CreateDestinationRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a CreateDestinationRequest instance requesting the creation of a destination.
private  void doProcess(CreateUserRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a CreateUserRequest instance requesting the creation of a UserAgent for a given user.
private  void doProcess(DeleteDestination request, AgentId replyTo, java.lang.String msgId)
          Processes a DeleteDestination instance requesting the deletion of a destination.
private  void doProcess(DeleteUser request, AgentId replyTo, java.lang.String msgId)
          Processes a DeleteUser instance requesting the deletion of a user.
private  void doProcess(GetClusterRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetCluster request by forwarding it to its target topic, if local.
private  void doProcess(GetConfigRequest request, AgentId replyTo, java.lang.String msgId)
          Gets the current configuration.
private  void doProcess(GetDestinationsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetDestinations request by sending registered destinations.
private  void doProcess(GetDMQSettingsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetDMQSettings request either by processing it and sending back the default DMQ settings, or by forwarding it to its target destination or proxy.
private  void doProcess(GetDomainNames request, AgentId replyTo, java.lang.String msgId)
           
private  void doProcess(GetFatherRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetFather request by forwarding it to its target topic, if local.
private  void doProcess(GetNbMaxMsgRequest request, AgentId replyTo, java.lang.String msgId)
          Processes an Monitor_GetNbMaxMsg request requesting to get the maximum number of messages.
private  void doProcess(GetPendingMessages request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetPendingMessages request by forwarding it to its target queue, if local.
private  void doProcess(GetPendingRequests request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetPendingRequests request by forwarding it to its target queue, if local.
private  AdminReply doProcess(GetRightsReplyNot not)
          Processes a Monit_GetUsersRep notification holding a destination's readers' or writers' identifiers.
private  void doProcess(GetRightsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a GetRightsRequest request by forwarding it to its target destination, if local.
private  void doProcess(GetServersIdsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetServersIds request by sending the list of the platform servers' ids.
private  void doProcess(GetStatsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetStat request by forwarding it to its target destination, if local.
private  void doProcess(GetSubscriberIds request, AgentId replyTo, java.lang.String requestMsgId)
           
private  void doProcess(GetSubscriptionsRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetSubscriptions request by forwarding it to its target queue, if local.
private  void doProcess(GetUsersRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a Monitor_GetUsers request by sending the users table.
private  void doProcess(QueueAdminRequest request, AgentId replyTo, java.lang.String requestMsgId)
           
private  void doProcess(RemoveDomainRequest request, AgentId replyTo, java.lang.String msgId, AgentId from)
          Removes a domain in the configuration.
private  void doProcess(RemoveServerRequest request, AgentId replyTo, java.lang.String msgId, AgentId from)
          Removes a server in the configuration.
private  void doProcess(SetCluster request, AgentId replyTo, java.lang.String msgId)
          Processes a SetCluster instance requesting to link two topics in a cluster relationship.
private  void doProcess(SetDMQRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a SetDMQ request requesting a given queue to be set as the DMQ of a given destination or user.
private  void doProcess(SetFather request, AgentId replyTo, java.lang.String msgId)
          Processes a SetFather instance requesting to link two topics in a hierarchical relationship.
private  void doProcess(SetNbMaxMsgRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a SetNbMaxMsg request requesting a given nbMaxMsg value to be set in queue or subscription.
 void doProcess(SetRight request, AgentId replyTo, java.lang.String msgId)
          Processes a SetRight instance requesting to grant a user a given right on a given destination.
private  void doProcess(SetThresholdRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a SetThreshold request requesting a given threshold value to be set as the threshold of a given destination or user.
private  void doProcess(SpecialAdmin request, AgentId replyTo, java.lang.String msgId)
           
private  void doProcess(StopServerRequest request, AgentId replyTo, java.lang.String msgId)
          Processes a StopServerRequest instance requesting to stop a given server.
private  void doProcess(UpdateUser request, AgentId replyTo, java.lang.String msgId)
          Processes an UpdateUser instance requesting to modify the identification of a user.
private  void doProcess(UserAdminRequest request, AgentId replyTo, java.lang.String requestMsgId)
          Handle administration request about user.
protected  void doUnknownAgent(UnknownAgent uA)
          Specializes this TopicImpl reaction.
 java.lang.String getName(AgentId proxyId)
          Method used by proxies for retrieving their name.
 java.lang.Object getPassword(AgentId proxyId)
          Method used by proxies for retrieving their password.
 AgentId getProxyId(Identity identity, java.lang.String inaddr)
          Method used by ConnectionManager proxies to check their clients identification.
 void GetProxyIdListNot(GetProxyIdListNot not)
           
 void GetProxyIdNot(GetProxyIdNot not)
           
protected  void handleDeniedMessage(java.lang.String msgId, AgentId replyTo)
          Method used to send a response when a message is denied because of a lack of rights.
 boolean isTaken(java.lang.String name)
          Method used by proxies for checking if a given name is already used.
static AdminTopicImpl.DestinationDesc lookupDest(java.lang.String name, byte type)
          Retrieves an existing destination.
 ClientMessages preProcess(AgentId from, ClientMessages msgs)
          Overrides this DestinationImpl method; ClientMessages notifications hold requests sent by an administrator.
(package private)  void processAdminRequests(AgentId replyTo, java.lang.String msgId, AdminRequest request, AgentId from)
          Method getting the administration requests from messages, and distributing them to the appropriate reactions.
private  void processAdminRequests(ClientMessages not)
          Method getting the administration requests from messages, and distributing them to the appropriate reactions.
private  void readObject(java.io.ObjectInputStream in)
          Deserializes an AdminTopicImpl instance.
static void registerDest(AgentId id, java.lang.String name, byte type)
          Registers a newly created destination.
 void requestGroupNot(AgentId from, RequestGroupNot not)
           
 void topicForwardNot(AgentId from, TopicForwardNot not)
          Overrides this TopicImpl method; the forwarded messages contain admin requests and will be processed.
 java.lang.String toString()
          Returns a string representation of this destination.
static void unregisterDest(java.lang.String name)
          Removes a registered destination.
private  void writeObject(java.io.ObjectOutputStream out)
          Serializes an AdminTopicImpl instance.
 
Methods inherited from class org.objectweb.joram.mom.dest.TopicImpl
doClientMessages, doDeleteNot, doRightRequest, forwardMessages, getNbMsgsReceiveSinceCreation, getNumberOfSubscribers, getSubscriberIds, handleAdminRequestNot, initialize, postSubscribe, postUnsubscribe, preSubscribe, preUnsubscribe, processMessages, setAlreadySentLocally, subscribeRequest, topicForwardNot, unsubscribeRequest, wakeUpNot
 
Methods inherited from class org.objectweb.joram.mom.dest.DestinationImpl
canBeDeleted, clientMessages, delete, forward, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQAgentId, getDMQId, getId, getJMXStatistics, getName, getNbMsgsDeliverSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, getRights, isAdministrator, isFreeReading, isFreeWriting, isLocal, isReader, isValidJMXAttribute, isWriter, postProcess, processSetRight, replyToTopic, setAgent, setFreeReading, setFreeWriting, setNoSave, setPeriod, setRight, setSave, specialAdminProcess, specialAdminRequest, unknownAgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.joram.mom.dest.TopicImplMBean
getNumberOfSubscribers, getSubscriberIds
 
Methods inherited from interface org.objectweb.joram.mom.dest.DestinationImplMBean
delete, getCreationDate, getCreationTimeInMillis, getDestinationId, getDMQId, getName, getNbMsgsDeliverSinceCreation, getNbMsgsReceiveSinceCreation, getNbMsgsSentToDMQSinceCreation, getPeriod, getRight, getRights, isFreeReading, isFreeWriting, setFreeReading, setFreeWriting, setPeriod
 

Field Detail

serialVersionUID

private static final long serialVersionUID
define serialVersionUID for interoperability

See Also:
Constant Field Values

ref

private static AdminTopicImpl ref
Reference of the server's local AdminTopicImpl instance.


serverId

private int serverId
Identifier of the server this topic is deployed on.


destinationsTable

private java.util.Map destinationsTable
Table holding the local server's destinations names. This table is used by more than one thread so it needs to be synchronized.

Key: destination name
Object: destination agent identifier


usersTable

private java.util.Map usersTable
Table holding the TCP users identifications.

Key: user name
Object: user password


proxiesTable

private java.util.Map proxiesTable
Table holding the TCP users proxies identifiers.

Key: user name
Object: proxy's identifier


requestsTable

private java.util.Map requestsTable
Table keeping the administrator's requests.

Key: request's message identifier
Value: request's message ReplyTo field


msgCounter

private long msgCounter
Counter of messages produced by this AdminTopic.

Constructor Detail

AdminTopicImpl

public AdminTopicImpl(AgentId topicId)
Constructs an AdminTopicImpl instance.

Parameters:
topicId - Identifier of the agent hosting the AdminTopicImpl.
Method Detail

toString

public java.lang.String toString()
Description copied from class: TopicImpl
Returns a string representation of this destination.

Specified by:
toString in interface DestinationImplMBean
Overrides:
toString in class TopicImpl

getProxyId

public AgentId getProxyId(Identity identity,
                          java.lang.String inaddr)
                   throws java.lang.Exception
Method used by ConnectionManager proxies to check their clients identification.

Parameters:
identity -
inaddr -
Returns:
The agent unique identifier of the authentified user.
Throws:
java.lang.Exception - If the user does not exist, is wrongly identified, or does not have any proxy deployed.
See Also:
ConnectionManager

getName

public java.lang.String getName(AgentId proxyId)
Method used by proxies for retrieving their name.


getPassword

public java.lang.Object getPassword(AgentId proxyId)
Method used by proxies for retrieving their password.


isTaken

public boolean isTaken(java.lang.String name)
Method used by proxies for checking if a given name is already used.


handleDeniedMessage

protected void handleDeniedMessage(java.lang.String msgId,
                                   AgentId replyTo)
Method used to send a response when a message is denied because of a lack of rights.

Overrides:
handleDeniedMessage in class DestinationImpl

AdminNotification

public void AdminNotification(AdminNotification adminNot)
Method implementing the reaction to a AdminNotification notification notifying of the creation of an administrator proxy.

Parameters:
adminNot - the AdminNotification notification.

AdminReply

public void AdminReply(AdminReplyNot not)
Method implementing the reaction to a org.objectweb.joram.mom.notifications.AdminReply notification replying to an administration request.

A reply is sent back to the connected administrator if needed.


GetProxyIdNot

public void GetProxyIdNot(GetProxyIdNot not)

GetProxyIdListNot

public void GetProxyIdListNot(GetProxyIdListNot not)

doProcess

private AdminReply doProcess(GetRightsReplyNot not)
Processes a Monit_GetUsersRep notification holding a destination's readers' or writers' identifiers.


requestGroupNot

public void requestGroupNot(AgentId from,
                            RequestGroupNot not)
Overrides:
requestGroupNot in class DestinationImpl

preProcess

public ClientMessages preProcess(AgentId from,
                                 ClientMessages msgs)
Overrides this DestinationImpl method; ClientMessages notifications hold requests sent by an administrator.

Overrides:
preProcess in class DestinationImpl
Parameters:
from - The sender of the message
msgs - The incoming messages.
Returns:
The incoming messages after processing.

clusterTest

public void clusterTest(AgentId from,
                        ClusterTest request)
Overrides this TopicImpl method; AdminTopics do not accept to join clusters other than their admin topics cluster.

Overrides:
clusterTest in class TopicImpl

clusterAck

public void clusterAck(AgentId from,
                       ClusterAck ack)
Overrides this TopicImpl method; a ClusterAck is not expected by an AdminTopic.

Overrides:
clusterAck in class TopicImpl

clusterNot

public void clusterNot(AgentId from,
                       ClusterNot not)
Overrides this TopicImpl method; if this AdminTopic is on server0, new cluster fellow is notified to other fellows and other fellows are notified to it.

Overrides:
clusterNot in class TopicImpl

topicForwardNot

public void topicForwardNot(AgentId from,
                            TopicForwardNot not)
Overrides this TopicImpl method; the forwarded messages contain admin requests and will be processed.


deleteNot

public void deleteNot(AgentId from,
                      DeleteNot not)
Overrides this DestinationImpl method. Deletion requests are not accepted by AdminTopics.

Overrides:
deleteNot in class DestinationImpl

doUnknownAgent

protected void doUnknownAgent(UnknownAgent uA)
Specializes this TopicImpl reaction.

Overrides:
doUnknownAgent in class TopicImpl

processAdminRequests

private void processAdminRequests(ClientMessages not)
Method getting the administration requests from messages, and distributing them to the appropriate reactions.


processAdminRequests

void processAdminRequests(AgentId replyTo,
                          java.lang.String msgId,
                          AdminRequest request,
                          AgentId from)
Method getting the administration requests from messages, and distributing them to the appropriate reactions.


doProcess

private void doProcess(StopServerRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a StopServerRequest instance requesting to stop a given server.

Throws:
UnknownServerException

doProcess

private void doProcess(CreateDestinationRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException,
                       RequestException
Processes a CreateDestinationRequest instance requesting the creation of a destination.

Throws:
UnknownServerException - If the target server does not exist.
RequestException - If the destination deployment fails.

createDestination

public AdminTopicImpl.DestinationDesc createDestination(java.lang.String destName,
                                                        AgentId adminId,
                                                        java.util.Properties properties,
                                                        byte type,
                                                        java.lang.String className,
                                                        java.lang.String requestClassName,
                                                        java.lang.StringBuffer strbuf)
                                                 throws UnknownServerException,
                                                        RequestException
Instantiating the destination class or retrieving the destination.

Parameters:
destName - destination Name
adminId - other admin (null for TopicAdmin)
properties - destination properties
type - destination type ("queue" or "topic")
className - creates an instance of the class
requestClassName -
strbuf - information
Returns:
DestinationDesc contain destination description
Throws:
UnknownServerException
RequestException

doProcess

private void doProcess(DeleteDestination request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a DeleteDestination instance requesting the deletion of a destination.

Throws:
UnknownServerException

doProcess

private void doProcess(GetClusterRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetCluster request by forwarding it to its target topic, if local.


doProcess

private void doProcess(SetCluster request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a SetCluster instance requesting to link two topics in a cluster relationship.


doProcess

private void doProcess(GetFatherRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetFather request by forwarding it to its target topic, if local.


doProcess

private void doProcess(SetFather request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a SetFather instance requesting to link two topics in a hierarchical relationship.


doProcess

private void doProcess(CreateUserRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException,
                       RequestException
Processes a CreateUserRequest instance requesting the creation of a UserAgent for a given user.

Throws:
UnknownServerException - If the target server does not exist.
RequestException - If the user already exists but with a different password, or if the proxy deployment failed.

doProcess

private void doProcess(UpdateUser request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws RequestException,
                       UnknownServerException
Processes an UpdateUser instance requesting to modify the identification of a user.

Throws:
RequestException - If the user does not exist, or if it's new name is already used.
UnknownServerException

doProcess

private void doProcess(DeleteUser request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a DeleteUser instance requesting the deletion of a user.

Throws:
UnknownServerException

doProcess

public void doProcess(SetRight request,
                      AgentId replyTo,
                      java.lang.String msgId)
Processes a SetRight instance requesting to grant a user a given right on a given destination.


doProcess

private void doProcess(SetDMQRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a SetDMQ request requesting a given queue to be set as the DMQ of a given destination or user. If the AgentId of the destination is NullId set the default DMQ. If the AgentId of the DMQ is NullId unset the DMQ.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(SetThresholdRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a SetThreshold request requesting a given threshold value to be set as the threshold of a given destination or user. If the AgentId of the destination is NullId set the default threshold. If the threshold value is less than 0 reset the threshold.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(SetNbMaxMsgRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a SetNbMaxMsg request requesting a given nbMaxMsg value to be set in queue or subscription.


doProcess

private void doProcess(GetServersIdsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a Monitor_GetServersIds request by sending the list of the platform servers' ids.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(AgentId replyTo,
                       java.lang.String msgId)

doProcess

private void doProcess(GetDomainNames request,
                       AgentId replyTo,
                       java.lang.String msgId)

doProcess

private void doProcess(GetDestinationsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a Monitor_GetDestinations request by sending registered destinations.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(GetUsersRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a Monitor_GetUsers request by sending the users table.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(GetRightsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a GetRightsRequest request by forwarding it to its target destination, if local.

Throws:
UnknownServerException

doProcess

private void doProcess(GetDMQSettingsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Processes a Monitor_GetDMQSettings request either by processing it and sending back the default DMQ settings, or by forwarding it to its target destination or proxy.

Throws:
UnknownServerException - If the target server does not exist.

doProcess

private void doProcess(GetPendingMessages request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetPendingMessages request by forwarding it to its target queue, if local.


doProcess

private void doProcess(GetPendingRequests request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetPendingRequests request by forwarding it to its target queue, if local.


doProcess

private void doProcess(GetStatsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetStat request by forwarding it to its target destination, if local.


doProcess

private void doProcess(GetNbMaxMsgRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes an Monitor_GetNbMaxMsg request requesting to get the maximum number of messages.


doProcess

private void doProcess(GetSubscriptionsRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Processes a Monitor_GetSubscriptions request by forwarding it to its target queue, if local.


doProcess

private void doProcess(SpecialAdmin request,
                       AgentId replyTo,
                       java.lang.String msgId)
                throws UnknownServerException
Throws:
UnknownServerException

doProcess

private void doProcess(AddDomainRequest request,
                       AgentId replyTo,
                       java.lang.String msgId,
                       AgentId from)
Adds a new domain to the configuration.

Parameters:
request - The request describing the domain to create.
replyTo - The destination to reply.
msgId - The JMS message id needed to reply.
from - The AgentId of sender.

doProcess

private void doProcess(RemoveDomainRequest request,
                       AgentId replyTo,
                       java.lang.String msgId,
                       AgentId from)
Removes a domain in the configuration.

Parameters:
request - The request describing the domain to remove.
replyTo - The destination to reply.
msgId - The JMS message id needed to reply.
from - The AgentId of sender.

doProcess

private void doProcess(AddServerRequest request,
                       AgentId replyTo,
                       java.lang.String msgId,
                       AgentId from)
Adds a server to the configuration.

Parameters:
request - The request describing the server to create.
replyTo - The destination to reply.
msgId - The JMS message id needed to reply.
from - The AgentId of sender.

doProcess

private void doProcess(RemoveServerRequest request,
                       AgentId replyTo,
                       java.lang.String msgId,
                       AgentId from)
Removes a server in the configuration.

Parameters:
request - The request describing the server to remove.
replyTo - The destination to reply.
msgId - The JMS message id needed to reply.
from - The AgentId of sender.

broadcastRequest

private void broadcastRequest(AdminRequest request,
                              int avoidServerId,
                              AgentId replyTo,
                              java.lang.String msgId)
Sends the administration request to AdminTopic of all servers except the given one. This method is used to broadcast server/domain creation and deletion.

Parameters:
request - The administration request.
avoidServerId - The id. of the server to avoid.
replyTo - The destination to reply.
msgId - The JMS message id needed to reply.

doProcess

private void doProcess(GetConfigRequest request,
                       AgentId replyTo,
                       java.lang.String msgId)
Gets the current configuration.

Parameters:
request -
replyTo -
msgId -

distributeReply

private void distributeReply(AgentId to,
                             java.lang.String msgId,
                             AdminReply reply)
Actually sends an AdminReply object to an identified destination.

Parameters:
to - Identifier of a destination to send the reply to.
msgId - Identifier of the original request.
reply - The AdminReply instance to send.

createMessageId

private java.lang.String createMessageId()

doProcess

private void doProcess(UserAdminRequest request,
                       AgentId replyTo,
                       java.lang.String requestMsgId)
                throws UnknownServerException
Handle administration request about user.

Parameters:
request -
replyTo -
requestMsgId -
Throws:
UnknownServerException

doProcess

private void doProcess(GetSubscriberIds request,
                       AgentId replyTo,
                       java.lang.String requestMsgId)

doProcess

private void doProcess(QueueAdminRequest request,
                       AgentId replyTo,
                       java.lang.String requestMsgId)

checkServerId

private boolean checkServerId(int serverId)
                       throws UnknownServerException
Returns true if a given server identification corresponds to the local server's.

Parameters:
serverId - Server identifier.
Throws:
UnknownServerException - If the server does not exist.

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
Serializes an AdminTopicImpl instance.

Throws:
java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Deserializes an AdminTopicImpl instance.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

createUser

public void createUser(java.lang.String user,
                       java.lang.String passwd)
                throws java.lang.Exception
Creates a new user on the local server. SimpleIdentity class is used.

Specified by:
createUser in interface AdminTopicImplMBean
Parameters:
user - the user name
passwd - the user password
Throws:
java.lang.Exception

createUser

public void createUser(java.lang.String user,
                       java.lang.String passwd,
                       int serverId)
                throws java.lang.Exception
Creates a new user on the selected server. SimpleIdentity class is used.

Specified by:
createUser in interface AdminTopicImplMBean
Parameters:
user - the user name
passwd - the user password
serverId - the server where the user will be created
Throws:
java.lang.Exception

createUser

public void createUser(java.lang.String user,
                       java.lang.String passwd,
                       int serverId,
                       java.lang.String identityClassName)
                throws java.lang.Exception
Creates a new user on the selected server.

Specified by:
createUser in interface AdminTopicImplMBean
Parameters:
user - the user name
passwd - the user password
serverId - the server where the user will be created
identityClassName - the identity class name to instantiate
Throws:
java.lang.Exception

createQueue

public void createQueue(java.lang.String name)
Creates a new queue on the local server.

Specified by:
createQueue in interface AdminTopicImplMBean
Parameters:
name - the queue name

createQueue

public void createQueue(java.lang.String name,
                        int serverId)
Creates a new queue on the selected server. The queue will be an instance of Queue.

Specified by:
createQueue in interface AdminTopicImplMBean
Parameters:
name - the topic name
serverId - the server where the queue will be deployed

createQueue

public void createQueue(java.lang.String name,
                        java.lang.String queueClassName,
                        int serverId)
Creates a new queue on the selected server.

Specified by:
createQueue in interface AdminTopicImplMBean
Parameters:
name - the topic name
queueClassName - the queue class to instantiate
serverId - the server where the queue will be deployed

createTopic

public void createTopic(java.lang.String name)
Creates a new topic on the local server.

Specified by:
createTopic in interface AdminTopicImplMBean
Parameters:
name - the topic name

createTopic

public void createTopic(java.lang.String name,
                        int serverId)
Creates a new topic on the selected server. The topic will be an instance of Topic.

Specified by:
createTopic in interface AdminTopicImplMBean
Parameters:
name - the topic name
serverId - the server where the topic will be deployed

createTopic

public void createTopic(java.lang.String name,
                        java.lang.String topicClassName,
                        int serverId)
Creates a new topic on the selected server.

Specified by:
createTopic in interface AdminTopicImplMBean
Parameters:
name - the topic name
topicClassName - the topic class to instantiate
serverId - the server where the topic will be deployed

deleteUser

public static void deleteUser(java.lang.String userName)

lookupDest

public static AdminTopicImpl.DestinationDesc lookupDest(java.lang.String name,
                                                        byte type)
                                                 throws RequestException
Retrieves an existing destination.

Parameters:
name - The name of the destination.
type - The type of the destination.
Returns:
the descriptor of the destination, null if it does not exist.
Throws:
RequestException - If the existing destination have a different type.

registerDest

public static void registerDest(AgentId id,
                                java.lang.String name,
                                byte type)
Registers a newly created destination.

Parameters:
id - The unique identifier of the created destination.
name - The name of the created destination.
type - The type of the created destination.
Throws:
java.io.IOException - If an error occurs during saving.

unregisterDest

public static void unregisterDest(java.lang.String name)
Removes a registered destination.

Parameters:
name - The name of the destination to remove.


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.