Class AdminWrapper
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.AdminWrapper
-
-
Field Summary
Fields Modifier and Type Field Description static StringADM_NAME_PROPERTYstatic StringDEFAULT_ADM_NAMEstatic org.objectweb.util.monolog.api.Loggerloggerprivate AdminRequestorrequestorThe requestor for sending the synchronous requests.private ServerserverThe description of the server the module is connected to.
-
Constructor Summary
Constructors Constructor Description AdminWrapper(Connection cnx)Creates an administration wrapper for a Joram server.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidabortRequest()StringaddAMQPBridgeConnection(int serverId, String urls)Adds an AMQP server and starts a live connection with it, accessible via the url provided.voidaddDomain(String domain, int sid, int port)Adds a domain to the platform.voidaddDomain(String domain, String network, int sid, int port)Adds a domain to the platform using a specific network component.StringaddJMSBridgeConnection(int serverId, String urls)Adds a JMS server and starts a live connection with it, accessible via the url provided.voidaddServer(int sid, String host, String domain, int port, String server)Adds a server to the platform.voidaddServer(int sid, String host, String domain, int port, String server, String[] services, String[] args)Adds a server to the platform.voidclose()Closes the underlying requestor.QueuecreateDeadMQueue(int serverId, String name)Deprecated.No longer needed, any queue can be used as DMQ.private org.objectweb.joram.shared.security.IdentitycreateIdentity(String user, String passwd, String identityClassName)Create a user Identity.DestinationcreateQueue(int serverId, String name)Creates or retrieves a queue destination on a given JORAM server.DestinationcreateQueue(int serverId, String name, String className, Properties prop)Creates or retrieves a queue destination on a given JORAM server.DestinationcreateQueue(String name)Creates or retrieves a queue destination on a given JORAM server.DestinationcreateTopic(int serverId, String name)Creates or retrieves a topic destination on a given JORAM server.DestinationcreateTopic(int serverId, String name, String className, Properties prop)Creates or retrieves a topic destination on a given JORAM server.DestinationcreateTopic(String name)Creates or retrieves a topic destination on the underlying JORAM server.UsercreateUser(String name, String password)Creates or retrieves a user on the underlying JORAM server.UsercreateUser(String name, String password, int serverId)Creates or retrieves a user on the underlying JORAM server.UsercreateUser(String name, String password, int serverId, String identityClassName)Admin method creating a user for a given server and instantiating the correspondingUserobject.UsercreateUser(String name, String password, int serverId, String identityClassName, Properties prop)Admin method creating a user for a given server and instantiating the correspondingUserobject.UsercreateUser(String name, String password, String identityClass)Creates or retrieves a user on the underlying JORAM server.StringdeleteAMQPBridgeConnection(int serverId, String names)Removes the live connection to the specified AMQP server.StringdeleteJMSBridgeConnection(int serverId, String names)Removes the live connection to the specified JMS server.StringdeleteJMSBridgeConnection(int serverId, String names, boolean async)Removes the live connection to the specified JMS server.StringdeleteJMSPBridgeConnection(int serverId, String names)Deprecated.Use deleteJMSBridgeConnection instead.StringdeleteJMSPBridgeConnection(int serverId, String names, boolean async)Deprecated.Use deleteJMSBridgeConnection instead.org.objectweb.joram.shared.admin.AdminReplydoRequest(org.objectweb.joram.shared.admin.AdminRequest request)Method actually sending anAdminRequestinstance to the platform and getting anAdminReplyinstance.StringgetConfiguration()Returns the current servers configuration (a3servers.xml).QueuegetDefaultDMQ()Returns the default dead message queue for the local server, null if not set.QueuegetDefaultDMQ(int serverId)Returns the default dead message queue for a given server, null if not set.StringgetDefaultDMQId()Returns the unique identifier of the default dead message queue for the local server, null if not set.StringgetDefaultDMQId(int serverId)Returns the unique identifier of the default dead message queue for a given server, null if not set.intgetDefaultThreshold()Returns the default threshold value for the local server, -1 if not set.intgetDefaultThreshold(int serverId)Returns the default threshold value for a given server, -1 if not set.Destination[]getDestinations()Returns the list of all destinations that exist on the local server.Destination[]getDestinations(int serverId)Returns the list of all destinations that exist on a given server.String[]getDomainNames(int serverId)Returns the list of the domain names that contains the specified server.HashtablegetJMXAttribute(int serverId, String attname)Returns JMX attribute value for the specified server.HashtablegetJMXAttribute(String attname)Returns JMX attribute value for the local server.StringgetLocalHost()Returns the host name of the server the module is connected to.StringgetLocalName()Returns the name of the server the module is connected to.ServergetLocalServer()Returns the information about the current server: unique identifier, symbolic name and hostname.intgetLocalServerId()Returns the identifier of the server the module is connected to.Server[]getServers()Returns the list of the platform's servers' identifiers.Server[]getServers(String domain)Returns the list of the servers' that belong to the specified domain.int[]getServersIds()Returns the list of the platform's servers' identifiers.int[]getServersIds(String domain)Returns the list of the servers' identifiers that belong to the specified domainString[]getServersNames()Returns the list of the platform's servers' names.String[]getServersNames(String domain)Returns the list of the servers' names that belong to the specified domainHashtablegetStatistics()Returns statistics for the local server.HashtablegetStatistics(int serverId)Returns statistics for the specified server.longgetTimeOutToAbortRequest()Returns the maximum time in ms before aborting request.User[]getUsers()Returns the list of all users that exist on the local server.User[]getUsers(int serverId)Returns the list of all users that exist on a given server.StringinvokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args)Invokes the specified static method with the specified parameters on the chosen server.StringinvokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args, boolean async)Invokes the specified static method with the specified parameters on the chosen server.booleanisClosed()Returns true if the underlying requestor is closed.org.objectweb.joram.shared.admin.AdminReplyprocessAdmin(String targetId, int command, Properties prop)The method send the admin JMS message on JORAM server (AdminTopic).voidremoveDomain(String domain)Removes a domain from the platform.voidremoveServer(int sid)Removes a server from the platform.voidsetDefaultDMQ(int serverId, Queue dmq)Sets a given dead message queue as the default DMQ for a given server (nullfor unsetting previous DMQ).voidsetDefaultDMQ(Queue dmq)Sets a given dead message queue as the default DMQ for the local server (nullfor unsetting previous DMQ).voidsetDefaultDMQId(int serverId, String dmqId)Sets a given dead message queue as the default DMQ for a given server (nullfor unsetting previous DMQ).voidsetDefaultDMQId(String dmqId)Sets a given dead message queue as the default DMQ for the local server (nullfor unsetting previous DMQ).voidsetDefaultThreshold(int threshold)Sets a given value as the default threshold for the local server (-1 for unsetting previous value).voidsetDefaultThreshold(int serverId, int threshold)Sets a given value as the default threshold for a given server (-1 for unsetting previous value).voidsetTimeOutToAbortRequest(long timeOut)Set the maximum time in ms before aborting request.voidstopServer()Stops the platform local server.voidstopServer(int serverId)Stops a given server of the platform.
-
-
-
Field Detail
-
server
private Server server
The description of the server the module is connected to.
-
requestor
private AdminRequestor requestor
The requestor for sending the synchronous requests.
-
ADM_NAME_PROPERTY
public static final String ADM_NAME_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_ADM_NAME
public static final String DEFAULT_ADM_NAME
- See Also:
- Constant Field Values
-
logger
public static org.objectweb.util.monolog.api.Logger logger
-
-
Constructor Detail
-
AdminWrapper
public AdminWrapper(Connection cnx) throws JMSException, ConnectException, AdminException
Creates an administration wrapper for a Joram server. Be careful, if the connection is not started this method will failed with a ConnectException.- Parameters:
cnx- A valid connection to the Joram server.- Throws:
JMSException- A problem occurs during initialization.ConnectExceptionAdminException
-
-
Method Detail
-
setTimeOutToAbortRequest
public final void setTimeOutToAbortRequest(long timeOut) throws ConnectExceptionSet the maximum time in ms before aborting request.- Specified by:
setTimeOutToAbortRequestin interfaceAdminItf- Parameters:
timeOut- the maximum time in ms before aborting request.- Throws:
ConnectException- if the connection is not established.
-
getTimeOutToAbortRequest
public final long getTimeOutToAbortRequest() throws ConnectExceptionReturns the maximum time in ms before aborting request.- Specified by:
getTimeOutToAbortRequestin interfaceAdminItf- Returns:
- the maximum time in ms before aborting request.
- Throws:
ConnectException- if the connection is not established.
-
close
public void close()
Closes the underlying requestor.
-
isClosed
public boolean isClosed()
Returns true if the underlying requestor is closed.
-
stopServer
public final void stopServer() throws ConnectException, AdminExceptionStops the platform local server.- Specified by:
stopServerin interfaceAdminItf- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
stopServer(int)
-
stopServer
public final void stopServer(int serverId) throws ConnectException, AdminExceptionStops a given server of the platform.The request fails if the target server does not belong to the platform.
- Specified by:
stopServerin interfaceAdminItf- Parameters:
serverId- Identifier of the server to stop.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addServer
public final void addServer(int sid, String host, String domain, int port, String server) throws ConnectException, AdminExceptionAdds a server to the platform.The server is configured without any service.
- Specified by:
addServerin interfaceAdminItf- Parameters:
sid- Id of the added serverhost- Address of the host where the added server is starteddomain- Name of the domain where the server is addedport- Listening port of the server in the specified domainserver- Name of the added server- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
addServer(int, String, String, int, String, String[], String[])
-
addServer
public final void addServer(int sid, String host, String domain, int port, String server, String[] services, String[] args) throws ConnectException, AdminExceptionAdds a server to the platform.- Specified by:
addServerin interfaceAdminItf- Parameters:
sid- Id of the added serverhost- Address of the host where the added server is starteddomain- Name of the domain where the server is addedport- Listening port of the server in the specified domainserver- Name of the added serverservices- Names of the service to start within the serverargs- Services' arguments- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
removeServer
public final void removeServer(int sid) throws ConnectException, AdminExceptionRemoves a server from the platform.- Specified by:
removeServerin interfaceAdminItf- Parameters:
sid- Id of the removed server- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addDomain
public final void addDomain(String domain, int sid, int port) throws ConnectException, AdminException
Adds a domain to the platform.The domain will use the default network component "SimpleNetwork".
- Specified by:
addDomainin interfaceAdminItf- Parameters:
domain- Name of the added domain.sid- Id of the router server that gives access to the added domain.port- Listening port in the added domain of the router server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addDomain
public final void addDomain(String domain, String network, int sid, int port) throws ConnectException, AdminException
Adds a domain to the platform using a specific network component.- Specified by:
addDomainin interfaceAdminItf- Parameters:
domain- Name of the added domain.network- Classname of the network component to use.sid- Id of the router server that gives access to the added domain.port- Listening port in the added domain of the router server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
removeDomain
public final void removeDomain(String domain) throws ConnectException, AdminException
Removes a domain from the platform.- Specified by:
removeDomainin interfaceAdminItf- Parameters:
domain- Name of the domain to remove- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getConfiguration
public final String getConfiguration() throws ConnectException, AdminException
Returns the current servers configuration (a3servers.xml).- Specified by:
getConfigurationin interfaceAdminItf- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getStatistics
public final Hashtable getStatistics() throws ConnectException, AdminException
Returns statistics for the local server.- Specified by:
getStatisticsin interfaceAdminItf- Returns:
- statistics for the local server.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getStatistics(int)
-
getStatistics
public final Hashtable getStatistics(int serverId) throws ConnectException, AdminException
Returns statistics for the specified server.The request fails if the target server does not belong to the platform.
- Specified by:
getStatisticsin interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Returns:
- the statistics for the the specified server.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getJMXAttribute
public final Hashtable getJMXAttribute(String attname) throws ConnectException, AdminException
Returns JMX attribute value for the local server.- Specified by:
getJMXAttributein interfaceAdminItf- Returns:
- Corresponding JMX attribute value for the local server.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getStatistics(int)
-
getJMXAttribute
public final Hashtable getJMXAttribute(int serverId, String attname) throws ConnectException, AdminException
Returns JMX attribute value for the specified server.The request fails if the target server does not belong to the platform.
- Specified by:
getJMXAttributein interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Returns:
- the statistics for the the specified server.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getDefaultDMQId
public final String getDefaultDMQId() throws ConnectException, AdminException
Returns the unique identifier of the default dead message queue for the local server, null if not set.- Specified by:
getDefaultDMQIdin interfaceAdminItf- Returns:
- The unique identifier of the default dead message queue for the local server, null if not set.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getDefaultDMQId(int)
-
getDefaultDMQId
public final String getDefaultDMQId(int serverId) throws ConnectException, AdminException
Returns the unique identifier of the default dead message queue for a given server, null if not set.The request fails if the target server does not belong to the platform.
- Specified by:
getDefaultDMQIdin interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Returns:
- The unique identifier of the default dead message queue for the local server, null if not set.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
setDefaultDMQId
public final void setDefaultDMQId(String dmqId) throws ConnectException, AdminException
Sets a given dead message queue as the default DMQ for the local server (nullfor unsetting previous DMQ).- Specified by:
setDefaultDMQIdin interfaceAdminItf- Parameters:
dmqId- The dmqId (AgentId) to be set as the default one.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
setDefaultDMQId(int, String)
-
setDefaultDMQId
public final void setDefaultDMQId(int serverId, String dmqId) throws ConnectException, AdminExceptionSets a given dead message queue as the default DMQ for a given server (nullfor unsetting previous DMQ).The request fails if the target server does not belong to the platform.
- Specified by:
setDefaultDMQIdin interfaceAdminItf- Parameters:
serverId- The identifier of the server.dmqId- The dmqId (AgentId) to be set as the default one.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getDefaultDMQ
public final Queue getDefaultDMQ() throws ConnectException, AdminException
Returns the default dead message queue for the local server, null if not set.- Specified by:
getDefaultDMQin interfaceAdminItf- Returns:
- The default dead message queue for the local server, null if not set.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getDefaultDMQ(int)
-
getDefaultDMQ
public final Queue getDefaultDMQ(int serverId) throws ConnectException, AdminException
Returns the default dead message queue for a given server, null if not set.The request fails if the target server does not belong to the platform.
- Specified by:
getDefaultDMQin interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Returns:
- The default dead message queue for the local server, null if not set.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
setDefaultDMQ
public final void setDefaultDMQ(Queue dmq) throws ConnectException, AdminException
Sets a given dead message queue as the default DMQ for the local server (nullfor unsetting previous DMQ).- Specified by:
setDefaultDMQin interfaceAdminItf- Parameters:
dmq- The dmq to be set as the default one.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
setDefaultDMQ(int, Queue)
-
setDefaultDMQ
public final void setDefaultDMQ(int serverId, Queue dmq) throws ConnectException, AdminExceptionSets a given dead message queue as the default DMQ for a given server (nullfor unsetting previous DMQ).The request fails if the target server does not belong to the platform.
- Specified by:
setDefaultDMQin interfaceAdminItf- Parameters:
serverId- The identifier of the server.dmq- The dmq to be set as the default one.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getDefaultThreshold
public final int getDefaultThreshold() throws ConnectException, AdminExceptionReturns the default threshold value for the local server, -1 if not set.- Specified by:
getDefaultThresholdin interfaceAdminItf- Returns:
- The default threshold value for the local server, -1 if not set.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getDefaultThreshold(int)
-
getDefaultThreshold
public final int getDefaultThreshold(int serverId) throws ConnectException, AdminExceptionReturns the default threshold value for a given server, -1 if not set.The request fails if the target server does not belong to the platform.
- Specified by:
getDefaultThresholdin interfaceAdminItf- Returns:
- The default threshold value for the local server, -1 if not set.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
setDefaultThreshold
public final void setDefaultThreshold(int threshold) throws ConnectException, AdminExceptionSets a given value as the default threshold for the local server (-1 for unsetting previous value).- Specified by:
setDefaultThresholdin interfaceAdminItf- Parameters:
threshold- The threshold value to be set.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
setDefaultThreshold(int, int)
-
setDefaultThreshold
public final void setDefaultThreshold(int serverId, int threshold) throws ConnectException, AdminExceptionSets a given value as the default threshold for a given server (-1 for unsetting previous value).The request fails if the target server does not belong to the platform.
- Specified by:
setDefaultThresholdin interfaceAdminItf- Parameters:
serverId- The identifier of the server.threshold- The threshold value to be set.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getServersIds
public final int[] getServersIds() throws ConnectException, AdminExceptionReturns the list of the platform's servers' identifiers.- Specified by:
getServersIdsin interfaceAdminItf- Returns:
- An array containing the list of server's identifiers.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getServers(String)
-
getServersIds
public final int[] getServersIds(String domain) throws ConnectException, AdminException
Returns the list of the servers' identifiers that belong to the specified domain- Specified by:
getServersIdsin interfaceAdminItf- Parameters:
domain- Name of the domain.- Returns:
- An array containing the list of server's identifiers of the specified domain.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getServersNames
public final String[] getServersNames() throws ConnectException, AdminException
Returns the list of the platform's servers' names.- Specified by:
getServersNamesin interfaceAdminItf- Returns:
- An array containing the list of server's names.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getServers(String)
-
getServersNames
public final String[] getServersNames(String domain) throws ConnectException, AdminException
Returns the list of the servers' names that belong to the specified domain- Specified by:
getServersNamesin interfaceAdminItf- Parameters:
domain- Name of the domain.- Returns:
- An array containing the list of server's names of the specified domain.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getServers
public final Server[] getServers() throws ConnectException, AdminException
Returns the list of the platform's servers' identifiers.- Specified by:
getServersin interfaceAdminItf- Returns:
- An array containing the description of all servers.
- Throws:
ConnectExceptionAdminException- See Also:
getServers(String)
-
getServers
public final Server[] getServers(String domain) throws ConnectException, AdminException
Returns the list of the servers' that belong to the specified domain.- Specified by:
getServersin interfaceAdminItf- Parameters:
domain- Name of the domain.- Returns:
- An array containing the description of all servers.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getDomainNames
public final String[] getDomainNames(int serverId) throws ConnectException, AdminException
Returns the list of the domain names that contains the specified server.- Specified by:
getDomainNamesin interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getDestinations
public final Destination[] getDestinations() throws ConnectException, AdminException
Returns the list of all destinations that exist on the local server.- Specified by:
getDestinationsin interfaceAdminItf- Returns:
- An array containing all destinations defined on the given server or null if none exists.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations(int)
-
getDestinations
public final Destination[] getDestinations(int serverId) throws ConnectException, AdminException
Returns the list of all destinations that exist on a given server.The request fails if the target server does not belong to the platform.
- Specified by:
getDestinationsin interfaceAdminItf- Parameters:
serverId- Unique identifier of the server.- Returns:
- An array containing all destinations defined on the given server or null if none exists.
- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
createQueue
public Destination createQueue(String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on a given JORAM server.- Specified by:
createQueuein interfaceAdminItf- Parameters:
name- The name of the queue.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.- See Also:
createQueue(int, String, String, Properties)
-
createQueue
public Destination createQueue(int serverId, String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on a given JORAM server.- Specified by:
createQueuein interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the queue.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.- See Also:
createQueue(int, String, String, Properties)
-
createQueue
public Destination createQueue(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
Creates or retrieves a queue destination on a given JORAM server.First a destination with the specified name is searched on the given server, if it does not exist it is created.
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
- Specified by:
createQueuein interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the queue.name- The name of the queue.className- The queue class name.prop- The queue properties.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
createTopic
public Destination createTopic(String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on the underlying JORAM server.- Specified by:
createTopicin interfaceAdminItf- Parameters:
name- The name of the topic.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.- See Also:
createTopic(int, String, String, Properties)
-
createTopic
public Destination createTopic(int serverId, String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on a given JORAM server.- Specified by:
createTopicin interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the topic.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.- See Also:
createTopic(int, String, String, Properties)
-
createTopic
public Destination createTopic(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
Creates or retrieves a topic destination on a given JORAM server.First a destination with the specified name is searched on the given server, if it does not exist it is created.
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
- Specified by:
createTopicin interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the topic.className- The topic class name.prop- The topic properties.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
createDeadMQueue
public Queue createDeadMQueue(int serverId, String name) throws ConnectException, AdminException
Deprecated.No longer needed, any queue can be used as DMQ.Creates or retrieves a DeadMessageQueue destination on a given JORAM server.First a destination with the specified name is searched on the given server, if it does not exist it is created.
The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the queue.- Throws:
ConnectException- If the admin connection is closed or broken.AdminException- If the request fails.
-
getUsers
public final User[] getUsers() throws ConnectException, AdminException
Returns the list of all users that exist on the local server.- Specified by:
getUsersin interfaceAdminItf- Returns:
- An array containing all users defined on the local server, or null if none exist.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getUsers(int)
-
getUsers
public final User[] getUsers(int serverId) throws ConnectException, AdminException
Returns the list of all users that exist on a given server.The request fails if the target server does not belong to the platform.
- Specified by:
getUsersin interfaceAdminItf- Parameters:
serverId- Unique identifier of the given server.- Returns:
- An array containing all users defined on the local server, or null if none exist.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
createUser
public User createUser(String name, String password) throws ConnectException, AdminException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- Name of the user.password- Password of the user.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
createUser(String, String, int, String)
-
createUser
public User createUser(String name, String password, int serverId) throws ConnectException, AdminException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- Name of the user.password- Password of the user.serverId- The identifier of the user's server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
createUser(String, String, int, String)
-
createUser
public User createUser(String name, String password, String identityClass) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- Name of the user.password- Password of the user.identityClass- Classname for authentication, by default SimpleIdentity for user/password.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
createUser(String, String, int, String)
-
createUser
public User createUser(String name, String password, int serverId, String identityClassName) throws ConnectException, AdminException
Admin method creating a user for a given server and instantiating the correspondingUserobject.If the user has already been set on this server, the method simply returns the corresponding
Userobject. Its fails if the target server does not belong to the platform, or if a proxy could not be deployed server side for a new user.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- Name of the user.password- Password of the user.serverId- The identifier of the user's server.identityClassName- By default user/password for SimpleIdentity.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
createUser
public User createUser(String name, String password, int serverId, String identityClassName, Properties prop) throws ConnectException, AdminException
Admin method creating a user for a given server and instantiating the correspondingUserobject.If the user has already been set on this server, the method simply returns the corresponding
Userobject. Its fails if the target server does not belong to the platform, or if a proxy could not be deployed server side for a new user.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- Name of the user.password- Password of the user.serverId- The identifier of the user's server.identityClassName- By default user/password for SimpleIdentity.prop- properties- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
createIdentity
private org.objectweb.joram.shared.security.Identity createIdentity(String user, String passwd, String identityClassName) throws AdminException
Create a user Identity.- Parameters:
user- Name of the user.passwd- Password of the user.identityClassName- identity class name (simple, jaas).- Returns:
- identity user Identity.
- Throws:
AdminException
-
getLocalServer
public final Server getLocalServer() throws ConnectException, AdminException
Returns the information about the current server: unique identifier, symbolic name and hostname.- Specified by:
getLocalServerin interfaceAdminItf- Returns:
- The description of the server.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getLocalServerId
public final int getLocalServerId() throws ConnectException, AdminExceptionReturns the identifier of the server the module is connected to.- Specified by:
getLocalServerIdin interfaceAdminItf- Throws:
ConnectException- If the admin connection is not established.AdminException- If the request fails.- See Also:
getLocalServer()
-
getLocalHost
public final String getLocalHost() throws ConnectException, AdminException
Returns the host name of the server the module is connected to.- Specified by:
getLocalHostin interfaceAdminItf- Throws:
ConnectException- If the admin connection is not established.AdminException- If the request fails.- See Also:
getLocalServer()
-
getLocalName
public final String getLocalName() throws ConnectException, AdminException
Returns the name of the server the module is connected to.- Specified by:
getLocalNamein interfaceAdminItf- Throws:
ConnectException- If the admin connection is not established.AdminException- If the request fails.- See Also:
getLocalServer()
-
processAdmin
public org.objectweb.joram.shared.admin.AdminReply processAdmin(String targetId, int command, Properties prop) throws ConnectException, AdminException
The method send the admin JMS message on JORAM server (AdminTopic).- Specified by:
processAdminin interfaceAdminItf- Parameters:
targetId- agent Id target.command- the command to execute.prop- the properties.- Returns:
- the reply.
- Throws:
AdminExceptionConnectException- If the connection fails.
-
doRequest
public org.objectweb.joram.shared.admin.AdminReply doRequest(org.objectweb.joram.shared.admin.AdminRequest request) throws AdminException, ConnectExceptionMethod actually sending anAdminRequestinstance to the platform and getting anAdminReplyinstance.- Specified by:
doRequestin interfaceAdminItf- Parameters:
request- the administration request to send- Returns:
- the reply message
- Throws:
ConnectException- If the connection to the platform fails.AdminException- If the platform's reply is invalid, or if the request failed.
-
abortRequest
public void abortRequest() throws ConnectException- Specified by:
abortRequestin interfaceAdminItf- Throws:
ConnectException
-
invokeStaticServerMethod
public String invokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args) throws ConnectException, AdminException
Invokes the specified static method with the specified parameters on the chosen server. The parameters types of the invoked method must be java primitive types, the java objects wrapping them or String type. The method is invoked synchronously by the server and the result is returned.- Specified by:
invokeStaticServerMethodin interfaceAdminItf- Parameters:
serverId- the identifier of the server.className- the name of the class holding the static methodmethodName- the name of the invoked methodparameterTypes- the list of parametersargs- the arguments used for the method call- Returns:
- the result of the invoked method after applying the toString method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
invokeStaticServerMethod
public String invokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args, boolean async) throws ConnectException, AdminException
Invokes the specified static method with the specified parameters on the chosen server. The parameters types of the invoked method must be java primitive types, the java objects wrapping them or String type. The method can be invoked either asynchronously or not by the server depending of the parameter async.- Parameters:
serverId- the identifier of the server.className- the name of the class holding the static methodmethodName- the name of the invoked methodparameterTypes- the list of parametersargs- the arguments used for the method callasync- if true the method is invoked asynchronously by the server and the result is lost.- Returns:
- the result of the invoked method after applying the toString method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
addAMQPBridgeConnection
public String addAMQPBridgeConnection(int serverId, String urls) throws ConnectException, AdminException
Adds an AMQP server and starts a live connection with it, accessible via the url provided. A server is uniquely identified by the given name. Adding an existing server won't do anything.- Specified by:
addAMQPBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdurls- the amqp url list identifying the servers separate by space, for example: "amqp://user:pass@localhost:5672/?name=serv1 amqp://user:pass@localhost:5678/?name=serv2"- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
deleteAMQPBridgeConnection
public String deleteAMQPBridgeConnection(int serverId, String names) throws ConnectException, AdminException
Removes the live connection to the specified AMQP server.- Specified by:
deleteAMQPBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdnames- the name identifying the server or list of name separate by space- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
addJMSBridgeConnection
public String addJMSBridgeConnection(int serverId, String urls) throws ConnectException, AdminException
Adds a JMS server and starts a live connection with it, accessible via the url provided. A server is uniquely identified by the given name. Adding an existing server won't do anything.- Specified by:
addJMSBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdurls- the jms url list identifying the servers separate by space, for example: "jndi_url/?name=cnx1&cf=cfName&jndiFactoryClass=com.xxx.yyy&user=user1&pass=pass1&clientID=clientID"- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
deleteJMSBridgeConnection
public String deleteJMSBridgeConnection(int serverId, String names) throws ConnectException, AdminException
Removes the live connection to the specified JMS server.- Specified by:
deleteJMSBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdnames- the name identifying the server or list of name separate by space- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
deleteJMSPBridgeConnection
public String deleteJMSPBridgeConnection(int serverId, String names) throws ConnectException, AdminException
Deprecated.Use deleteJMSBridgeConnection instead.Removes the live connection to the specified JMS server (Use deleteJMSBridgeConnection instead).- Specified by:
deleteJMSPBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdnames- the name identifying the server or list of name separate by space- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
deleteJMSBridgeConnection
public String deleteJMSBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
Removes the live connection to the specified JMS server.- Specified by:
deleteJMSBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdnames- the name identifying the server or list of name separate by spaceasync- invoke asynchronously- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
deleteJMSPBridgeConnection
public String deleteJMSPBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
Deprecated.Use deleteJMSBridgeConnection instead.Removes the live connection to the specified JMS server (Use deleteJMSBridgeConnection instead).- Specified by:
deleteJMSPBridgeConnectionin interfaceAdminItf- Parameters:
serverId- the serverIdnames- the name identifying the server or list of name separate by spaceasync- invoke asynchronously- Returns:
- the result of the method
- Throws:
ConnectException- If the connection fails.AdminException- If the invocation can't be done or fails
-
-