public class OpenMetadataStoreClient extends OpenMetadataClient
| Constructor and Description |
|---|
OpenMetadataStoreClient(String serverName,
String serverPlatformURLRoot,
GovernanceEngineClient governanceEngineClient,
GovernanceListenerManager governanceListenerManager,
GovernanceServiceHandler governanceServiceHandler,
String engineUserId)
Create a new client with no authentication embedded in the HTTP request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
classifyMetadataElementInStore(String metadataElementGUID,
String classificationName,
Date effectiveFrom,
Date effectiveTo,
ElementProperties properties)
Add a new classification to the metadata element.
|
String |
createIncidentReport(String qualifiedName,
int domainIdentifier,
String background,
List<IncidentImpactedElement> impactedResources,
List<IncidentDependency> previousIncidents,
Map<String,Integer> incidentClassifiers,
Map<String,String> additionalProperties)
Create an incident report to capture the situation detected by this governance action service.
|
String |
createMetadataElementInStore(String metadataElementTypeName,
ElementStatus initialStatus,
Date effectiveFrom,
Date effectiveTo,
ElementProperties properties,
String templateGUID)
Create a new metadata element in the metadata store.
|
String |
createRelatedElementsInStore(String relationshipTypeName,
String metadataElement1GUID,
String metadataElement2GUID,
Date effectiveFrom,
Date effectiveTo,
ElementProperties properties)
Create a relationship between two metadata elements.
|
void |
deleteMetadataElementInStore(String metadataElementGUID)
Delete a specific metadata element.
|
void |
deleteRelatedElementsInStore(String relationshipGUID)
Delete a relationship between two metadata elements.
|
void |
disconnectListener()
Called during the disconnect processing of the watchdog governance action service.
|
List<OpenMetadataElement> |
findMetadataElements(String metadataElementTypeName,
List<String> metadataElementSubtypeName,
SearchProperties searchProperties,
List<ElementStatus> limitResultsByStatus,
SearchClassifications matchClassifications,
String sequencingProperty,
SequencingOrder sequencingOrder,
int startFrom,
int pageSize)
Return a list of metadata elements that match the supplied criteria.
|
List<OpenMetadataElement> |
findMetadataElementsWithString(String searchString,
int startFrom,
int pageSize)
Retrieve the metadata elements that contain the requested string.
|
List<RelatedMetadataElements> |
findRelationshipsBetweenMetadataElements(String relationshipTypeName,
SearchProperties searchProperties,
String sequencingProperty,
SequencingOrder sequencingOrder,
int startFrom,
int pageSize)
Return a list of relationships that match the requested conditions.
|
OpenMetadataElement |
getMetadataElementByGUID(String elementGUID)
Retrieve the metadata element using its unique identifier.
|
OpenMetadataElement |
getMetadataElementByUniqueName(String uniqueName,
String uniquePropertyName)
Retrieve the metadata element using its unique name (typically the qualified name).
|
String |
getMetadataElementGUIDByUniqueName(String uniqueName,
String uniquePropertyName)
Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
|
List<RelatedMetadataElement> |
getRelatedMetadataElements(String elementGUID,
int startingAtEnd,
String relationshipTypeName,
int startFrom,
int pageSize)
Retrieve the metadata elements connected to the supplied element.
|
String |
initiateGovernanceAction(String qualifiedName,
int domainIdentifier,
String displayName,
String description,
List<String> requestSourceGUIDs,
List<NewActionTarget> actionTargets,
Date startTime,
String governanceEngineName,
String requestType,
Map<String,String> requestParameters)
Create a governance action in the metadata store which will trigger the governance action service
associated with the supplied request type.
|
String |
initiateGovernanceActionProcess(String processQualifiedName,
Map<String,String> requestParameters,
List<String> requestSourceGUIDs,
List<NewActionTarget> actionTargets,
Date startTime)
Using the named governance action process as a template, initiate a chain of governance actions.
|
void |
reclassifyMetadataElementInStore(String metadataElementGUID,
String classificationName,
boolean replaceProperties,
ElementProperties properties)
Update the properties of a classification that is currently attached to a specific metadata element.
|
void |
recordCompletionStatus(CompletionStatus status,
List<String> outputGuards,
Map<String,String> requestParameters,
List<NewActionTarget> newActionTargets)
Declare that all of the processing for the governance action service is finished and the status of the work.
|
void |
registerListener(WatchdogGovernanceListener listener,
List<WatchdogEventType> interestingEventTypes,
List<String> interestingMetadataTypes,
String specificInstance)
Register a listener to receive events about changes to metadata elements in the open metadata store.
|
void |
unclassifyMetadataElementInStore(String metadataElementGUID,
String classificationName)
Remove the named classification from a specific metadata element.
|
void |
updateActionTargetStatus(String actionTargetGUID,
GovernanceActionStatus status,
Date startDate,
Date completionDate)
Update the status of a specific action target.
|
void |
updateClassificationStatusInStore(String metadataElementGUID,
String classificationName,
Date effectiveFrom,
Date effectiveTo)
Update the effectivity dates of a specific classification attached to a metadata element.
|
void |
updateMetadataElementInStore(String metadataElementGUID,
boolean replaceProperties,
ElementProperties properties)
Update the properties of a specific metadata element.
|
void |
updateMetadataElementStatusInStore(String metadataElementGUID,
ElementStatus newElementStatus,
Date effectiveFrom,
Date effectiveTo)
Update the status of specific metadata element.
|
void |
updateRelatedElementsInStore(String relationshipGUID,
boolean replaceProperties,
ElementProperties properties)
Update the properties associated with a relationship.
|
void |
updateRelatedElementsStatusInStore(String relationshipGUID,
Date effectiveFrom,
Date effectiveTo)
Update the effectivity dates of a specific relationship between metadata elements.
|
toStringpublic OpenMetadataStoreClient(String serverName, String serverPlatformURLRoot, GovernanceEngineClient governanceEngineClient, GovernanceListenerManager governanceListenerManager, GovernanceServiceHandler governanceServiceHandler, String engineUserId) throws InvalidParameterException
serverName - name of the server to connect toserverPlatformURLRoot - the network address of the server running the OMAS REST serversgovernanceEngineClient - client that does all of the workgovernanceListenerManager - governance listener managerengineUserId - engine userIdInvalidParameterException - the server name of platform URL root is null.public OpenMetadataElement getMetadataElementByGUID(String elementGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
getMetadataElementByGUID in interface OpenMetadataStoregetMetadataElementByGUID in class OpenMetadataClientelementGUID - unique identifier for the metadata elementInvalidParameterException - 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 storepublic OpenMetadataElement getMetadataElementByUniqueName(String uniqueName, String uniquePropertyName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
getMetadataElementByUniqueName in interface OpenMetadataStoregetMetadataElementByUniqueName in class OpenMetadataClientuniqueName - unique name for the metadata elementuniquePropertyName - name of property name to test in the open metadata element - if null "qualifiedName" is usedInvalidParameterException - 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 storepublic String getMetadataElementGUIDByUniqueName(String uniqueName, String uniquePropertyName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
getMetadataElementGUIDByUniqueName in interface OpenMetadataStoregetMetadataElementGUIDByUniqueName in class OpenMetadataClientuniqueName - unique name for the metadata elementuniquePropertyName - name of property name to test in the open metadata element - if null "qualifiedName" is usedInvalidParameterException - 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 storepublic List<OpenMetadataElement> findMetadataElementsWithString(String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
findMetadataElementsWithString in interface OpenMetadataStorefindMetadataElementsWithString in class OpenMetadataClientsearchString - name to retrievestartFrom - paging start pointpageSize - maximum results that can be returnedInvalidParameterException - the qualified name is nullUserNotAuthorizedException - the governance action service is not able to access the elementPropertyServerException - there is a problem accessing the metadata storepublic List<RelatedMetadataElement> getRelatedMetadataElements(String elementGUID, int startingAtEnd, String relationshipTypeName, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
getRelatedMetadataElements in interface OpenMetadataStoregetRelatedMetadataElements in class OpenMetadataClientelementGUID - 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)startFrom - paging start pointpageSize - maximum results that can be returnedInvalidParameterException - 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 storepublic List<OpenMetadataElement> findMetadataElements(String metadataElementTypeName, List<String> metadataElementSubtypeName, SearchProperties searchProperties, List<ElementStatus> limitResultsByStatus, SearchClassifications matchClassifications, String sequencingProperty, SequencingOrder sequencingOrder, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
findMetadataElements in interface OpenMetadataStorefindMetadataElements in class OpenMetadataClientmetadataElementTypeName - 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.startFrom - paging start pointpageSize - maximum results that can be returnedInvalidParameterException - 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 storepublic List<RelatedMetadataElements> findRelationshipsBetweenMetadataElements(String relationshipTypeName, SearchProperties searchProperties, String sequencingProperty, SequencingOrder sequencingOrder, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
findRelationshipsBetweenMetadataElements in interface OpenMetadataStorefindRelationshipsBetweenMetadataElements in class OpenMetadataClientrelationshipTypeName - 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.startFrom - paging start pointpageSize - maximum results that can be returnedInvalidParameterException - 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 storepublic String createMetadataElementInStore(String metadataElementTypeName, ElementStatus initialStatus, Date effectiveFrom, Date effectiveTo, ElementProperties properties, String templateGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
createMetadataElementInStore in class OpenMetadataClientmetadataElementTypeName - 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 of the attachments such as nested content, schema
connection etc)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 storepublic void updateMetadataElementInStore(String metadataElementGUID, boolean replaceProperties, ElementProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateMetadataElementInStore in class OpenMetadataClientmetadataElementGUID - 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.properties - new properties for the metadata elementInvalidParameterException - 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 storepublic void updateMetadataElementStatusInStore(String metadataElementGUID, ElementStatus newElementStatus, Date effectiveFrom, Date effectiveTo) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateMetadataElementStatusInStore in class OpenMetadataClientmetadataElementGUID - unique identifier of the metadata element to updatenewElementStatus - new status value - or null to leave as iseffectiveFrom - the date when this element is active - null for active noweffectiveTo - the date when this element becomes inactive - null for active until deletedInvalidParameterException - 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 storepublic void deleteMetadataElementInStore(String metadataElementGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
deleteMetadataElementInStore in class OpenMetadataClientmetadataElementGUID - unique identifier of the metadata element to updateInvalidParameterException - 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 storepublic void classifyMetadataElementInStore(String metadataElementGUID, String classificationName, Date effectiveFrom, Date effectiveTo, ElementProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
classifyMetadataElementInStore in class OpenMetadataClientmetadataElementGUID - unique identifier of the metadata element to updateclassificationName - name of the classification to add (if the classification is already present then use reclassify)effectiveFrom - 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 nameInvalidParameterException - 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 storepublic void reclassifyMetadataElementInStore(String metadataElementGUID, String classificationName, boolean replaceProperties, ElementProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
reclassifyMetadataElementInStore in class OpenMetadataClientmetadataElementGUID - 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.properties - new properties for the classificationInvalidParameterException - 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 storepublic void updateClassificationStatusInStore(String metadataElementGUID, String classificationName, Date effectiveFrom, Date effectiveTo) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateClassificationStatusInStore in class OpenMetadataClientmetadataElementGUID - unique identifier of the metadata element to updateclassificationName - unique name of the classification to updateeffectiveFrom - the date when this element is active - null for active noweffectiveTo - the date when this element becomes inactive - null for active until deletedInvalidParameterException - 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 storepublic void unclassifyMetadataElementInStore(String metadataElementGUID, String classificationName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
unclassifyMetadataElementInStore in class OpenMetadataClientmetadataElementGUID - unique identifier of the metadata element to updateclassificationName - unique name of the classification to removeInvalidParameterException - 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 storepublic String createRelatedElementsInStore(String relationshipTypeName, String metadataElement1GUID, String metadataElement2GUID, Date effectiveFrom, Date effectiveTo, ElementProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
createRelatedElementsInStore in class OpenMetadataClientrelationshipTypeName - 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 relationshipeffectiveFrom - 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 relationshipInvalidParameterException - 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 storepublic void updateRelatedElementsInStore(String relationshipGUID, boolean replaceProperties, ElementProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateRelatedElementsInStore in class OpenMetadataClientrelationshipGUID - 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.properties - new properties for the relationshipInvalidParameterException - 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 storepublic void updateRelatedElementsStatusInStore(String relationshipGUID, Date effectiveFrom, Date effectiveTo) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateRelatedElementsStatusInStore in class OpenMetadataClientrelationshipGUID - unique identifier of the relationship to updateeffectiveFrom - the date when this element is active - null for active noweffectiveTo - the date when this element becomes inactive - null for active until deletedInvalidParameterException - 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 storepublic void deleteRelatedElementsInStore(String relationshipGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
deleteRelatedElementsInStore in class OpenMetadataClientrelationshipGUID - unique identifier of the relationship to deleteInvalidParameterException - 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 storepublic void updateActionTargetStatus(String actionTargetGUID, GovernanceActionStatus status, Date startDate, Date completionDate) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
updateActionTargetStatus in class OpenMetadataClientactionTargetGUID - 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.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 storepublic void recordCompletionStatus(CompletionStatus status, List<String> outputGuards, Map<String,String> requestParameters, List<NewActionTarget> newActionTargets) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
recordCompletionStatus in class OpenMetadataClientstatus - completion status enum valueoutputGuards - optional guard strings for triggering subsequent action(s)requestParameters - properties to pass to the next governance action servicenewActionTargets - list of action target names to GUIDs for the resulting governance action serviceInvalidParameterException - 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 storepublic String initiateGovernanceAction(String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
initiateGovernanceAction in class OpenMetadataClientqualifiedName - 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 servicestartTime - future start time or null for "as soon as possible"governanceEngineName - name of the governance engine to run the requestrequestType - request type to identify the governance action service to runrequestParameters - properties to pass to the governance action serviceInvalidParameterException - null qualified nameUserNotAuthorizedException - this governance action service is not authorized to create a governance actionPropertyServerException - there is a problem with the metadata storepublic String initiateGovernanceActionProcess(String processQualifiedName, Map<String,String> requestParameters, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Date startTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
initiateGovernanceActionProcess in class OpenMetadataClientprocessQualifiedName - unique name of the governance action process to userequestParameters - initial set of request parameters to pass to the governance actionsrequestSourceGUIDs - 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".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 storepublic String createIncidentReport(String qualifiedName, int domainIdentifier, String background, List<IncidentImpactedElement> impactedResources, List<IncidentDependency> previousIncidents, Map<String,Integer> incidentClassifiers, Map<String,String> additionalProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
createIncidentReport in class OpenMetadataClientqualifiedName - 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 reportsInvalidParameterException - null or non-unique qualified name for the incident reportUserNotAuthorizedException - this governance action service is not authorized to create a incident reportPropertyServerException - there is a problem with the metadata storepublic void registerListener(WatchdogGovernanceListener listener, List<WatchdogEventType> interestingEventTypes, List<String> interestingMetadataTypes, String specificInstance) throws InvalidParameterException
registerListener in class OpenMetadataClientlistener - listener object to receive eventsinterestingEventTypes - types of events that should be passed to the listenerinterestingMetadataTypes - types of elements that are the subject of the interesting event typesspecificInstance - unique identifier of a specific instance to watch forInvalidParameterException - one or more of the type names are unrecognizedpublic void disconnectListener()
disconnectListener in class OpenMetadataClientCopyright © 2018–2021 LF AI & Data Foundation. All rights reserved.