public abstract class AbstractConnector extends Object implements Connector, org.springframework.context.ApplicationContextAware
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.
AbstractAuthenticator| Modifier and Type | Field and Description |
|---|---|
protected ConnectorSession |
connectorSession |
protected RemoteConfigElement.ConnectorDescriptor |
descriptor |
protected String |
endpoint |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractConnector(RemoteConfigElement.ConnectorDescriptor descriptor,
String endpoint)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected RemoteClient |
buildRemoteClient(String endpoint)
Build a Remote Client instance by retrieving and configuring the "connector.remoteclient" bean.
|
Response |
call(String uri)
Invokes a URI on a remote service.
|
ConnectorSession |
getConnectorSession()
Returns the connector session
|
Credentials |
getCredentials()
Returns the credents for this connector.
|
String |
getEndpoint()
Returns the endpoint to which this connector connects.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Sets the Spring application context
|
void |
setConnectorSession(ConnectorSession connectorSession)
Sets the connector session
|
void |
setCredentials(Credentials credentials)
Binds Credentials to this connector.
|
void |
setEndpoint(String endpoint)
Sets the endpoint.
|
String |
toString() |
protected String endpoint
protected RemoteConfigElement.ConnectorDescriptor descriptor
protected ConnectorSession connectorSession
protected AbstractConnector(RemoteConfigElement.ConnectorDescriptor descriptor, String endpoint)
descriptor - the descriptorendpoint - the endpointpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - the Spring application contextprotected RemoteClient buildRemoteClient(String endpoint)
endpoint - Configured Endpoint ID for the remote client instancepublic Response call(String uri)
Connectorpublic void setCredentials(Credentials credentials)
ConnectorsetCredentials in interface Connectorcredentials - the new credentialspublic Credentials getCredentials()
ConnectorgetCredentials in interface Connectorpublic void setEndpoint(String endpoint)
ConnectorsetEndpoint in interface Connectorendpoint - the new endpointpublic String getEndpoint()
ConnectorgetEndpoint in interface Connectorpublic void setConnectorSession(ConnectorSession connectorSession)
ConnectorsetConnectorSession in interface ConnectorconnectorSession - ConnectorSessionpublic ConnectorSession getConnectorSession()
ConnectorgetConnectorSession in interface ConnectorCopyright © 2005–2021 Alfresco Software. All rights reserved.