public final class AdminModule extends Object
AdminModule
class allows to set an administrator
connection to a given JORAM server, and provides administration and
monitoring methods at a server/platform level.
The AdminModule
class uses a unique static connection to
the Joram server, the connection is opened through connect method and
closed by calling disconnect.
AdminWrapper
Modifier and Type | Field and Description |
---|---|
static String |
ADM_NAME_PROPERTY |
private static Connection |
cnx
The connection used to link the administrator and the platform.
|
static String |
DEFAULT_ADM_NAME |
protected static String |
localHost
The host name or IP address of the server the module is connected to.
|
protected static int |
localPort
The port number of the client connection.
|
private static Object |
lock
Lock object used to avoid multiple connections in case of concurrent connect.
|
static org.objectweb.util.monolog.api.Logger |
logger |
(package private) static AdminWrapper |
wrapper
The administration wrapper needed to interact with the Joram server.
|
Constructor and Description |
---|
AdminModule() |
Modifier and Type | Method and Description |
---|---|
static void |
abortRequest() |
static String |
addAMQPBridgeConnection(int serverId,
String urls)
Adds an AMQP server and starts a live connection with it, accessible via
the url provided.
|
static void |
addDomain(String domain,
int sid,
int port)
Adds a domain to the platform.
|
static void |
addDomain(String domain,
String network,
int sid,
int port)
Adds a domain to the platform using a specific network component.
|
static String |
addJMSBridgeConnection(int serverId,
String urls)
Adds a JMS server and starts a live connection with it, accessible via
the url provided.
|
static void |
addServer(int sid,
String host,
String domain,
int port,
String server)
Adds a server to the platform.
|
static void |
addServer(int sid,
String host,
String domain,
int port,
String server,
String[] services,
String[] args)
Adds a server to the platform.
|
static void |
collocatedConnect()
Opens a connection with the collocated Joram server.
|
static void |
collocatedConnect(String name,
String password)
Opens a connection with the collocated JORAM server.
|
static void |
collocatedConnect(String name,
String password,
String identityClass)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect()
Opens a TCP connection with the Joram server running on the default
"localhost" host and listening to the default 16010 port.
|
static void |
connect(ConnectionFactory cf)
Opens a connection dedicated to administering with the Joram server
which parameters are wrapped by a given
ConnectionFactory . |
static void |
connect(ConnectionFactory cf,
String name,
String password)
Opens a connection dedicated to administering with the Joram server
which parameters are wrapped by a given
ConnectionFactory . |
static void |
connect(ConnectionFactory cf,
String name,
String password,
String identityClass)
Opens a connection dedicated to administering with the Joram server
which parameters are wrapped by a given
ConnectionFactory . |
static void |
connect(String host,
int port,
String name,
String password)
Opens a TCP connection with the Joram server running on a given host and
listening to a given port.
|
static void |
connect(String host,
int port,
String name,
String password,
int cnxTimer)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect(String host,
int port,
String name,
String password,
int cnxTimer,
String reliableClass)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect(String host,
int port,
String name,
String password,
int cnxTimer,
String reliableClass,
String identityClass)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect(String name,
String password)
Opens a TCP connection with the Joram server running on the default
"localhost" host and listening to the default 16010 port.
|
static void |
connect(String name,
String password,
int cnxTimer)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect(String name,
String password,
int cnxTimer,
String reliableClass)
Deprecated.
Next to Joram 5.2 use connect methods with ConnectionFactory.
|
static void |
connect(TopicConnectionFactory cf,
String name,
String password)
Deprecated.
No longer use TopicConnectionFactory next to Joram 5.2.
|
static void |
connect(TopicConnectionFactory cf,
String name,
String password,
String identityClass)
Deprecated.
No longer use TopicConnectionFactory next to Joram 5.2.
|
static Destination |
createQueue(int serverId,
String name,
String className,
Properties prop)
Creates or retrieves a queue destination on a given JORAM server.
|
static Destination |
createTopic(int serverId,
String name,
String className,
Properties prop)
Creates or retrieves a topic destination on a given JORAM server.
|
static User |
createUser(String name,
String password,
int serverId,
String identityClassName)
Admin method creating a user for a given server and instantiating the
corresponding
User object. |
static String |
deleteAMQPBridgeConnection(int serverId,
String names)
Removes the live connection to the specified AMQP server.
|
static String |
deleteJMSBridgeConnection(int serverId,
String names)
Removes the live connection to the specified AMQP server.
|
static String |
deleteJMSBridgeConnection(int serverId,
String names,
boolean async)
Removes the live connection to the specified AMQP server.
|
static String |
deleteJMSPBridgeConnection(int serverId,
String names)
Deprecated.
|
static String |
deleteJMSPBridgeConnection(int serverId,
String names,
boolean async)
Deprecated.
|
static void |
disconnect()
Closes the administration connection.
|
static void |
doCollocatedConnect(String name,
String password,
String identityClass)
Opens a connection with the collocated JORAM server.
|
private static void |
doConnect(AbstractConnectionFactory cf,
String name,
String password,
String identityClass)
Opens a connection dedicated to administering with the Joram server
which parameters are wrapped by a given
ConnectionFactory . |
private static void |
doConnect(String host,
int port,
String name,
String password,
int cnxTimer,
String reliableClass,
String identityClass)
Opens a TCP connection with the Joram server running on a given host and
listening to a given port.
|
static AdminReply |
doRequest(AdminRequest request)
Deprecated.
|
static void |
executeAdmin(Reader reader) |
static void |
executeXMLAdmin(String path)
This method execute the XML script file that the pathname is given
in parameter.
|
static void |
executeXMLAdmin(String cfgDir,
String cfgFileName)
This method execute the XML script file that the location is given
in parameter.
|
static void |
exportRepositoryToFile(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)
|
static String |
getConfiguration()
Returns the current servers configuration (a3servers.xml).
|
static Queue |
getDefaultDMQ()
Returns the default dead message queue for the local server, null if not
set.
|
static Queue |
getDefaultDMQ(int serverId)
Returns the default dead message queue for a given server, null if not set.
|
static String |
getDefaultDMQId()
Returns the default dead message queue for the local server, null if not
set.
|
static String |
getDefaultDMQId(int serverId)
Returns the default dead message queue for a given server, null if not
set.
|
static int |
getDefaultThreshold()
Returns the default threshold value for the local server, -1 if not set.
|
static int |
getDefaultThreshold(int serverId)
Returns the default threshold value for a given server, -1 if not set.
|
static Destination[] |
getDestinations()
Returns the list of all destinations that exist on the local server,
or null if none exist.
|
static Destination[] |
getDestinations(int serverId)
Returns the list of all destinations that exist on a given server,
or null if none exist.
|
static List |
getDestinationsList()
Deprecated.
No longer supported next to Joram 5.2
|
static List |
getDestinationsList(int serverId)
Deprecated.
No longer supported next to Joram 5.2
|
static String[] |
getDomainNames(int serverId)
Returns the list of the domain names that contains the specified server.
|
static Hashtable |
getJMXAttribute(int serverId,
String attname)
Returns JMX attribute value for the specified server.
|
static Hashtable |
getJMXAttribute(String attname)
Returns JMX attribute value for the local server.
|
static String |
getLocalHost()
Returns the host name of the server the module is connected to.
|
static int |
getLocalPort()
Returns the port number of the server the module is connected to.
|
static Server |
getLocalServer() |
static int |
getLocalServerId()
Returns the identifier of the server the module is connected to.
|
static Server[] |
getServers() |
static Server[] |
getServers(String domain)
Returns the list of the servers' that belong to the specified domain
|
static List |
getServersIds()
Deprecated.
No longer supported next to Joram 5.2
|
static List |
getServersIds(String domain)
Deprecated.
No longer supported next to Joram 5.2
|
static Hashtable |
getStatistics()
Returns statistics for the local server.
|
static Hashtable |
getStatistics(int serverId)
Returns statistics for the the specified server.
|
static long |
getTimeOutToAbortRequest()
Gets the timeout in ms before abortion of administration requests.
|
static User[] |
getUsers()
Returns the list of all users that exist on the local server, or null if none exist.
|
static User[] |
getUsers(int serverId)
Returns the list of all users that exist on a given server, or null if none exist.
|
static List |
getUsersList()
Deprecated.
No longer supported next to Joram 5.2
|
static List |
getUsersList(int serverId)
Deprecated.
No longer supported next to Joram 5.2
|
static AdminWrapper |
getWrapper()
Returns the administration wrapper.
|
static String |
invokeStaticServerMethod(int serverId,
String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args)
Invokes the specified static method with the specified parameters on the
chosen server.
|
static String |
invokeStaticServerMethod(int serverId,
String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args,
boolean async)
Invokes the specified static method with the specified parameters on the
chosen server.
|
static String |
invokeStaticServerMethod(String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args)
Invokes the specified static method with the specified parameters on the
local server.
|
static String |
invokeStaticServerMethod(String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args,
boolean async)
Invokes the specified static method with the specified parameters on the
local server.
|
static void |
main(String[] args)
This method execute the XML script file that the path is given in
parameter.
|
static AdminReply |
processAdmin(String targetId,
int command,
Properties prop)
The method send the admin JMS message on JORAM server (AdminTopic).
|
static void |
removeDomain(String domain)
Removes a domain from the platform.
|
static void |
removeServer(int sid)
Removes a server from the platform.
|
static void |
setDefaultDMQ(int serverId,
Queue dmq)
Sets a given dead message queue as the default DMQ for a given server
(
null for unsetting previous DMQ). |
static void |
setDefaultDMQ(Queue dmq)
Sets a given dead message queue as the default DMQ for the local server
(
null for unsetting previous DMQ). |
static void |
setDefaultDMQId(int serverId,
String dmqId)
Sets a given dead message queue as the default DMQ for a given server
(
null for unsetting previous DMQ). |
static void |
setDefaultDMQId(String dmqId)
Sets a given dead message queue as the default DMQ for the local server
(
null for unsetting previous DMQ). |
static void |
setDefaultThreshold(int threshold)
Sets a given value as the default threshold for the local server (-1 for
unsetting previous value).
|
static void |
setDefaultThreshold(int serverId,
int threshold)
Sets a given value as the default threshold for a given server (-1 for
unsetting previous value).
|
static void |
setTimeOutToAbortRequest(long timeOut)
Sets the timeout in ms before abortion of administration requests.
|
static void |
stopServer()
Stops the platform local server.
|
static void |
stopServer(int serverId)
Stops a given server of the platform.
|
public static final String ADM_NAME_PROPERTY
public static final String DEFAULT_ADM_NAME
protected static String localHost
protected static int localPort
private static Object lock
private static Connection cnx
static AdminWrapper wrapper
public static org.objectweb.util.monolog.api.Logger logger
public static AdminWrapper getWrapper() throws ConnectException
ConnectException
- if no wrapper is defined.public static void main(String[] args)
public static void connect(ConnectionFactory cf) throws ConnectException, AdminException
ConnectionFactory
.
Default administrator login name and password are used for connection
as defined in AbstractConnectionFactory.getDefaultRootLogin()
and AbstractConnectionFactory.getDefaultRootPassword()
.cf
- The Joram's ConnectionFactory to use for connecting.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.ClassCastException
- If the ConnectionFactory is not a Joram ConnectionFactory.public static void connect(ConnectionFactory cf, String name, String password) throws ConnectException, AdminException
ConnectionFactory
.cf
- The Joram's ConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.ClassCastException
- If the ConnectionFactory is not a Joram ConnectionFactory.public static void connect(ConnectionFactory cf, String name, String password, String identityClass) throws ConnectException, AdminException
ConnectionFactory
.cf
- The Joram's ConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.ClassCastException
- If the ConnectionFactory is not a Joram ConnectionFactory.public static void connect(TopicConnectionFactory cf, String name, String password) throws ConnectException, AdminException
TopicConnectionFactory
.cf
- The TopicConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.ClassCastException
- If the ConnectionFactory is not a Joram ConnectionFactory.public static void connect(TopicConnectionFactory cf, String name, String password, String identityClass) throws ConnectException, AdminException
TopicConnectionFactory
.cf
- The TopicConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.ClassCastException
- If the ConnectionFactory is not a Joram ConnectionFactory.public static void connect() throws UnknownHostException, ConnectException, AdminException
AbstractConnectionFactory.getDefaultRootLogin()
and AbstractConnectionFactory.getDefaultRootPassword()
.UnknownHostException
- Never thrown.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void connect(String name, String password) throws UnknownHostException, ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.UnknownHostException
- Never thrown.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void connect(String name, String password, int cnxTimer) throws UnknownHostException, ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server is attempted.UnknownHostException
- Never thrown.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void connect(String host, int port, String name, String password) throws UnknownHostException, ConnectException, AdminException
host
- The name or IP address of the host the server is running on.port
- The number of the port the server is listening to.name
- Administrator's name.password
- Administrator's password.UnknownHostException
- If the host is invalid.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void connect(String host, int port, String name, String password, int cnxTimer) throws UnknownHostException, ConnectException, AdminException
host
- The name or IP address of the host the server is running on.port
- The number of the port the server is listening to.name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server
is attempted.UnknownHostException
- If the host is invalid.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.public static void connect(String name, String password, int cnxTimer, String reliableClass) throws UnknownHostException, ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server
is attempted.reliableClass
- Reliable class name.UnknownHostException
- Never thrown.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.public static void connect(String host, int port, String name, String password, int cnxTimer, String reliableClass) throws UnknownHostException, ConnectException, AdminException
host
- The name or IP address of the host the server is running on.port
- The number of the port the server is listening to.name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server
is attempted.reliableClass
- Reliable class name.UnknownHostException
- If the host is invalid.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.public static void connect(String host, int port, String name, String password, int cnxTimer, String reliableClass, String identityClass) throws UnknownHostException, ConnectException, AdminException
host
- The name or IP address of the host the server is running on.port
- The number of the port the server is listening to.name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server is attempted.reliableClass
- Reliable class name.identityClass
- identity class name.UnknownHostException
- If the host is invalid.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.private static void doConnect(String host, int port, String name, String password, int cnxTimer, String reliableClass, String identityClass) throws UnknownHostException, ConnectException, AdminException
host
- The name or IP address of the host the server is running on.port
- The number of the port the server is listening to.name
- Administrator's name.password
- Administrator's password.cnxTimer
- Timer in seconds during which connecting to the server is attempted.reliableClass
- Reliable class name.identityClass
- identity class name.UnknownHostException
- If the host is invalid.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.public static void collocatedConnect() throws ConnectException, AdminException
Default administrator login name and password are used for connection
as defined in AbstractConnectionFactory.getDefaultRootLogin()
and AbstractConnectionFactory.getDefaultRootPassword()
.
UnknownHostException
- Never thrown.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void collocatedConnect(String name, String password) throws ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.ConnectException
- If connecting fails.AdminException
- If the administrator identification is
incorrect.public static void collocatedConnect(String name, String password, String identityClass) throws ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static void doCollocatedConnect(String name, String password, String identityClass) throws ConnectException, AdminException
name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.private static void doConnect(AbstractConnectionFactory cf, String name, String password, String identityClass) throws ConnectException, AdminException
ConnectionFactory
.cf
- The Joram's ConnectionFactory to use for connecting.name
- Administrator's name.password
- Administrator's password.identityClass
- identity class name.ConnectException
- If connecting fails.AdminException
- If the administrator identification is incorrect.public static AdminReply doRequest(AdminRequest request) throws AdminException, ConnectException
AdminRequest
instance to
the platform and getting an AdminReply
instance.request
- the administration request to sendConnectException
- If the connection to the platform fails.AdminException
- If the platform's reply is invalid, or if
the request failed.public static void disconnect()
public static void stopServer(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- Identifier of the server to stop.ConnectException
- If the connection fails.AdminException
- If the request fails.public static void stopServer() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static void addServer(int sid, String host, String domain, int port, String server) throws ConnectException, AdminException
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 serverConnectException
- If the connection fails.AdminException
- If the request fails.public static void addServer(int sid, String host, String domain, int port, String server, String[] services, String[] args) throws ConnectException, AdminException
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' argumentsConnectException
- If the connection fails.AdminException
- If the request fails.public static void removeServer(int sid) throws ConnectException, AdminException
sid
- Id of the removed serverConnectException
- If the connection fails.AdminException
- If the request fails.public static void addDomain(String domain, int sid, int port) throws ConnectException, AdminException
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.ConnectException
- If the connection fails.AdminException
- If the request fails.public static void addDomain(String domain, String network, int sid, int port) throws ConnectException, AdminException
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.ConnectException
- If the connection fails.AdminException
- If the request fails.public static void removeDomain(String domain) throws ConnectException, AdminException
domain
- Name of the added domainConnectException
- If the connection fails.AdminException
- If the request fails.public static String getConfiguration() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- If the request fails.public static Hashtable getStatistics() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.getStatistics(int)
public static Hashtable getStatistics(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- Unique identifier of the server.ConnectException
- If the connection fails.AdminException
- If the request fails.public static Hashtable getJMXAttribute(String attname) throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.getStatistics(int)
public static Hashtable getJMXAttribute(int serverId, String attname) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- Unique identifier of the server.ConnectException
- If the connection fails.AdminException
- If the request fails.public static Queue getDefaultDMQ() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static Queue getDefaultDMQ(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- Unique identifier of the server.ConnectException
- If the connection fails.AdminException
- If the request fails.public static void setDefaultDMQ(Queue dmq) throws ConnectException, AdminException
null
for unsetting previous DMQ).dmq
- The dmq to be set as the default one.ConnectException
- If the connection fails.AdminException
- Never thrown.public static void setDefaultDMQ(int serverId, Queue dmq) throws ConnectException, AdminException
null
for unsetting previous DMQ).
The request fails if the target server does not belong to the platform.
serverId
- The identifier of the server.dmq
- The dmq to be set as the default one.ConnectException
- If the connection fails.AdminException
- If the request fails.public static String getDefaultDMQId() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static String getDefaultDMQId(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
ConnectException
- If the connection fails.AdminException
- If the request fails.public static void setDefaultDMQId(String dmqId) throws ConnectException, AdminException
null
for unsetting previous DMQ).dmqId
- The dmqId (AgentId) to be set as the default one.ConnectException
- If the connection fails.AdminException
- Never thrown.public static void setDefaultDMQId(int serverId, String dmqId) throws ConnectException, AdminException
null
for unsetting previous DMQ).
The request fails if the target server does not belong to the platform.
serverId
- The identifier of the server.dmqId
- The dmqId (AgentId) to be set as the default one.ConnectException
- If the connection fails.AdminException
- If the request fails.public static int getDefaultThreshold() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static int getDefaultThreshold(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
ConnectException
- If the connection fails.AdminException
- If the request fails.public static void setDefaultThreshold(int threshold) throws ConnectException, AdminException
threshold
- The threshold value to be set.ConnectException
- If the connection fails.AdminException
- Never thrown.public static void setDefaultThreshold(int serverId, int threshold) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- The identifier of the server.threshold
- The threshold value to be set.ConnectException
- If the connection fails.AdminException
- If the request fails.public static List getServersIds() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static List getServersIds(String domain) throws ConnectException, AdminException
domain
- Name of the domain.ConnectException
- If the connection fails.AdminException
- Never thrown.public static Server[] getServers() throws ConnectException, AdminException
ConnectException
AdminException
public static Server[] getServers(String domain) throws ConnectException, AdminException
domain
- Name of the domain.ConnectException
- If the connection fails.AdminException
- Never thrown.public static String[] getDomainNames(int serverId) throws ConnectException, AdminException
serverId
- Unique identifier of the server.ConnectException
- If the connection fails.AdminException
- Never thrown.public static List getDestinationsList() throws ConnectException, AdminException
ConnectException
- If the admin connection is closed or broken.AdminException
- Never thrown.public static List getDestinationsList(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Destination[] getDestinations() throws ConnectException, AdminException
ConnectException
- If the admin connection is closed or broken.AdminException
- Never thrown.public static Destination[] getDestinations(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- The unique identifier of the selected server.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.public static Destination createQueue(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
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.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.AdminWrapper.createQueue(int, String, String, Properties)
public static Destination createTopic(int serverId, String name, String className, Properties prop) throws ConnectException, AdminException
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.ConnectException
- If the admin connection is closed or broken.AdminException
- If the request fails.AdminWrapper.createTopic(int, String, String, Properties)
public static List getUsersList() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static List getUsersList(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
ConnectException
- If the connection fails.AdminException
- If the request fails.public static User[] getUsers() throws ConnectException, AdminException
ConnectException
- If the connection fails.AdminException
- Never thrown.public static User[] getUsers(int serverId) throws ConnectException, AdminException
The request fails if the target server does not belong to the platform.
serverId
- Unique identifier of the given server.ConnectException
- If the connection fails.AdminException
- If the request fails.public static Server getLocalServer() throws ConnectException, AdminException
ConnectException
AdminException
public static User createUser(String name, String password, int serverId, String identityClassName) throws ConnectException, AdminException
User
object.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.ConnectException
- If the connection fails.AdminException
- If the request fails.AdminWrapper.createUser(String, String, int, String)
public static int getLocalServerId() throws ConnectException, AdminException
ConnectException
- If the admin connection is not established.AdminException
public static String getLocalHost() throws ConnectException
ConnectException
- If the admin connection is not established.public static int getLocalPort() throws ConnectException
ConnectException
- If the admin connection is not established.public static void abortRequest() throws ConnectException
ConnectException
public static void executeXMLAdmin(String cfgDir, String cfgFileName) throws Exception
cfgDir
- The directory containing the file.cfgFileName
- The script filename.Exception
public static void executeXMLAdmin(String path) throws Exception
path
- The script pathname.Exception
public static void exportRepositoryToFile(String exportDir, String exportFilename) throws AdminException
exportDir
- target directory where the export file will be putexportFilename
- filename of the export fileAdminException
- if an error occurspublic static void setTimeOutToAbortRequest(long timeOut) throws ConnectException
Be careful, the value can be changed prior to the connection only using
the AdminRequestor.REQUEST_TIMEOUT_PROP
property.
timeOut
- The timeoutConnectException
- if the connection is not established.public static long getTimeOutToAbortRequest() throws ConnectException
ConnectException
- if the connection is not established.public static AdminReply processAdmin(String targetId, int command, Properties prop) throws ConnectException, AdminException
targetId
- agent Id target.command
- the command to execute.prop
- the properties.AdminException
ConnectException
- If the connection fails.public static String invokeStaticServerMethod(String className, String methodName, Class<?>[] parameterTypes, Object[] args) throws ConnectException, AdminException
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 callConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String invokeStaticServerMethod(String className, String methodName, Class<?>[] parameterTypes, Object[] args, boolean async) throws ConnectException, AdminException
className
- the name of the class holding the static methodmethodName
- the name of the invoked methodparameterTypes
- the list of parametersargs
- the arguments used for the method callasync
- if true the method is invoked asynchronously by the server and the result is lost.ConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String invokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args) throws ConnectException, AdminException
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 callConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String invokeStaticServerMethod(int serverId, String className, String methodName, Class<?>[] parameterTypes, Object[] args, boolean async) throws ConnectException, AdminException
serverId
- the identifier of the server.className
- the name of the class holding the static methodmethodName
- the name of the invoked methodparameterTypes
- the list of parametersargs
- the arguments used for the method callasync
- if true the method is invoked asynchronously by the server and the result is lost.ConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String addAMQPBridgeConnection(int serverId, String urls) throws ConnectException, AdminException
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"ConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String deleteAMQPBridgeConnection(int serverId, String names) throws ConnectException, AdminException
serverId
- the serverIdnames
- the name identifying the server or list of name separate by spaceConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String addJMSBridgeConnection(int serverId, String urls) throws ConnectException, AdminException
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"ConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String deleteJMSBridgeConnection(int serverId, String names) throws ConnectException, AdminException
serverId
- the serverIdnames
- the name identifying the server or list of name separate by spaceConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String deleteJMSBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
serverId
- the serverIdnames
- the name identifying the server or list of name separate by spaceasync
- invoke asynchronouslyConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String deleteJMSPBridgeConnection(int serverId, String names) throws ConnectException, AdminException
serverId
- the serverIdnames
- the name identifying the server or list of name separate by spaceConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failspublic static String deleteJMSPBridgeConnection(int serverId, String names, boolean async) throws ConnectException, AdminException
serverId
- the serverIdnames
- the name identifying the server or list of name separate by spaceasync
- invoke asynchronouslyConnectException
- If the connection fails.AdminException
- If the invocation can't be done or failsCopyright © 2021 ScalAgent D.T.. All rights reserved.