Class GovernanceDefinitionHandler

java.lang.Object
org.odpi.openmetadata.frameworkservices.omf.client.handlers.GovernanceDefinitionHandler
Direct Known Subclasses:
GovernanceDefinitionManager

public class GovernanceDefinitionHandler extends Object
GovernanceDefinitionHandler is the handler for managing governance definitions.
  • Constructor Details

    • GovernanceDefinitionHandler

      public GovernanceDefinitionHandler(String localServerName, String serverName, String serverPlatformURLRoot, AuditLog auditLog, String accessServiceURLMarker, String serviceName, int maxPageSize) throws InvalidParameterException
      Create a new client.
      Parameters:
      serverName - name of the server to connect to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      accessServiceURLMarker - optional access service URL marker used to identify which back end service to call
      auditLog - logging destination
      maxPageSize - maximum value allowed for page size
      serviceName - name of calling service
      Throws:
      InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
  • Method Details

    • createGovernanceDefinition

      public String createGovernanceDefinition(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, boolean isOwnAnchor, String anchorScopeGUID, GovernanceDefinitionProperties properties, GovernanceDefinitionStatus initialStatus, String parentGUID, String parentRelationshipTypeName, ElementProperties parentRelationshipProperties, boolean parentAtEnd1, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Create a new governance definition.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      anchorGUID - unique identifier of the element that should be the anchor for the new element. Set to null if no anchor, or the Anchors classification is included in the initial classifications.
      isOwnAnchor - boolean flag to day that the element should be classified as its own anchor once its element is created in the repository.
      anchorScopeGUID - unique identifier of any anchor scope to use for searching
      properties - properties for the new element.
      initialStatus - what is the initial status for the governance definition - default value is DRAFT
      parentGUID - unique identifier of optional parent entity
      parentRelationshipTypeName - type of relationship to connect the new element to the parent
      parentRelationshipProperties - properties to include in parent relationship
      parentAtEnd1 - which end should the parent GUID go in the relationship
      forLineage - the retrieved elements are for lineage processing so include archived elements
      forDuplicateProcessing - the retrieved element is for duplicate processing so do not combine results from known duplicates.
      effectiveTime - only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      unique identifier of the newly created element
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • createGovernanceDefinitionFromTemplate

      public String createGovernanceDefinitionFromTemplate(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, boolean isOwnAnchor, String anchorScopeGUID, Date effectiveFrom, Date effectiveTo, String templateGUID, ElementProperties replacementProperties, Map<String,String> placeholderProperties, String parentGUID, String parentRelationshipTypeName, ElementProperties parentRelationshipProperties, boolean parentAtEnd1, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a governance definition using an existing element as a template. The template defines additional classifications and relationships that should be added to the new governance definition.
      Parameters:
      userId - calling user
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      anchorGUID - unique identifier of the element that should be the anchor for the new element. Set to null if no anchor, or the Anchors classification is included in the initial classifications.
      isOwnAnchor - boolean flag to day that the element should be classified as its own anchor once its element is created in the repository.
      anchorScopeGUID - unique identifier of any anchor scope to use for searching
      effectiveFrom - the date when this element is active - null for active on creation
      effectiveTo - the date when this element becomes inactive - null for active until deleted
      templateGUID - the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema connection etc)
      replacementProperties - properties of the new metadata element. These override the template values
      placeholderProperties - property name-to-property value map to replace any placeholder values in the template element - and their anchored elements, which are also copied as part of this operation.
      parentGUID - unique identifier of optional parent entity
      parentRelationshipTypeName - type of relationship to connect the new element to the parent
      parentRelationshipProperties - properties to include in parent relationship
      parentAtEnd1 - which end should the parent GUID go in the relationship
      forLineage - the retrieved elements are for lineage processing so include archived elements
      forDuplicateProcessing - the retrieved element is for duplicate processing so do not combine results from known duplicates.
      effectiveTime - only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      Returns:
      unique identifier of the new metadata element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • updateGovernanceDefinition

      public void updateGovernanceDefinition(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionGUID, boolean replaceAllProperties, GovernanceDefinitionProperties properties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Update the properties of a governance definition.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionGUID - unique identifier of the governance definition (returned from create)
      replaceAllProperties - flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.
      properties - properties for the element.
      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)
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • updateGovernanceDefinitionStatus

      public void updateGovernanceDefinitionStatus(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionGUID, GovernanceDefinitionStatus status, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Update the properties of a governance definition.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionGUID - unique identifier of the governance definition (returned from create)
      status - new status for the element.
      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)
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • linkPeerDefinitions

      public void linkPeerDefinitions(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionOneGUID, String governanceDefinitionTwoGUID, String relationshipTypeName, PeerDefinitionProperties relationshipProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Attach two peer governance definitions.
      Parameters:
      userId - userId of user making request
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionOneGUID - unique identifier of the first governance definition
      governanceDefinitionTwoGUID - unique identifier of the second governance definition
      relationshipTypeName - name of the relationship to use
      relationshipProperties - additional properties for the relationship.
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • detachPeerDefinitions

      public void detachPeerDefinitions(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionOneGUID, String governanceDefinitionTwoGUID, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Detach a governance definition from one of its peers.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionOneGUID - unique identifier of the first governance definition
      governanceDefinitionTwoGUID - unique identifier of the second governance definition
      relationshipTypeName - name of the relationship to use
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • attachSupportingDefinition

      public void attachSupportingDefinition(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionOneGUID, String governanceDefinitionTwoGUID, String relationshipTypeName, SupportingDefinitionProperties relationshipProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Attach a supporting governance definition.
      Parameters:
      userId - userId of user making request
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionOneGUID - unique identifier of the parent governance definition
      governanceDefinitionTwoGUID - unique identifier of the child governance definition
      relationshipTypeName - name of the relationship to use
      relationshipProperties - additional properties for the relationship.
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • detachSupportingDefinition

      public void detachSupportingDefinition(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionOneGUID, String governanceDefinitionTwoGUID, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Detach a governance definition from a supporting governance definition.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionOneGUID - unique identifier of the parent governance definition
      governanceDefinitionTwoGUID - unique identifier of the child governance definition
      relationshipTypeName - name of the relationship to use
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • linkDefinitionImplementation

      public void linkDefinitionImplementation(String userId, String externalSourceGUID, String externalSourceName, String technicalControlGUID, String implementationGUID, String relationshipTypeName, GovernanceImplementationProperties relationshipProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Attach a governance definition to its implementation.
      Parameters:
      userId - userId of user making request
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      technicalControlGUID - unique identifier of the first governance definition
      implementationGUID - unique identifier of the implementation
      relationshipTypeName - name of the relationship to use
      relationshipProperties - additional properties for the relationship.
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • detachDefinitionImplementation

      public void detachDefinitionImplementation(String userId, String externalSourceGUID, String externalSourceName, String technicalControlGUID, String implementationGUID, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Detach a governance definition from its implementation.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      technicalControlGUID - unique identifier of the governance definition
      implementationGUID - unique identifier of the implementation
      relationshipTypeName - name of the relationship to use
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • deleteGovernanceDefinition

      public void deleteGovernanceDefinition(String userId, String externalSourceGUID, String externalSourceName, String governanceDefinitionGUID, boolean cascadedDelete, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Delete a governance definition.
      Parameters:
      userId - userId of user making request.
      externalSourceGUID - unique identifier of the software capability that owns this element
      externalSourceName - unique name of the software capability that owns this element
      governanceDefinitionGUID - unique identifier of the element
      cascadedDelete - can the governance definition be deleted if it has data fields linked to it?
      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)
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • getGovernanceDefinitionsByName

      public List<GovernanceDefinitionElement> getGovernanceDefinitionsByName(String userId, String name, TemplateFilter templateFilter, List<ElementStatus> limitResultsByStatus, Date asOfTime, SequencingOrder sequencingOrder, String sequencingProperty, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Returns the list of governance definitions with a particular name.
      Parameters:
      userId - userId of user making request
      name - name of the element to return - match is full text match in qualifiedName or name
      templateFilter - should templates be returned?
      limitResultsByStatus - control the status of the elements to retrieve - default is everything but Deleted
      asOfTime - repository time to use
      sequencingOrder - order to retrieve results
      sequencingProperty - property to use for sequencing order
      startFrom - paging start point
      pageSize - maximum results that can be returned
      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)
      Returns:
      a list of elements
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • findGovernanceDefinitions

      public List<GovernanceDefinitionElement> findGovernanceDefinitions(String userId, String searchString, TemplateFilter templateFilter, List<ElementStatus> limitResultsByStatus, Date asOfTime, SequencingOrder sequencingOrder, String sequencingProperty, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of governance definitions metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      userId - calling user
      searchString - string to find in the properties
      templateFilter - should templates be returned?
      limitResultsByStatus - control the status of the elements to retrieve - default is everything but Deleted
      asOfTime - repository time to use
      sequencingOrder - order to retrieve results
      sequencingProperty - property to use for sequencing order
      startFrom - paging start point
      pageSize - maximum results that can be returned
      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)
      Returns:
      list of matching metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getGovernanceDefinitionByGUID

      public GovernanceDefinitionElement getGovernanceDefinitionByGUID(String userId, String governanceDefinitionGUID, Date asOfTime, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the properties of a specific governance definition.
      Parameters:
      userId - userId of user making request
      governanceDefinitionGUID - unique identifier of the required element
      asOfTime - repository time to use
      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)
      Returns:
      retrieved properties
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem retrieving information from the property server(s).
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • getGovernanceDefinitionInContext

      public GovernanceDefinitionGraph getGovernanceDefinitionInContext(String userId, String guid, List<ElementStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the definition metadata element with the supplied unique identifier.
      Parameters:
      userId - calling user
      guid - unique identifier of the requested metadata element
      limitResultsByStatus - By default, relationships in all statuses (other than DELETE) are returned. However, it is possible to specify a list of statuses (for example ACTIVE) to restrict the results to. Null means all status values.
      asOfTime - Requests a historical query of the entity. Null means return the present values.
      sequencingProperty - String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).
      sequencingOrder - Enum defining how the results should be ordered.
      forLineage - the retrieved element is for lineage processing so include archived elements
      forDuplicateProcessing - the retrieved element is for duplicate processing so do not combine results from known duplicates.
      effectiveTime - only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      matching metadata element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)