Class ConnectorContext


  • public final class ConnectorContext
    extends java.lang.Object
    Describes invocation context that the connector should use when creating the connection to a remote service.

    Invocation context consists of HTTP request state such as fixed parameters and headers and the HTTP request method.

    Author:
    Kevin Roast
    • Constructor Detail

      • ConnectorContext

        public ConnectorContext()
        Instantiates a new connector context.
      • ConnectorContext

        public ConnectorContext​(java.util.Map<java.lang.String,​java.lang.String> parameters,
                                java.util.Map<java.lang.String,​java.lang.String> headers)
        Instantiates a new connector context.
        Parameters:
        parameters - the parameters
        headers - the headers
      • ConnectorContext

        public ConnectorContext​(HttpMethod method)
        Instantiates a new connector context.
        Parameters:
        method - the HTTP method
      • ConnectorContext

        public ConnectorContext​(HttpMethod method,
                                java.util.Map<java.lang.String,​java.lang.String> parameters,
                                java.util.Map<java.lang.String,​java.lang.String> headers)
        Instantiates a new connector context.
        Parameters:
        method - the HTTP method
        parameters - the parameters
        headers - the headers
    • Method Detail

      • getParameters

        public java.util.Map<java.lang.String,​java.lang.String> getParameters()
        Gets the parameters.
        Returns:
        the parameters
      • getHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        Gets the headers.
        Returns:
        the headers
      • getContentType

        public java.lang.String getContentType()
        Gets the content type.
        Returns:
        the content type
      • setContentType

        public void setContentType​(java.lang.String contentType)
        Sets the content type.
        Parameters:
        contentType - the new content type
      • getMethod

        public HttpMethod getMethod()
        Gets the method.
        Returns:
        the method
      • setMethod

        public void setMethod​(HttpMethod method)
        Sets the method.
        Parameters:
        method - the new method
      • getCommitResponse

        public boolean getCommitResponse()
        Returns:
        true to commit the response if a 401 error is returned, false otherwise. Allows for retry of connections that stream to a remote connection after an authentication pass.
      • setCommitResponseOnAuthenticationError

        public void setCommitResponseOnAuthenticationError​(boolean commitResponse)
        Parameters:
        commitResponse - true to commit the response if a 401 error is returned, false otherwise. Allows for retry of connections that stream to a remote connection after an authentication pass.
      • setExceptionOnError

        public void setExceptionOnError​(boolean exceptionOnError)
        Parameters:
        exceptionOnError - True to throw an exception on a server 500 response - else return 500 code in the usual Response object. This is useful when internal services want to make a remote call but are not interested in dealing with and returing exceptions directly to the user.
      • getExceptionOnError

        public boolean getExceptionOnError()