Class AssetCatalogHandler
java.lang.Object
org.odpi.openmetadata.accessservices.assetcatalog.handlers.AssetCatalogHandler
Asset Catalog Handler supports the lookup of the assets from the repositories.
It runs on the server-side of the Asset Catalog OMAS, fetches the entities using the RepositoryHandler.
-
Constructor Summary
ConstructorsConstructorDescriptionAssetCatalogHandler
(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, OpenMetadataAPIGenericHandler<AssetCatalogBean> assetHandler, AssetCatalogConverter<AssetCatalogBean> assetCatalogConverter, RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch, ClockService clockService) Construct the handler information needed to interact with the repository services -
Method Summary
Modifier and TypeMethodDescriptionbuildContextByType
(String userId, String entityGUID, String entityTypeDefName) Returns a list of elements that define the context based on the type of the given asset.getEntitiesFromNeighborhood
(String userId, String assetGUID, SearchParameters searchParameters, String serverName) getEntityClassificationByName
(String userId, String assetGUID, String assetTypeName, String classificationName) Returns a list of the classification assigned to the given asset.getEntityDetails
(String userId, String assetGUID, String assetTypeName) Return the requested entity and converting to Asset Catalog OMAS modelgetRelationships
(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) Returns a certain kind of relationships for a specified asset.getRelationshipsByEntityGUID
(String userId, String assetGUID, String assetTypeName) Returns a list of the relationships for the given entity identifier.getSupportedTypes
(String userId, String typeName) Returns supported types for search with all sub-types.searchByType
(String userId, String searchCriteria, SearchParameters searchParameters) searchByTypeGUID
(String userId, String typeGUID) searchByTypeName
(String userId, String typeName)
-
Constructor Details
-
AssetCatalogHandler
public AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, OpenMetadataAPIGenericHandler<AssetCatalogBean> assetHandler, AssetCatalogConverter<AssetCatalogBean> assetCatalogConverter, RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch, ClockService clockService) Construct the handler information needed to interact with the repository services- Parameters:
serverUserName
- name of the local serversourceName
- name of the componentinvalidParameterHandler
- handler for managing parameter errorsrepositoryHandler
- manages calls to the repository servicesrepositoryHelper
- provides utilities for manipulating the repository services objectsassetHandler
- provides utilities for manipulating asset catalog objects using a generic handlerassetCatalogConverter
- asset catalog bean convertererrorHandler
- provides common validation routines for the other handler classessupportedZones
- configurable list of zones that Asset Catalog is allowed to serve Assets fromsupportedTypesForSearch
- configurable list of supported types used for searchclockService
- clock service
-
-
Method Details
-
getEntityDetails
public AssetCatalogBean getEntityDetails(String userId, String assetGUID, String assetTypeName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the requested entity and converting to Asset Catalog OMAS model- Parameters:
userId
- user identifier that issues the callassetGUID
- the asset identifierassetTypeName
- the asset type name- Returns:
- AssetCatalogBean that contains the core properties of the entity and additional properties
- Throws:
InvalidParameterException
- is thrown by the OMAS when a parameter is null or an invalid value.PropertyServerException
- reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorUserNotAuthorizedException
- is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.
-
getRelationshipsByEntityGUID
public List<Relationship> getRelationshipsByEntityGUID(String userId, String assetGUID, String assetTypeName) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException Returns a list of the relationships for the given entity identifier. Relationship type name can be used for filtering.- Parameters:
userId
- user identifier that issues the callassetGUID
- the asset identifierassetTypeName
- the asset type name- Returns:
- a list of Relationships
- Throws:
UserNotAuthorizedException
- is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.PropertyServerException
- reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorInvalidParameterException
- is thrown by the OMAG Service when a parameter is null or an invalid value.
-
getEntityClassificationByName
public List<Classification> getEntityClassificationByName(String userId, String assetGUID, String assetTypeName, String classificationName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns a list of the classification assigned to the given asset. The filtering based on the classification name is possible.- Parameters:
userId
- user identifier that issues the callassetGUID
- the asset identifierassetTypeName
- the asset type nameclassificationName
- the classification type name- Returns:
- a list of Classifications assigned to the given asset
- Throws:
InvalidParameterException
- is thrown by the OMAG Service when a parameter is null or an invalid value.PropertyServerException
- reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorUserNotAuthorizedException
- is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.
-
getRelationships
public List<Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException Returns a certain kind of relationships for a specified asset.- Parameters:
userId
- user identifier that issues the callassetGUID
- the asset identifierassetTypeName
- the asset type namerelationshipTypeName
- the relationship type namefrom
- offsetpageSize
- limit the number of the assets returned- Returns:
- the list of relationships for the given asset
- Throws:
UserNotAuthorizedException
- is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.PropertyServerException
- reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorInvalidParameterException
- is thrown by the OMAG Service when a parameter is null or an invalid value.
-
getEntitiesFromNeighborhood
public List<AssetCatalogBean> getEntitiesFromNeighborhood(String userId, String assetGUID, SearchParameters searchParameters, String serverName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, AssetCatalogException - Parameters:
userId
- user identifier that issues the callassetGUID
- the asset identifiersearchParameters
- additional parameters for searching and filteringserverName
- the name of the server- Returns:
- a list of entities from the neighborhood of the given entity
- Throws:
AssetCatalogException
- is thrown by the Asset Catalog OMAS when the asset passed on a request is not found in the repositoryInvalidParameterException
- is thrown by the OMAG Service when a parameter is null or an invalid value.PropertyServerException
- reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorUserNotAuthorizedException
- is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.
-
searchByType
public List<Elements> searchByType(String userId, String searchCriteria, SearchParameters searchParameters) throws UserNotAuthorizedException, FunctionNotSupportedException, InvalidParameterException, PropertyErrorException, TypeErrorException, PagingErrorException, InvalidParameterException, RepositoryErrorException, EntityNotKnownException, PropertyServerException, UserNotAuthorizedException - Parameters:
userId
- user identifier that issues the callsearchCriteria
- search criteria string used for finding the entitiessearchParameters
- additional parameters for searching and filtering- Returns:
- a list of matching criteria entities
- Throws:
UserNotAuthorizedException
- - is thrown by an OMRS Connector when the supplied UserId is not permitted to perform a specific operation on the metadata collection.FunctionNotSupportedException
- - provides a checked exception for reporting that an OMRS repository connector does not support the method calledInvalidParameterException
- - is thrown by an OMRS Connector when the parameters passed to a repository connector are not validPropertyErrorException
- - is thrown by an OMRS Connector when the properties defined for a specific entity or relationship instance do not match the TypeDefs for the metadata collection.TypeErrorException
- - is thrown by an OMRS Connector when the requested type for an instance is not represented by a known TypeDef.PagingErrorException
- - is thrown by an OMRS Connector when the caller has passed invalid paging attributes on a search call.InvalidParameterException
- - is thrown by the OMAG Service when a parameter is null or an invalid value.RepositoryErrorException
- - there is a problem communicating with the metadata repository.EntityNotKnownException
- - is thrown when the entity is not found in the repositoriesPropertyServerException
- - is thrown when there is a server configuration errorUserNotAuthorizedException
- - is thrown when the user is not authorized to do the search
-
searchByTypeName
public List<Elements> searchByTypeName(String userId, String typeName) throws UserNotAuthorizedException, FunctionNotSupportedException, InvalidParameterException, PropertyErrorException, TypeErrorException, PagingErrorException, InvalidParameterException, RepositoryErrorException, EntityNotKnownException, PropertyServerException, UserNotAuthorizedException - Parameters:
userId
- user identifier that issues the calltypeName
- the assets type name to search for- Returns:
- list of assets by type name
- Throws:
UserNotAuthorizedException
- - is thrown by an OMRS Connector when the supplied UserId is not permitted to perform a specific operation on the metadata collection.FunctionNotSupportedException
- - provides a checked exception for reporting that an OMRS repository connector does not support the method calledInvalidParameterException
- - is thrown by an OMRS Connector when the parameters passed to a repository connector are not validPropertyErrorException
- - is thrown by an OMRS Connector when the properties defined for a specific entityTypeErrorException
- - is thrown by an OMRS Connector when the requested type for an instance is not represented by a known TypeDef.PagingErrorException
- - is thrown by an OMRS Connector when the caller has passed invalid paging attributes on a search call.InvalidParameterException
- - is thrown by the OMAG Service when a parameter is null or an invalid value.RepositoryErrorException
- - there is a problem communicating with the metadata repository.EntityNotKnownException
- - is thrown when the entity is not found in the repositoriesPropertyServerException
- - reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorUserNotAuthorizedException
- - is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.
-
searchByTypeGUID
public List<Elements> searchByTypeGUID(String userId, String typeGUID) throws UserNotAuthorizedException, FunctionNotSupportedException, InvalidParameterException, PropertyErrorException, TypeErrorException, PagingErrorException, InvalidParameterException, RepositoryErrorException, EntityNotKnownException, PropertyServerException, UserNotAuthorizedException - Parameters:
userId
- user identifier that issues the calltypeGUID
- the assets type GUID to search for- Returns:
- list of assets by type GUID
- Throws:
UserNotAuthorizedException
- - is thrown by an OMRS Connector when the supplied UserId is not permitted to perform a specific operation on the metadata collection.FunctionNotSupportedException
- - provides a checked exception for reporting that an OMRS repository connector does not support the method calledInvalidParameterException
- - is thrown by an OMRS Connector when the parameters passed to a repository connector are not validPropertyErrorException
- - is thrown by an OMRS Connector when the properties defined for a specific entityTypeErrorException
- - is thrown by an OMRS Connector when the requested type for an instance is not represented by a known TypeDef.PagingErrorException
- - is thrown by an OMRS Connector when the caller has passed invalid paging attributes on a search call.InvalidParameterException
- - is thrown by the OMAG Service when a parameter is null or an invalid value.RepositoryErrorException
- - there is a problem communicating with the metadata repository.EntityNotKnownException
- - is thrown when the entity is not found in the repositoriesPropertyServerException
- - reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connectorUserNotAuthorizedException
- - is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.
-
buildContextByType
public Elements buildContextByType(String userId, String entityGUID, String entityTypeDefName) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException Returns a list of elements that define the context based on the type of the given asset.- Parameters:
userId
- user identifier that issues the callentityGUID
- the identifier of the entityentityTypeDefName
- the type name of the entity- Returns:
- the context of the given entity
- Throws:
UserNotAuthorizedException
- - is thrown by the OCF when a userId passed on a request is not authorized to perform the requested action.PropertyServerException
- - provides a checked exception for reporting errors when connecting to a metadata repository to retrieve properties about the connection and/or connector.InvalidParameterException
- - is thrown by the OMAS when a parameter is null or an invalid value.
-
getSupportedTypes
Returns supported types for search with all sub-types. If type name is provided, it returns the type itself and the list of sub-types for it- Parameters:
userId
- user identifier that issues the calltypeName
- optional type name- Returns:
- a list of types
-