flux
Interface RestAction

All Superinterfaces:
Action, java.lang.Cloneable, RuntimeDataMap, java.io.Serializable

public interface RestAction
extends Action

Invokes a REST service with support for SSL encryption, security certificates, multipart messages, and other REST capabilities.

The REST Action returns its result in the flow context variable "RESULT". The following table contains more information on accessing and using the result.

Flow Context Variable Field Java Type Description
RESULTresponseCodeintThe HTTP response code from the server after invoking the REST service.
RESULTresponseStatusjava.lang.StringThe HTTP response status from the server after invoking the REST service.
RESULTresultjava.lang.ObjectThe object returned from the REST service call.
RESULTtypejava.lang.StringThe HTTP media type of the object contained in the "result" field.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Nested Class Summary
static class RestAction.RestActionResult
          The response from the REST service.
 
Method Summary
 RestActionType getActionType()
          Returns the kind of HTTP action to perform against the REST service.
 java.net.URL getBaseUrl()
          Returns the base URL that defines how the REST service is accessed and used.
 java.lang.String getBaseUrlAsString()
          Returns the base URL that defines how the REST service is accessed and used.
 java.util.Properties getBodyParts()
          Returns the optional body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service.
 java.lang.String getContentType()
          Returns the optional "Content-Type" header in the HTTP request to the REST service.
 java.util.Properties getHeaders()
          Returns the optional headers set in the HTTP request to the REST service.
 java.lang.String getKeystoreFilename()
          Returns the optional filename that references a keystore on the file system; a keystore contains a collection of private keys and associated certificates.
 java.lang.String getKeystorePassword()
          Returns the password for the keystore.
 java.util.Properties getNamespaces()
          Returns the optional XML namespaces for resolving an XPath query.
 java.lang.String getPassword()
          Returns the optional password used to access the REST service, assuming the service is secured with basic authentication.
 java.util.Properties getQueryParameters()
          Returns the optional input string data that are used as query parameters to the REST service.
 java.lang.Object getRequestEntity()
          Returns the optional request entity to be sent with an HTTP POST or PUT action.
 java.lang.Class getResponseType()
          Returns the type of the response from the REST service.
 java.lang.String getResponseTypeAsString()
          Returns the type of the response from the REST service.
 java.lang.String getTruststoreFilename()
          Returns the optional filename that references a truststore on the file system; a truststore contains only the certificates trusted by the client.
 java.lang.String getTruststorePassword()
          Returns the password for the truststore.
 java.lang.String getUsername()
          Returns the optional username used to access the REST service, assuming the service is secured with basic authentication.
 java.lang.String getXpathExpression()
          Returns the optional XPath expression used to query the response from the REST service.
 java.lang.Class getXpathResponseType()
          Returns the optional type of the response from an XPath query.
 java.lang.String getXpathResponseTypeAsString()
          Returns the optional type of the response from an XPath query.
 boolean isInteractiveAuthenticationEnabled()
          Indicates that the client should interactively prompt for credentials should it receive a 401 response.
 boolean isPreemptiveAuthenticationEnabled()
          Indicates that the client should send an authentication request even before the server gives a 401 response.
 boolean isSslEnabled()
          Indicates that the client should use SSL for communication.
 void setActionType(RestActionType actionType)
          Sets the kind of HTTP action to perform against the REST service.
 void setBaseUrl(java.net.URL baseUrl)
          Sets the base URL that defines how the REST service is accessed and used.
 void setBaseUrlAsString(java.lang.String baseUrl)
          Sets the base URL that defines how the REST service is accessed and used.
 void setBodyParts(java.util.Properties bodyParts)
          Sets the body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service.
 void setContentType(java.lang.String contentType)
          Sets the optional "Content-Type" header in the HTTP request to the REST service.
 void setHeaders(java.util.Properties headers)
          Sets the optional headers set in the HTTP request to the REST service.
 void setInteractiveAuthenticationEnabled(boolean enabled)
          Sets whether the client should interactively prompt for credentials should it receive a 401 response.
 void setKeystoreFilename(java.lang.String keyStore)
          Sets the optional filename that references a keystore on the file system; a keystore contains a collection of private keys and associated certificates.
 void setKeystorePassword(java.lang.String keystorePassword)
          Sets the password for the keystore.
 void setNamespaces(java.util.Properties namespaces)
          Sets the optional XML namespaces for resolving an XPath query.
 void setPassword(java.lang.String password)
          Sets the optional password used to access the REST service, assuming the service is secured with basic authentication.
 void setPreemptiveAuthenticationEnabled(boolean enabled)
          Sets whether the client should send an authentication request even before the server gives a 401 response.
 void setQueryParameters(java.util.Properties queryParameters)
          Sets the optional input string data that are used as query parameters to the REST service.
 void setRequestEntity(java.lang.Object requestEntity)
          Sets the optional request entity to be sent with an HTTP POST or PUT action.
 void setResponseType(java.lang.Class responseType)
          Sets the type of the response from the REST service.
 void setResponseTypeAsString(java.lang.String responseType)
          Sets the type of the response from the REST service.
 void setSslEnabled(boolean sslEnabled)
          Sets whether the client should use SSL for communication.
 void setTruststoreFilename(java.lang.String trustStore)
          Sets the optional filename that references a truststore on the file system; a truststore contains only the certificates trusted by the client.
 void setTruststorePassword(java.lang.String truststorePassword)
          Sets the password for the truststore.
 void setUsername(java.lang.String username)
          Sets the optional username used to access the REST service, assuming the service is secured with basic authentication.
 void setXpathExpression(java.lang.String xpathExpression)
          Sets the optional XPath expression used to query the response from the REST service.
 void setXpathResponseType(java.lang.Class xpathResponseType)
          Sets the optional type of the response from an XPath query.
 void setXpathResponseTypeAsString(java.lang.String xpathResponseType)
          Sets the optional type of the response from an XPath query.
 
