Class RestDistributionQueue


  • public class RestDistributionQueue
    extends Object
    The RestDistributionQueue class 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 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
      • 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
    • Constructor Detail

      • RestDistributionQueue

        public RestDistributionQueue()
    • Method Detail

      • getHost

        public String getHost()
        Returns:
        the hostName
      • getPort

        public int getPort()
        Returns:
        the port
      • 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
      • getPassword

        public String getPassword()
        Returns:
        the password
      • 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()
      • 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.
        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.
        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.