Class RestAcquisitionQueue
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.RestAcquisitionQueue
-
public class RestAcquisitionQueue extends Object
TheRestAcquisitionQueueclass allows administrators to create REST acquisition queues (Rest bridge in).The Rest bridge destinations rely on a particular Joram service which purpose is to maintain valid connections with the foreign REST Joram servers. The valid properties define by this destination are:
- rest.host: hostname or IP address of remote JMS REST server, by default "localhost".
- rest.port: listening port of remote JMS REST server, by default 8989.
- rest.useOldAPI: if true, use the old Rest/JMS API with authentication through query parameters.
- rest.user: user name needed to connect to remote JMS REST server, by default "anonymous".
- rest.pass: password needed to connect to remote JMS REST server, by default "anonymous".
- rest.mediaTypeJson: if true the acquisition queue accepts JSON message, default true.
- rest.timeout: Timeout for waiting for a message, by default 10.000 (10 seconds).
- rest.idletimeout: normally each remote resource need to be explicitly closed, this parameter allows to set the idle time in seconds in which the remote context will be closed if idle. If less than or equal to 0, the context never closes. By default 60 seconds.
- acquisition.period: delay between to attempts to receive a message if the acquisition queue doesn't use the asyncrhonous mode, by default 100 milliseconds.
- jms.destination: the name of remote JMS destination.
- rest.connectTimeout: configures connectTimeout for WS client.
- rest.readTimeout: configures readTimeout for WS client.
- rest.checkPeriod: verification period in seconds of acquisition handler. If no message has been received during this period, the handler is restarted.
-
-
Field Summary
Fields Modifier and Type Field Description private intacquisitionPeriodprivate longcheckPeriodprivate Stringhostprivate longidleTimeoutprivate booleanmediaTypeJsonprivate Stringpasswordprivate intportstatic StringRESTAcquisitionClass name of handler allowing to acquire messages to a foreign REST provider.private longtimeoutprivate booleanuseOldAPIprivate Stringusername
-
Constructor Summary
Constructors Constructor Description RestAcquisitionQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Queuecreate(int serverId, String dest)Administration method creating and deploying a REST acquisition queue on a given server.Queuecreate(int serverId, String name, String dest)Administration method creating and deploying a REST acquisition queue on a given server.Queuecreate(int serverId, String name, String dest, Properties props)Administration method creating and deploying a REST acquisition queue on a given server.Queuecreate(String dest)Administration method creating and deploying a REST acquisition queue on the local server.longgetAcquisitionPeriod()longgetCheckPeriod()StringgetHost()longgetIdleTimeout()StringgetPassword()intgetPort()longgetTimeout()StringgetUsername()booleanisMediaTypeJson()booleanisUseOldAPI()RestAcquisitionQueuesetAcquisitionPeriod(int acquisitionPeriod)RestAcquisitionQueuesetCheckPeriod(long checkPeriod)RestAcquisitionQueuesetHost(String host)RestAcquisitionQueuesetIdleTimeout(long idleTimeout)RestAcquisitionQueuesetMediaTypeJson(boolean mediaTypeJson)RestAcquisitionQueuesetPassword(String password)RestAcquisitionQueuesetPort(int port)RestAcquisitionQueuesetTimeout(long timeout)RestAcquisitionQueuesetUseOldAPI(boolean useOldAPI)RestAcquisitionQueuesetUsername(String userName)
-
-
-
Field Detail
-
RESTAcquisition
public static final String RESTAcquisition
Class name of handler allowing to acquire messages to a foreign REST provider.- See Also:
- Constant Field Values
-
host
private String host
-
port
private int port
-
useOldAPI
private boolean useOldAPI
-
username
private String username
-
password
private String password
-
mediaTypeJson
private boolean mediaTypeJson
-
timeout
private long timeout
-
acquisitionPeriod
private int acquisitionPeriod
-
idleTimeout
private long idleTimeout
-
checkPeriod
private long checkPeriod
-
-
Method Detail
-
getHost
public String getHost()
- Returns:
- the hostName
-
setHost
public RestAcquisitionQueue setHost(String host)
-
getPort
public int getPort()
- Returns:
- the port
-
setPort
public RestAcquisitionQueue setPort(int port)
- Parameters:
port- the port to set
-
isUseOldAPI
public boolean isUseOldAPI()
- Returns:
- the useOldAPI
-
setUseOldAPI
public RestAcquisitionQueue setUseOldAPI(boolean useOldAPI)
- Parameters:
useOldAPI- the useOldAPI to set
-
getUsername
public String getUsername()
- Returns:
- the userName
-
setUsername
public RestAcquisitionQueue setUsername(String userName)
- Parameters:
userName- the userName to set
-
getPassword
public String getPassword()
- Returns:
- the password
-
setPassword
public RestAcquisitionQueue setPassword(String password)
- Parameters:
password- the password to set
-
isMediaTypeJson
public boolean isMediaTypeJson()
- Returns:
- the mediaTypeJson
-
setMediaTypeJson
public RestAcquisitionQueue setMediaTypeJson(boolean mediaTypeJson)
- Parameters:
mediaTypeJson- the mediaTypeJson to set
-
getTimeout
public long getTimeout()
- Returns:
- the timeout
-
setTimeout
public RestAcquisitionQueue setTimeout(long timeout)
- Parameters:
timeout- the timeout to set
-
getAcquisitionPeriod
public long getAcquisitionPeriod()
- Returns:
- the acquisitionPeriod
-
setAcquisitionPeriod
public RestAcquisitionQueue setAcquisitionPeriod(int acquisitionPeriod)
- Parameters:
acquisitionPeriod- the acquisitionPeriod to set
-
getIdleTimeout
public long getIdleTimeout()
-
setIdleTimeout
public RestAcquisitionQueue setIdleTimeout(long idleTimeout)
-
getCheckPeriod
public long getCheckPeriod()
- Returns:
- the checkPeriod.
-
setCheckPeriod
public RestAcquisitionQueue setCheckPeriod(long checkPeriod)
- Parameters:
checkPeriod- the ckeckPeriod to set.- Returns:
-
create
public Queue create(String dest) throws ConnectException, AdminException
Administration method creating and deploying a REST acquisition queue on the local server.The request fails if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
- Parameters:
dest- The name of the foreign destination.- Returns:
- the created bridge destination.
- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.- See Also:
create(int, String, String, Properties)
-
create
public Queue create(int serverId, String dest) throws ConnectException, AdminException
Administration method creating and deploying a REST acquisition queue on a given server.The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
- Parameters:
serverId- The identifier of the server where deploying the queue.dest- The name of the foreign destination.- Returns:
- the created bridge destination.
- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.- See Also:
create(int, String, String, Properties)
-
create
public Queue create(int serverId, String name, String dest) throws ConnectException, AdminException
Administration method creating and deploying a REST acquisition queue on a given server.The request fails if the target server does not belong to the platform, or if the destination deployment fails server side.
Be careful this method use the static AdminModule connection.
- Parameters:
serverId- The identifier of the server where deploying the queue.name- The name of the created queue.dest- The name of the foreign destination.- Returns:
- the created bridge destination.
- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.- See Also:
create(int, String, String, Properties)
-
create
public Queue create(int serverId, String name, String dest, Properties props) throws ConnectException, AdminException
Administration method creating and deploying a REST acquisition queue on a given server.In addition to properties used to configure acquisition queues a set of specific properties allows to configure Rest/JMS acquisition destination:
- rest.host: hostname or IP address of remote JMS REST server, by default "localhost".
- rest.port: listening port of remote JMS REST server, by default 8989.
- rest.user: user name needed to connect to remote JMS REST server, by default "anonymous".
- rest.pass: password needed to connect to remote JMS REST server, by default "anonymous".
- rest.mediaTypeJson: if true the acquisition queue accepts JSON message, default true.
- rest.timeout: Timeout for waiting for a message, by default 10.000 (10 seconds).
- rest.idletimeout: normally each remote resource need to be explicitly closed, this parameter allows to set the idle time in seconds in which the remote context will be closed if idle. If less than or equal to 0, the context never closes. By default 60 seconds.
- acquisition.period: delay between to attempts to receive a message if the acquisition queue doesn't use the asyncrhonous mode, by default 100 milliseconds.
- jms.destination: the name of remote JMS destination.
- rest.connectTimeout: configures connectTimeout for WS client.
- rest.readTimeout: configures readTimeout for WS client.
- additional parameters for specific WS implementation can be added.
Be careful this method use the static AdminModule connection.
- Parameters:
serverId- The identifier of the server where deploying the queue.name- The name of the created queue.dest- The name of the foreign destination.props- A Properties object containing all needed parameters.- Returns:
- the created bridge destination.
- Throws:
ConnectException- If the administration connection is closed or broken.AdminException- If the request fails.
-
-