Methods inherited from interface flux.Action
addFlow, addFlow, addSignalFlow, clone, execute, getDescription, getFlows, getHiddenVariableNames, getJoinExpression, getName, getPostscript, getPostscriptLanguage, getPrescript, getPrescriptLanguage, getResultInfo, getSignalsToMonitor, getTimeoutBusinessInterval, getTimeoutBusinessIntervalNamespace, getTimeoutExpression, getVariableManager, isEndOfRun, isJoinPoint, isSkippable, isStartAction, isStartOfRun, isTransactionBreak, removeFlow, reset, setDescription, setElseFlow, setEndOfRun, setErrorFlow, setErrorFlowWithoutRollback, setErrorFlowWithRollback, setJoinExpression, setJoinPoint, setName, setPostscript, setPostscriptLanguage, setPrescript, setPrescriptLanguage, setSignalsToMonitor, setSkippable, setStartAction, setStartOfRun, setTimeoutBusinessInterval, setTimeoutBusinessIntervalNamespace, setTimeoutExpression, setTimeoutFlow, setTransactionBreak, verify, verifyOnClient
 
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap
getRuntimeDataMap, setRuntimeDataMap
 

Method Detail

getActionType

RestActionType getActionType()
Returns the kind of HTTP action to perform against the REST service. Valid actions include GET, POST, PUT, and DELETE. Defaults to GET.

Returns:
The kind of HTTP action to perform against the REST service.

getBaseUrl

java.net.URL getBaseUrl()
                        throws java.lang.IllegalStateException
Returns the base URL that defines how the REST service is accessed and used.

Returns:
Returns the base URL that defines how the REST service is accessed and used.
Throws:
java.lang.IllegalStateException - If the URL to be returned is invalid.
See Also:
getBaseUrlAsString()

getBaseUrlAsString

java.lang.String getBaseUrlAsString()
Returns the base URL that defines how the REST service is accessed and used.

Returns:
Returns the base URL that defines how the REST service is accessed and used.
See Also:
getBaseUrl()

getBodyParts

java.util.Properties getBodyParts()
Returns the optional body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service. The key to each property is the name of the body part. The corresponding value is a filename that references the contents of that body part.

Returns:
The optional body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service. Does not return null.

getContentType

java.lang.String getContentType()
Returns the optional "Content-Type" header in the HTTP request to the REST service. Typical content types include "text/plain" and "text/xml". By default, there is no content type.

Returns:
The optional "Content-Type" header in the HTTP request to the REST service.

getHeaders

java.util.Properties getHeaders()
Returns the optional headers set in the HTTP request to the REST service. Typical headers include "User-Agent: Flux Scheduler/7.11". The User-Agent header contains information about the user agent originating the request.

Returns:
The optional headers set in the HTTP request to the REST service. Does not return null.

getKeystoreFilename

java.lang.String getKeystoreFilename()
Returns the optional filename that references a keystore on the file system; a keystore contains a collection of private keys and associated certificates. Keystores are managed by Java's keytool utility, which is part of the JDK installation.

Returns:
The optional keystore filename.

getKeystorePassword

java.lang.String getKeystorePassword()
Returns the password for the keystore. If the keystore filename is set, the keystore password must be non-null and non-empty.

Returns:
The password for the keystore.

getNamespaces

java.util.Properties getNamespaces()
Returns the optional XML namespaces for resolving an XPath query. The key to the map is the namespace prefix. The corresponding value is the target namespace.

