|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FunctionContext
The context in which a Function
is executed.
Method Summary | ||
---|---|---|
Location |
appliedAt()
Get the location of the node at which the function is to be applied. |
|
RequestBuilder |
builder()
Return a build that can be used to build, immediately execute, and return the executed requests. |
|
void |
execute(Request request)
Immediately execute the supplied request on this connector. |
|
ExecutionContext |
getExecutionContext()
The context in which this function is executing. |
|
DateTime |
getNowInUtc()
Get the 'current time' for this processor, which is usually a constant during its lifetime. |
|
Object |
input(String name)
Get the value for the named input to this function. |
|
|
input(String name,
Class<T> type)
Get the value for the named input to this function. |
|
|
input(String name,
Class<T> type,
T defaultValue)
Get the value for the named input to this function. |
|
|
input(String name,
PropertyType type,
T defaultValue)
Get the value for the named input to this function. |
|
boolean |
isCancelled()
Determine whether this execution has been cancelled. |
|
|
output(String name,
Class<T> type,
T defaultValue)
Get the value for the named output to this function. |
|
|
output(String name,
PropertyType type,
T defaultValue)
Get the value for the named output to this function. |
|
void |
setError(Throwable t)
Record that an error occurred. |
|
void |
setOutput(String name,
Serializable value)
Set the value for the named output parameter for the function. |
|
String |
workspace()
Get the name of the workspace in which this function is being applied. |
Method Detail |
---|
ExecutionContext getExecutionContext()
Location appliedAt()
String workspace()
Object input(String name)
name
- the name of the input parameter
<T> T input(String name, Class<T> type)
PropertyType
, then the
value will be converted to the specified type using the ExecutionContext
's ValueFactories
. Otherwise, the
value will simply be cast to the supplied type.
T
- the desired type of the valuename
- the name of the input parametertype
- the expected type of the value
ValueFormatException
- if the conversion from to the expected value could not be performed<T> T input(String name, Class<T> type, T defaultValue)
PropertyType
, then the
value will be converted to the specified type using the ExecutionContext
's ValueFactories
. Otherwise, the
value will simply be cast to the supplied type.
T
- the desired type of the valuename
- the name of the input parametertype
- the expected type of the valuedefaultValue
- the default value for the parameter
ValueFormatException
- if the conversion from to the expected value could not be performed<T> T input(String name, PropertyType type, T defaultValue)
ExecutionContext
's ValueFactories
.
T
- the desired type of the valuename
- the name of the input parametertype
- the expected type of the valuedefaultValue
- the default value for the parameter
ValueFormatException
- if the conversion from to the expected value could not be performed<T> T output(String name, Class<T> type, T defaultValue)
PropertyType
, then the
value will be converted to the specified type using the ExecutionContext
's ValueFactories
. Otherwise, the
value will simply be cast to the supplied type.
This is a convenience method, as the value would have already been set by the same function invocation using
setOutput(String, Serializable)
.
T
- the desired type of the valuename
- the name of the output parametertype
- the expected type of the valuedefaultValue
- the default value for the parameter
ValueFormatException
- if the conversion from to the expected value could not be performed<T> T output(String name, PropertyType type, T defaultValue)
ExecutionContext
's ValueFactories
.
This is a convenience method, as the value would have already been set by the same function invocation using
setOutput(String, Serializable)
.
T
- the desired type of the valuename
- the name of the output parametertype
- the expected type of the valuedefaultValue
- the default value for the parameter
ValueFormatException
- if the conversion from to the expected value could not be performedvoid setOutput(String name, Serializable value)
name
- the name of the output parameter; may not be nullvalue
- the value for the named parameter; must be Serializable
void execute(Request request)
has an error
, and if that error results in an error condition of the caller,
then the caller is responsible for setting the error on this context
.
request
- the request to be performed; may not be nullbuilder()
RequestBuilder builder()
execute(Request)
them manually.
execute(Request)
DateTime getNowInUtc()
void setError(Throwable t)
t
- the exceptionboolean isCancelled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |