Class AssetCatalogHandler
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.assetcatalog.handlers.AssetCatalogHandler
-
public class AssetCatalogHandler extends Object
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
Constructors Constructor Description AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch)Construct the handler information needed to interact with the repository services
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ElementsbuildContextByType(String userId, String entityGUID, String entityTypeDefName)List<AssetCatalogBean>getEntitiesFromNeighborhood(String userId, String assetGUID, SearchParameters searchParameters)List<Classification>getEntityClassificationByName(String userId, String assetGUID, String assetTypeName, String classificationName)Returns a list of the classification assigned to the given asset.AssetCatalogBeangetEntityDetails(String userId, String assetGUID, String assetTypeName)Return the requested entity and converting to Asset Catalog OMAS modelList<AssetCatalogBean>getIntermediateAssets(String userId, String startAssetGUID, String endAssetGUID)List<Relationship>getLinkingRelationshipsBetweenAssets(String serverName, String userId, String startAssetGUID, String endAssetGUID)List<Relationship>getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize)List<Relationship>getRelationshipsByEntityGUID(String userId, String assetGUID, String assetTypeName)Returns a list of the relationships for the given entity identifier.List<Type>getSupportedTypes(String userId, String typeName)Returns supported types for search with all sub-types.List<Elements>searchByType(String userId, String searchCriteria, SearchParameters searchParameters)
-
-
-
Constructor Detail
-
AssetCatalogHandler
public AssetCatalogHandler(String serverUserName, String sourceName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, RepositoryErrorHandler errorHandler, List<String> supportedZones, List<String> supportedTypesForSearch)
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 objectserrorHandler- 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 search
-
-
Method Detail
-
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.
-
getLinkingRelationshipsBetweenAssets
public List<Relationship> getLinkingRelationshipsBetweenAssets(String serverName, String userId, String startAssetGUID, String endAssetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, AssetCatalogException
- Parameters:
serverName- name of the local serveruserId- user identifier that issues the callstartAssetGUID- the starting asset identifierendAssetGUID- the ending asset identifier- Returns:
- the linking relationship between the given assets
- 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.
-
getRelationships
public List<Relationship> getRelationships(String userId, String assetGUID, String assetTypeName, String relationshipTypeName, Integer from, Integer pageSize) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException
- 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.
-
getIntermediateAssets
public List<AssetCatalogBean> getIntermediateAssets(String userId, String startAssetGUID, String endAssetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, AssetCatalogException
- Parameters:
userId- user identifier that issues the callstartAssetGUID- the starting asset identifierendAssetGUID- the ending asset identifier- Returns:
- a list of the entities that connects the given assets from the request
- 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.
-
getEntitiesFromNeighborhood
public List<AssetCatalogBean> getEntitiesFromNeighborhood(String userId, String assetGUID, SearchParameters searchParameters) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException, AssetCatalogException
- Parameters:
userId- user identifier that issues the callassetGUID- the asset identifiersearchParameters- additional parameters for searching and filtering- 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
- 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
-
buildContextByType
public Elements buildContextByType(String userId, String entityGUID, String entityTypeDefName) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException
- 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
public List<Type> getSupportedTypes(String userId, String typeName)
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
-
-