Class EitherOperationHandler<O extends Operation>
- java.lang.Object
-
- uk.gov.gchq.gaffer.federated.simple.operation.handler.EitherOperationHandler<O>
-
- All Implemented Interfaces:
AddToCacheHandler<O>
,OperationHandler<O>
public class EitherOperationHandler<O extends Operation> extends Object implements AddToCacheHandler<O>
Custom handler for operations that could in theory target sub graphs or the federated store directly. Implements theAddToCacheHandler
interface so that this can also handle operations that add named operations etc.
-
-
Constructor Summary
Constructors Constructor Description EitherOperationHandler(OperationHandler<O> standardHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
doOperation(O operation, Context context, Store store)
If graph IDs are in the options the operation will be handled by aFederatedOperationHandler
, otherwise the original handler will be used e.g.String
getSuffixCacheName()
We might be handling an Operation that extendsAddToCacheHandler
so use the default handler for the suffix.
-
-
-
Constructor Detail
-
EitherOperationHandler
public EitherOperationHandler(OperationHandler<O> standardHandler)
-
-
Method Detail
-
doOperation
public Object doOperation(O operation, Context context, Store store) throws OperationException
If graph IDs are in the options the operation will be handled by aFederatedOperationHandler
, otherwise the original handler will be used e.g. executed on the federated store directly.- Specified by:
doOperation
in interfaceOperationHandler<O extends Operation>
- Parameters:
operation
- theOperation
to be executedcontext
- the operation chain context, containing the user who executed the operationstore
- theStore
the operation should be run on- Returns:
- the output for the operation or null.
- Throws:
OperationException
- thrown if the operation fails
-
getSuffixCacheName
public String getSuffixCacheName()
We might be handling an Operation that extendsAddToCacheHandler
so use the default handler for the suffix.- Specified by:
getSuffixCacheName
in interfaceAddToCacheHandler<O extends Operation>
-
-