Package uk.gov.gchq.gaffer.graph.hook
Class NamedOperationResolver
- java.lang.Object
-
- uk.gov.gchq.gaffer.graph.hook.NamedOperationResolver
-
- All Implemented Interfaces:
GetFromCacheHook
,GraphHook
public class NamedOperationResolver extends Object implements GetFromCacheHook
AGraphHook
to resolve named operations.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEPTH_LIMIT_DEFAULT
Default depth the resolver will go when checking for nested named operations
-
Constructor Summary
Constructors Constructor Description NamedOperationResolver(String suffixNamedOperationCacheName)
NamedOperationResolver(String suffixNamedOperationCacheName, int depthLimit)
NamedOperationResolver(NamedOperationCache cache)
NamedOperationResolver(NamedOperationCache cache, int depthLimit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDepthLimit()
String
getSuffixCacheName()
<T> T
onFailure(T result, OperationChain<?> opChain, Context context, Exception e)
Called fromGraph
if an error occurs whilst executing theOperationChain
.<T> T
postExecute(T result, OperationChain<?> opChain, Context context)
Called fromGraph
after anOperationChain
is executed.void
preExecute(OperationChain<?> opChain, Context context)
Called fromGraph
before anOperationChain
is executed.
-
-
-
Field Detail
-
DEPTH_LIMIT_DEFAULT
public static final int DEPTH_LIMIT_DEFAULT
Default depth the resolver will go when checking for nested named operations- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NamedOperationResolver
public NamedOperationResolver(String suffixNamedOperationCacheName, int depthLimit)
-
NamedOperationResolver
public NamedOperationResolver(String suffixNamedOperationCacheName)
-
NamedOperationResolver
public NamedOperationResolver(NamedOperationCache cache)
-
NamedOperationResolver
public NamedOperationResolver(NamedOperationCache cache, int depthLimit)
-
-
Method Detail
-
getSuffixCacheName
public String getSuffixCacheName()
- Specified by:
getSuffixCacheName
in interfaceGetFromCacheHook
-
getDepthLimit
public int getDepthLimit()
-
preExecute
public void preExecute(OperationChain<?> opChain, Context context)
Description copied from interface:GraphHook
Called fromGraph
before anOperationChain
is executed.- Specified by:
preExecute
in interfaceGraphHook
- Parameters:
opChain
- theOperationChain
being executed. This can be modified/optimised in any GraphHook.context
- theContext
in which the operation chain was executed. The context also holds a reference to the original operation chain.
-
postExecute
public <T> T postExecute(T result, OperationChain<?> opChain, Context context)
Description copied from interface:GraphHook
Called fromGraph
after anOperationChain
is executed.- Specified by:
postExecute
in interfaceGraphHook
- Type Parameters:
T
- the result type- Parameters:
result
- the result from the operation chainopChain
- theOperationChain
that was executed. This can be modified/optimised in any GraphHook.context
- theContext
in which the operation chain was executed. The context also holds a reference to the original operation chain.- Returns:
- result object
-
onFailure
public <T> T onFailure(T result, OperationChain<?> opChain, Context context, Exception e)
Description copied from interface:GraphHook
Called fromGraph
if an error occurs whilst executing theOperationChain
.- Specified by:
onFailure
in interfaceGraphHook
- Type Parameters:
T
- the result type- Parameters:
result
- the result from the operation chain - likely to be null.opChain
- theOperationChain
that was executed. This can be modified/optimised in any GraphHook.context
- theContext
in which the operation chain was executed. The context also holds a reference to the original operation chain.e
- the exception- Returns:
- result object
-
-