Package jade.mtp.http

Class MessageTransportProtocol

    • Constructor Detail

      • MessageTransportProtocol

        public MessageTransportProtocol()
    • Method Detail

      • strToAddr

        public TransportAddress strToAddr​(String rep)
                                   throws MTPException
        MTP Interface Methods
        Specified by:
        strToAddr in interface MTP
        Parameters:
        rep - The string representation of the address.
        Returns:
        A TransportAddress object, created from the given string.
        Throws:
        MTPException - If the given string is not a valid address according to this MTP.
      • addrToStr

        public String addrToStr​(TransportAddress ta)
                         throws MTPException
        Description copied from interface: MTP
        Converts a TransportAddress object into a string representation.
        Specified by:
        addrToStr in interface MTP
        Parameters:
        ta - The TransportAddress object.
        Returns:
        A string representing the given address.
        Throws:
        MTPException - If the given TransportAddress is not a valid address for this MTP.
      • getName

        public String getName()
        Description copied from interface: MTP
        Reads the name of the message transport protocol managed by this MTP. The FIPA standard message transport protocols have a name starting with "fipa.mts.mtp".
        Specified by:
        getName in interface MTP
        Returns:
        A string, that is the name of this MTP.
      • activate

        public void activate​(InChannel.Dispatcher disp,
                             TransportAddress ta,
                             Profile p)
                      throws MTPException
        Actual method to activate the HTTP MTP. Customizable parameters read from profile:
        • port: the port this HTTP server listens to.
        • numKeepAlive: Maximum number of keep-alive connections. Default value is 10. Set to 0 to disable keep-alive coonections (possible performance impact).
        • proxyHost: Proxy host name or IP-address. No default value.
        • proxyPort: Default value is 1080.
        • outPort: Fix port to be used by HTTP client (for firewall configuration). Default value is freely chosen by Java
        • parser: XML SAX2 parser implementation to use. Default value is JDK 1.4 default parser.
        • policy: "conservative" (default value) or "aggressive". (see documentation for details).
        • timeout: Timeout for keep-alive connections. Default value is 1 min. 0 means infinite.
        Note that all these parameters must be prefixed with "jade_mtp_http_".
        Specified by:
        activate in interface InChannel
        ta - A TransportAddress object, representing the transport address to listen to.
        Throws:
        MTPException - Thrown if some MTP initialization error occurs.
      • deactivate

        public void deactivate​(TransportAddress ta)
                        throws MTPException
        Description copied from interface: InChannel
        Deactivates the MTP handler listening at a given transport address.
        Specified by:
        deactivate in interface InChannel
        Parameters:
        ta - The TransportAddress object the handle to close is listening to.
        Throws:
        MTPException - Thrown if some MTP cleanup error occurs.
      • deliver

        public void deliver​(String addr,
                            Envelope env,
                            byte[] payload)
                     throws MTPException
        OutChannel Interface Methods *
        Specified by:
        deliver in interface OutChannel
        env - The message envelope, containing various fields related to message recipients, encoding, and timestamping.
        Throws:
        MTPException - Thrown if some MTP delivery error occurs.