public interface AutomationService
Modifier and Type | Method and Description |
---|---|
CompiledChain |
compileChain(Class<?> inputType,
OperationChain chain)
Builds the operation chain given a context.
|
CompiledChain |
compileChain(Class<?> inputType,
OperationParameters... chain)
Same as previous but takes an array of operation parameters
|
<T> T |
getAdaptedValue(OperationContext ctx,
Object toAdapt,
Class<?> targetType)
Adapts an object to a target type if possible otherwise throws an
exception.
|
AutomationFilter |
getAutomationFilter(String id) |
AutomationFilter[] |
getAutomationFilters() |
ChainException |
getChainException(String onChainId) |
ChainException[] |
getChainExceptions() |
List<OperationDocumentation> |
getDocumentation()
Generates a documentation model for all registered operations.
|
OperationType |
getOperation(String id)
Gets an operation type given its ID.
|
OperationChain |
getOperationChain(String id)
Gets a registered operation chain.
|
List<OperationChain> |
getOperationChains()
Gets a list of all registered chains
|
OperationType[] |
getOperations()
Gets all operation types that was registered.
|
TypeAdapter |
getTypeAdapter(Class<?> accept,
Class<?> produce)
Gets a type adapter for the input type accept and the output type
produce.
|
boolean |
hasChainException(String onChainId) |
boolean |
hasOperation(String id) |
boolean |
isTypeAdaptable(Class<?> typeToAdapt,
Class<?> targetType)
Checks whether or not the given type is adaptable into the target type.
|
void |
putAutomationFilter(AutomationFilter automationFilter) |
void |
putChainException(ChainException exceptionChain) |
void |
putOperation(Class<?> type)
Registers an operation given its class.
|
void |
putOperation(Class<?> type,
boolean replace)
Registers an operation given its class.
|
void |
putOperation(Class<?> type,
boolean replace,
String contributingComponent)
Registers an operation given its class.
|
void |
putOperationChain(OperationChain chain)
Registers a parametrized operation chain.
|
void |
putOperationChain(OperationChain chain,
boolean replace)
Registers a parametrized operation chain.
|
void |
putTypeAdapter(Class<?> accept,
Class<?> produce,
TypeAdapter adapter)
Registers a new type adapter that can adapt an instance of the accepted
type into one of the produced type.
|
void |
removeAutomationFilter(AutomationFilter automationFilter) |
void |
removeExceptionChain(ChainException exceptionChain) |
void |
removeOperation(Class<?> key)
Removes an operation given its class.
|
void |
removeOperationChain(String id)
Removes a registered operation chain given its ID.
|
void |
removeTypeAdapter(Class<?> accept,
Class<?> produce)
Removes a type adapter
|
Object |
run(OperationContext ctx,
OperationChain chain)
Builds and runs the operation chain given a context.
|
Object |
run(OperationContext ctx,
String chainId)
Same as previous but for managed chains identified by an ID.
|
Object |
run(OperationContext ctx,
String id,
Map<String,Object> params)
Shortcut to execute a single operation described by the given ID and map
of parameters
|
void putOperation(Class<?> type) throws OperationException
Operation
annotation. If an operation having the
same ID exists an exception will be thrown.OperationException
void putOperation(Class<?> type, boolean replace) throws OperationException
Operation
annotation. If the
replace
argument is true then any existing operation having
the same ID will replaced with this one.OperationException
void putOperation(Class<?> type, boolean replace, String contributingComponent) throws OperationException
Operation
annotation. If the
replace
argument is true then any existing operation having
the same ID will replaced with this one. Third argument represents the
name of the component registring the operationOperationException
void removeOperation(Class<?> key)
OperationType[] getOperations()
OperationType getOperation(String id) throws OperationNotFoundException
OperationNotFoundException
CompiledChain compileChain(Class<?> inputType, OperationChain chain) throws Exception, InvalidChainException
InvalidChainException
is thrown.
The returned object can be used to run the chain.Exception
InvalidChainException
CompiledChain compileChain(Class<?> inputType, OperationParameters... chain) throws Exception, InvalidChainException
Exception
InvalidChainException
Object run(OperationContext ctx, OperationChain chain) throws OperationException, InvalidChainException, Exception
InvalidChainException
is thrown.Object run(OperationContext ctx, String chainId) throws OperationException, InvalidChainException, Exception
Object run(OperationContext ctx, String id, Map<String,Object> params) throws OperationException, InvalidChainException, Exception
void putOperationChain(OperationChain chain) throws OperationException
run
and passing the chain ID. If a chain
having the same ID exists an exception is thrownOperationException
void putOperationChain(OperationChain chain, boolean replace) throws OperationException
run
and passing the chain ID. If the
replace attribute is true then any chain already registered under the
same id will be replaced otherwise an exception is thrown.OperationException
void removeOperationChain(String id)
OperationChain getOperationChain(String id) throws OperationNotFoundException
OperationNotFoundException
List<OperationChain> getOperationChains()
void putTypeAdapter(Class<?> accept, Class<?> produce, TypeAdapter adapter)
TypeAdapter getTypeAdapter(Class<?> accept, Class<?> produce)
<T> T getAdaptedValue(OperationContext ctx, Object toAdapt, Class<?> targetType) throws Exception
Exception
boolean isTypeAdaptable(Class<?> typeToAdapt, Class<?> targetType)
This is a shortcut to
getTypeAdapter(typeToAdapt, targetType) != null
List<OperationDocumentation> getDocumentation() throws OperationException
OperationException
boolean hasOperation(String id)
id
- operation IDvoid putChainException(ChainException exceptionChain)
void removeExceptionChain(ChainException exceptionChain)
ChainException[] getChainExceptions()
ChainException getChainException(String onChainId)
void putAutomationFilter(AutomationFilter automationFilter)
void removeAutomationFilter(AutomationFilter automationFilter)
AutomationFilter getAutomationFilter(String id)
AutomationFilter[] getAutomationFilters()
boolean hasChainException(String onChainId)
Copyright © 2013 Nuxeo SA. All Rights Reserved.