use of uk.gov.gchq.gaffer.store.operation.handler.export.set.GetSetExportHandler in project Gaffer by gchq.
the class Store method addCoreOpHandlers.
private void addCoreOpHandlers() {
// Add elements
addOperationHandler(AddElements.class, getAddElementsHandler());
// Get Elements
addOperationHandler(GetElements.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetEntities.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetEdges.class, (OperationHandler) getGetElementsHandler());
// Get Adjacent
addOperationHandler(GetAdjacentEntitySeeds.class, (OperationHandler) getAdjacentEntitySeedsHandler());
// Get All Elements
addOperationHandler(GetAllElements.class, (OperationHandler) getGetAllElementsHandler());
addOperationHandler(GetAllEntities.class, (OperationHandler) getGetAllElementsHandler());
addOperationHandler(GetAllEdges.class, (OperationHandler) getGetAllElementsHandler());
// Deprecated Get operations
addOperationHandler(GetEdgesBySeed.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetElementsBySeed.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetEntitiesBySeed.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetRelatedEdges.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetRelatedElements.class, (OperationHandler) getGetElementsHandler());
addOperationHandler(GetRelatedEntities.class, (OperationHandler) getGetElementsHandler());
// Export
addOperationHandler(ExportToSet.class, new ExportToSetHandler());
addOperationHandler(GetSetExport.class, new GetSetExportHandler());
addOperationHandler(GetExports.class, new GetExportsHandler());
// Jobs
addOperationHandler(GetJobDetails.class, new GetJobDetailsHandler());
addOperationHandler(GetAllJobDetails.class, new GetAllJobDetailsHandler());
addOperationHandler(GetJobResults.class, new GetJobResultsHandler());
// Other
addOperationHandler(GenerateElements.class, new GenerateElementsHandler<>());
addOperationHandler(GenerateObjects.class, new GenerateObjectsHandler<>());
addOperationHandler(Validate.class, new ValidateHandler());
addOperationHandler(Deduplicate.class, new DeduplicateHandler());
addOperationHandler(CountGroups.class, new CountGroupsHandler());
addOperationHandler(Limit.class, new LimitHandler());
}
use of uk.gov.gchq.gaffer.store.operation.handler.export.set.GetSetExportHandler in project Gaffer by gchq.
the class StoreTest method shouldCreateStoreWithValidSchemasAndRegisterOperations.
@Test
public void shouldCreateStoreWithValidSchemasAndRegisterOperations() throws StoreException {
// Given
final StoreProperties properties = mock(StoreProperties.class);
final StoreImpl store = new StoreImpl();
final OperationHandler<AddElements, Void> addElementsHandlerOverridden = mock(OperationHandler.class);
final OperationDeclarations opDeclarations = new OperationDeclarations.Builder().declaration(new OperationDeclaration.Builder().operation(AddElements.class).handler(addElementsHandlerOverridden).build()).build();
given(properties.getOperationDeclarations()).willReturn(opDeclarations);
// When
store.initialise(schema, properties);
// Then
assertNotNull(store.getOperationHandlerExposed(Validate.class));
assertSame(addElementsHandlerOverridden, store.getOperationHandlerExposed(AddElements.class));
assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllElements.class));
assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllEntities.class));
assertSame(getAllElementsHandler, store.getOperationHandlerExposed(GetAllEdges.class));
assertTrue(store.getOperationHandlerExposed(GenerateElements.class) instanceof GenerateElementsHandler);
assertTrue(store.getOperationHandlerExposed(GenerateObjects.class) instanceof GenerateObjectsHandler);
assertTrue(store.getOperationHandlerExposed(CountGroups.class) instanceof CountGroupsHandler);
assertTrue(store.getOperationHandlerExposed(Deduplicate.class) instanceof DeduplicateHandler);
assertTrue(store.getOperationHandlerExposed(ExportToSet.class) instanceof ExportToSetHandler);
assertTrue(store.getOperationHandlerExposed(GetSetExport.class) instanceof GetSetExportHandler);
assertEquals(1, store.getCreateOperationHandlersCallCount());
assertSame(schema, store.getSchema());
assertSame(properties, store.getProperties());
verify(schemaOptimiser).optimise(schema, true);
}
Aggregations