Class JoramAdmin
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.JoramAdmin
-
- All Implemented Interfaces:
AdminItf,JoramAdminMBean
public class JoramAdmin extends Object implements AdminItf, JoramAdminMBean
JoramAdmin is the implementation of the interface JoramAdminMBean. It must only be used to allow administration through JMX.- See Also:
AdminModule,AdminWrapper
-
-
Field Summary
Fields Modifier and Type Field Description protected StringJMXBaseNamestatic org.objectweb.util.monolog.api.LoggerloggerAdminWrapperwrapper
-
Constructor Summary
Constructors Constructor Description JoramAdmin(Connection cnx)Creates a MBean to administer Joram using the default basename for JMX registering (JoramAdmin(Connection, String)).JoramAdmin(Connection cnx, String base)Creates a MBean to administer Joram using the given basename for JMX registering.
-
Method Summary
All Methods Static 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.DestinationcreateQueue(int serverId, String name)Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.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 the underlying JORAM server, (re)binds the correspondingQueueinstance.DestinationcreateTopic(int serverId, String name)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.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, (re)binds the correspondingTopicinstance.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 given JORAM server.UsercreateUser(String name, String password, int serverId, String identityClass)Creates or retrieves a user on the underlying JORAM server.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 AMQP server.StringdeleteJMSBridgeConnection(int serverId, String names, boolean async)Removes the live connection to the specified JMS server.StringdeleteJMSPBridgeConnection(int serverId, String names)Deprecated.StringdeleteJMSPBridgeConnection(int serverId, String names, boolean async)Deprecated.static JoramAdmindoCreate(AbstractConnectionFactory cf, String name, String password, String identityClass)Opens a connection dedicated to administering with the Joram server which parameters are wrapped by a givenConnectionFactory.org.objectweb.joram.shared.admin.AdminReplydoRequest(org.objectweb.joram.shared.admin.AdminRequest request)Method actually sending anAdminRequestinstance to the platform and getting anAdminReplyinstance.voidexecuteXMLAdmin(String path)This method execute the XML script file that the pathname is given in parameter.voidexecuteXMLAdmin(String cfgDir, String cfgFileName)This method execute the XML script file that the location is given in parameter.voidexit()Closes the administration connection and unregister the MBean.voidexportRepositoryToFile(String exportDir, String exportFilename)Export the repository content to an XML file - only the destinations objects are retrieved in this version - xml script format of the admin objects (joramAdmin.xml)voidgetAllDestinations(int serverId)This method creates and registers MBeans for all the destinations of the selected server.voidgetAllUsers(int serverId)This method creates and registers MBeans for all the users of the selected server.StringgetConfiguration()Returns the current servers configuration (equivalent to the a3servers.xml file).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 the local 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()This method creates and registers MBeans for all the destinations on the local server.Destination[]getDestinations(int serverId)This method creates and registers MBeans for all the destinations of the selected 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.StringgetJMXBaseName()voidgetLocalDestinations()This method creates and registers MBeans for all the destinations on 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.voidgetLocalUsers()This method creates and registers MBeans for all the users on the local server.Server[]getServers()Returns the list of the platform's servers' descriptions.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 the specified server.longgetTimeOutToAbortRequest()Gets the maximum time a command has to complete before it is canceled.User[]getUsers()This method creates and registers MBeans for all the users on the local server.User[]getUsers(int serverId)This method creates and registers MBeans for all the users of the selected 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)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).voidqueueCreate(int serverId, String name)Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.voidqueueCreate(String name)Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.voidregisterMBean(String base)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)Specifies how much time a command has to complete before If the command does not complete within the specified time, it is canceled and an exception is generated.voidstopServer()Stops the platform local server.voidstopServer(int serverId)Stops a given server of the platform.voidtopicCreate(int serverId, String name)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.voidtopicCreate(String name)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.voidunregisterMBean()voiduserCreate(String name, String password)Creates or retrieves a user on the underlying JORAM server.voiduserCreate(String name, String password, int serverId)Creates or retrieves a user on the given JORAM server.voiduserCreate(String name, String password, int serverId, String identityClass)Creates or retrieves a user on the underlying JORAM server.voiduserCreate(String name, String password, String identityClass)Creates or retrieves a user on the underlying JORAM server.private DestinationwrapDestination(Destination destination)private Destination[]wrapDestinations(Destination[] destinations)private UserwrapUser(User user)private User[]wrapUsers(User[] users)
-
-
-
Field Detail
-
logger
public static org.objectweb.util.monolog.api.Logger logger
-
wrapper
public AdminWrapper wrapper
-
JMXBaseName
protected transient String JMXBaseName
-
-
Constructor Detail
-
JoramAdmin
public JoramAdmin(Connection cnx) throws ConnectException, AdminException, JMSException
Creates a MBean to administer Joram using the default basename for JMX registering (JoramAdmin(Connection, String)). 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- See Also:
AdminWrapper(Connection)
-
JoramAdmin
public JoramAdmin(Connection cnx, String base) throws ConnectException, AdminException, JMSException
Creates a MBean to administer Joram using the given basename for JMX registering. Be careful, if the connection is not started this method will failed with a ConnectException.- Parameters:
cnx- A valid connection to the Joram server.base- the basename for registering the MBean.- Throws:
JMSException- A problem occurs during initialization.ConnectExceptionAdminException- See Also:
AdminWrapper(Connection)
-
-
Method Detail
-
exit
public void exit()
Closes the administration connection and unregister the MBean.- Specified by:
exitin interfaceJoramAdminMBean
-
close
public void close()
Description copied from interface:AdminItfCloses the underlying requestor.
-
isClosed
public boolean isClosed()
Description copied from interface:AdminItfReturns true if the underlying requestor is closed.
-
setTimeOutToAbortRequest
public void setTimeOutToAbortRequest(long timeOut) throws ConnectExceptionSpecifies how much time a command has to complete before If the command does not complete within the specified time, it is canceled and an exception is generated.Be careful, the value can be changed prior to the connection only using the
AdminRequestor.REQUEST_TIMEOUT_PROPproperty.- Specified by:
setTimeOutToAbortRequestin interfaceAdminItf- Specified by:
setTimeOutToAbortRequestin interfaceJoramAdminMBean- Parameters:
timeOut- the maximum time before a command is canceled.- Throws:
ConnectException- if the connection is not established.
-
getTimeOutToAbortRequest
public long getTimeOutToAbortRequest() throws ConnectExceptionGets the maximum time a command has to complete before it is canceled.- Specified by:
getTimeOutToAbortRequestin interfaceAdminItf- Specified by:
getTimeOutToAbortRequestin interfaceJoramAdminMBean- Returns:
- the maximum time before a command is canceled
- Throws:
ConnectException- if the connection is not established.
-
stopServer
public void stopServer() throws ConnectException, AdminExceptionStops the platform local server.- Specified by:
stopServerin interfaceAdminItf- Specified by:
stopServerin interfaceJoramAdminMBean- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
stopServer(int)
-
stopServer
public 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- Specified by:
stopServerin interfaceJoramAdminMBean- Parameters:
serverId- Identifier of the server to stop.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addServer
public 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- Specified by:
addServerin interfaceJoramAdminMBean- 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:
AdminItf.addServer(int, String, String, int, String, String[], String[])
-
addServer
public void addServer(int sid, String host, String domain, int port, String server, String[] services, String[] args) throws ConnectException, AdminExceptionDescription copied from interface:AdminItfAdds 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 void removeServer(int sid) throws ConnectException, AdminExceptionRemoves a server from the platform.- Specified by:
removeServerin interfaceAdminItf- Specified by:
removeServerin interfaceJoramAdminMBean- Parameters:
sid- Id of the removed server- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addDomain
public 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- Specified by:
addDomainin interfaceJoramAdminMBean- 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 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- Specified by:
addDomainin interfaceJoramAdminMBean- 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 void removeDomain(String domain) throws ConnectException, AdminException
Removes a domain from the platform.- Specified by:
removeDomainin interfaceAdminItf- Specified by:
removeDomainin interfaceJoramAdminMBean- Parameters:
domain- Name of the domain to remove- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getConfiguration
public String getConfiguration() throws ConnectException, AdminException
Returns the current servers configuration (equivalent to the a3servers.xml file).- Specified by:
getConfigurationin interfaceAdminItf- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getServersIds
public int[] getServersIds() throws ConnectException, AdminExceptionReturns the list of the platform's servers' identifiers.- Specified by:
getServersIdsin interfaceAdminItf- Specified by:
getServersIdsin interfaceJoramAdminMBean- Returns:
- An array containing the list of server's identifiers.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getServersIds(String)
-
getServersIds
public int[] getServersIds(String domain) throws ConnectException, AdminException
Returns the list of the servers' identifiers that belong to the specified domain- Specified by:
getServersIdsin interfaceAdminItf- Specified by:
getServersIdsin interfaceJoramAdminMBean- 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.
-
getServers
public Server[] getServers() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns the list of the platform's servers' descriptions.- Specified by:
getServersin interfaceAdminItf- Returns:
- An array containing the description of all servers.
- Throws:
ConnectExceptionAdminException- See Also:
AdminItf.getServers(String)
-
getServers
public Server[] getServers(String domain) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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 the corresponding servers.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getDomainNames
public String[] getDomainNames(int serverId) throws ConnectException, AdminException
Returns the list of the domain names that contains the specified server.- Specified by:
getDomainNamesin interfaceAdminItf- Specified by:
getDomainNamesin interfaceJoramAdminMBean- Parameters:
serverId- Unique identifier of the server.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getDefaultDMQId
public 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- Specified by:
getDefaultDMQIdin interfaceJoramAdminMBean- 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 String getDefaultDMQId(int serverId) throws ConnectException, AdminException
Returns the unique identifier of the default dead message queue for the local server, null if not set.The request fails if the target server does not belong to the platform.
- Specified by:
getDefaultDMQIdin interfaceAdminItf- Specified by:
getDefaultDMQIdin interfaceJoramAdminMBean- 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 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- Specified by:
setDefaultDMQIdin interfaceJoramAdminMBean- 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 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- Specified by:
setDefaultDMQIdin interfaceJoramAdminMBean- 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 Queue getDefaultDMQ() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getDefaultDMQ(int)
-
getDefaultDMQ
public Queue getDefaultDMQ(int serverId) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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 void setDefaultDMQ(Queue dmq) throws ConnectException, AdminException
Description copied from interface:AdminItfSets 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:
AdminItf.setDefaultDMQ(int, Queue)
-
setDefaultDMQ
public void setDefaultDMQ(int serverId, Queue dmq) throws ConnectException, AdminExceptionDescription copied from interface:AdminItfSets 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.
-
setDefaultThreshold
public 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- Specified by:
setDefaultThresholdin interfaceJoramAdminMBean- Parameters:
threshold- The threshold value to be set.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
setDefaultThreshold(int, int)
-
setDefaultThreshold
public 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- Specified by:
setDefaultThresholdin interfaceJoramAdminMBean- 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.
-
getDefaultThreshold
public int getDefaultThreshold() throws ConnectException, AdminExceptionReturns the default threshold value for the local server, -1 if not set.- Specified by:
getDefaultThresholdin interfaceAdminItf- Specified by:
getDefaultThresholdin interfaceJoramAdminMBean- 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 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- Specified by:
getDefaultThresholdin interfaceJoramAdminMBean- Returns:
- The default threshold value for the local server, -1 if not set.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getLocalDestinations
public void getLocalDestinations() throws ConnectException, AdminExceptionThis method creates and registers MBeans for all the destinations on the local server.- Specified by:
getLocalDestinationsin interfaceJoramAdminMBean- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations(int)
-
getDestinations
public Destination[] getDestinations() throws ConnectException, AdminException
This method creates and registers MBeans for all the destinations on the local server.- Specified by:
getDestinationsin interfaceAdminItf- Returns:
- the destinations tab
- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations(int)
-
getAllDestinations
public void getAllDestinations(int serverId) throws ConnectException, AdminExceptionThis method creates and registers MBeans for all the destinations of the selected server.The request fails if the target server does not belong to the platform.
- Specified by:
getAllDestinationsin interfaceJoramAdminMBean- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations()
-
getDestinations
public Destination[] getDestinations(int serverId) throws ConnectException, AdminException
This method creates and registers MBeans for all the destinations of the selected 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:
- the destinations tab
- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations()
-
wrapDestinations
private final Destination[] wrapDestinations(Destination[] destinations)
-
createQueue
public Destination createQueue(String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
createQueuein interfaceAdminItf- Parameters:
name- The name of the queue.- Returns:
- the destination
- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
createQueue(int, String)
-
createQueue
public Destination createQueue(int serverId, String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
createQueuein interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the queue.name- The name of the queue.- Returns:
- the destination
- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
AdminItf.createQueue(int, String, String, Properties)
-
createQueue
public Destination createQueue(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
Description copied from interface:AdminItfCreates 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, (re)binds the correspondingTopicinstance.- Specified by:
createTopicin interfaceAdminItf- Parameters:
name- The name of the topic.- Returns:
- the destination
- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
createTopic(int, String)
-
createTopic
public Destination createTopic(int serverId, String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Specified by:
createTopicin interfaceAdminItf- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the topic.- Returns:
- the destination
- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
AdminItf.createTopic(int, String, String, Properties)
-
createTopic
public Destination createTopic(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
Description copied from interface:AdminItfCreates 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.
-
wrapDestination
private final Destination wrapDestination(Destination destination)
-
getUsers
public User[] getUsers() throws ConnectException, AdminException
This method creates and registers MBeans for all the users on the local server.- Specified by:
getUsersin interfaceAdminItf- Returns:
- the users tab
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getUsers(int)
-
getUsers
public User[] getUsers(int serverId) throws ConnectException, AdminException
This method creates and registers MBeans for all the users of the selected 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:
- the users tab
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
createUser
public User createUser(String name, String password) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- The login name of the user.password- The password of the user.- Returns:
- the user
- Throws:
AdminException- If the creation fails.ConnectException- If the connection 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- The login name of the user.password- The password of the user.identityClass- The identity class used for authentication.- Returns:
- the user
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
createUser(String, String, int, String)
-
createUser
public User createUser(String name, String password, int serverId) throws AdminException, ConnectException
Creates or retrieves a user on the given JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- The login name of the user.password- The password of the user.serverId- The unique identifier of the Joram server.- Returns:
- the user
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
createUser(String, String, int, String)
-
createUser
public User createUser(String name, String password, int serverId, String identityClass) throws ConnectException, AdminException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceAdminItf- Parameters:
name- The login name of the user.password- The password of the user.serverId- The unique identifier of the Joram server.identityClass- The identity class used for authentication.- Returns:
- the user
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.
-
createUser
public User createUser(String name, String password, int serverId, String identityClassName, Properties prop) throws ConnectException, AdminException
Description copied from interface:AdminItfAdmin 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.
-
getJMXBaseName
public String getJMXBaseName()
-
registerMBean
public void registerMBean(String base)
-
unregisterMBean
public void unregisterMBean()
-
doCreate
public static JoramAdmin doCreate(AbstractConnectionFactory cf, String name, String password, String identityClass) throws ConnectException, AdminException
Opens a connection dedicated to administering with the Joram server which parameters are wrapped by a givenConnectionFactory.- Parameters:
cf- The Joram's ConnectionFactory to use for connecting.name- Administrator's name.password- Administrator's password.identityClass- identity class name.- Throws:
ConnectException- If connecting fails.AdminException- If the administrator identification is incorrect.
-
executeXMLAdmin
public void executeXMLAdmin(String cfgDir, String cfgFileName) throws Exception
This method execute the XML script file that the location is given in parameter.Be careful, currently this method use the static administration connection through the AdminModule Class.
- Specified by:
executeXMLAdminin interfaceJoramAdminMBean- Parameters:
cfgDir- The directory containing the file.cfgFileName- The script filename.- Throws:
Exception
-
executeXMLAdmin
public void executeXMLAdmin(String path) throws Exception
This method execute the XML script file that the pathname is given in parameter.Be careful, currently this method use the static administration connection through the AdminModule Class.
- Specified by:
executeXMLAdminin interfaceJoramAdminMBean- Parameters:
path- The script pathname.- Throws:
Exception
-
exportRepositoryToFile
public void exportRepositoryToFile(String exportDir, String exportFilename) throws AdminException
Export the repository content to an XML file - only the destinations objects are retrieved in this version - xml script format of the admin objects (joramAdmin.xml)Be careful, currently this method use the static administration connection through the AdminModule Class.
- Specified by:
exportRepositoryToFilein interfaceJoramAdminMBean- Parameters:
exportDir- target directory where the export file will be putexportFilename- filename of the export file- Throws:
AdminException- if an error occurs
-
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- Specified by:
processAdminin interfaceJoramAdminMBean- Parameters:
targetId- agent Id target.command- the command to execute.prop- the properties.- Returns:
- the reply.
- Throws:
AdminExceptionConnectException- If the connection fails.
-
queueCreate
public void queueCreate(String name) throws AdminException, ConnectException
Description copied from interface:JoramAdminMBeanCreates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
queueCreatein interfaceJoramAdminMBean- Parameters:
name- The name of the queue.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
JoramAdminMBean.queueCreate(int, String)
-
queueCreate
public void queueCreate(int serverId, String name) throws AdminException, ConnectExceptionDescription copied from interface:JoramAdminMBeanCreates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
queueCreatein interfaceJoramAdminMBean- Parameters:
serverId- The identifier of the server where deploying the queue.name- The name of the queue.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken
-
topicCreate
public void topicCreate(String name) throws AdminException, ConnectException
Description copied from interface:JoramAdminMBeanCreates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Specified by:
topicCreatein interfaceJoramAdminMBean- Parameters:
name- The name of the topic.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
JoramAdminMBean.topicCreate(int, String)
-
topicCreate
public void topicCreate(int serverId, String name) throws AdminException, ConnectExceptionDescription copied from interface:JoramAdminMBeanCreates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Specified by:
topicCreatein interfaceJoramAdminMBean- Parameters:
serverId- The identifier of the server where deploying the topic.name- The name of the topic.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken
-
getLocalUsers
public void getLocalUsers() throws ConnectException, AdminExceptionDescription copied from interface:JoramAdminMBeanThis method creates and registers MBeans for all the users on the local server.- Specified by:
getLocalUsersin interfaceJoramAdminMBean- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
JoramAdminMBean.getAllUsers(int)
-
getAllUsers
public void getAllUsers(int serverId) throws ConnectException, AdminExceptionDescription copied from interface:JoramAdminMBeanThis method creates and registers MBeans for all the users of the selected server.The request fails if the target server does not belong to the platform.
- Specified by:
getAllUsersin interfaceJoramAdminMBean- Parameters:
serverId- Unique identifier of the given server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
userCreate
public void userCreate(String name, String password) throws AdminException, ConnectException
Description copied from interface:JoramAdminMBeanCreates or retrieves a user on the underlying JORAM server.- Specified by:
userCreatein interfaceJoramAdminMBean- Parameters:
name- The login name of the user.password- The password of the user.- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
JoramAdminMBean.userCreate(String, String, int, String)
-
userCreate
public void userCreate(String name, String password, String identityClass) throws AdminException, ConnectException
Description copied from interface:JoramAdminMBeanCreates or retrieves a user on the underlying JORAM server.- Specified by:
userCreatein interfaceJoramAdminMBean- Parameters:
name- The login name of the user.password- The password of the user.identityClass- The identity class used for authentication.- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
JoramAdminMBean.userCreate(String, String, int, String)
-
userCreate
public void userCreate(String name, String password, int serverId) throws AdminException, ConnectException
Description copied from interface:JoramAdminMBeanCreates or retrieves a user on the given JORAM server.- Specified by:
userCreatein interfaceJoramAdminMBean- Parameters:
name- The login name of the user.password- The password of the user.serverId- The unique identifier of the Joram server.- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
JoramAdminMBean.userCreate(String, String, int, String)
-
userCreate
public void userCreate(String name, String password, int serverId, String identityClass) throws ConnectException, AdminException
Description copied from interface:JoramAdminMBeanCreates or retrieves a user on the underlying JORAM server.- Specified by:
userCreatein interfaceJoramAdminMBean- Parameters:
name- The login name of the user.password- The password of the user.serverId- The unique identifier of the Joram server.identityClass- The identity class used for authentication.- Throws:
ConnectException- If the connection fails.AdminException- If the creation fails.
-
getStatistics
public Hashtable getStatistics() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getStatistics(int)
-
getStatistics
public Hashtable getStatistics(int serverId) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns statistics for the 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 Hashtable getJMXAttribute(String attname) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getStatistics(int)
-
getJMXAttribute
public Hashtable getJMXAttribute(int serverId, String attname) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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.
-
getServersNames
public String[] getServersNames() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getServers(String)
-
getServersNames
public String[] getServersNames(String domain) throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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.
-
getLocalServer
public Server getLocalServer() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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 int getLocalServerId() throws ConnectException, AdminExceptionDescription copied from interface:AdminItfReturns 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:
AdminItf.getLocalServer()
-
getLocalHost
public String getLocalHost() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getLocalServer()
-
getLocalName
public String getLocalName() throws ConnectException, AdminException
Description copied from interface:AdminItfReturns 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:
AdminItf.getLocalServer()
-
doRequest
public org.objectweb.joram.shared.admin.AdminReply doRequest(org.objectweb.joram.shared.admin.AdminRequest request) throws AdminException, ConnectExceptionDescription copied from interface:AdminItfMethod 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:
AdminException- If the platform's reply is invalid, or if the request failed.ConnectException- If the connection to the platform fails.
-
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
Description copied from interface:AdminItfInvokes 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.- 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
- Throws:
ConnectExceptionAdminException
-
addAMQPBridgeConnection
public String addAMQPBridgeConnection(int serverId, String urls) throws ConnectException, AdminException
Description copied from interface:AdminItfAdds 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
Description copied from interface:AdminItfRemoves 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
Description copied from interface:AdminItfAdds 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
Description copied from interface:AdminItfRemoves the live connection to the specified AMQP 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
-
deleteJMSBridgeConnection
public String deleteJMSBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
Description copied from interface:AdminItfRemoves 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) throws ConnectException, AdminException
Deprecated.Description copied from interface:AdminItfRemoves 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
-
deleteJMSPBridgeConnection
public String deleteJMSPBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
Deprecated.Description copied from interface:AdminItfRemoves 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
-
-