psdi.iface.router

Class HTTPHandler

  • All Implemented Interfaces:
    RouterHandler
    Direct Known Subclasses:
    IoTCloudantHTTPHandler, IoTCloudantHTTPHandler, TestJSONHandler, TestJSONHandler


    public class HTTPHandler
    extends BaseRouterHandler
    HTTPHandler supports both HTTP POST and GET to a given url. It Supports both HTTP and HTTPS. HTTPHandler sends data in a format Content-Type = text/xml [for POST]. There is no userinteraction such as popping a dialog box as the property "allowUserInteraction" is set to false. The protocol must always try to get a fresh copy of the object as the property "useCaches" is set to false. This Class extends the BaseRouterHandler class.
    • Field Detail

      • HTTPMETHOD_GET

        public static final java.lang.String HTTPMETHOD_GET
        HTTP GET.
        See Also:
        Constant Field Values
      • HTTPMETHOD_HEAD

        public static final java.lang.String HTTPMETHOD_HEAD
        HTTP GET.
        See Also:
        Constant Field Values
      • HTTPMETHOD_POST

        public static final java.lang.String HTTPMETHOD_POST
        HTTP POST.
        See Also:
        Constant Field Values
      • HTTPMETHOD_PATCH

        public static final java.lang.String HTTPMETHOD_PATCH
        HTTP PATCH.
        See Also:
        Constant Field Values
      • HTTPMETHOD_PUT

        public static final java.lang.String HTTPMETHOD_PUT
        HTTP PUT.
        See Also:
        Constant Field Values
      • HTTPMETHOD_DELETE

        public static final java.lang.String HTTPMETHOD_DELETE
        HTTP DELETE.
        See Also:
        Constant Field Values
      • RESPONSE_HEADERS

        public static final java.lang.String RESPONSE_HEADERS
        See Also:
        Constant Field Values
      • HTTPGET_URLPROPS

        public static final java.lang.String HTTPGET_URLPROPS
        The binding key for programmatic setting of url properties for HTTP GET.
        See Also:
        Constant Field Values
      • HTTP_HEADERPROPS

        public static final java.lang.String HTTP_HEADERPROPS
        The binding key for programmatic setting of url properties for HTTP GET.
        See Also:
        Constant Field Values
      • HTTP_REQUEST_COOKIES

        public static final java.lang.String HTTP_REQUEST_COOKIES
        The binding key for programmatic setting of url properties for HTTP GET.
        See Also:
        Constant Field Values
      • HTTP_ETAG

        public static final java.lang.String HTTP_ETAG
        The binding key for programmatic setting of url properties for HTTP GET.
        See Also:
        Constant Field Values
      • HTTPEXIT

        public static final java.lang.String HTTPEXIT
        The exit class property name for processing HTTP request and response.
        See Also:
        Constant Field Values
      • HTTPMETHOD

        public static final java.lang.String HTTPMETHOD
        The HTTP method name property.
        See Also:
        Constant Field Values
      • URL

        public static final java.lang.String URL
        The HTTP url binding property name.
        See Also:
        Constant Field Values
      • CONNECTTIMEOUT

        public static final java.lang.String CONNECTTIMEOUT
        The connection timeout property name.
        See Also:
        Constant Field Values
      • READTIMEOUT

        public static final java.lang.String READTIMEOUT
        The connection timeout property name.
        See Also:
        Constant Field Values
      • ERRORONSTATUS

        public static final java.lang.String ERRORONSTATUS
        The error on status property name. Type boolean.
        See Also:
        Constant Field Values
      • ALLRESPONSEHEADERS

        public static final java.lang.String ALLRESPONSEHEADERS
        The all response header property. Type boolean. If set to 1 - all response headers are set back to the metaData Map
        See Also:
        Constant Field Values
      • RESPONSE_STATUS

        public static final java.lang.String RESPONSE_STATUS
        The error on status property name. Type boolean.
        See Also:
        Constant Field Values
      • RESPONSE_STATUS_TEXT

        public static final java.lang.String RESPONSE_STATUS_TEXT
        The error on status property name. Type boolean.
        See Also:
        Constant Field Values
      • FIREANDFORGET

        public static final java.lang.String FIREANDFORGET
        Fire and forget mode would not wait for the response.
        See Also:
        Constant Field Values
      • FORMDATA

        public static final java.lang.String FORMDATA
        form data for POST.
        See Also:
        Constant Field Values
      • CLIENTCERTSTORE

        public static final java.lang.String CLIENTCERTSTORE
        The client cert file.
        See Also:
        Constant Field Values
      • CLIENTCERTTYPE

        public static final java.lang.String CLIENTCERTTYPE
        The client cert type - PKCS12.
        See Also:
        Constant Field Values
      • CLIENTCERTPASS

        public static final java.lang.String CLIENTCERTPASS
        The client cert password.
        See Also:
        Constant Field Values
      • CLIENTCERTALG

        public static final java.lang.String CLIENTCERTALG
        The client cert algorithm.
        See Also:
        Constant Field Values
      • OAUTHCLIENT

        public static final java.lang.String OAUTHCLIENT
        form data for POST.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HTTPHandler

        public HTTPHandler(MaxEndPointInfo endPointInfo)
        Parameters:
        endPointInfo -
      • HTTPHandler

        public HTTPHandler()
    • Method Detail

      • getProperties

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

        protected HTTPExit getExitInstance()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getReadTimeout

        public int getReadTimeout()
        Returns:
        the [response] read timeout in millis.
      • getConnectTimeout

        public int getConnectTimeout()
        Returns:
        the [socket] connect timeout in millis.
      • getHttpExitName

        public java.lang.String getHttpExitName()
        Returns:
        the http exit class name.
      • getOAUTHClientName

        public java.lang.String getOAUTHClientName()
        Returns:
        the http exit class name.
      • getUrl

        public java.lang.String getUrl()
        Returns:
        url to connect to.
      • getUserName

        public java.lang.String getUserName()
        Returns:
        the user name to use for connecting to the endpoint.
      • getHttpMethod

        public java.lang.String getHttpMethod()
        Returns:
        the HTTP method to use.
      • encode

        public static java.lang.String encode(java.lang.String userName,
                                              java.lang.String password)
                                       throws java.lang.Exception
        encode the username and password with BASE64Encoder
        Parameters:
        userName - - a String
        password - - a String
        Returns:
        encoded string
        Throws:
        java.lang.Exception