Class AbstractConnector

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, Connector
    Direct Known Subclasses:
    HttpConnector

    public abstract class AbstractConnector
    extends java.lang.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:
    AbstractAuthenticator
    • Constructor Detail

      • AbstractConnector

        protected AbstractConnector​(RemoteConfigElement.ConnectorDescriptor descriptor,
                                    java.lang.String endpoint)
        Constructor.
        Parameters:
        descriptor - the descriptor
        endpoint - the endpoint
    • Method Detail

      • 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​(java.lang.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​(java.lang.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​(java.lang.String endpoint)
        Description copied from interface: Connector
        Sets the endpoint.
        Specified by:
        setEndpoint in interface Connector
        Parameters:
        endpoint - the new endpoint
      • getEndpoint

        public java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object