Returns:
The optional XML namespaces for resolving an XPath query.

getPassword

java.lang.String getPassword()
Returns the optional password used to access the REST service, assuming the service is secured with basic authentication.

Returns:
The optional password used to access the REST service, assuming the service is secured with basic authentication.

getQueryParameters

java.util.Properties getQueryParameters()
Returns the optional input string data that are used as query parameters to the REST service.

Returns:
The input string data that are used as query parameters to the REST service.

getUsername

java.lang.String getUsername()
Returns the optional username used to access the REST service, assuming the service is secured with basic authentication.

Returns:
The optional username used to access the REST service, assuming the service is secured with basic authentication.

getRequestEntity

java.lang.Object getRequestEntity()
Returns the optional request entity to be sent with an HTTP POST or PUT action.

Returns:
The request entity to be sent with an HTTP POST or PUT action.

getResponseType

java.lang.Class getResponseType()
                                throws java.lang.IllegalStateException
Returns the type of the response from the REST service. Defaults to java.lang.String.

Returns:
The type of the response from the REST service.
Throws:
java.lang.IllegalStateException - If the Java class to be returned cannot be loaded into the JVM.
See Also:
getResponseTypeAsString()

getResponseTypeAsString

java.lang.String getResponseTypeAsString()
Returns the type of the response from the REST service. Defaults to java.lang.String.

Returns:
The type of the response from the REST service.
See Also:
getResponseType()

getTruststoreFilename

java.lang.String getTruststoreFilename()
Returns the optional filename that references a truststore on the file system; a truststore contains only the certificates trusted by the client. Truststores are managed by Java's keytool utility, which is part of the JDK installation.

Returns:
The optional truststore filename.

getTruststorePassword

java.lang.String getTruststorePassword()
Returns the password for the truststore. If the truststore filename is set, the truststore password must be non-null and non-empty.

Returns:
The password for the truststore.

getXpathExpression

java.lang.String getXpathExpression()
Returns the optional XPath expression used to query the response from the REST service.

Returns:
The optional XPath expression used to query the response from the REST service.

getXpathResponseType

java.lang.Class getXpathResponseType()
                                     throws java.lang.IllegalStateException
Returns the optional type of the response from an XPath query.

Returns:
The optional type of the response from an XPath query.
Throws:
java.lang.IllegalStateException - If the Java class to be returned cannot be loaded into the JVM.
See Also:
getXpathResponseTypeAsString()

getXpathResponseTypeAsString

java.lang.String getXpathResponseTypeAsString()
Returns the optional type of the response from an XPath query.

Returns:
The optional type of the response from an XPath query.
See Also:
getXpathResponseType()

isInteractiveAuthenticationEnabled

boolean isInteractiveAuthenticationEnabled()
Indicates that the client should interactively prompt for credentials should it receive a 401 response. Defaults to false.

Returns:
Whether the client should interactively prompt for credentials should it receive a 401 response.

isPreemptiveAuthenticationEnabled

boolean isPreemptiveAuthenticationEnabled()
Indicates that the client should send an authentication request even before the server gives a 401 response. Defaults to false.

Returns:
Whether the client should send an authentication request even before the server gives a 401 response.

isSslEnabled

boolean isSslEnabled()
Indicates that the client should use SSL for communication. Defaults to false.

Returns:
Whether the client should use SSL for communication.

setActionType

void setActionType(RestActionType actionType)
Sets the kind of HTTP action to perform against the REST service. Valid actions include GET, POST, PUT, and DELETE.

Parameters:
actionType - The kind of HTTP action to perform against the REST service. Cannot be null.
Throws:
java.lang.IllegalArgumentException - If actionType is null.

setBaseUrl

void setBaseUrl(java.net.URL baseUrl)
Sets the base URL that defines how the REST service is accessed and used.

Parameters:
baseUrl - The base URL that defines how the REST service is accessed and used.
See Also:
setBaseUrlAsString(String)

setBaseUrlAsString

void setBaseUrlAsString(java.lang.String baseUrl)
Sets the base URL that defines how the REST service is accessed and used.

Parameters:
baseUrl - The base URL that defines how the REST service is accessed and used.
See Also:
setBaseUrl(URL)

setBodyParts

void setBodyParts(java.util.Properties bodyParts)
Sets the body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service. The key to each property is the name of the body part. The corresponding value is a filename that references the contents of that body part.

Parameters:
bodyParts - The body parts, commonly called file attachments, that are set in a multipart HTTP request to the REST service.

setContentType

void setContentType(java.lang.String contentType)
Sets the optional "Content-Type" header in the HTTP request to the REST service. Typical content types include "text/plain" and "text/xml".

