public interface SecureServiceClient
The interface for a secure invocation client to use with mashables that require a security profile (a specific protocol for secure connections and/or authentication information). Secure invocation clients handle all aspects of adding authentication to requests, making secure or unsecure connections to mashable information sources and invoking those sources.
Presto provides built-in security profiles, and their corresponding secure invocation clients, for many common authentication protocols used by mashable information sources, such as HTTP Basic Authentication. You can also define custom security profiles to use with mashables that have unique requirements.
With custom security profiles, you must provide the secure invocation client for that profile. You may implement this interface
or extend the BaseSecureServiceClient
convenience class to create a custom secure invocation client.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection to the mashable.
|
java.io.InputStream |
getData(java.lang.String requestData,
ServiceInvocationContext invCtx)
Invokes a mashable for this type of security profile for a specific request that Presto has received from clients or from
mashups.
|
java.io.InputStream |
getMetadata(java.lang.String requestData,
ServiceInvocationContext invCtx)
Invokes a mashable for this type of security profile during registration of the mashable in Presto.
|
java.util.Map<java.lang.String,java.lang.String> |
getResponseHeaders()
Returns the HTTP response headers from the mashable response to an invocation.
|
int |
getStatusCode()
Returns the HTTP status code from the mashable response to an invocation.
|
java.lang.String |
getStatusText()
Returns the HTTP status text from the mashable response to an invocation.
|
java.io.InputStream getMetadata(java.lang.String requestData, ServiceInvocationContext invCtx) throws SecureServiceClientException
Invokes a mashable for this type of security profile during registration of the mashable in Presto. Invocation during registration is used primarily to verify that the endpoint is valid, a connection can be created and that the mashable can successfully be invoked.
requestData
- The request payload sent to Presto to invoke this mashable.invCtx
- A ServiceInvocationContext object with context information for this invocation. This includes the security profile
for this mashable and other metadata.SecureServiceClientException
java.io.InputStream getData(java.lang.String requestData, ServiceInvocationContext invCtx) throws SecureServiceClientException
Invokes a mashable for this type of security profile for a specific request that Presto has received from clients or from mashups.
requestData
- The request payload sent to Presto to invoke this mashable.invCtx
- A ServiceInvocationContext object with context information for this invocation. This includes the security profile
for this mashable and other metadata.SecureServiceClientException
java.util.Map<java.lang.String,java.lang.String> getResponseHeaders()
Returns the HTTP response headers from the mashable response to an invocation. Headers are returned as a Map.
int getStatusCode()
Returns the HTTP status code from the mashable response to an invocation.
java.lang.String getStatusText()
Returns the HTTP status text from the mashable response to an invocation.
void close()
Closes the connection to the mashable.