public interface Connector
All connectors are scoped to a particular user and a particular endpoint. Create new connectors for new users and new endpoints.
All calls using a connector will be stamped with a user's connector credentials. These connector credentials usually consist of things like cookies, tokens, additional request parameters and other HTTP request state.
The caller does not have to pass this data manually. It is managed for the developer by the underlying ConnectorService during the factory construction of Connector objects.
If a connector is constructed without user information then no credential information is passed through - the connections are anonymous.
| Modifier and Type | Method and Description |
|---|---|
Response |
call(String uri)
Invokes a URI on a remote service.
|
Response |
call(String uri,
ConnectorContext context)
Invokes a URI on a remote service.
|
Response |
call(String uri,
ConnectorContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Invokes a URI on a remote service and streams back results to the
provided response object.
|
Response |
call(String uri,
ConnectorContext context,
InputStream in)
Invokes a URI on a remote service, passing the input as supplied via
a POST/PUT.
|
Response |
call(String uri,
ConnectorContext context,
InputStream in,
OutputStream out)
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 |
setConnectorSession(ConnectorSession connectorSession)
Sets the connector session
|
void |
setCredentials(Credentials credentials)
Binds Credentials to this connector.
|
void |
setEndpoint(String endpoint)
Sets the endpoint.
|
Response call(String uri)
uri - the uriResponse call(String uri, ConnectorContext context)
uri - the uricontext - the context of the invokeResponse call(String uri, ConnectorContext context, InputStream in)
uri - the uricontext - the context of the invokein - the input streamResponse call(String uri, ConnectorContext context, InputStream in, OutputStream out)
uri - the uricontext - the context of the invokein - the input streamout - the output streamResponse call(String uri, ConnectorContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
uri - the uricontext - the context of the invokereq - Request to proxy fromres - Response to proxy ontovoid setCredentials(Credentials credentials)
credentials - the new credentialsCredentials getCredentials()
void setEndpoint(String endpoint)
endpoint - the new endpointString getEndpoint()
void setConnectorSession(ConnectorSession connectorSession)
connectorSession - ConnectorSessionConnectorSession getConnectorSession()
Copyright © 2005–2021 Alfresco Software. All rights reserved.