Class RelatedAssetHandler<B>
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
-
- org.odpi.openmetadata.commonservices.generichandlers.RelatedAssetHandler<B>
-
public class RelatedAssetHandler<B> extends OpenMetadataAPIGenericHandler<B>
RelatedAssetHandler manages B objects and optionally connections in the property server. It runs server-side in the OMAG Server Platform and retrieves Assets and Connections through the OMRSRepositoryConnector.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
auditLog, beanClass, converter, defaultZones, errorHandler, invalidParameterHandler, localServerUserId, publishZones, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName, supportedZones
-
-
Constructor Summary
Constructors Constructor Description RelatedAssetHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)Construct the handler with information needed to work with B objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetRelatedAssetCount(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, String relationshipTypeGUID, String relationshipTypeName, List<String> serviceSupportedZones, Date effectiveTime, String methodName)Return the count of related assets.List<B>getRelatedAssets(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, String relationshipTypeGUID, String relationshipTypeName, String relatedAssetsTypeName, List<String> serviceSupportedZones, int startingEnd, int startFrom, int pageSize, Date effectiveTime, String methodName)Return the assets and relationship properties attached to an element by the specified relationship type.-
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
addAnchorsClassification, archiveBeanInRepository, archiveBeanInRepository, countAttachments, createBeanFromTemplate, createBeanInRepository, deleteAnchoredEntity, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteRelationship, entityMatchSearchCriteria, findAttachmentLinks, findBeanGUIDs, findBeans, findBeans, findBeans, findEntities, findEntities, getAllAttachmentLinks, getAnchorGUIDFromAnchorsClassification, getAttachedElement, getAttachedElementGUID, getAttachedElementGUID, getAttachedElementGUIDs, getAttachedElementGUIDs, getAttachedElements, getAttachedElements, getAttachedElements, getAttachedEntities, getAttachedEntities, getAttachedEntitiesFromUser, getAttachedEntity, getAttachedEntity, getAttachedEntity, getAttachedEntityFromUser, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachmentLink, getAttachmentLinks, getAttachmentLinks, getAttachmentLinks, getBeanByUniqueName, getBeanByUniqueName, getBeanByValue, getBeanFromEntity, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanGUIDByUniqueName, getBeanGUIDByUniqueName, getBeanGUIDsByClassification, getBeanGUIDsByType, getBeanGUIDsByType, getBeanGUIDsByValue, getBeansByClassification, getBeansByCreator, getBeansByIntValue, getBeansByType, getBeansByType, getBeansByValue, getBeansByValue, getBeansByValue, getBeansByValue, getEffectiveTime, getEffectiveTime, getEntitiesByIntValue, getEntitiesByType, getEntitiesByType, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntityByValue, getEntityFromRepository, getEntityFromRepository, getEntityGUIDByValue, getEntityGUIDsByValue, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getTypeDefByName, getUniqueAttachmentLink, getUniqueAttachmentLink, isBeanIsolated, isEntityATypeOf, linkElementToElement, linkElementToElement, linkElementToElement, linkElementToElement, maintainSupplementaryProperties, multiLinkElementToElement, regexSearchCriteria, relinkElementToNewElement, relinkElementToNewElement, removeClassificationFromRepository, removeClassificationFromRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setSecurityVerifier, unlinkAllElements, unlinkConnectedElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, updateBeanEffectivityDates, updateBeanEffectivityDates, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanPropertyInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateClassificationEffectivityDates, updateClassificationEffectivityDates, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateRelationshipEffectivityDates, updateRelationshipEffectivityDates, updateRelationshipProperties, validateAnchorEntity, validateAnchorEntity, validateUniqueProperty, verifyExternalSourceIdentity
-
-
-
-
Constructor Detail
-
RelatedAssetHandler
public RelatedAssetHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
Construct the handler with information needed to work with B objects.- Parameters:
converter- specific converter for this bean classbeanClass- name of bean class that is represented by the generic class BserviceName- name of this serviceserverName- name of the local serverinvalidParameterHandler- handler for managing parameter errorsrepositoryHandler- manages calls to the repository servicesrepositoryHelper- provides utilities for manipulating the repository services objectslocalServerUserId- userId for this serversecurityVerifier- open metadata security services verifiersupportedZones- list of zones that the access service is allowed to serve B instances from.defaultZones- list of zones that the access service should set in all new B instances.publishZones- list of zones that the access service sets up in published B instances.auditLog- destination for audit log events.
-
-
Method Detail
-
getRelatedAssetCount
public int getRelatedAssetCount(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, String relationshipTypeGUID, String relationshipTypeName, List<String> serviceSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the count of related assets.- Parameters:
userId- calling userelementGUID- identifier for the asset that the related assets are attached toelementGUIDParameterName- parameter passing the elementGUIDelementTypeName- name of the type of the starting elementrelationshipTypeGUID- unique identifier for relationship typerelationshipTypeName- unique name for relationship typeserviceSupportedZones- override the default supported zones.effectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Returns:
- unique identifier of the object or null
- Throws:
InvalidParameterException- the endpoint bean properties are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
getRelatedAssets
public List<B> getRelatedAssets(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, String relationshipTypeGUID, String relationshipTypeName, String relatedAssetsTypeName, List<String> serviceSupportedZones, int startingEnd, int startFrom, int pageSize, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the assets and relationship properties attached to an element by the specified relationship type. If all related assets are required then specify null for the relationship type GUID and name.- Parameters:
userId- calling userelementGUID- identifier for the asset that the related assets are attached toelementGUIDParameterName- parameter passing the elementGUIDelementTypeName- name of the type of the starting elementrelationshipTypeGUID- unique identifier for relationship typerelationshipTypeName- unique name for relationship typeserviceSupportedZones- override the default supported zonesrelatedAssetsTypeName- expected type of asset at the end of the relationshipstartingEnd- which end of the relationship to start at 0=either end; 1=end1 and 2=end 2startFrom- starting element (used in paging through large result sets)pageSize- maximum number of results to returneffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Returns:
- list of retrieved objects
- Throws:
InvalidParameterException- the input properties are invalidUserNotAuthorizedException- user not authorized to issue this requestPropertyServerException- problem accessing the property server
-
-