Class GovernanceEngineClient
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.governanceengine.client.GovernanceEngineClient
-
- All Implemented Interfaces:
GovernanceProcessingInterface,MetadataElementInterface,SpecialGovernanceActionInterface
public class GovernanceEngineClient extends Object implements MetadataElementInterface, GovernanceProcessingInterface, SpecialGovernanceActionInterface
GovernanceEngineClient sits in the governance context of a governance action service when it is running in the engine host OMAG server. It is however shared by all the governance action services running in an engine service so that we only need one connector to the topic listener for the watchdog governance services.
-
-
Constructor Summary
Constructors Constructor Description GovernanceEngineClient(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.GovernanceEngineClient(String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword)Create a new client that passes userId and password in each HTTP request.GovernanceEngineClient(String serverName, String serverPlatformURLRoot, GovernanceEngineRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclaimGovernanceAction(String userId, String governanceActionGUID)Request that execution of a governance action is allocated to the caller.voidclassifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, ElementProperties properties, Date effectiveTime)Add a new classification to the metadata element.StringcreateIncidentReport(String userId, String qualifiedName, int domainIdentifier, String background, List<IncidentImpactedElement> impactedResources, List<IncidentDependency> previousIncidents, Map<String,Integer> incidentClassifiers, Map<String,String> additionalProperties, String originatorGUID)Create an incident report to capture the situation detected by this governance action service.StringcreateMetadataElementInStore(String userId, String metadataElementTypeName, ElementStatus initialStatus, Date effectiveFrom, Date effectiveTo, ElementProperties properties, String templateGUID)Create a new metadata element in the metadata store.StringcreateRelatedElementsInStore(String userId, String relationshipTypeName, String metadataElement1GUID, String metadataElement2GUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, ElementProperties properties, Date effectiveTime)Create a relationship between two metadata elements.voiddeleteMetadataElementInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Delete a specific metadata element.voiddeleteRelatedElementsInStore(String userId, String relationshipGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Delete a relationship between two metadata elements.List<OpenMetadataElement>findMetadataElements(String userId, String metadataElementTypeName, List<String> metadataElementSubtypeName, SearchProperties searchProperties, List<ElementStatus> limitResultsByStatus, SearchClassifications matchClassifications, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize)Return a list of metadata elements that match the supplied criteria.List<OpenMetadataElement>findMetadataElementsWithString(String userId, String searchString, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize)Retrieve the metadata elements that contain the requested string.List<RelatedMetadataElements>findRelationshipsBetweenMetadataElements(String userId, String relationshipTypeName, SearchProperties searchProperties, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize)Return a list of relationships that match the requested conditions.List<GovernanceActionElement>getActiveClaimedGovernanceActions(String userId, String governanceEngineGUID, int startFrom, int pageSize)Retrieve the governance actions that are still in process and that have been claimed by this caller's userId.List<GovernanceActionElement>getActiveGovernanceActions(String userId, int startFrom, int pageSize)Retrieve the governance actions that are still in process.GovernanceActionElementgetGovernanceAction(String userId, String governanceActionGUID)Request the status of an executing governance action request.List<GovernanceActionElement>getGovernanceActions(String userId, int startFrom, int pageSize)Retrieve the governance actions known to the server.OpenMetadataElementgetMetadataElementByGUID(String userId, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Retrieve the metadata element using its unique identifier.OpenMetadataElementgetMetadataElementByUniqueName(String userId, String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Retrieve the metadata element using its unique name (typically the qualified name).StringgetMetadataElementGUIDByUniqueName(String userId, String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).List<RelatedMetadataElement>getRelatedMetadataElements(String userId, String elementGUID, int startingAtEnd, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize)Retrieve the metadata elements connected to the supplied element.StringinitiateGovernanceAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters, String originatorServiceName, String originatorEngineName)Create a governance action in the metadata store which will trigger the governance action service associated with the supplied request type.StringinitiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String,String> requestParameters, String originatorServiceName, String originatorEngineName)Using the named governance action process as a template, initiate a chain of governance actions.voidlinkConsolidatedDuplicate(String userId, String consolidatedElementGUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, List<String> sourceElementGUIDs)Identify an element that acts as a consolidated version for a set of duplicate elements.voidlinkElementsAsPeerDuplicates(String userId, String metadataElement1GUID, String metadataElement2GUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, boolean setKnownDuplicate)Link elements as peer duplicates.voidreclassifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime)Update the properties of a classification that is currently attached to a specific metadata element.voidrecordCompletionStatus(String userId, String governanceActionGUID, Map<String,String> requestParameters, CompletionStatus status, List<String> outputGuards, List<NewActionTarget> newActionTargets)Declare that all the processing for the governance action service is finished and the status of the work.voidunclassifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime)Remove the named classification from a specific metadata element.voidupdateActionTargetStatus(String userId, String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate)Update the status of a specific action target.voidupdateClassificationEffectivityInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime)Update the effectivity dates of a specific classification attached to a metadata element.voidupdateGovernanceActionStatus(String userId, String governanceActionGUID, GovernanceActionStatus governanceActionStatus)Update the status of the governance action - providing the caller is permitted.voidupdateMetadataElementEffectivityInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime)Update the status of specific metadata element.voidupdateMetadataElementInStore(String userId, String metadataElementGUID, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime)Update the properties of a specific metadata element.voidupdateMetadataElementStatusInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, ElementStatus newElementStatus, Date effectiveTime)Update the status of specific metadata element.voidupdateRelatedElementsEffectivityInStore(String userId, String relationshipGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime)Update the effectivity dates of a specific relationship between metadata elements.voidupdateRelatedElementsInStore(String userId, String relationshipGUID, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime)Update the properties associated with a relationship.
-
-
-
Constructor Detail
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot, String serverUserId, String serverPassword) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversserverUserId- caller's userId embedded in all HTTP requestsserverPassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceEngineClient
public GovernanceEngineClient(String serverName, String serverPlatformURLRoot, GovernanceEngineRESTClient restClient, int maxPageSize) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- pre-initialized REST clientmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is a problem with the information about the remote OMAS
-
-
Method Detail
-
getMetadataElementByGUID
public OpenMetadataElement getMetadataElementByGUID(String userId, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the metadata element using its unique identifier.- Specified by:
getMetadataElementByGUIDin interfaceMetadataElementInterface- Parameters:
userId- caller's userIdelementGUID- unique identifier for the metadata element- Returns:
- metadata element properties
- Throws:
InvalidParameterException- the unique identifier is null or not known.UserNotAuthorizedException- the governance action service is not able to access the elementPropertyServerException- there is a problem accessing the metadata store
-
getMetadataElementByUniqueName
public OpenMetadataElement getMetadataElementByUniqueName(String userId, String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the metadata element using its unique name (typically the qualified name).- Specified by:
getMetadataElementByUniqueNamein interfaceMetadataElementInterface- Parameters:
uniqueName- unique name for the metadata elementuniquePropertyName- name of property name to test in the open metadata element - if null "qualifiedName" is usedforLineage- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing- 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.- Returns:
- metadata element properties
- Throws:
InvalidParameterException- the unique identifier is null or not known.UserNotAuthorizedException- the governance action service is not able to access the elementPropertyServerException- there is a problem accessing the metadata store
-
getMetadataElementGUIDByUniqueName
public String getMetadataElementGUIDByUniqueName(String userId, String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).- Specified by:
getMetadataElementGUIDByUniqueNamein interfaceMetadataElementInterface- Parameters:
userId- caller's userIduniqueName- unique name for the metadata elementuniquePropertyName- name of property name to test in the open metadata element - if null "qualifiedName" is usedforLineage- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing- 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.- Returns:
- metadata element unique identifier (guid)
- Throws:
InvalidParameterException- the unique identifier is null or not known.UserNotAuthorizedException- the governance action service is not able to access the elementPropertyServerException- there is a problem accessing the metadata store
-
findMetadataElementsWithString
public List<OpenMetadataElement> findMetadataElementsWithString(String userId, String searchString, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the metadata elements that contain the requested string.- Specified by:
findMetadataElementsWithStringin interfaceMetadataElementInterface- Parameters:
userId- caller's userIdsearchString- name to retrieveforLineage- the retrieved elements are for lineage processing so include archived elementsforDuplicateProcessing- the retrieved elements are 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.startFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements (or null if no elements match the name)
- Throws:
InvalidParameterException- the qualified name is nullUserNotAuthorizedException- the governance action service is not able to access the elementPropertyServerException- there is a problem accessing the metadata store
-
getRelatedMetadataElements
public List<RelatedMetadataElement> getRelatedMetadataElements(String userId, String elementGUID, int startingAtEnd, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the metadata elements connected to the supplied element.- Specified by:
getRelatedMetadataElementsin interfaceMetadataElementInterface- Parameters:
userId- caller's userIdelementGUID- unique identifier for the starting metadata elementstartingAtEnd- indicates which end to retrieve from (0 is "either end"; 1 is end1; 2 is end 2)relationshipTypeName- type name of relationships to follow (or null for all)forLineage- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing- the retrieved elements are 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.startFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of related elements
- Throws:
InvalidParameterException- the unique identifier is null or not known; the relationship type is invalidUserNotAuthorizedException- the governance action service is not able to access the elementsPropertyServerException- there is a problem accessing the metadata store
-
findMetadataElements
public List<OpenMetadataElement> findMetadataElements(String userId, String metadataElementTypeName, List<String> metadataElementSubtypeName, SearchProperties searchProperties, List<ElementStatus> limitResultsByStatus, SearchClassifications matchClassifications, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return a list of metadata elements that match the supplied criteria. The results can be returned over many pages.- Specified by:
findMetadataElementsin interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementTypeName- type of interest (null means any element type)metadataElementSubtypeName- optional list of the subtypes of the metadataElementTypeName to include in the search results. Null means all subtypes.searchProperties- Optional list of entity property conditions to match.limitResultsByStatus- By default, entities in all statuses (other than DELETE) are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.matchClassifications- Optional list of classifications to match.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 elementsforDuplicateProcessing- 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 pointpageSize- maximum results that can be returned- Returns:
- a list of elements matching the supplied criteria; null means no matching elements in the metadata store.
- Throws:
InvalidParameterException- one of the search parameters are is invalidUserNotAuthorizedException- the governance action service is not able to access the elementsPropertyServerException- there is a problem accessing the metadata store
-
findRelationshipsBetweenMetadataElements
public List<RelatedMetadataElements> findRelationshipsBetweenMetadataElements(String userId, String relationshipTypeName, SearchProperties searchProperties, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return a list of relationships that match the requested conditions. The results can be received as a series of pages.- Specified by:
findRelationshipsBetweenMetadataElementsin interfaceMetadataElementInterface- Parameters:
userId- caller's userIdrelationshipTypeName- relationship's type. Null means all types (but may be slow so not recommended).searchProperties- Optional list of relationship property conditions to match.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 elements are for lineage processing so include archived elementsforDuplicateProcessing- 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.startFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- a list of relationships. Null means no matching relationships.
- Throws:
InvalidParameterException- one of the search parameters are is invalidUserNotAuthorizedException- the governance action service is not able to access the elementsPropertyServerException- there is a problem accessing the metadata store
-
createMetadataElementInStore
public String createMetadataElementInStore(String userId, String metadataElementTypeName, ElementStatus initialStatus, Date effectiveFrom, Date effectiveTo, ElementProperties properties, String templateGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element in the metadata store. The type name comes from the open metadata types. The selected type also controls the names and types of the properties that are allowed. This version of the method allows access to advanced features such as multiple states and effectivity dates.- Specified by:
createMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementTypeName- type name of the new metadata elementinitialStatus- initial status of the metadata elementeffectiveFrom- the date when this element is active - null for active on creationeffectiveTo- the date when this element becomes inactive - null for active until deletedproperties- properties of the new metadata elementtemplateGUID- the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema connection etc)- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- the type name, status or one of the properties is invalidUserNotAuthorizedException- the governance action service is not authorized to create this type of elementPropertyServerException- there is a problem with the metadata store
-
updateMetadataElementInStore
public void updateMetadataElementInStore(String userId, String metadataElementGUID, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of a specific metadata element. The properties must match the type definition associated with the metadata element when it was created. However, it is possible to update a few properties, or replace all them by the value used in the replaceProperties flag.- Specified by:
updateMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updatereplaceProperties- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.forLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateproperties- new properties for the metadata elementeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- either the unique identifier or the properties are invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
updateMetadataElementStatusInStore
public void updateMetadataElementStatusInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, ElementStatus newElementStatus, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the status of specific metadata element. The new status must match a status value that is defined for the element's type assigned when it was created. The effectivity dates control the visibility of the element through specific APIs.- Specified by:
updateMetadataElementStatusInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicatenewElementStatus- new status value - or null to leave as iseffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- either the unique identifier or the status are invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
updateMetadataElementEffectivityInStore
public void updateMetadataElementEffectivityInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the status of specific metadata element. The new status must match a status value that is defined for the element's type assigned when it was created. The effectivity dates control the visibility of the element through specific APIs.- Specified by:
updateMetadataElementEffectivityInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveFrom- the date when this element is active - null for active noweffectiveTo- the date when this element becomes inactive - null for active until deletedeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- either the unique identifier or the status are invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
deleteMetadataElementInStore
public void deleteMetadataElementInStore(String userId, String metadataElementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Delete a specific metadata element.- Specified by:
deleteMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateforLineage- 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)- Throws:
InvalidParameterException- the unique identifier is null or invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to delete this elementPropertyServerException- there is a problem with the metadata store
-
classifyMetadataElementInStore
public void classifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, ElementProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Add a new classification to the metadata element. Note that only one classification with the same name can be attached to a metadata element.- Specified by:
classifyMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateclassificationName- name of the classification to add (if the classification is already present then use reclassify)forLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveFrom- the date when this classification is active - null for active noweffectiveTo- the date when this classification becomes inactive - null for active until deletedproperties- properties to store in the new classification. These must conform to the valid properties associated with the classification nameeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definitionUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
reclassifyMetadataElementInStore
public void reclassifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of a classification that is currently attached to a specific metadata element.- Specified by:
reclassifyMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateclassificationName- unique name of the classification to updatereplaceProperties- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.forLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateproperties- new properties for the classificationeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- the unique identifier or classification name is null or invalid in some way; properties do not match the valid properties associated with the classification's type definitionUserNotAuthorizedException- the governance action service is not authorized to update this element/classificationPropertyServerException- there is a problem with the metadata store
-
updateClassificationEffectivityInStore
public void updateClassificationEffectivityInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the effectivity dates of a specific classification attached to a metadata element. The effectivity dates control the visibility of the classification through specific APIs.- Specified by:
updateClassificationEffectivityInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateclassificationName- unique name of the classification to updateforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveFrom- the date when this element is active - null for active noweffectiveTo- the date when this element becomes inactive - null for active until deletedeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- either the unique identifier or the status are invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
unclassifyMetadataElementInStore
public void unclassifyMetadataElementInStore(String userId, String metadataElementGUID, String classificationName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the named classification from a specific metadata element.- Specified by:
unclassifyMetadataElementInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdmetadataElementGUID- unique identifier of the metadata element to updateclassificationName- unique name of the classification to removeforLineage- 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)- Throws:
InvalidParameterException- the unique identifier or classification name is null or invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to remove this classificationPropertyServerException- there is a problem with the metadata store
-
createRelatedElementsInStore
public String createRelatedElementsInStore(String userId, String relationshipTypeName, String metadataElement1GUID, String metadataElement2GUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, ElementProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a relationship between two metadata elements. It is important to put the right element at each end of the relationship according to the type definition since this will affect how the relationship is interpreted.- Specified by:
createRelatedElementsInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdrelationshipTypeName- name of the type of relationship to create. This will determine the types of metadata elements that can be related and the properties that can be associated with this relationship.metadataElement1GUID- unique identifier of the metadata element at end 1 of the relationshipmetadataElement2GUID- unique identifier of the metadata element at end 2 of the relationshipforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveFrom- the date when this element is active - null for active noweffectiveTo- the date when this element becomes inactive - null for active until deletedproperties- the properties of the relationshipeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- unique identifier of the new relationship
- Throws:
InvalidParameterException- the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the governance action service is not authorized to create this type of relationshipPropertyServerException- there is a problem with the metadata store
-
updateRelatedElementsInStore
public void updateRelatedElementsInStore(String userId, String relationshipGUID, boolean replaceProperties, boolean forLineage, boolean forDuplicateProcessing, ElementProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties associated with a relationship.- Specified by:
updateRelatedElementsInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdrelationshipGUID- unique identifier of the relationship to updatereplaceProperties- flag to indicate whether to completely replace the existing properties with the new properties, or just update the individual properties specified on the request.forLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateproperties- new properties for the relationshipeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- the unique identifier of the relationship is null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the governance action service is not authorized to update this relationshipPropertyServerException- there is a problem with the metadata store
-
updateRelatedElementsEffectivityInStore
public void updateRelatedElementsEffectivityInStore(String userId, String relationshipGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveFrom, Date effectiveTo, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the effectivity dates of a specific relationship between metadata elements. The effectivity dates control the visibility of the classification through specific APIs.- Specified by:
updateRelatedElementsEffectivityInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdrelationshipGUID- unique identifier of the relationship to updateforLineage- the query is to support lineage retrievalforDuplicateProcessing- the query is for duplicate processing and so must not deduplicateeffectiveFrom- the date when this element is active - null for active noweffectiveTo- the date when this element becomes inactive - null for active until deletedeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Throws:
InvalidParameterException- either the unique identifier or the status are invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to update this elementPropertyServerException- there is a problem with the metadata store
-
deleteRelatedElementsInStore
public void deleteRelatedElementsInStore(String userId, String relationshipGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Delete a relationship between two metadata elements.- Specified by:
deleteRelatedElementsInStorein interfaceMetadataElementInterface- Parameters:
userId- caller's userIdrelationshipGUID- unique identifier of the relationship to deleteforLineage- 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)- Throws:
InvalidParameterException- the unique identifier of the relationship is null or invalid in some wayUserNotAuthorizedException- the governance action service is not authorized to delete this relationshipPropertyServerException- there is a problem with the metadata store
-
updateActionTargetStatus
public void updateActionTargetStatus(String userId, String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the status of a specific action target. By default, these values are derived from the values for the governance action service. However, if the governance action service has to process name target elements, then setting the status on each individual target will show the progress of the governance action service.- Specified by:
updateActionTargetStatusin interfaceGovernanceProcessingInterface- Parameters:
userId- caller's userIdactionTargetGUID- unique identifier of the governance action service.status- status enum to show its progressstartDate- date/time that the governance action service started processing the targetcompletionDate- date/time that the governance process completed processing this target.- Throws:
InvalidParameterException- the action target GUID is not recognizedUserNotAuthorizedException- the governance action service is not authorized to update the action target propertiesPropertyServerException- there is a problem connecting to the metadata store
-
updateGovernanceActionStatus
public void updateGovernanceActionStatus(String userId, String governanceActionGUID, GovernanceActionStatus governanceActionStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the status of the governance action - providing the caller is permitted.- Specified by:
updateGovernanceActionStatusin interfaceGovernanceProcessingInterface- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action requestgovernanceActionStatus- new status enum- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
recordCompletionStatus
public void recordCompletionStatus(String userId, String governanceActionGUID, Map<String,String> requestParameters, CompletionStatus status, List<String> outputGuards, List<NewActionTarget> newActionTargets) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Declare that all the processing for the governance action service is finished and the status of the work.- Specified by:
recordCompletionStatusin interfaceGovernanceProcessingInterface- Parameters:
userId- caller's userIdgovernanceActionGUID- unique identifier of the governance action to updaterequestParameters- request properties from the caller (will be passed onto any follow-on actions)status- completion status enum valueoutputGuards- optional guard strings for triggering subsequent action(s)newActionTargets- list of action target names to GUIDs for the resulting governance action service- Throws:
InvalidParameterException- the completion status is nullUserNotAuthorizedException- the governance action service is not authorized to update the governance action service statusPropertyServerException- there is a problem connecting to the metadata store
-
initiateGovernanceAction
public String initiateGovernanceAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters, String originatorServiceName, String originatorEngineName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a governance action in the metadata store which will trigger the governance action service associated with the supplied request type. The governance action remains to act as a record of the actions taken for auditing.- Specified by:
initiateGovernanceActionin interfaceGovernanceProcessingInterface- Parameters:
userId- caller's userIdqualifiedName- unique identifier to give this governance actiondomainIdentifier- governance domain associated with this action (0=ALL)displayName- display name for this actiondescription- description for this actionrequestSourceGUIDs- request source elements for the resulting governance action serviceactionTargets- list of action target names to GUIDs for the resulting governance action servicereceivedGuards- list of guards to initiate the governance actionstartTime- future start time or null for "as soon as possible"governanceEngineName- name of the governance engine that should execute the requestrequestType- request type to identify the governance action service to runrequestParameters- properties to pass to the governance action serviceoriginatorServiceName- unique name of the requesting governance service (if initiated by a governance engine).originatorEngineName- optional unique name of the requesting governance engine (if initiated by a governance engine).- Returns:
- unique identifier of the governance action
- Throws:
InvalidParameterException- null qualified nameUserNotAuthorizedException- this governance action service is not authorized to create a governance actionPropertyServerException- there is a problem with the metadata store
-
initiateGovernanceActionProcess
public String initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String,String> requestParameters, String originatorServiceName, String originatorEngineName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Using the named governance action process as a template, initiate a chain of governance actions.- Specified by:
initiateGovernanceActionProcessin interfaceGovernanceProcessingInterface- Parameters:
userId- caller's userIdprocessQualifiedName- unique name of the governance action process to userequestSourceGUIDs- request source elements for the resulting governance action serviceactionTargets- list of action target names to GUIDs for the resulting governance action servicestartTime- future start time or null for "as soon as possible".requestParameters- request properties to be passed to the first governance actionoriginatorServiceName- unique name of the requesting governance service (if initiated by a governance engine).originatorEngineName- optional unique name of the governance engine (if initiated by a governance engine).- Returns:
- unique identifier of the first governance action of the process
- Throws:
InvalidParameterException- null or unrecognized qualified name of the processUserNotAuthorizedException- this governance action service is not authorized to create a governance action processPropertyServerException- there is a problem with the metadata store
-
getGovernanceAction
public GovernanceActionElement getGovernanceAction(String userId, String governanceActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Request the status of an executing governance action request.- Specified by:
getGovernanceActionin interfaceGovernanceProcessingInterface- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action request.- Returns:
- status enum
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
claimGovernanceAction
public void claimGovernanceAction(String userId, String governanceActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Request that execution of a governance action is allocated to the caller.- Specified by:
claimGovernanceActionin interfaceGovernanceProcessingInterface- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action request.- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
getGovernanceActions
public List<GovernanceActionElement> getGovernanceActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance actions known to the server.- Specified by:
getGovernanceActionsin interfaceGovernanceProcessingInterface- Parameters:
userId- userId of callerstartFrom- starting from elementpageSize- maximum elements to return- Returns:
- list of governance action elements
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
getActiveGovernanceActions
public List<GovernanceActionElement> getActiveGovernanceActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance actions that are still in process.- Specified by:
getActiveGovernanceActionsin interfaceGovernanceProcessingInterface- Parameters:
userId- userId of callerstartFrom- starting from elementpageSize- maximum elements to return- Returns:
- list of governance action elements
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
getActiveClaimedGovernanceActions
public List<GovernanceActionElement> getActiveClaimedGovernanceActions(String userId, String governanceEngineGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance actions that are still in process and that have been claimed by this caller's userId. This call is used when the caller restarts.- Specified by:
getActiveClaimedGovernanceActionsin interfaceGovernanceProcessingInterface- Parameters:
userId- userId of callergovernanceEngineGUID- unique identifier of governance enginestartFrom- starting from elementpageSize- maximum elements to return- Returns:
- list of governance action elements
- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
createIncidentReport
public String createIncidentReport(String userId, String qualifiedName, int domainIdentifier, String background, List<IncidentImpactedElement> impactedResources, List<IncidentDependency> previousIncidents, Map<String,Integer> incidentClassifiers, Map<String,String> additionalProperties, String originatorGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create an incident report to capture the situation detected by this governance action service. This incident report will be processed by other governance activities.- Specified by:
createIncidentReportin interfaceSpecialGovernanceActionInterface- Parameters:
userId- caller's userIdqualifiedName- unique identifier to give this new incident reportdomainIdentifier- governance domain associated with this action (0=ALL)background- description of the situationimpactedResources- details of the resources impacted by this situationpreviousIncidents- links to previous incident reports covering this situationincidentClassifiers- initial classifiers for the incident reportadditionalProperties- additional arbitrary properties for the incident reportsoriginatorGUID- the unique identifier of the person or process that created the incident- Returns:
- unique identifier of the resulting incident report
- Throws:
InvalidParameterException- null or non-unique qualified name for the incident reportUserNotAuthorizedException- this governance action service is not authorized to create an incident reportPropertyServerException- there is a problem with the metadata store
-
linkElementsAsPeerDuplicates
public void linkElementsAsPeerDuplicates(String userId, String metadataElement1GUID, String metadataElement2GUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, boolean setKnownDuplicate) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Link elements as peer duplicates. Create a simple relationship between two elements. If the relationship already exists, the properties are updated.- Specified by:
linkElementsAsPeerDuplicatesin interfaceSpecialGovernanceActionInterface- Parameters:
userId- caller's userIdmetadataElement1GUID- unique identifier of the metadata element at end 1 of the relationshipmetadataElement2GUID- unique identifier of the metadata element at end 2 of the relationshipstatusIdentifier- what is the status of this relationship (negative means untrusted, 0 means unverified and positive means trusted)steward- identifier of the stewardstewardTypeName- type of element used to identify the stewardstewardPropertyName- property name used to identify stewardsource- source of the duplicate detection processingnotes- notes for the stewardsetKnownDuplicate- boolean flag indicating whether the KnownDuplicate classification should be set on the linked entities.- Throws:
InvalidParameterException- the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the governance action service is not authorized to create this type of relationshipPropertyServerException- there is a problem with the metadata store
-
linkConsolidatedDuplicate
public void linkConsolidatedDuplicate(String userId, String consolidatedElementGUID, int statusIdentifier, String steward, String stewardTypeName, String stewardPropertyName, String source, String notes, List<String> sourceElementGUIDs) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Identify an element that acts as a consolidated version for a set of duplicate elements. (The consolidated element is created using createMetadataElement.)- Specified by:
linkConsolidatedDuplicatein interfaceSpecialGovernanceActionInterface- Parameters:
userId- caller's userIdconsolidatedElementGUID- unique identifier of the metadata elementstatusIdentifier- what is the status of this relationship (negative means untrusted, 0 means unverified and positive means trusted)steward- identifier of the stewardstewardTypeName- type of element used to identify the stewardstewardPropertyName- property name used to identify stewardsource- source of the duplicate detection processingnotes- notes for the stewardsourceElementGUIDs- List of the source elements that must be linked to the consolidated element. It is assumed that they already have the KnownDuplicateClassification.- Throws:
InvalidParameterException- the unique identifier's of the metadata elements are null or invalid in some way; the properties are not valid for this type of relationshipUserNotAuthorizedException- the governance action service is not authorized to create this type of relationshipPropertyServerException- there is a problem with the metadata store
-
-