Class ConnectorContext

java.lang.Object
org.springframework.extensions.webscripts.connector.ConnectorContext

public final class ConnectorContext extends 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 Details

    • ConnectorContext

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

      public ConnectorContext(Map<String,String> parameters, Map<String,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, Map<String,String> parameters, Map<String,String> headers)
      Instantiates a new connector context.
      Parameters:
      method - the HTTP method
      parameters - the parameters
      headers - the headers
  • Method Details

    • getParameters

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

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

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

      public void setContentType(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()