|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.client.jms.admin.JoramAdmin
public class JoramAdmin
JoramAdmin is the implementation of the interface JoramAdminMBean. It must only be used to allow administration through JMX.
AdminModule
,
AdminWrapper
Field Summary | |
---|---|
protected java.lang.String |
JMXBaseName
|
static org.objectweb.util.monolog.api.Logger |
logger
|
AdminWrapper |
wrapper
|
Constructor Summary | |
---|---|
JoramAdmin(javax.jms.Connection cnx)
Creates a MBean to administer Joram using the default basename for JMX registering ( JoramAdmin(Connection, String) ). |
|
JoramAdmin(javax.jms.Connection cnx,
java.lang.String base)
Creates a MBean to administer Joram using the given basename for JMX registering. |
Method Summary | |
---|---|
void |
addDomain(java.lang.String domain,
int sid,
int port)
Adds a domain to the platform. |
void |
addDomain(java.lang.String domain,
java.lang.String network,
int sid,
int port)
Adds a domain to the platform using a specific network component. |
void |
addServer(int sid,
java.lang.String host,
java.lang.String domain,
int port,
java.lang.String server)
Adds a server to the platform. |
void |
createQueue(int serverId,
java.lang.String name)
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance. |
void |
createQueue(java.lang.String name)
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the corresponding Queue instance. |
void |
createTopic(int serverId,
java.lang.String name)
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance. |
void |
createTopic(java.lang.String name)
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the corresponding Topic instance. |
void |
createUser(java.lang.String name,
java.lang.String password)
Creates or retrieves a user on the underlying JORAM server. |
void |
createUser(java.lang.String name,
java.lang.String password,
int serverId)
Creates or retrieves a user on the given JORAM server. |
void |
createUser(java.lang.String name,
java.lang.String password,
int serverId,
java.lang.String identityClass)
Creates or retrieves a user on the underlying JORAM server. |
void |
createUser(java.lang.String name,
java.lang.String password,
java.lang.String identityClass)
Creates or retrieves a user on the underlying JORAM server. |
static JoramAdmin |
doCreate(AbstractConnectionFactory cf,
java.lang.String name,
java.lang.String password,
java.lang.String identityClass)
Opens a connection dedicated to administering with the Joram server which parameters are wrapped by a given ConnectionFactory . |
void |
executeXMLAdmin(java.lang.String path)
This method execute the XML script file that the pathname is given in parameter. |
void |
executeXMLAdmin(java.lang.String cfgDir,
java.lang.String cfgFileName)
This method execute the XML script file that the location is given in parameter. |
void |
exit()
Closes the administration connection and unregister the MBean. |
void |
exportRepositoryToFile(java.lang.String exportDir,
java.lang.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) Be careful, currently this method use the static administration connection through the AdminModule Class. |
java.lang.String |
getConfiguration()
Returns the current servers configuration (equivalent to the a3servers.xml file). |
java.lang.String |
getDefaultDMQId()
Returns the unique identifier of the default dead message queue for the local server, null if not set. |
java.lang.String |
getDefaultDMQId(int serverId)
Returns the unique identifier of the default dead message queue for the local server, null if not set. |
int |
getDefaultThreshold()
Returns the default threshold value for the local server, -1 if not set. |
int |
getDefaultThreshold(int serverId)
Returns the default threshold value for a given server, -1 if not set. |
void |
getDestinations()
This method creates and registers MBeans for all the destinations on the local server. |
void |
getDestinations(int serverId)
This method creates and registers MBeans for all the destinations of the selected server. |
java.lang.String[] |
getDomainNames(int serverId)
Returns the list of the domain names that contains the specified server. |
int[] |
getServersIds()
Returns the list of the platform's servers' identifiers. |
int[] |
getServersIds(java.lang.String domain)
Returns the list of the servers' identifiers that belong to the specified domain |
long |
getTimeOutToAbortRequest()
Gets the maximum time a command has to complete before it is canceled. |
void |
getUsers()
This method creates and registers MBeans for all the users on the local server. |
void |
getUsers(int serverId)
This method creates and registers MBeans for all the users of the selected server. |
void |
registerMBean(java.lang.String base)
|
void |
removeDomain(java.lang.String domain)
Removes a domain from the platform. |
void |
removeServer(int sid)
Removes a server from the platform. |
void |
setDefaultDMQId(int serverId,
java.lang.String dmqId)
Sets a given dead message queue as the default DMQ for a given server ( null for unsetting previous DMQ). |
void |
setDefaultDMQId(java.lang.String dmqId)
Sets a given dead message queue as the default DMQ for the local server ( null for unsetting previous DMQ). |
void |
setDefaultThreshold(int threshold)
Sets a given value as the default threshold for the local server (-1 for unsetting previous value). |
void |
setDefaultThreshold(int serverId,
int threshold)
Sets a given value as the default threshold for a given server (-1 for unsetting previous value). |
void |
setTimeOutToAbortRequest(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. |
void |
stopServer()
Stops the platform local server. |
void |
stopServer(int serverId)
Stops a given server of the platform. |
void |
unregisterMBean()
|
private void |
wrapDestination(Destination destination)
|
private void |
wrapDestinations(Destination[] destinations)
|
private void |
wrapUser(User user)
|
private void |
wrapUsers(User[] users)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
public AdminWrapper wrapper
protected transient java.lang.String JMXBaseName
Constructor Detail |
---|
public JoramAdmin(javax.jms.Connection cnx) throws java.net.ConnectException, AdminException, javax.jms.JMSException
JoramAdmin(Connection, String)
).
Be careful, if the connection is not started this method will failed with
a ConnectException.
cnx
- A valid connection to the Joram server.
javax.jms.JMSException
- A problem occurs during initialization.
java.net.ConnectException
AdminException
AdminWrapper.AdminWrapper(Connection)
public JoramAdmin(javax.jms.Connection cnx, java.lang.String base) throws java.net.ConnectException, AdminException, javax.jms.JMSException
cnx
- A valid connection to the Joram server.base
- the basename for registering the MBean.
javax.jms.JMSException
- A problem occurs during initialization.
java.net.ConnectException
AdminException
AdminWrapper.AdminWrapper(Connection)
Method Detail |
---|
public void exit()
exit
in interface JoramAdminMBean
public void setTimeOutToAbortRequest(long timeOut) throws java.net.ConnectException
Be careful, the value can be changed prior to the connection only using
the AdminRequestor.REQUEST_TIMEOUT_PROP
property.
setTimeOutToAbortRequest
in interface JoramAdminMBean
timeOut
- the maximum time before a command is canceled.
java.net.ConnectException
- if the connection is not established.public long getTimeOutToAbortRequest() throws java.net.ConnectException
getTimeOutToAbortRequest
in interface JoramAdminMBean
java.net.ConnectException
- if the connection is not established.public void stopServer() throws java.net.ConnectException, AdminException
stopServer
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.stopServer(int)
public void stopServer(int serverId) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
stopServer
in interface JoramAdminMBean
serverId
- Identifier of the server to stop.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void addServer(int sid, java.lang.String host, java.lang.String domain, int port, java.lang.String server) throws java.net.ConnectException, AdminException
The server is configured without any service.
addServer
in interface JoramAdminMBean
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
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void removeServer(int sid) throws java.net.ConnectException, AdminException
removeServer
in interface JoramAdminMBean
sid
- Id of the removed server
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void addDomain(java.lang.String domain, int sid, int port) throws java.net.ConnectException, AdminException
The domain will use the default network component "Simplenetwork".
addDomain
in interface JoramAdminMBean
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.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void addDomain(java.lang.String domain, java.lang.String network, int sid, int port) throws java.net.ConnectException, AdminException
addDomain
in interface JoramAdminMBean
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.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void removeDomain(java.lang.String domain) throws java.net.ConnectException, AdminException
removeDomain
in interface JoramAdminMBean
domain
- Name of the domain to remove
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public java.lang.String getConfiguration() throws java.net.ConnectException, AdminException
getConfiguration
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public int[] getServersIds() throws java.net.ConnectException, AdminException
getServersIds
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.getServersIds(String)
public int[] getServersIds(java.lang.String domain) throws java.net.ConnectException, AdminException
getServersIds
in interface JoramAdminMBean
domain
- Name of the domain.
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.public java.lang.String[] getDomainNames(int serverId) throws java.net.ConnectException, AdminException
getDomainNames
in interface JoramAdminMBean
serverId
- Unique identifier of the server.
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.public java.lang.String getDefaultDMQId() throws java.net.ConnectException, AdminException
getDefaultDMQId
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.getDefaultDMQId(int)
public java.lang.String getDefaultDMQId(int serverId) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
getDefaultDMQId
in interface JoramAdminMBean
serverId
- Unique identifier of the server.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void setDefaultDMQId(java.lang.String dmqId) throws java.net.ConnectException, AdminException
null
for unsetting previous DMQ).
setDefaultDMQId
in interface JoramAdminMBean
dmqId
- The dmqId (AgentId) to be set as the default one.
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.setDefaultDMQId(int, String)
public void setDefaultDMQId(int serverId, java.lang.String dmqId) throws java.net.ConnectException, AdminException
null
for unsetting previous DMQ).
The request fails if the target server does not belong to the platform.
setDefaultDMQId
in interface JoramAdminMBean
serverId
- The identifier of the server.dmqId
- The dmqId (AgentId) to be set as the default one.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void setDefaultThreshold(int threshold) throws java.net.ConnectException, AdminException
setDefaultThreshold
in interface JoramAdminMBean
threshold
- The threshold value to be set.
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.setDefaultThreshold(int, int)
public void setDefaultThreshold(int serverId, int threshold) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
setDefaultThreshold
in interface JoramAdminMBean
serverId
- The identifier of the server.threshold
- The threshold value to be set.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public int getDefaultThreshold() throws java.net.ConnectException, AdminException
getDefaultThreshold
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.getDefaultThreshold(int)
public int getDefaultThreshold(int serverId) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
getDefaultThreshold
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.public void getDestinations() throws java.net.ConnectException, AdminException
getDestinations
in interface JoramAdminMBean
java.net.ConnectException
- If the connection is closed or broken.
AdminException
- Never thrown.getDestinations(int)
public void getDestinations(int serverId) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
getDestinations
in interface JoramAdminMBean
java.net.ConnectException
- If the connection is closed or broken.
AdminException
- Never thrown.getDestinations()
private final void wrapDestinations(Destination[] destinations)
public void createQueue(java.lang.String name) throws AdminException, java.net.ConnectException
Queue
instance.
createQueue
in interface JoramAdminMBean
name
- The name of the queue.
AdminException
- If the creation fails.
java.net.ConnectException
- if the connection is closed or brokencreateQueue(int, String)
public void createQueue(int serverId, java.lang.String name) throws AdminException, java.net.ConnectException
Queue
instance.
createQueue
in interface JoramAdminMBean
serverId
- The identifier of the server where deploying the queue.name
- The name of the queue.
AdminException
- If the creation fails.
java.net.ConnectException
- if the connection is closed or brokenpublic void createTopic(java.lang.String name) throws AdminException, java.net.ConnectException
Topic
instance.
createTopic
in interface JoramAdminMBean
name
- The name of the topic.
AdminException
- If the creation fails.
java.net.ConnectException
- if the connection is closed or brokencreateTopic(int, String)
public void createTopic(int serverId, java.lang.String name) throws AdminException, java.net.ConnectException
Topic
instance.
createTopic
in interface JoramAdminMBean
serverId
- The identifier of the server where deploying the topic.name
- The name of the topic.
AdminException
- If the creation fails.
java.net.ConnectException
- if the connection is closed or brokenprivate final void wrapDestination(Destination destination)
public void getUsers() throws java.net.ConnectException, AdminException
getUsers
in interface JoramAdminMBean
java.net.ConnectException
- If the connection fails.
AdminException
- Never thrown.getUsers(int)
public void getUsers(int serverId) throws java.net.ConnectException, AdminException
The request fails if the target server does not belong to the platform.
getUsers
in interface JoramAdminMBean
serverId
- Unique identifier of the given server.
java.net.ConnectException
- If the connection fails.
AdminException
- If the request fails.private final void wrapUsers(User[] users)
public void createUser(java.lang.String name, java.lang.String password) throws AdminException, java.net.ConnectException
createUser
in interface JoramAdminMBean
name
- The login name of the user.password
- The password of the user.
AdminException
- If the creation fails.
java.net.ConnectException
- If the connection fails.createUser(String, String, int, String)
public void createUser(java.lang.String name, java.lang.String password, java.lang.String identityClass) throws AdminException, java.net.ConnectException
createUser
in interface JoramAdminMBean
name
- The login name of the user.password
- The password of the user.identityClass
- The identity class used for authentication.
AdminException
- If the creation fails.
java.net.ConnectException
- If the connection fails.createUser(String, String, int, String)
public void createUser(java.lang.String name, java.lang.String password, int serverId) throws AdminException, java.net.ConnectException
createUser
in interface JoramAdminMBean
name
- The login name of the user.password
- The password of the user.serverId
- The unique identifier of the Joram server.
AdminException
- If the creation fails.
java.net.ConnectException
- If the connection fails.createUser(String, String, int, String)
public void createUser(java.lang.String name, java.lang.String password, int serverId, java.lang.String identityClass) throws java.net.ConnectException, AdminException
createUser
in interface JoramAdminMBean
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.
AdminException
- If the creation fails.
java.net.ConnectException
- If the connection fails.private final void wrapUser(User user)
public void registerMBean(java.lang.String base)
public void unregisterMBean()
public static JoramAdmin doCreate(AbstractConnectionFactory cf, java.lang.String name, java.lang.String password, java.lang.String identityClass) throws java.net.ConnectException, AdminException
ConnectionFactory
.
cf
- The Joram's ConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.
java.net.ConnectException
- If connecting fails.
AdminException
- If the administrator identification is incorrect.public void executeXMLAdmin(java.lang.String cfgDir, java.lang.String cfgFileName) throws java.lang.Exception
Be careful, currently this method use the static administration connection through the AdminModule Class.
executeXMLAdmin
in interface JoramAdminMBean
cfgDir
- The directory containing the file.cfgFileName
- The script filename.
java.lang.Exception
public void executeXMLAdmin(java.lang.String path) throws java.lang.Exception
Be careful, currently this method use the static administration connection through the AdminModule Class.
executeXMLAdmin
in interface JoramAdminMBean
path
- The script pathname.
java.lang.Exception
public void exportRepositoryToFile(java.lang.String exportDir, java.lang.String exportFilename) throws AdminException
Be careful, currently this method use the static administration connection through the AdminModule Class.
exportRepositoryToFile
in interface JoramAdminMBean
exportDir
- target directory where the export file will be putexportFilename
- filename of the export file
AdminException
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |