@Test(expected = MetaDataExecutionException.class) public void givenInsertObjectGroupWhenParentNotFoundThenThrowMetaDataNotFoundException() throws Exception { doThrow(MetaDataExecutionException.class).when(request).execInsertObjectGroupRequests(any()); metaDataImpl.insertObjectGroup(buildQueryJsonWithOptions("", DATA_INSERT)); }
public void insertObjectGroup(JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException { final InsertParserMultiple insertParser = new InsertParserMultiple(DEFAULT_VARNAME_ADAPTER); insertParser.parse(objectGroupRequest); insertParser.getRequest().addHintFilter(BuilderToken.FILTERARGS.OBJECTGROUPS.exactToken()); dbRequest.execInsertObjectGroupRequests(singletonList(insertParser)); }
MetaDataImpl { public void insertObjectGroup(JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException { final InsertParserMultiple insertParser = new InsertParserMultiple(DEFAULT_VARNAME_ADAPTER); insertParser.parse(objectGroupRequest); insertParser.getRequest().addHintFilter(BuilderToken.FILTERARGS.OBJECTGROUPS.exactToken()); dbRequest.execInsertObjectGroupRequests(singletonList(insertParser)); } }
MetaDataImpl { public void insertObjectGroup(JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException { final InsertParserMultiple insertParser = new InsertParserMultiple(DEFAULT_VARNAME_ADAPTER); insertParser.parse(objectGroupRequest); insertParser.getRequest().addHintFilter(BuilderToken.FILTERARGS.OBJECTGROUPS.exactToken()); dbRequest.execInsertObjectGroupRequests(singletonList(insertParser)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); }
MetaDataImpl { public void insertObjectGroup(JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException { final InsertParserMultiple insertParser = new InsertParserMultiple(DEFAULT_VARNAME_ADAPTER); insertParser.parse(objectGroupRequest); insertParser.getRequest().addHintFilter(BuilderToken.FILTERARGS.OBJECTGROUPS.exactToken()); dbRequest.execInsertObjectGroupRequests(singletonList(insertParser)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); static MetaDataImpl newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); MongoDbAccessMetadataImpl getMongoDbAccess(); void insertUnits(BulkUnitInsertRequest request); void deleteUnits(List<String> idList); void deleteObjectGroups(List<String> idList); void insertObjectGroup(JsonNode objectGroupRequest); void insertObjectGroups(List<JsonNode> objectGroupRequest); List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(String operationId); List<Document> createAccessionRegisterSymbolic(Integer tenant); List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(Integer tenant,
        String operationId); RequestResponse<JsonNode> selectUnitsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectObjectGroupsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId); RequestResponse<JsonNode> selectObjectGroupById(JsonNode selectQuery, String objectGroupId); void updateObjectGroupId(JsonNode updateQuery, String objectId); RequestResponse<UpdateUnit> updateUnits(JsonNode updateQuery); RequestResponse<UpdateUnit> updateUnitsRules(List<String> unitIds, RuleActions ruleActions,
        Map<String, DurationData> bindRuleToDuration); UpdateUnit updateUnitById(JsonNode updateQuery, String unitId); void refreshUnit(); void refreshObjectGroup(); IndexationResult reindex(IndexParameters indexParam); void switchIndex(String alias, String newIndexName); }
MetaDataImpl { public void insertObjectGroup(JsonNode objectGroupRequest) throws InvalidParseOperationException, MetaDataExecutionException { final InsertParserMultiple insertParser = new InsertParserMultiple(DEFAULT_VARNAME_ADAPTER); insertParser.parse(objectGroupRequest); insertParser.getRequest().addHintFilter(BuilderToken.FILTERARGS.OBJECTGROUPS.exactToken()); dbRequest.execInsertObjectGroupRequests(singletonList(insertParser)); } MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); @VisibleForTesting  MetaDataImpl(MongoDbAccessMetadataImpl mongoDbAccess,
        AdminManagementClientFactory adminManagementClientFactory,
        IndexationHelper indexationHelper,
        DbRequest dbRequest, int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); static MetaDataImpl newMetadata(MongoDbAccessMetadataImpl mongoDbAccessMetadata,
        int ontologyCacheMaxEntries, int ontologyCacheTimeoutInSeconds,
        int archiveUnitProfileCacheMaxEntries, int archiveUnitProfileCacheTimeoutInSeconds,
        int schemaValidatorCacheMaxEntries, int schemaValidatorCacheTimeoutInSeconds); MongoDbAccessMetadataImpl getMongoDbAccess(); void insertUnits(BulkUnitInsertRequest request); void deleteUnits(List<String> idList); void deleteObjectGroups(List<String> idList); void insertObjectGroup(JsonNode objectGroupRequest); void insertObjectGroups(List<JsonNode> objectGroupRequest); List<FacetBucket> selectOwnAccessionRegisterOnUnitByOperationId(String operationId); List<Document> createAccessionRegisterSymbolic(Integer tenant); List<ObjectGroupPerOriginatingAgency> selectOwnAccessionRegisterOnObjectGroupByOperationId(Integer tenant,
        String operationId); RequestResponse<JsonNode> selectUnitsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectObjectGroupsByQuery(JsonNode selectQuery); RequestResponse<JsonNode> selectUnitsById(JsonNode selectQuery, String unitId); RequestResponse<JsonNode> selectObjectGroupById(JsonNode selectQuery, String objectGroupId); void updateObjectGroupId(JsonNode updateQuery, String objectId); RequestResponse<UpdateUnit> updateUnits(JsonNode updateQuery); RequestResponse<UpdateUnit> updateUnitsRules(List<String> unitIds, RuleActions ruleActions,
        Map<String, DurationData> bindRuleToDuration); UpdateUnit updateUnitById(JsonNode updateQuery, String unitId); void refreshUnit(); void refreshObjectGroup(); IndexationResult reindex(IndexParameters indexParam); void switchIndex(String alias, String newIndexName);  }