@Test public void getGovernedAssets() throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException { String methodName = "getGovernedAssets"; mockGetEntitiesForClassificationType(mockEntityDetailsList(SCHEMA_ELEMENT_GUID, SCHEMA_ELEMENT)); List<GovernedAsset> governedAssets = governedAssetHandler.getGovernedAssets(USER_ID, null, FROM, PAGE_SIZE); assertEquals(SCHEMA_ELEMENT_GUID, governedAssets.get(0).getGuid()); verify(invalidParameterHandler, times(1)).validateUserId(USER_ID, methodName); }
public List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getGovernedAssets"; invalidParameterHandler.validateUserId(userId, methodName); List<EntityDetail> response = new ArrayList<>(); if (CollectionUtils.isEmpty(entityTypes)) { response = repositoryHandler.getEntitiesForClassificationType(userId, null, SECURITY_TAG, offset, pageSize, methodName); } else { for (String typeName : entityTypes) { TypeDef typeDefByName = repositoryHelper.getTypeDefByName(userId, typeName); if (typeDefByName != null && typeDefByName.getGUID() != null) { response.addAll(repositoryHandler.getEntitiesForClassificationType(userId, typeDefByName.getGUID(), SECURITY_TAG, offset, pageSize, methodName)); } } } return convertGovernedAssets(userId, response); }
GovernedAssetHandler { public List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getGovernedAssets"; invalidParameterHandler.validateUserId(userId, methodName); List<EntityDetail> response = new ArrayList<>(); if (CollectionUtils.isEmpty(entityTypes)) { response = repositoryHandler.getEntitiesForClassificationType(userId, null, SECURITY_TAG, offset, pageSize, methodName); } else { for (String typeName : entityTypes) { TypeDef typeDefByName = repositoryHelper.getTypeDefByName(userId, typeName); if (typeDefByName != null && typeDefByName.getGUID() != null) { response.addAll(repositoryHandler.getEntitiesForClassificationType(userId, typeDefByName.getGUID(), SECURITY_TAG, offset, pageSize, methodName)); } } } return convertGovernedAssets(userId, response); } }
GovernedAssetHandler { public List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getGovernedAssets"; invalidParameterHandler.validateUserId(userId, methodName); List<EntityDetail> response = new ArrayList<>(); if (CollectionUtils.isEmpty(entityTypes)) { response = repositoryHandler.getEntitiesForClassificationType(userId, null, SECURITY_TAG, offset, pageSize, methodName); } else { for (String typeName : entityTypes) { TypeDef typeDefByName = repositoryHelper.getTypeDefByName(userId, typeName); if (typeDefByName != null && typeDefByName.getGUID() != null) { response.addAll(repositoryHandler.getEntitiesForClassificationType(userId, typeDefByName.getGUID(), SECURITY_TAG, offset, pageSize, methodName)); } } } return convertGovernedAssets(userId, response); } GovernedAssetHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler,
                                RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, RepositoryErrorHandler errorHandler,
                                List<String> supportedZones); }
GovernedAssetHandler { public List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getGovernedAssets"; invalidParameterHandler.validateUserId(userId, methodName); List<EntityDetail> response = new ArrayList<>(); if (CollectionUtils.isEmpty(entityTypes)) { response = repositoryHandler.getEntitiesForClassificationType(userId, null, SECURITY_TAG, offset, pageSize, methodName); } else { for (String typeName : entityTypes) { TypeDef typeDefByName = repositoryHelper.getTypeDefByName(userId, typeName); if (typeDefByName != null && typeDefByName.getGUID() != null) { response.addAll(repositoryHandler.getEntitiesForClassificationType(userId, typeDefByName.getGUID(), SECURITY_TAG, offset, pageSize, methodName)); } } } return convertGovernedAssets(userId, response); } GovernedAssetHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler,
                                RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, RepositoryErrorHandler errorHandler,
                                List<String> supportedZones); void setSecurityVerifier(OpenMetadataServerSecurityVerifier securityVerifier); List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize); GovernedAsset getGovernedAsset(String userId, String assedID); boolean containsGovernedClassification(EntityDetail entityDetail); boolean isSchemaElement(InstanceType entityType); String createSoftwareServerCapability(String userId, SoftwareServerCapability softwareServerCapability); SoftwareServerCapability getSoftwareServerCapabilityByGUID(String userId, String guid); GovernedAsset convertGovernedAsset(String userID, EntityDetail entity); }
GovernedAssetHandler { public List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException { String methodName = "getGovernedAssets"; invalidParameterHandler.validateUserId(userId, methodName); List<EntityDetail> response = new ArrayList<>(); if (CollectionUtils.isEmpty(entityTypes)) { response = repositoryHandler.getEntitiesForClassificationType(userId, null, SECURITY_TAG, offset, pageSize, methodName); } else { for (String typeName : entityTypes) { TypeDef typeDefByName = repositoryHelper.getTypeDefByName(userId, typeName); if (typeDefByName != null && typeDefByName.getGUID() != null) { response.addAll(repositoryHandler.getEntitiesForClassificationType(userId, typeDefByName.getGUID(), SECURITY_TAG, offset, pageSize, methodName)); } } } return convertGovernedAssets(userId, response); } GovernedAssetHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler,
                                RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, RepositoryErrorHandler errorHandler,
                                List<String> supportedZones); void setSecurityVerifier(OpenMetadataServerSecurityVerifier securityVerifier); List<GovernedAsset> getGovernedAssets(String userId, List<String> entityTypes, Integer offset, Integer pageSize); GovernedAsset getGovernedAsset(String userId, String assedID); boolean containsGovernedClassification(EntityDetail entityDetail); boolean isSchemaElement(InstanceType entityType); String createSoftwareServerCapability(String userId, SoftwareServerCapability softwareServerCapability); SoftwareServerCapability getSoftwareServerCapabilityByGUID(String userId, String guid); GovernedAsset convertGovernedAsset(String userID, EntityDetail entity);  }