Class AbstractConnector

java.lang.Object
org.springframework.extensions.webscripts.connector.AbstractConnector
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, Connector
Direct Known Subclasses:
HttpConnector

public abstract class AbstractConnector extends Object implements Connector, org.springframework.context.ApplicationContextAware
Abstract class providing the base implementation for a Connector.

Provides implementations for the basic setter and helper functions.

The delegate functions is the call() method - this should be overriden to provide the appropriate connector functionality.

Author:
Kevin Roast
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Sets the Spring application context
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Parameters:
      applicationContext - the Spring application context
    • buildRemoteClient

      protected RemoteClient buildRemoteClient(String endpoint)
      Build a Remote Client instance by retrieving and configuring the "connector.remoteclient" bean.
      Parameters:
      endpoint - Configured Endpoint ID for the remote client instance
    • call

      public Response call(String uri)
      Description copied from interface: Connector
      Invokes a URI on a remote service. The response data is buffered into a data element on the returned object of type Response.
      Specified by:
      call in interface Connector
      Parameters:
      uri - the uri
      Returns:
      the response
    • setCredentials

      public void setCredentials(Credentials credentials)
      Description copied from interface: Connector
      Binds Credentials to this connector.
      Specified by:
      setCredentials in interface Connector
      Parameters:
      credentials - the new credentials
    • getCredentials

      public Credentials getCredentials()
      Description copied from interface: Connector
      Returns the credents for this connector.
      Specified by:
      getCredentials in interface Connector
      Returns:
      the credentials
    • setEndpoint

      public void setEndpoint(String endpoint)
      Description copied from interface: Connector
      Sets the endpoint.
      Specified by:
      setEndpoint in interface Connector
      Parameters:
      endpoint - the new endpoint
    • getEndpoint

      public String getEndpoint()
      Description copied from interface: Connector
      Returns the endpoint to which this connector connects.
      Specified by:
      getEndpoint in interface Connector
      Returns:
      endpoint the endpoint
    • setConnectorSession

      public void setConnectorSession(ConnectorSession connectorSession)
      Description copied from interface: Connector
      Sets the connector session
      Specified by:
      setConnectorSession in interface Connector
      Parameters:
      connectorSession - ConnectorSession
    • getConnectorSession

      public ConnectorSession getConnectorSession()
      Description copied from interface: Connector
      Returns the connector session
      Specified by:
      getConnectorSession in interface Connector
      Returns:
      the connector session
    • toString

      public String toString()
      Overrides:
      toString in class Object