psdi.iface.router

Class JMSHandler

  • All Implemented Interfaces:
    RouterHandler


    public class JMSHandler
    extends BaseRouterHandler
    MQHandler sends/writes data into a JMS MQ(for example : Websphere MQ). Before using this class, one must make sure that they have correct JNDI setup for Queue Connection Factory and Queue. Also depending on the JMS provider, one has to make sure that their application server classpath contains the necessessary jar files. This Class Implements RouterHandler Interface.
    • Constructor Detail

      • JMSHandler

        public JMSHandler()
    • Method Detail

      • invoke

        public byte[] invoke(java.util.Map metaData,
                             byte[] data)
                      throws MXException
        Sends / Writes data to a given Queue. This sendData method looks for two properties namely CON_FACTORY_JNDI_NAME, DEST_QUEUE_JNDI_NAME and its values for a given external system from the MAXEXTSYSHANDLER table. It uses JMSQueueProducer api to write data into a JMS Queue. Note: Before writing into Queue, if you want to compress the message(byte array), then you have to set a property called "ISCOMPRESS" = true in the MAXEXTSYSHANDLER table
        Specified by:
        invoke in interface RouterHandler
        Overrides:
        invoke in class BaseRouterHandler
        Parameters:
        destinationName - Name of the External System
        interfaceName - interfaceName of this transacion
        data - the xml transaction in byte array
        Returns:
        the Bidi transformed data to be collected and used by the descendant classes
        Throws:
        MXException - if there's a problem in writing data to queue.
        See Also:
        RouterHandler.invoke(java.util.Map, byte[])
      • getProperties

        public java.util.List getProperties()
        Returns:
        the List of supported properties.
      • getExitInstance

        protected JMSExit getExitInstance()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getJMSExit

        public java.lang.String getJMSExit()
        looks for CON_FACTORY_JNDI_NAME from the Map and returns the Queue Connection Factory JNDI Name from the map.
        Returns:
        Queue Connection Factory name from the map. If there is no property in the map, it returns 'null'
      • getConFactoryName

        public java.lang.String getConFactoryName()
        looks for CON_FACTORY_JNDI_NAME from the Map and returns the Queue Connection Factory JNDI Name from the map.
        Returns:
        Queue Connection Factory name from the map. If there is no property in the map, it returns 'null'
      • getDestinationName

        public java.lang.String getDestinationName()
        looks for DEST_QUEUE_JNDI_NAME from the Map and returns the Queue JNDI Name from the map.
        Returns:
        Queue JNDI Name from the map. If there is no property in the map, it returns 'null'
      • getIniConFactory

        public java.lang.String getIniConFactory()
        looks for INITIAL_CON_FACTORY from the Map and returns the Initial Context Factory from the map.
        Returns:
        Initial Context Factory name from the map. If there is no property in the map, it returns 'null'
      • getProviderUrl

        public java.lang.String getProviderUrl()
        looks for PROVIDER_URL from the Map and returns the Provider Url from the map.
        Returns:
        Provider URL from the map. If there is no property in the map, it returns 'null'
      • isCompress

        public boolean isCompress()
                           throws java.lang.Exception
        looks for ISCOMPRESS from the Map and returns a boolean from the map.
        Returns:
        a boolean from the map. If there is no property in the map, it returns 'false'
        Throws:
        java.lang.Exception
      • getDestinationType

        public java.lang.String getDestinationType()
        The Destination type - javax.jms.Queue/javax.jms.Topic.
        Returns:
        the destivation type.
      • getUsername

        public java.lang.String getUsername()
        The username for accessing the destination.
        Returns:
        the username
      • getProviderUsername

        public java.lang.String getProviderUsername()
        The username of the provider
        Returns:
        the PROVIDERUSER
      • getProviderPassword

        public java.lang.String getProviderPassword()
        The Password of the provider
        Returns:
        the PROVIDERPASSWORD
      • isText

        public boolean isText()