|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connector
Describes a connector to a remote endpoint for a given user. All connectors are scoped to a particular user and a particular endpoint. As such, their endpoints and user bindings cannot be swapped once they are created. Rather, you should create new connectors for new users and new endpoints. A connector is scoped to a given user and a given endpoint. 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 it is scoped to a null user. No credential information is passed through and the connections are anonymous.
Method Summary | |
---|---|
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. |
Method Detail |
---|
Response call(String uri)
uri
- the uri
Response call(String uri, ConnectorContext context)
uri
- the uricontext
- the context of the invoke
Response call(String uri, ConnectorContext context, InputStream in)
uri
- the uricontext
- the context of the invokein
- the input stream
Response call(String uri, ConnectorContext context, InputStream in, OutputStream out)
uri
- the uricontext
- the context of the invokein
- the input streamout
- the output stream
Response 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 onto
void setCredentials(Credentials credentials)
credentials
- the new credentialsCredentials getCredentials()
void setEndpoint(String endpoint)
endpoint
- the new endpointString getEndpoint()
void setConnectorSession(ConnectorSession connectorSession)
connectorSession
- ConnectorSession getConnectorSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |