Class OpenMetadataAPIAnchorHandler<B>
java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler<B>
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIAnchorHandler<B>
- Type Parameters:
B- bean class
- Direct Known Subclasses:
OpenMetadataAPIGenericHandler
OpenMetadataAPIRootHandler provides the common properties for the generic handlers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe properties for an Anchors classification. -
Field Summary
Fields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler
assetActionDescription, auditLog, beanClass, converter, errorHandler, invalidParameterHandler, localServerUserId, qualifiedNamePropertyNamesList, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName -
Constructor Summary
ConstructorsConstructorDescriptionOpenMetadataAPIAnchorHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, AuditLog auditLog) Construct the handler information needed to interact with the repository services -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnchorsClassification(String userId, EntityDetail anchoredElement, String anchoredElementGUIDParameterName, String anchorGUID, String anchorTypeName, String anchorDomainName, String anchorScopeGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Classify an element with the Anchors classification.getAnchoredEntities(String userId, String anchorGUID, int startingFrom, int pageSize, String methodName) Retrieve the list of entities that are anchored to an element.getAnchorGUIDForEntity(EntityDetail connectToEntity, String connectToGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the anchor guid for an entity.getAnchorScopeGUIDFromAnchorsClassification(EntitySummary anchorEntity, String methodName) Retrieve the anchorScopeGUID from the anchors classification.getAnchorsFromAnchorsClassification(EntitySummary connectToEntity, String methodName) Retrieve the anchorGUID property and related values from the Anchors classification if present.getDomainName(String typeName) Return the domain name of a type.getDomainName(EntitySummary instance) Return the domain name of an entity.voidrefreshAnchorsClassification(String userId, String externalSourceGUID, String externalSourceName, String entityGUID, String entityGUIDParameterName, String entityTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Locate all of the elements that are anchored to this entity and update their Anchors classification to match this entity and their anchor.setUpAnchorsClassificationFromAnchor(String userId, String anchorGUID, String anchorGUIDParameterName, String anchorScopeGUID, OpenMetadataAPIGenericBuilder builder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Provide a standard approach to setting the anchors for a new element based on the supplied anchor.voidsetUpAnchorsClassificationFromParent(String userId, String parentGUID, String parentGUIDParameterName, OpenMetadataAPIGenericBuilder builder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Provide a standard approach to setting the anchors for a new element based on the anchor of the parent.Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandler
getConverter, getElementStub, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getTypeDefByName, setSecurityVerifier
-
Constructor Details
-
OpenMetadataAPIAnchorHandler
public OpenMetadataAPIAnchorHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, AuditLog auditLog) Construct the handler information needed to interact with the repository services- 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 verifierauditLog- destination for audit log events.
-
-
Method Details
-
getAnchorsFromAnchorsClassification
public OpenMetadataAPIAnchorHandler.AnchorIdentifiers getAnchorsFromAnchorsClassification(EntitySummary connectToEntity, String methodName) Retrieve the anchorGUID property and related values from the Anchors classification if present. A null is returned if the Anchors classification is missing, or it has no properties.- Parameters:
connectToEntity- entity containing the classificationsmethodName- calling method- Returns:
- anchorGUID or null
-
setUpAnchorsClassificationFromParent
public void setUpAnchorsClassificationFromParent(String userId, String parentGUID, String parentGUIDParameterName, OpenMetadataAPIGenericBuilder builder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Provide a standard approach to setting the anchors for a new element based on the anchor of the parent. If there is no parentGUID, no anchor is added. An invalid parentGUID results in an exception. If the parent entity has no Anchors classification, no anchors classification is constructed. Otherwise, the values from the retrieved parents Anchors classification are used.- Parameters:
userId- calling userparentGUID- required anchorparentGUIDParameterName- parameter passing the parentGUIDbuilder- builder to set up the anchorforLineage- is this a lineage request?forDuplicateProcessing- is this part of de-duplicate processing?effectiveTime- what effect time to use for the retrieve?methodName- calling method- Throws:
InvalidParameterException- bad parameter (probably parentGUID)PropertyServerException- repository not workingUserNotAuthorizedException- security error
-
setUpAnchorsClassificationFromAnchor
public EntityDetail setUpAnchorsClassificationFromAnchor(String userId, String anchorGUID, String anchorGUIDParameterName, String anchorScopeGUID, OpenMetadataAPIGenericBuilder builder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Provide a standard approach to setting the anchors for a new element based on the supplied anchor. If there is no anchorGUID, no anchor is added. An invalid anchorGUID results in an exception. If the anchor entity has no Anchors classification, a default anchors classification is constructed. Otherwise the default anchors classification is supplemented with the anchorScopeGUID from the retrieved Anchors classification is used.- Parameters:
userId- calling useranchorGUID- required anchoranchorGUIDParameterName- parameter passing the anchorGUIDanchorScopeGUID- optional scope of the anchorbuilder- builder to set up the anchorforLineage- is this a lineage request?forDuplicateProcessing- is this part of de-duplicate processing?effectiveTime- what effect time to use for the retrieve?methodName- calling method- Returns:
- anchor entity
- Throws:
InvalidParameterException- bad parameter (probably anchorGUID)PropertyServerException- repository not workingUserNotAuthorizedException- security error
-
getAnchorScopeGUIDFromAnchorsClassification
public String getAnchorScopeGUIDFromAnchorsClassification(EntitySummary anchorEntity, String methodName) Retrieve the anchorScopeGUID from the anchors classification.- Parameters:
anchorEntity- required anchormethodName- calling method
-
refreshAnchorsClassification
public void refreshAnchorsClassification(String userId, String externalSourceGUID, String externalSourceName, String entityGUID, String entityGUIDParameterName, String entityTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Locate all of the elements that are anchored to this entity and update their Anchors classification to match this entity and their anchor. This is used when something like the anchorScopeGUID or zoneMembership changes. The assumption is that changes to the anchor element have already occurred.- Parameters:
userId- calling userexternalSourceGUID- unique identifier of the software capability that owns this elementexternalSourceName- unique name of the software capability that owns this elemententityGUID- unique identifier for the asset to updateentityGUIDParameterName- parameter name supplying entityGUIDentityTypeName- expected type of entityforLineage- return elements marked with the Memento classification?forDuplicateProcessing- do not merge elements marked as duplicates?effectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Throws:
InvalidParameterException- guid or userId is null or this is not an anchor entityPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
getAnchoredEntities
public List<EntityDetail> getAnchoredEntities(String userId, String anchorGUID, int startingFrom, int pageSize, String methodName) throws PropertyServerException, UserNotAuthorizedException Retrieve the list of entities that are anchored to an element.- Parameters:
userId- calling useranchorGUID- unique identifier of the anchorstartingFrom- where in the paging sequencepageSize- maximum resultsmethodName- calling method- Returns:
- list of entities or null if there are no more
- Throws:
PropertyServerException- problem with the repositoryUserNotAuthorizedException- security problem
-
getDomainName
Return the domain name of an entity.- Parameters:
instance- entity- Returns:
- domain name
-
getDomainName
Return the domain name of a type.- Parameters:
typeName- type to check- Returns:
- domain name
-
getAnchorGUIDForEntity
public OpenMetadataAPIAnchorHandler.AnchorIdentifiers getAnchorGUIDForEntity(EntityDetail connectToEntity, String connectToGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws PropertyServerException, InvalidParameterException, UserNotAuthorizedException Retrieve the anchor guid for an entity. Ths is in two phases. If the connectToEntity has an Anchors classification then the anchor information is extracted from that classification. If there is on Anchors classification then a new one is derived and added to the connectToEntity for the next time it is retrieved.- Parameters:
connectToEntity- entity retrieved from the repositoryconnectToGUIDParameterName- name of the parameter that passed the connectTo guidforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Returns:
- anchor identifiers
- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- there is a problem accessing the properties in the repositories.UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
addAnchorsClassification
public void addAnchorsClassification(String userId, EntityDetail anchoredElement, String anchoredElementGUIDParameterName, String anchorGUID, String anchorTypeName, String anchorDomainName, String anchorScopeGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws UserNotAuthorizedException, PropertyServerException, InvalidParameterException Classify an element with the Anchors classification.- Parameters:
userId- calling useranchoredElement- element to add the classification toanchoredElementGUIDParameterName- name of parameteranchorGUID- unique identifier of the anchoranchorTypeName- unique name of the type of the anchoranchorDomainName- unique name of the type of the anchoranchorScopeGUID- unique identifier of the anchor's scopeforLineage- the request is to support lineage retrieval this means entities with the Memento classification can be returnedforDuplicateProcessing- the request is for duplicate processing and so must not deduplicateeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.PropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-