Interface JoramAdminMBean
-
- All Known Implementing Classes:
JoramAdmin
public interface JoramAdminMBeanMBean interface for JoramAdmin.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.voidaddServer(int sid, String host, String domain, int port, String server)Adds a server to the platform.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.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.String[]getDomainNames(int serverId)Returns the list of the domain names that contains the specified server.voidgetLocalDestinations()This method creates and registers MBeans for all the destinations on the local server.voidgetLocalUsers()This method creates and registers MBeans for all the users on the local server.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 domainlonggetTimeOutToAbortRequest()Gets the maximum time a command has to complete before it is canceled.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.voidremoveDomain(String domain)Removes a domain from the platform.voidremoveServer(int sid)Removes a server from the platform.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.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.
-
-
-
Method Detail
-
exit
void exit()
Closes the administration connection and unregister the MBean.
-
setTimeOutToAbortRequest
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.- Parameters:
timeOut- the maximum time before a command is canceled.- Throws:
ConnectException- A problem occurs during connection.
-
getTimeOutToAbortRequest
long getTimeOutToAbortRequest() throws ConnectExceptionGets the maximum time a command has to complete before it is canceled.- Returns:
- the maximum time before a command is canceled
- Throws:
ConnectException- A problem occurs during connection.
-
stopServer
void stopServer() throws ConnectException, AdminExceptionStops the platform local server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
stopServer(int)
-
stopServer
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.
- Parameters:
serverId- Identifier of the server to stop.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addServer
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.
- 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.
-
removeServer
void removeServer(int sid) throws ConnectException, AdminExceptionRemoves a server from the platform.- Parameters:
sid- Id of the removed server- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
addDomain
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".
- 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
void addDomain(String domain, String network, int sid, int port) throws ConnectException, AdminException
Adds a domain to the platform using a specific network component.- 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
void removeDomain(String domain) throws ConnectException, AdminException
Removes a domain from the platform.- Parameters:
domain- Name of the domain to remove- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getServersIds
int[] getServersIds() throws ConnectException, AdminExceptionReturns the list of the platform's servers' identifiers.- Returns:
- An array containing the list of server's identifiers.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getServersIds(String)
-
getServersIds
int[] getServersIds(String domain) throws ConnectException, AdminException
Returns the list of the servers' identifiers that belong to the specified domain- 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.
-
getDomainNames
String[] getDomainNames(int serverId) throws ConnectException, AdminException
Returns the list of the domain names that contains the specified server.- Parameters:
serverId- Unique identifier of the server.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getDefaultDMQId
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.
- 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
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.
- 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.
-
setDefaultDMQId
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).- 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)
-
getDefaultDMQId
String getDefaultDMQId() throws ConnectException, AdminException
Returns the unique identifier of the default dead message queue for the local server, null if not set.- 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)
-
setDefaultThreshold
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.
- 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.
-
setDefaultThreshold
void setDefaultThreshold(int threshold) throws ConnectException, AdminExceptionSets a given value as the default threshold for the local server (-1 for unsetting previous value).- Parameters:
threshold- The threshold value to be set.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
setDefaultThreshold(int, int)
-
getDefaultThreshold
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.
- Returns:
- The default threshold value for the local server, -1 if not set.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getDefaultThreshold
int getDefaultThreshold() throws ConnectException, AdminExceptionReturns the default threshold value for the local server, -1 if not set.- 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)
-
getLocalDestinations
void getLocalDestinations() throws ConnectException, AdminExceptionThis method creates and registers MBeans for all the destinations on the local server.- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getAllDestinations(int)
-
getAllDestinations
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.
- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getLocalDestinations()
-
queueCreate
void queueCreate(String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Parameters:
name- The name of the queue.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
queueCreate(int, String)
-
queueCreate
void queueCreate(int serverId, String name) throws AdminException, ConnectExceptionCreates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- 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
void topicCreate(String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Parameters:
name- The name of the topic.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
topicCreate(int, String)
-
topicCreate
void topicCreate(int serverId, String name) throws AdminException, ConnectExceptionCreates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- 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
void getLocalUsers() throws ConnectException, AdminExceptionThis method creates and registers MBeans for all the users on the local server.- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getAllUsers(int)
-
getAllUsers
void getAllUsers(int serverId) throws ConnectException, AdminExceptionThis 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.
- Parameters:
serverId- Unique identifier of the given server.- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
userCreate
void userCreate(String name, String password) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- 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:
userCreate(String, String, int, String)
-
userCreate
void userCreate(String name, String password, String identityClass) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- 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:
userCreate(String, String, int, String)
-
userCreate
void userCreate(String name, String password, int serverId) throws AdminException, ConnectException
Creates or retrieves a user on the given JORAM server.- 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:
userCreate(String, String, int, String)
-
userCreate
void userCreate(String name, String password, int serverId, String identityClass) throws ConnectException, AdminException
Creates or retrieves a user on the underlying JORAM server.- 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:
AdminException- If the creation fails.ConnectException- If the connection fails.
-
exportRepositoryToFile
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)- Parameters:
exportDir- target directory where the export file will be putexportFilename- filename of the export file- Throws:
AdminException- if an error occurs
-
executeXMLAdmin
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.
- Parameters:
cfgDir- The directory containing the file.cfgFileName- The script filename.- Throws:
Exception
-
executeXMLAdmin
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.
- Parameters:
path- The script pathname.- Throws:
Exception
-
processAdmin
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).- Parameters:
targetId- agent Id target.command- the command to execute.prop- the properties.- Returns:
- the reply.
- Throws:
AdminExceptionConnectException- If the connection fails.
-
-