@Test public void getRelationships_throwsPropertyServerException() throws UserNotAuthorizedException, PropertyServerException { String methodName = "getRelationships"; mockTypeDef(RELATIONSHIP_TYPE, RELATIONSHIP_TYPE_GUID); doThrow(new PropertyServerException(AssetCatalogErrorCode.SERVICE_NOT_INITIALIZED.getMessageDefinition(), this.getClass().getName(), "")).when(repositoryHandler).getPagedRelationshipsByType(USER, FIRST_GUID, ASSET_TYPE, RELATIONSHIP_TYPE_GUID, RELATIONSHIP_TYPE, FROM, PAGE_SIZE, methodName); assertThrows(PropertyServerException.class, () -> assetCatalogHandler.getRelationships(USER, FIRST_GUID, ASSET_TYPE, RELATIONSHIP_TYPE, FROM, PAGE_SIZE)); }
public List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getRelationships"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, GUID_PARAMETER, methodName); invalidParameterHandler.validatePaging(from, pageSize, methodName); String relationshipTypeGUID = commonHandler.getTypeDefGUID(userId, relationshipTypeName); List<Relationship> pagedRelationshipsByType = repositoryHandler.getPagedRelationshipsByType(userId, assetGUID, assetTypeName, relationshipTypeGUID, relationshipTypeName, from, pageSize, methodName); if (CollectionUtils.isNotEmpty(pagedRelationshipsByType)) { return assetConverter.convertRelationships(pagedRelationshipsByType); } return Collections.emptyList(); }
AssetCatalogHandler { public List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getRelationships"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, GUID_PARAMETER, methodName); invalidParameterHandler.validatePaging(from, pageSize, methodName); String relationshipTypeGUID = commonHandler.getTypeDefGUID(userId, relationshipTypeName); List<Relationship> pagedRelationshipsByType = repositoryHandler.getPagedRelationshipsByType(userId, assetGUID, assetTypeName, relationshipTypeGUID, relationshipTypeName, from, pageSize, methodName); if (CollectionUtils.isNotEmpty(pagedRelationshipsByType)) { return assetConverter.convertRelationships(pagedRelationshipsByType); } return Collections.emptyList(); } }
AssetCatalogHandler { public List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getRelationships"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, GUID_PARAMETER, methodName); invalidParameterHandler.validatePaging(from, pageSize, methodName); String relationshipTypeGUID = commonHandler.getTypeDefGUID(userId, relationshipTypeName); List<Relationship> pagedRelationshipsByType = repositoryHandler.getPagedRelationshipsByType(userId, assetGUID, assetTypeName, relationshipTypeGUID, relationshipTypeName, from, pageSize, methodName); if (CollectionUtils.isNotEmpty(pagedRelationshipsByType)) { return assetConverter.convertRelationships(pagedRelationshipsByType); } return Collections.emptyList(); } AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler,
                               RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper,
                               RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch); }
AssetCatalogHandler { public List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getRelationships"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, GUID_PARAMETER, methodName); invalidParameterHandler.validatePaging(from, pageSize, methodName); String relationshipTypeGUID = commonHandler.getTypeDefGUID(userId, relationshipTypeName); List<Relationship> pagedRelationshipsByType = repositoryHandler.getPagedRelationshipsByType(userId, assetGUID, assetTypeName, relationshipTypeGUID, relationshipTypeName, from, pageSize, methodName); if (CollectionUtils.isNotEmpty(pagedRelationshipsByType)) { return assetConverter.convertRelationships(pagedRelationshipsByType); } return Collections.emptyList(); } AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler,
                               RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper,
                               RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch); AssetDescription getEntityDetails(String userId, String assetGUID, String assetTypeName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationshipsByEntityGUID(String userId,
                                                                                                                   String assetGUID,
                                                                                                                   String assetTypeName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Classification> getEntityClassificationByName(String userId,
                                                                                                                      String assetGUID,
                                                                                                                      String assetTypeName,
                                                                                                                      String classificationName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getLinkingRelationshipsBetweenAssets(String serverName,
                                                                                                                           String userId,
                                                                                                                           String startAssetGUID,
                                                                                                                           String endAssetGUID); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId,
                                                                                                       String assetGUID,
                                                                                                       String assetTypeName,
                                                                                                       String relationshipTypeName,
                                                                                                       Integer from, Integer pageSize); List<AssetDescription> getIntermediateAssets(String userId, String startAssetGUID, String endAssetGUID); List<AssetDescription> getEntitiesFromNeighborhood(String serverName, String userId, String assetGUID, SearchParameters searchParameters); List<AssetElements> searchByType(String userId, String searchCriteria, SearchParameters searchParameters); AssetElements buildContextByType(String userId,
                                            String entityGUID,
                                            String entityTypeDefName); List<Type> getSupportedTypes(String userId, String typeName); }
AssetCatalogHandler { public List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getRelationships"; invalidParameterHandler.validateUserId(userId, methodName); invalidParameterHandler.validateGUID(assetGUID, GUID_PARAMETER, methodName); invalidParameterHandler.validatePaging(from, pageSize, methodName); String relationshipTypeGUID = commonHandler.getTypeDefGUID(userId, relationshipTypeName); List<Relationship> pagedRelationshipsByType = repositoryHandler.getPagedRelationshipsByType(userId, assetGUID, assetTypeName, relationshipTypeGUID, relationshipTypeName, from, pageSize, methodName); if (CollectionUtils.isNotEmpty(pagedRelationshipsByType)) { return assetConverter.convertRelationships(pagedRelationshipsByType); } return Collections.emptyList(); } AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler,
                               RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper,
                               RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch); AssetDescription getEntityDetails(String userId, String assetGUID, String assetTypeName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationshipsByEntityGUID(String userId,
                                                                                                                   String assetGUID,
                                                                                                                   String assetTypeName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Classification> getEntityClassificationByName(String userId,
                                                                                                                      String assetGUID,
                                                                                                                      String assetTypeName,
                                                                                                                      String classificationName); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getLinkingRelationshipsBetweenAssets(String serverName,
                                                                                                                           String userId,
                                                                                                                           String startAssetGUID,
                                                                                                                           String endAssetGUID); List<org.odpi.openmetadata.accessservices.assetcatalog.model.Relationship> getRelationships(String userId,
                                                                                                       String assetGUID,
                                                                                                       String assetTypeName,
                                                                                                       String relationshipTypeName,
                                                                                                       Integer from, Integer pageSize); List<AssetDescription> getIntermediateAssets(String userId, String startAssetGUID, String endAssetGUID); List<AssetDescription> getEntitiesFromNeighborhood(String serverName, String userId, String assetGUID, SearchParameters searchParameters); List<AssetElements> searchByType(String userId, String searchCriteria, SearchParameters searchParameters); AssetElements buildContextByType(String userId,
                                            String entityGUID,
                                            String entityTypeDefName); List<Type> getSupportedTypes(String userId, String typeName);  }