Class RestDistributionQueue
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.RestDistributionQueue
-
public class RestDistributionQueue extends Object
TheRestDistributionQueueclass allows administrators to create REST distribution queues (REST bridge out).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".
- distribution.async: default true.
- distribution.batch: default true.
- 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.
- period: default 1.000 (1 second).
- jms.destination: the name of remote JMS destination.
- rest.connectTimeout: configures connectTimeout for WS client.
- rest.readTimeout: configures readTimeout for WS client.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanasyncprivate booleanbatchprivate Stringhostprivate longidleTimeoutprivate Stringpasswordprivate intperiodprivate intportstatic StringRESTDistributionClass name of handler allowing to distribute messages to a foreign REST provider.private booleanuseOldAPIprivate StringuserName
-
Constructor Summary
Constructors Constructor Description RestDistributionQueue()
-
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 distribution queue on a given server.Queuecreate(int serverId, String name, String dest)Administration method creating and deploying a REST distribution queue on a given server.Queuecreate(int serverId, String name, String dest, Properties props)Administration method creating and deploying a REST distribution queue on a given server.Queuecreate(String dest)Administration method creating and deploying a REST distribution queue on the local server.StringgetHost()longgetIdleTimeout()StringgetPassword()intgetPeriod()intgetPort()StringgetUserName()booleanisAsync()Gets the async parameter.booleanisBatch()Gets the batch parameter.booleanisUseOldAPI()RestDistributionQueuesetAsync(boolean async)Sets the async parameter.RestDistributionQueuesetBatch(boolean batch)Sets the batch parameter.RestDistributionQueuesetHost(String host)RestDistributionQueuesetIdleTimeout(long idleTimeout)RestDistributionQueuesetPassword(String password)RestDistributionQueuesetPeriod(int period)RestDistributionQueuesetPort(int port)RestDistributionQueuesetUseOldAPI(boolean useOldAPI)RestDistributionQueuesetUserName(String userName)
-
-
-
Field Detail
-
RESTDistribution
public static final String RESTDistribution
Class name of handler allowing to distribute 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
-
batch
private boolean batch
-
async
private boolean async
-
period
private int period
-
idleTimeout
private long idleTimeout
-
-
Method Detail
-
getHost
public String getHost()
- Returns:
- the hostName
-
setHost
public RestDistributionQueue setHost(String host)
-
getPort
public int getPort()
- Returns:
- the port
-
setPort
public RestDistributionQueue setPort(int port)
- Parameters:
port- the port to set
-
isUseOldAPI
public boolean isUseOldAPI()
- Returns:
- the useOldAPI
-
setUseOldAPI
public RestDistributionQueue setUseOldAPI(boolean useOldAPI)
- Parameters:
useOldAPI- the useOldAPI to set
-
getUserName
public String getUserName()
- Returns:
- the userName
-
setUserName
public RestDistributionQueue setUserName(String userName)
- Parameters:
userName- the userName to set
-
getPassword
public String getPassword()
- Returns:
- the password
-
setPassword
public RestDistributionQueue setPassword(String password)
- Parameters:
password- the password to set
-
isBatch
public boolean isBatch()
Gets the batch parameter.- Returns:
- the batch parameter
-
setBatch
public RestDistributionQueue setBatch(boolean batch)
Sets the batch parameter.- Parameters:
batch- the batch to set
-
isAsync
public boolean isAsync()
Gets the async parameter.- Returns:
- the async parameter
-
setAsync
public RestDistributionQueue setAsync(boolean async)
Sets the async parameter.- Parameters:
async- the batch to set
-
getPeriod
public int getPeriod()
- Returns:
- the period
-
setPeriod
public RestDistributionQueue setPeriod(int period)
- Parameters:
period- the period to set
-
getIdleTimeout
public long getIdleTimeout()
-
setIdleTimeout
public RestDistributionQueue setIdleTimeout(long idleTimeout)
-
create
public Queue create(String dest) throws ConnectException, AdminException
Administration method creating and deploying a REST distribution 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 distribution 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 distribution 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 distribution queue on a given server.In addition to properties used to configure distribution queues a set of specific properties allows to configure Rest/JMS distribution 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".
- distribution.async: default true.
- distribution.batch: default true.
- 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.
- period: default 1.000 (1 second).
- 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.
-
-