Class JoramAdapter
- java.lang.Object
-
- org.objectweb.joram.client.connector.JoramResourceAdapter
-
- org.objectweb.joram.client.connector.JoramAdapter
-
- All Implemented Interfaces:
Serializable,ExceptionListener,ResourceAdapter,JoramAdapterMBean
public final class JoramAdapter extends JoramResourceAdapter implements JoramAdapterMBean, ExceptionListener
AJoramAdapterinstance manages connectivities to an underlying JORAM server: outbound connectivity (JCA connection management contract) and inbound connectivity (asynchronous message delivery as specified by the JCA message inflow contract).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.objectweb.joram.client.connector.JoramResourceAdapter
JoramResourceAdapter.Status
-
-
Field Summary
Fields Modifier and Type Field Description private longadminDurationStateThe duration of admin connection before change state.private StringadminFileExportXMLPath to the XML file containing a description of the exported administered objects (destination) from the platform.private StringadminFileXMLPath to the XML file (joramAdmin.xml) containing a description of the administered objects to create and bind.private Connectioncnxprivate booleancollocatedtrueif the underlying JORAM server is collocated.private intconnectingTimerDuration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.private static booleanDEBUGprivate StringhostNameHost name or IP of the underlying JORAM server. localhost if collocated.private StringidentityClassIdentity class needed for authenticationprivate booleanisActivetrueif admin connection connection is active.private static Loggerloggerprivate StringplatformConfigDirPath to the directory containing JORAM's configuration files (a3servers.xml,a3debug.cfgand admin file), needed when StartJoramServer is set to true.private org.osgi.framework.ServiceRegistration<?>registrationprivate StringrootNamelogin name for administrator.private StringrootPasswdpassword for administratorprivate static longserialVersionUIDDefine serialVersionUID for interoperability.private ServerDescserverDescprivate shortserverIdIdentifier of the JORAM server to start.private intserverPortPort number of the underlying JORAM server. -1 if collocatedprivate booleanstartJoramServertrue start the JoramServerprivate Stringstoragethe persistence directory of the JORAM server to start, needed when StartJoramServer is set to true.private JoramAdminwrapper-
Fields inherited from class org.objectweb.joram.client.connector.JoramResourceAdapter
jmxRootName, jndiHelper, jndiName, name, status
-
-
Constructor Summary
Constructors Constructor Description JoramAdapter()Constructs aJoramAdapterinstance.JoramAdapter(MBeanServer jmxServer)Constructs aJoramAdapterinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) voidadminConnect()Initiates an admin session.(package private) voidadminDisconnect()voidcreateCF(String name)Creates a non managed connection factory and binds it to JNDI.StringcreateQueue(short serverId, String name)Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.StringcreateQueue(short serverId, String name, String className, Properties prop)First tries to retrieve a queue destination on the underlying JORAM server first using JNDI then the Joram's internal name service.StringcreateQueue(String name)Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.voidcreateQueueCF(String name)Creates a non managed PTP connection factory and binds it to JNDI.StringcreateTopic(short serverId, String name)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.StringcreateTopic(short serverId, String name, String className, Properties prop)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.StringcreateTopic(String name)Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.voidcreateTopicCF(String name)Creates a non managed PubSub connection factory and binds it to JNDI.StringcreateUser(String name, String password)Creates or retrieves a user on the underlying JORAM server.StringcreateUser(String name, String password, short serverId)Creates or retrieves a user on the given JORAM server.StringcreateUser(String name, String password, short serverId, String identityClass)Creates or retrieves a user on the underlying JORAM server.StringcreateUser(String name, String password, String identityClass)Creates or retrieves a user on the underlying JORAM server.booleanequals(Object o)Compares adapters according to their properties.voidexecuteXMLAdmin(String path)Executes the XML configuration file.voidexportRepositoryToFile(String exportDir)Export the repository content to an XML file with default filenamevoidexportRepositoryToFile(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)longgetAdminDurationBeforeChangeState()get duration of admin connection before change state.StringgetAdminDurationBeforeChangeStateDate()get duration of admin connection before change state.StringgetAdminFileExportXML()Returns the path of XML the file containing a description of the exported administered objects (destination) from the platform.StringgetAdminFileXML()Returns the path of XML the file containing a description of the administered objects to create and bind at starting.BooleangetCollocated()Returnstrueif the Joram server is collocated.BooleangetCollocatedServer()Deprecated.only needed for compatibility with JOnAS 5.2 administration GUIStringgetConfiguration()Returns the current servers configuration (a3servers.xml).IntegergetConnectingTimer()Duration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.StringgetDefaultDMQId()Returns the unique identifier of the default dead message queue for the local server, null if not set.StringgetDefaultDMQId(short serverId)Returns the unique identifier of the default dead message queue for a given server, null if not set.intgetDefaultThreshold()Returns the default threshold of the Joram server.intgetDefaultThreshold(short serverId)Returns the default threshold of the given Joram server.String[]getDestinations()Returns the list of all destinations that exist on the local server.String[]getDestinations(short serverId)Returns the list of all destinations that exist on the given server.StringgetHostName()Returns the location of the Joram server.StringgetIdentityClass()Identity class needed for authenticationStringgetMBeanName()StringgetPlatformConfigDir()Path to the directory containing JORAM's configuration files (a3servers.xml,a3debug.cfgand admin file), needed when StartJoramServer is set to true.StringgetRootName()login name for administrator.StringgetRootPasswd()ShortgetServerId()Returns the unique identifier of the Joram server.StringgetServerName()Deprecated.only needed for compatibility with JOnAS 5.2 administration GUIIntegergetServerPort()Returns the listening port of the Joram server.Short[]getServersIds()Returns the list of the platform's servers' identifiers.String[]getServersNames()Returns the list of the platform's servers' names.BooleangetStartJoramServer()true if the resource adapter start the JoramServerStringgetStorage()The persistence directory of the JORAM server to start, needed when StartJoramServer is set to true.longgetTimeOutToAbortRequest()Gets timeout in ms before abort a request.String[]getUsers()Returns the list of all users that exist on the local server.String[]getUsers(short serverId)Returns the list of all users that exist on a given server.JoramAdmingetWrapper()The admin wrapper.inthashCode()Returns a code depending on the adapter properties.booleanisActive()return the activity of the Joram administration connection.private booleanisJoramServerRun()voidreconnect()voidremoveDestination(String name)Remove a destination specified by its JNDI name on the underlying JORAM platform.private static StringremovePrefix(String name)remove prefix name scn:comp/voidresetDefaultDMQ(short serverId)Unset the default dead message queue for the given server.voidsetAdminFileExportXML(String adminFileExportXML)Sets the path of the XML file containing a description of the exported administered objects (destination) from the platform.voidsetAdminFileXML(String adminFileXML)Sets the path of the XML file containing a description of the administered objects to create and bind at starting.voidsetCollocated(Boolean collocated)voidsetConnectingTimer(Integer connectingTimer)voidsetDefaultThreshold(int threshold)Sets the default threshold of the Joram server.voidsetDefaultThreshold(short serverId, int threshold)Sets the default threshold of the given Joram server.voidsetHostName(String hostName)voidsetIdentityClass(String identityClass)voidsetPlatformConfigDir(String platformConfigDir)voidsetRootName(String rn)voidsetRootPasswd(String rp)voidsetServerId(Short serverId)voidsetServerPort(Integer serverPort)voidsetStartJoramServer(Boolean startJoramServer)voidsetStorage(String storage)voidsetTimeOutToAbortRequest(long timeOut)Sets timeout in ms before abort a request.voidstart()voidstart(BootstrapContext ctx)Initializes the adapter; starts, if needed, a collocated JORAM server, and if needed again, administers it.voidstop()Notifies the adapter to terminate the connections it manages, and if needed, to shutdown the collocated JORAM server.private voidwaitAgentServerStarted()-
Methods inherited from class org.objectweb.joram.client.connector.JoramResourceAdapter
addProducer, bind, createCF, createQueueCF, createTopicCF, endpointActivation, endpointDeactivation, getJMSProviderName, getJMSVersion, getJndiName, getName, getProviderVersion, getStatus, getStatusInfo, getXAResources, onException, removeProducer, setJmxServer, setJndiName, setName, setWorkManager, unbind
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.jms.ExceptionListener
onException
-
Methods inherited from interface org.objectweb.joram.client.connector.JoramAdapterMBean
getJMSProviderName, getJMSVersion, getJndiName, getName, getProviderVersion
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Define serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
isActive
private boolean isActive
trueif admin connection connection is active.
-
adminDurationState
private long adminDurationState
The duration of admin connection before change state.
-
wrapper
private JoramAdmin wrapper
-
serverDesc
private ServerDesc serverDesc
-
registration
private org.osgi.framework.ServiceRegistration<?> registration
-
cnx
private Connection cnx
-
collocated
private boolean collocated
trueif the underlying JORAM server is collocated.
-
startJoramServer
private boolean startJoramServer
true start the JoramServer
-
hostName
private String hostName
Host name or IP of the underlying JORAM server. localhost if collocated.
-
serverPort
private int serverPort
Port number of the underlying JORAM server. -1 if collocated
-
rootName
private String rootName
login name for administrator.
-
rootPasswd
private String rootPasswd
password for administrator
-
identityClass
private String identityClass
Identity class needed for authentication
-
serverId
private short serverId
Identifier of the JORAM server to start.
-
storage
private String storage
the persistence directory of the JORAM server to start, needed when StartJoramServer is set to true.
-
platformConfigDir
private String platformConfigDir
Path to the directory containing JORAM's configuration files (a3servers.xml,a3debug.cfgand admin file), needed when StartJoramServer is set to true.
-
adminFileXML
private String adminFileXML
Path to the XML file (joramAdmin.xml) containing a description of the administered objects to create and bind.
-
adminFileExportXML
private String adminFileExportXML
Path to the XML file containing a description of the exported administered objects (destination) from the platform.
-
connectingTimer
private int connectingTimer
Duration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.
-
-
Constructor Detail
-
JoramAdapter
public JoramAdapter()
Constructs aJoramAdapterinstance.
-
JoramAdapter
public JoramAdapter(MBeanServer jmxServer)
Constructs aJoramAdapterinstance.
-
-
Method Detail
-
setCollocated
public void setCollocated(Boolean collocated)
-
getCollocated
public Boolean getCollocated()
Description copied from interface:JoramAdapterMBeanReturnstrueif the Joram server is collocated.- Specified by:
getCollocatedin interfaceJoramAdapterMBean- Returns:
trueif the Joram server is collocated.
-
setStartJoramServer
public void setStartJoramServer(Boolean startJoramServer)
-
getStartJoramServer
public Boolean getStartJoramServer()
Description copied from interface:JoramAdapterMBeantrue if the resource adapter start the JoramServer- Specified by:
getStartJoramServerin interfaceJoramAdapterMBean
-
getHostName
public String getHostName()
Description copied from interface:JoramAdapterMBeanReturns the location of the Joram server.- Specified by:
getHostNamein interfaceJoramAdapterMBean- Returns:
- The location of the Joram server.
-
setHostName
public void setHostName(String hostName)
-
getServerPort
public Integer getServerPort()
Description copied from interface:JoramAdapterMBeanReturns the listening port of the Joram server.- Specified by:
getServerPortin interfaceJoramAdapterMBean- Returns:
- The listening port of the Joram server.
-
setServerPort
public void setServerPort(Integer serverPort)
-
getRootName
public String getRootName()
Description copied from interface:JoramAdapterMBeanlogin name for administrator.- Specified by:
getRootNamein interfaceJoramAdapterMBean
-
setRootName
public void setRootName(String rn)
-
getRootPasswd
public String getRootPasswd()
-
setRootPasswd
public void setRootPasswd(String rp)
-
getIdentityClass
public String getIdentityClass()
Description copied from interface:JoramAdapterMBeanIdentity class needed for authentication- Specified by:
getIdentityClassin interfaceJoramAdapterMBean
-
setIdentityClass
public void setIdentityClass(String identityClass)
-
getServerId
public Short getServerId()
Description copied from interface:JoramAdapterMBeanReturns the unique identifier of the Joram server.- Specified by:
getServerIdin interfaceJoramAdapterMBean- Returns:
- The unique identifier of the Joram server.
-
setServerId
public void setServerId(Short serverId)
-
getStorage
public String getStorage()
Description copied from interface:JoramAdapterMBeanThe persistence directory of the JORAM server to start, needed when StartJoramServer is set to true.- Specified by:
getStoragein interfaceJoramAdapterMBean- Returns:
- the persistence directory.
-
setStorage
public void setStorage(String storage)
-
getPlatformConfigDir
public String getPlatformConfigDir()
Description copied from interface:JoramAdapterMBeanPath to the directory containing JORAM's configuration files (a3servers.xml,a3debug.cfgand admin file), needed when StartJoramServer is set to true.- Specified by:
getPlatformConfigDirin interfaceJoramAdapterMBean
-
setPlatformConfigDir
public void setPlatformConfigDir(String platformConfigDir)
-
getAdminFileXML
public String getAdminFileXML()
Returns the path of XML the file containing a description of the administered objects to create and bind at starting.- Specified by:
getAdminFileXMLin interfaceJoramAdapterMBean
-
setAdminFileXML
public void setAdminFileXML(String adminFileXML)
Sets the path of the XML file containing a description of the administered objects to create and bind at starting.
-
getAdminFileExportXML
public String getAdminFileExportXML()
Returns the path of XML the file containing a description of the exported administered objects (destination) from the platform.- Specified by:
getAdminFileExportXMLin interfaceJoramAdapterMBean
-
setAdminFileExportXML
public void setAdminFileExportXML(String adminFileExportXML)
Sets the path of the XML file containing a description of the exported administered objects (destination) from the platform.
-
getConnectingTimer
public Integer getConnectingTimer()
Description copied from interface:JoramAdapterMBeanDuration in seconds during which connecting is attempted (connecting might take time if the server is temporarily not reachable); the 0 value is set for connecting only once and aborting if connecting failed.- Specified by:
getConnectingTimerin interfaceJoramAdapterMBean
-
setConnectingTimer
public void setConnectingTimer(Integer connectingTimer)
-
isJoramServerRun
private boolean isJoramServerRun()
-
waitAgentServerStarted
private void waitAgentServerStarted() throws ResourceAdapterInternalException- Throws:
ResourceAdapterInternalException
-
start
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException
Initializes the adapter; starts, if needed, a collocated JORAM server, and if needed again, administers it.- Specified by:
startin interfaceResourceAdapter- Overrides:
startin classJoramResourceAdapter- Throws:
ResourceAdapterInternalException- If the adapter could not be initialized.
-
start
public void start() throws ResourceAdapterInternalException- Overrides:
startin classJoramResourceAdapter- Throws:
ResourceAdapterInternalException
-
adminConnect
void adminConnect() throws AdminExceptionInitiates an admin session.- Throws:
AdminException- If the admin session could not be started.
-
getMBeanName
public String getMBeanName()
-
adminDisconnect
void adminDisconnect()
-
stop
public void stop()
Notifies the adapter to terminate the connections it manages, and if needed, to shutdown the collocated JORAM server.- Specified by:
stopin interfaceResourceAdapter- Overrides:
stopin classJoramResourceAdapter
-
reconnect
public void reconnect() throws Exception- Overrides:
reconnectin classJoramResourceAdapter- Throws:
Exception
-
hashCode
public int hashCode()
Returns a code depending on the adapter properties.
-
equals
public boolean equals(Object o)
Compares adapters according to their properties.
-
isActive
public boolean isActive()
return the activity of the Joram administration connection.- Specified by:
isActivein interfaceJoramAdapterMBean- Returns:
- true if connection is active.
-
getAdminDurationBeforeChangeState
public long getAdminDurationBeforeChangeState()
get duration of admin connection before change state.- Specified by:
getAdminDurationBeforeChangeStatein interfaceJoramAdapterMBean- Returns:
- the duration of admin change connection state.
-
getAdminDurationBeforeChangeStateDate
public String getAdminDurationBeforeChangeStateDate()
get duration of admin connection before change state.- Specified by:
getAdminDurationBeforeChangeStateDatein interfaceJoramAdapterMBean- Returns:
- the duration of admin connection before change state.
-
getTimeOutToAbortRequest
public long getTimeOutToAbortRequest() throws ConnectExceptionGets timeout in ms before abort a request.- Specified by:
getTimeOutToAbortRequestin interfaceJoramAdapterMBean- Returns:
- timeout before abort a request.
- Throws:
ConnectException- Since:
- 5.2.2
- See Also:
wrapper#getTimeOutToAbortRequest()
-
setTimeOutToAbortRequest
public void setTimeOutToAbortRequest(long timeOut) throws ConnectExceptionSets timeout in ms before abort a request.- Specified by:
setTimeOutToAbortRequestin interfaceJoramAdapterMBean- Parameters:
timeOut- timeout before abort a request.- Throws:
ConnectException- Since:
- 5.2.2
- See Also:
wrapper#setTimeOutToAbortRequest(long)
-
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 interfaceJoramAdapterMBean- Returns:
- The unique identifier of the dead message queue of the local server or null if none exists.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
wrapper#getDefaultDMQId()
-
getDefaultDMQId
public String getDefaultDMQId(short serverId) throws ConnectException, AdminException
Returns the unique identifier of the default dead message queue for a given server, null if not set.The request fails if the target server does not belong to the platform.
- Specified by:
getDefaultDMQIdin interfaceJoramAdapterMBean- Parameters:
serverId- Unique identifier of the server.- Returns:
- The unique identifier of the dead message queue of the given server or null if none exists.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.- See Also:
wrapper#getDefaultDMQId()
-
resetDefaultDMQ
public void resetDefaultDMQ(short serverId) throws ConnectException, AdminExceptionUnset the default dead message queue for the given server.- Specified by:
resetDefaultDMQin interfaceJoramAdapterMBean- Parameters:
serverId- Unique identifier of the given server.- Throws:
ConnectExceptionAdminException
-
getDefaultThreshold
public int getDefaultThreshold() throws ConnectException, AdminExceptionReturns the default threshold of the Joram server.- Specified by:
getDefaultThresholdin interfaceJoramAdapterMBean- Returns:
- the default threshold of the Joram server.
- Throws:
ConnectExceptionAdminException- See Also:
wrapper#getDefaultThreshold()
-
getDefaultThreshold
public int getDefaultThreshold(short serverId) throws ConnectException, AdminExceptionReturns the default threshold of the given Joram server.- Specified by:
getDefaultThresholdin interfaceJoramAdapterMBean- Parameters:
serverId- Unique identifier of the given Joram server.- Returns:
- the default threshold of the given Joram server.
- Throws:
ConnectExceptionAdminException- See Also:
wrapper#getDefaultThreshold(int)
-
setDefaultThreshold
public void setDefaultThreshold(int threshold) throws ConnectException, AdminExceptionSets the default threshold of the Joram server.- Specified by:
setDefaultThresholdin interfaceJoramAdapterMBean- Parameters:
threshold- the default threshold of the Joram server.- Throws:
ConnectExceptionAdminException- See Also:
wrapper#setDefaultThreshold(int)
-
setDefaultThreshold
public void setDefaultThreshold(short serverId, int threshold) throws ConnectException, AdminExceptionSets the default threshold of the given Joram server.- Specified by:
setDefaultThresholdin interfaceJoramAdapterMBean- Parameters:
serverId- Unique identifier of the given Joram server.threshold- the default threshold of the given Joram server.- Throws:
ConnectExceptionAdminException- See Also:
wrapper#setDefaultThreshold(int, int)
-
getDestinations
public String[] getDestinations() throws ConnectException, AdminException
Returns the list of all destinations that exist on the local server. This method creates and registers MBeans for all the destinations of the selected servers.- Specified by:
getDestinationsin interfaceJoramAdapterMBean- Returns:
- An array containing the object name of all destinations defined on the given server or null if none exists.
- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
getDestinations(short)
-
getDestinations
public String[] getDestinations(short serverId) throws ConnectException, AdminException
Returns the list of all destinations that exist on the given server. This method creates and registers MBeans for all the destinations of the selected servers.The request fails if the target server does not belong to the platform.
- Specified by:
getDestinationsin interfaceJoramAdapterMBean- Returns:
- An array containing the object name of all destinations defined on the given server or null if none exists.
- Throws:
ConnectException- If the connection is closed or broken.AdminException- Never thrown.- See Also:
JoramAdapterMBean.getDestinations(short)
-
createQueue
public String createQueue(String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
createQueuein interfaceJoramAdapterMBean- Overrides:
createQueuein classJoramResourceAdapter- Parameters:
name- The name of the queue.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
createQueue(short, String, String, Properties)
-
createQueue
public String createQueue(short serverId, String name) throws AdminException, ConnectException
Creates or retrieves a queue destination on the underlying JORAM server, (re)binds the correspondingQueueinstance.- Specified by:
createQueuein interfaceJoramAdapterMBean- 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- See Also:
createQueue(short, String, String, Properties)
-
createQueue
public String createQueue(short serverId, String name, String className, Properties prop) throws AdminException, ConnectException
First tries to retrieve a queue destination on the underlying JORAM server first using JNDI then the Joram's internal name service. Finally, if the destination does not exist it is created. Anyway at the end of this method the destination is bound in the JNDI repository.- 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:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken
-
createTopic
public String createTopic(String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Specified by:
createTopicin interfaceJoramAdapterMBean- Overrides:
createTopicin classJoramResourceAdapter- Parameters:
name- The name of the topic.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken- See Also:
createTopic(short, String, String, Properties)
-
createTopic
public String createTopic(short serverId, String name) throws AdminException, ConnectException
Creates or retrieves a topic destination on the underlying JORAM server, (re)binds the correspondingTopicinstance.- Specified by:
createTopicin interfaceJoramAdapterMBean- 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- See Also:
createTopic(short, String, String, Properties)
-
createTopic
public String createTopic(short serverId, String name, String className, Properties prop) throws AdminException, ConnectException
Creates 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.className- The topic class name.prop- The topic properties.- Throws:
AdminException- If the creation fails.ConnectException- if the connection is closed or broken
-
removeDestination
public void removeDestination(String name) throws AdminException
Remove a destination specified by its JNDI name on the underlying JORAM platform.- Specified by:
removeDestinationin interfaceJoramAdapterMBean- Parameters:
name- The JNDI name of the destination.- Throws:
AdminException
-
getUsers
public String[] getUsers() throws ConnectException, AdminException
Returns the list of all users that exist on the local server. This method creates and registers MBeans for all the users of the selected servers.- Specified by:
getUsersin interfaceJoramAdapterMBean- Returns:
- An array containing the object name of all users defined on the given server or null if none exists.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.- See Also:
getUsers(short)
-
getUsers
public String[] getUsers(short serverId) throws ConnectException, AdminException
Returns the list of all users that exist on a given server. This method creates and registers MBeans for all the users of the selected servers.The request fails if the target server does not belong to the platform.
- Specified by:
getUsersin interfaceJoramAdapterMBean- Parameters:
serverId- Unique identifier of the given server.- Returns:
- An array containing the object name of all users defined on the given server or null if none exists.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
createUser
public String createUser(String name, String password) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceJoramAdapterMBean- Parameters:
name- The login name of the user.password- The password of the user.- Returns:
- The object name of created user.
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
createUser(String, String, short, String)
-
createUser
public String createUser(String name, String password, String identityClass) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceJoramAdapterMBean- Overrides:
createUserin classJoramResourceAdapter- Parameters:
name- The login name of the user.password- The password of the user.identityClass- The identity class used for authentication.- Returns:
- The object name of created user.
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
createUser(String, String, short, String)
-
createUser
public String createUser(String name, String password, short serverId) throws AdminException, ConnectException
Creates or retrieves a user on the given JORAM server.- Specified by:
createUserin interfaceJoramAdapterMBean- Parameters:
name- The login name of the user.password- The password of the user.serverId- The unique identifier of the Joram server.- Returns:
- The object name of created user.
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.- See Also:
createUser(String, String, short, String)
-
createUser
public String createUser(String name, String password, short serverId, String identityClass) throws AdminException, ConnectException
Creates or retrieves a user on the underlying JORAM server.- Specified by:
createUserin interfaceJoramAdapterMBean- 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 object name of created user.
- Throws:
AdminException- If the creation fails.ConnectException- If the connection fails.
-
createCF
public void createCF(String name)
Creates a non managed connection factory and binds it to JNDI.- Specified by:
createCFin interfaceJoramAdapterMBean- Parameters:
name- Name of created connection factory.
-
createQueueCF
public void createQueueCF(String name)
Creates a non managed PTP connection factory and binds it to JNDI.- Specified by:
createQueueCFin interfaceJoramAdapterMBean- Parameters:
name- Name of created connection factory.
-
createTopicCF
public void createTopicCF(String name)
Creates a non managed PubSub connection factory and binds it to JNDI.- Specified by:
createTopicCFin interfaceJoramAdapterMBean- Parameters:
name- Name of created connection factory.
-
executeXMLAdmin
public void executeXMLAdmin(String path) throws Exception
Executes the XML configuration file.- Specified by:
executeXMLAdminin interfaceJoramAdapterMBean- Parameters:
path- the path for the joramAdmin file- Throws:
AdminException- if an error occursException
-
exportRepositoryToFile
public void exportRepositoryToFile(String exportDir) throws AdminException
Export the repository content to an XML file with default filename. - only the destinations objects are retrieved in this version - xml script format of the admin objects (joramAdmin.xml)- Specified by:
exportRepositoryToFilein interfaceJoramAdapterMBean- Parameters:
exportDir- target directory where the export file will be put- Throws:
AdminException- if an error occurs
-
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)- Specified by:
exportRepositoryToFilein interfaceJoramAdapterMBean- Parameters:
exportDir- target directory where the export file will be putexportFilename- filename of the export file- Throws:
AdminException- if an error occurs
-
getServersIds
public Short[] getServersIds() throws ConnectException, AdminException
Returns the list of the platform's servers' identifiers.- Specified by:
getServersIdsin interfaceJoramAdapterMBean- Returns:
- an array containing the list of the platform's servers' identifiers.
- Throws:
AdminException- If the request fails.ConnectException- If the connection fails.
-
getServersNames
public final String[] getServersNames() throws ConnectException, AdminException
Returns the list of the platform's servers' names.- Specified by:
getServersNamesin interfaceJoramAdapterMBean- Returns:
- An array containing the list of server's names.
- Throws:
ConnectException- If the connection fails.AdminException- Never thrown.
-
getConfiguration
public final String getConfiguration() throws ConnectException, AdminException
Returns the current servers configuration (a3servers.xml).- Returns:
- The current servers configuration.
- Throws:
ConnectException- If the connection fails.AdminException- If the request fails.
-
getWrapper
public JoramAdmin getWrapper()
The admin wrapper.- Returns:
- the admin wrapper of this resource adapter.
-
getCollocatedServer
public Boolean getCollocatedServer()
Deprecated.only needed for compatibility with JOnAS 5.2 administration GUIReturns true if the server is colocated.- Specified by:
getCollocatedServerin interfaceJoramAdapterMBean- See Also:
JoramAdapterMBean.getCollocatedServer()
-
getServerName
public String getServerName()
Deprecated.only needed for compatibility with JOnAS 5.2 administration GUIReturns the server name.- Specified by:
getServerNamein interfaceJoramAdapterMBean- See Also:
JoramAdapterMBean.getServerName()
-
-