Class RESTAcquisition

  • All Implemented Interfaces:
    AcquisitionHandler

    public final class RESTAcquisition
    extends Object
    implements AcquisitionHandler
    Simple acquisition handler for the REST acquisition bridge. A Rest/JMS acquisition request is triggered each time a new message is received. If this message contains properties, the module is reinitialized with the incoming properties.
    • Field Detail

      • logger

        private static final Logger logger
      • DEBUG

        private static final boolean DEBUG
      • hostName

        private String hostName
      • port

        private int port
      • useOldAPI

        private boolean useOldAPI
      • connectTimeout

        private int connectTimeout
      • readTimeout

        private int readTimeout
      • userName

        private String userName
      • password

        private String password
      • idleTimeout

        private String idleTimeout
      • timeout

        private long timeout
      • persistent

        private boolean persistent
      • nbMaxMsg

        private int nbMaxMsg
      • mediaTypeJson

        private boolean mediaTypeJson
      • destName

        private String destName
      • uriConsume

        private URI uriConsume
      • uriCloseConsumer

        private URI uriCloseConsumer
      • client

        private jakarta.ws.rs.client.Client client
    • Constructor Detail

      • RESTAcquisition

        public RESTAcquisition()
    • Method Detail

      • init

        private void init​(Properties properties)
      • createConsumer

        private void createConsumer()
                             throws Exception
        This method is called either from init (implying initialization of the consumer), or retrieve if the consumer is not initialized.
        Throws:
        Exception
      • setMessageHeader

        private void setMessageHeader​(Map jsonMessageHeader,
                                      Message message)
      • retrieve

        public void retrieve​(ReliableTransmitter transmitter)
                      throws Exception
        Description copied from interface: AcquisitionHandler
        Retrieves one or more message from an external source (e-mail, ftp, ...). Message properties such as priority, expiration or persistence will be set afterwards by the AcquisitionModule.

        If the external source is reliable, acknowledgment can be done safely after transmitting the message using the transmitter.
        Specified by:
        retrieve in interface AcquisitionHandler
        Parameters:
        transmitter - a transmitter used to transmit retrieved messages to the MOM reliably.
        Throws:
        Exception
      • setProperties

        public void setProperties​(Properties properties)
        Description copied from interface: AcquisitionHandler
        Configures the handler with the given properties. This method is called one time before the first call to retrieve and then when the acquisition destination receives a configuration message.
        Specified by:
        setProperties in interface AcquisitionHandler
        Parameters:
        properties - The new set of properties.
      • closeConsumer

        private void closeConsumer()
        Close the consumer.
      • close

        public void close()
        Closes the Acquisition module and all associated resources. Called by generic behavior during the destination finalization.
        Specified by:
        close in interface AcquisitionHandler