Class GovernanceActionHandler<B>
- java.lang.Object
-
- org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<B>
-
- org.odpi.openmetadata.commonservices.generichandlers.GovernanceActionHandler<B>
-
public class GovernanceActionHandler<B> extends OpenMetadataAPIGenericHandler<B>
MetadataElementHandler manages MetadataElement objects from the Governance Action Framework (GAF). These objects are 1-1 with an open metadata entity.
-
-
Field Summary
-
Fields inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
auditLog, beanClass, converter, defaultZones, errorHandler, invalidParameterHandler, localServerUserId, publishZones, repositoryHandler, repositoryHelper, securityVerifier, serverName, serviceName, supportedZones
-
-
Constructor Summary
Constructors Constructor Description GovernanceActionHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)Construct the handler for metadata elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclaimGovernanceAction(String userId, String governanceActionGUID, Date effectiveTime, String methodName)Request that execution of a governance action is allocated to the caller.GovernanceActionStatusgetActionStatus(String propertyName, InstanceProperties properties)Retrieve the ActionStatus enum property from the instance properties of a Governance Action.List<B>getActiveClaimedGovernanceActions(String userId, String governanceEngineGUID, int startFrom, int pageSize, Date effectiveTime, String methodName)Retrieve the governance actions that are still in process and that have been claimed by this caller's userId.List<B>getActiveGovernanceActions(String userId, int startFrom, int pageSize, Date effectiveTime, String methodName)Retrieve the governance actions that are still in process.BgetGovernanceAction(String userId, String governanceActionGUID, Date effectiveTime, String methodName)Request the status of an executing governance action request.List<B>getGovernanceActions(String userId, int startFrom, int pageSize, Date effectiveTime, String methodName)Retrieve the governance actions that are known to this server.StringinitiateGovernanceAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, List<String> mandatoryGuards, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters, String governanceActionTypeGUID, String governanceActionTypeName, String anchorGUID, String requestSourceName, String originatorServiceName, String originatorEngineName, String methodName)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, Map<String,String> requestParameters, Date startTime, String originatorServiceName, String originatorEngineName, String methodName)Using the named governance action process as a template, initiate a chain of governance actions.voidrecordCompletionStatus(String userId, String governanceActionGUID, int status, Map<String,String> callerRequestParameters, List<String> outputGuards, List<NewActionTarget> newActionTargets, Date effectiveTime, String methodName)Declare that all of the processing for the governance action service is finished along with status of the work.voidupdateActionTargetStatus(String userId, String actionTargetGUID, int status, Date startDate, Date completionDate, Date effectiveTime, String methodName)Update the status of a specific action target.voidupdateGovernanceActionStatus(String userId, String governanceActionGUID, int governanceActionStatus, Date effectiveTime, String methodName)Update the status of the governance action - providing the caller is permitted.-
Methods inherited from class org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler
addAnchorsClassification, archiveBeanInRepository, archiveBeanInRepository, countAttachments, createBeanFromTemplate, createBeanInRepository, deleteAnchoredEntity, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteBeanInRepository, deleteRelationship, entityMatchSearchCriteria, findAttachmentLinks, findBeanGUIDs, findBeans, findBeans, findBeans, findEntities, findEntities, getAllAttachmentLinks, getAnchorGUIDFromAnchorsClassification, getAttachedElement, getAttachedElementGUID, getAttachedElementGUID, getAttachedElementGUIDs, getAttachedElementGUIDs, getAttachedElements, getAttachedElements, getAttachedElements, getAttachedEntities, getAttachedEntities, getAttachedEntitiesFromUser, getAttachedEntity, getAttachedEntity, getAttachedEntity, getAttachedEntityFromUser, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachedFilteredEntities, getAttachmentLink, getAttachmentLinks, getAttachmentLinks, getAttachmentLinks, getBeanByUniqueName, getBeanByUniqueName, getBeanByValue, getBeanFromEntity, getBeanFromRepository, getBeanFromRepository, getBeanFromRepository, getBeanGUIDByUniqueName, getBeanGUIDByUniqueName, getBeanGUIDsByClassification, getBeanGUIDsByType, getBeanGUIDsByType, getBeanGUIDsByValue, getBeansByClassification, getBeansByCreator, getBeansByIntValue, getBeansByType, getBeansByType, getBeansByValue, getBeansByValue, getBeansByValue, getBeansByValue, getEffectiveTime, getEffectiveTime, getEntitiesByIntValue, getEntitiesByType, getEntitiesByType, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntitiesByValue, getEntityByValue, getEntityFromRepository, getEntityFromRepository, getEntityGUIDByValue, getEntityGUIDsByValue, getRepositoryHandler, getRepositoryHelper, getServerName, getServiceName, getTypeDefByName, getUniqueAttachmentLink, getUniqueAttachmentLink, isBeanIsolated, isEntityATypeOf, linkElementToElement, linkElementToElement, linkElementToElement, linkElementToElement, maintainSupplementaryProperties, multiLinkElementToElement, regexSearchCriteria, relinkElementToNewElement, relinkElementToNewElement, removeClassificationFromRepository, removeClassificationFromRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setClassificationInRepository, setSecurityVerifier, unlinkAllElements, unlinkConnectedElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, unlinkElementFromElement, updateBeanEffectivityDates, updateBeanEffectivityDates, updateBeanInRepository, updateBeanInRepository, updateBeanInRepository, updateBeanPropertyInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateBeanStatusInRepository, updateClassificationEffectivityDates, updateClassificationEffectivityDates, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateElementToElementLink, updateRelationshipEffectivityDates, updateRelationshipEffectivityDates, updateRelationshipProperties, validateAnchorEntity, validateAnchorEntity, validateUniqueProperty, verifyExternalSourceIdentity
-
-
-
-
Constructor Detail
-
GovernanceActionHandler
public GovernanceActionHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
Construct the handler for metadata elements.- Parameters:
converter- specific converter for this bean classbeanClass- name of bean class that is represented by the generic class BserviceName- name of this serviceserverName- name of the local serverinvalidParameterHandler- handler for managing parameter errorsrepositoryHandler- manages calls to the repository servicesrepositoryHelper- provides utilities for manipulating the repository services objectslocalServerUserId- userId for this serversecurityVerifier- open metadata security services verifiersupportedZones- list of zones that the access service is allowed to serve Asset instances from.defaultZones- list of zones that the access service should set in all new Asset instances.publishZones- list of zones that the access service sets up in published Asset instances.auditLog- destination for audit log events.
-
-
Method Detail
-
initiateGovernanceActionProcess
public String initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, Map<String,String> requestParameters, Date startTime, String originatorServiceName, String originatorEngineName, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Using the named governance action process as a template, initiate a chain of governance actions.- Parameters:
userId- caller's userIdprocessQualifiedName- unique name to give this governance action processrequestSourceGUIDs- request source elements for the resulting governance action serviceactionTargets- list of action target names to GUIDs for the resulting governance action servicerequestParameters- initial set of request parameters from the callerstartTime- future start time or null for "as soon as possible"originatorServiceName- unique identifier of the originator - typically an ActorProfile or Process such as a GovernanceService.originatorEngineName- optional unique name of the governance engine (if initiated by a governance engine).methodName- calling method- Returns:
- unique identifier of the first 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
-
initiateGovernanceAction
public String initiateGovernanceAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> requestSourceGUIDs, List<NewActionTarget> actionTargets, List<String> mandatoryGuards, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters, String governanceActionTypeGUID, String governanceActionTypeName, String anchorGUID, String requestSourceName, String originatorServiceName, String originatorEngineName, String methodName) 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.- 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 servicemandatoryGuards- list of guards that must be received in order to proceed with the governance actionreceivedGuards- 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 serviceanchorGUID- identifier of the first governance action of the process (null for standalone governance actions and the first governance action in a governance action process).governanceActionTypeGUID- unique identifier of the governance action type that initiated this governance action as part of a governance action process (or null if this is standalone governance action)governanceActionTypeName- unique name of the governance action type that initiated this governance action as part of a governance action process (or null if this is standalone governance action)requestSourceName- where did the request come fromoriginatorServiceName- unique identifier of the originator - typically an ActorProfile or Process such as a GovernanceService.originatorEngineName- optional unique name of the governance engine (if initiated by a governance engine)methodName- calling method- 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
-
getGovernanceAction
public B getGovernanceAction(String userId, String governanceActionGUID, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Request the status of an executing governance action request.- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action requesteffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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.
-
getActionStatus
public GovernanceActionStatus getActionStatus(String propertyName, InstanceProperties properties)
Retrieve the ActionStatus enum property from the instance properties of a Governance Action.- Parameters:
propertyName- name of property to extract the enum fromproperties- entity properties- Returns:
- ActionStatus enum value
-
claimGovernanceAction
public void claimGovernanceAction(String userId, String governanceActionGUID, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Request that execution of a governance action is allocated to the caller. This is only permitted if no other caller has claimed it.- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action requesteffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.UserNotAuthorizedException- user not authorized to issue this request.PropertyServerException- there was a problem detected by the metadata store.
-
updateGovernanceActionStatus
public void updateGovernanceActionStatus(String userId, String governanceActionGUID, int governanceActionStatus, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the status of the governance action - providing the caller is permitted.- Parameters:
userId- identifier of calling usergovernanceActionGUID- identifier of the governance action requestgovernanceActionStatus- new status ordinaleffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- Throws:
InvalidParameterException- one of the parameters is null or invalid.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, int status, Map<String,String> callerRequestParameters, List<String> outputGuards, List<NewActionTarget> newActionTargets, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Declare that all of the processing for the governance action service is finished along with status of the work. If this is part of a governance action process and it defines that there is a follow-on governance action then this is set up at this time.- Parameters:
userId- caller's userIdgovernanceActionGUID- unique identifier of the governance action to updatestatus- completion status enum valuecallerRequestParameters- request parameters used by the calleroutputGuards- optional guard strings for triggering subsequent action(s)newActionTargets- additional elements to add to the action targets for the next phaseeffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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
-
getGovernanceActions
public List<B> getGovernanceActions(String userId, int startFrom, int pageSize, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance actions that are known to this server.- Parameters:
userId- userId of callerstartFrom- starting from elementpageSize- maximum elements to returneffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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<B> getActiveGovernanceActions(String userId, int startFrom, int pageSize, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the governance actions that are still in process.- Parameters:
userId- userId of callerstartFrom- starting from elementpageSize- maximum elements to returneffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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<B> getActiveClaimedGovernanceActions(String userId, String governanceEngineGUID, int startFrom, int pageSize, Date effectiveTime, String methodName) 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.- Parameters:
userId- userId of callergovernanceEngineGUID- unique identifier of governance enginestartFrom- starting from elementpageSize- maximum elements to returneffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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.
-
updateActionTargetStatus
public void updateActionTargetStatus(String userId, String actionTargetGUID, int status, Date startDate, Date completionDate, Date effectiveTime, String methodName) 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.- Parameters:
userId- caller's userIdactionTargetGUID- unique identifier of the governance action servicestatus- 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 targeteffectiveTime- the time that the retrieved elements must be effective for (null for any time, new Date() for now)methodName- calling method- 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
-
-