Parameters:
contentType - The optional "Content-Type" header in the HTTP request to the REST service.

setHeaders

void setHeaders(java.util.Properties headers)
Sets the optional headers set in the HTTP request to the REST service. Typical headers include "User-Agent: Flux Scheduler/7.10". The User-Agent header contains information about the user agent originating the request.

Parameters:
headers - The optional headers set in the HTTP request to the REST service.

setInteractiveAuthenticationEnabled

void setInteractiveAuthenticationEnabled(boolean enabled)
Sets whether the client should interactively prompt for credentials should it receive a 401 response.

Parameters:
enabled - Whether the client should interactively prompt for credentials should it receive a 401 response.

setKeystoreFilename

void setKeystoreFilename(java.lang.String keyStore)
Sets the optional filename that references a keystore on the file system; a keystore contains a collection of private keys and associated certificates. Keystores are managed by Java's keytool utility, which is part of the JDK installation.

Parameters:
keyStore - The optional keystore filename.

setKeystorePassword

void setKeystorePassword(java.lang.String keystorePassword)
Sets the password for the keystore. If the keystore filename is set, the keystore password must be non-null and non-empty.

Parameters:
keystorePassword - The password for the keystore.

setNamespaces

void setNamespaces(java.util.Properties namespaces)
Sets the optional XML namespaces for resolving an XPath query. The key to the map is the namespace prefix. The corresponding value is the target namespace.

Parameters:
namespaces - The optional XML namespaces for resolving an XPath query.

setPassword

void setPassword(java.lang.String password)
Sets the optional password used to access the REST service, assuming the service is secured with basic authentication.

Parameters:
password - The optional password used to access the REST service, assuming the service is secured with basic authentication.

setPreemptiveAuthenticationEnabled

void setPreemptiveAuthenticationEnabled(boolean enabled)
Sets whether the client should send an authentication request even before the server gives a 401 response.

Parameters:
enabled - Whether the client should send an authentication request even before the server gives a 401 response.

setQueryParameters

void setQueryParameters(java.util.Properties queryParameters)
Sets the optional input string data that are used as query parameters to the REST service.

Parameters:
queryParameters - The input string data that are used as query parameters to the REST service.

setRequestEntity

void setRequestEntity(java.lang.Object requestEntity)
Sets the optional request entity to be sent with an HTTP POST or PUT action.

Parameters:
requestEntity - The request entity to be sent with an HTTP POST or PUT action.

setResponseType

void setResponseType(java.lang.Class responseType)
Sets the type of the response from the REST service.

Parameters:
responseType - The type of the response from the REST service.
See Also:
setResponseTypeAsString(String)

setResponseTypeAsString

void setResponseTypeAsString(java.lang.String responseType)
Sets the type of the response from the REST service.

Parameters:
responseType - The type of the response from the REST service.
See Also:
setResponseType(Class)

setSslEnabled

void setSslEnabled(boolean sslEnabled)
Sets whether the client should use SSL for communication.

Parameters:
sslEnabled - Whether the client should use SSL for communication.

setTruststoreFilename

void setTruststoreFilename(java.lang.String trustStore)
Sets the optional filename that references a truststore on the file system; a truststore contains only the certificates trusted by the client. Truststores are managed by Java's keytool utility, which is part of the JDK installation.

Parameters:
trustStore - The optional truststore filename.

setTruststorePassword

void setTruststorePassword(java.lang.String truststorePassword)
Sets the password for the truststore. If the truststore filename is set, the truststore password must be non-null and non-empty.

Parameters:
truststorePassword - The password for the truststore.

setUsername

void setUsername(java.lang.String username)
Sets the optional username used to access the REST service, assuming the service is secured with basic authentication.

Parameters:
username - The optional username used to access the REST service, assuming the service is secured with basic authentication.

setXpathExpression

void setXpathExpression(java.lang.String xpathExpression)
Sets the optional XPath expression used to query the response from the REST service.

Parameters:
xpathExpression - The optional XPath expression used to query the response from the REST service.

setXpathResponseType

void setXpathResponseType(java.lang.Class xpathResponseType)
Sets the optional type of the response from an XPath query.

Parameters:
xpathResponseType - The optional type of the response from an XPath query.
See Also:
setXpathResponseTypeAsString(String)

setXpathResponseTypeAsString

void setXpathResponseTypeAsString(java.lang.String xpathResponseType)
Sets the optional type of the response from an XPath query.

Parameters:
xpathResponseType - The optional type of the response from an XPath query.
See Also:
setXpathResponseType(Class)


© 2014 Flux Corporation. All rights reserved.