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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classThe properties for an Anchors classification.
- 
Field SummaryFields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIRootHandlerassetActionDescription, auditLog, beanClass, converter, defaultZones, errorHandler, invalidParameterHandler, localServerUserId, publishZones, qualifiedNamePropertyNamesList, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName, supportedZones
- 
Constructor SummaryConstructorsConstructorDescriptionOpenMetadataAPIAnchorHandler(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 information needed to interact with the repository services
- 
Method SummaryModifier 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.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 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.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.OpenMetadataAPIRootHandlergetConverter, getElementStub, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getSupportedZones, getTypeDefByName, setSecurityVerifier
- 
Constructor Details- 
OpenMetadataAPIAnchorHandlerpublic OpenMetadataAPIAnchorHandler(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 information needed to interact with the repository services- Parameters:
- converter- specific converter for this bean class
- beanClass- name of bean class that is represented by the generic class B
- serviceName- name of this service
- serverName- name of the local server
- invalidParameterHandler- handler for managing parameter errors
- repositoryHandler- manages calls to the repository services
- repositoryHelper- provides utilities for manipulating the repository services objects
- localServerUserId- userId for this server
- securityVerifier- open metadata security services verifier
- supportedZones- list of zones that the access service is allowed to serve Asset instances from.
- defaultZones- list of zones that the access service should set in all new Asset instances.
- publishZones- list of zones that the access service sets up in published Asset instances.
- auditLog- destination for audit log events.
 
 
- 
- 
Method Details- 
getAnchorsFromAnchorsClassificationpublic OpenMetadataAPIAnchorHandler.AnchorIdentifiers getAnchorsFromAnchorsClassification(EntitySummary connectToEntity, String methodName) Retrieve the anchorGUID property from the Anchors classification if present. A null is returned if the Anchors classification is missing, or the property is missing from the classification or is null.- Parameters:
- connectToEntity- entity containing the classifications
- methodName- calling method
- Returns:
- anchorGUID or null
 
- 
setUpAnchorsClassificationFromParentpublic 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 user
- parentGUID- required anchor
- parentGUIDParameterName- parameter passing the parentGUID
- builder- builder to set up the anchor
- forLineage- 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 working
- UserNotAuthorizedException- security error
 
- 
setUpAnchorsClassificationFromAnchorpublic 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 user
- anchorGUID- required anchor
- anchorGUIDParameterName- parameter passing the anchorGUID
- anchorScopeGUID- optional scope of the anchor
- builder- builder to set up the anchor
- forLineage- 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 working
- UserNotAuthorizedException- security error
 
- 
getAnchorScopeGUIDFromAnchorsClassificationpublic String getAnchorScopeGUIDFromAnchorsClassification(EntitySummary anchorEntity, String methodName) Retrieve the anchorScopeGUID from the anchors classification.- Parameters:
- anchorEntity- required anchor
- methodName- calling method
 
- 
getDomainNameReturn the domain name of an entity.- Parameters:
- instance- entity
- Returns:
- domain name
 
- 
getDomainNameReturn the domain name of a type.- Parameters:
- typeName- type to check
- Returns:
- domain name
 
- 
getAnchorGUIDForEntitypublic 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 repository
- connectToGUIDParameterName- name of the parameter that passed the connectTo guid
- forLineage- the query is to support lineage retrieval
- forDuplicateProcessing- the query is for duplicate processing and so must not deduplicate
- effectiveTime- 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.
 
- 
addAnchorsClassificationpublic 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 user
- anchoredElement- element to add the classification to
- anchoredElementGUIDParameterName- name of parameter
- anchorGUID- unique identifier of the anchor
- anchorTypeName- unique name of the type of the anchor
- anchorDomainName- unique name of the type of the anchor
- anchorScopeGUID- unique identifier of the anchor's scope
- forLineage- the request is to support lineage retrieval this means entities with the Memento classification can be returned
- forDuplicateProcessing- the request is for duplicate processing and so must not deduplicate
- effectiveTime- 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 server
- UserNotAuthorizedException- security access problem
 
 
-