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 Summary
FieldsModifier and TypeFieldDescriptionprotected ConnectorSessionprotected RemoteConfigElement.ConnectorDescriptorprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConnector(RemoteConfigElement.ConnectorDescriptor descriptor, String endpoint) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected RemoteClientbuildRemoteClient(String endpoint) Build a Remote Client instance by retrieving and configuring the "connector.remoteclient" bean.Invokes a URI on a remote service.Returns the connector sessionReturns the credents for this connector.Returns the endpoint to which this connector connects.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Sets the Spring application contextvoidsetConnectorSession(ConnectorSession connectorSession) Sets the connector sessionvoidsetCredentials(Credentials credentials) Binds Credentials to this connector.voidsetEndpoint(String endpoint) Sets the endpoint.toString()
-
Field Details
-
endpoint
-
descriptor
-
connectorSession
-
-
Constructor Details
-
AbstractConnector
Constructor.- Parameters:
descriptor- the descriptorendpoint- the endpoint
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) Sets the Spring application context- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
applicationContext- the Spring application context
-
buildRemoteClient
Build a Remote Client instance by retrieving and configuring the "connector.remoteclient" bean.- Parameters:
endpoint- Configured Endpoint ID for the remote client instance
-
call
Description copied from interface:ConnectorInvokes a URI on a remote service. The response data is buffered into a data element on the returned object of type Response. -
setCredentials
Description copied from interface:ConnectorBinds Credentials to this connector.- Specified by:
setCredentialsin interfaceConnector- Parameters:
credentials- the new credentials
-
getCredentials
Description copied from interface:ConnectorReturns the credents for this connector.- Specified by:
getCredentialsin interfaceConnector- Returns:
- the credentials
-
setEndpoint
Description copied from interface:ConnectorSets the endpoint.- Specified by:
setEndpointin interfaceConnector- Parameters:
endpoint- the new endpoint
-
getEndpoint
Description copied from interface:ConnectorReturns the endpoint to which this connector connects.- Specified by:
getEndpointin interfaceConnector- Returns:
- endpoint the endpoint
-
setConnectorSession
Description copied from interface:ConnectorSets the connector session- Specified by:
setConnectorSessionin interfaceConnector- Parameters:
connectorSession- ConnectorSession
-
getConnectorSession
Description copied from interface:ConnectorReturns the connector session- Specified by:
getConnectorSessionin interfaceConnector- Returns:
- the connector session
-
toString
-