Class OpenGovernanceClientBase

java.lang.Object
org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
All Implemented Interfaces:
ActionControlInterface, GovernanceActionProcessInterface
Direct Known Subclasses:
EgeriaOpenGovernanceClient, GovernanceContextClientBase

public class OpenGovernanceClientBase extends OpenGovernanceClient
OpenGovernanceClientBase provides common governance services that originate in the Open Survey Framework (OGF). This includes the ability to define and execute governance action processes as well as manage duplicates.
  • Field Details

  • Constructor Details

    • OpenGovernanceClientBase

      public OpenGovernanceClientBase(String serverName, String serverPlatformURLRoot, String localServerSecretsStoreProvider, String localServerSecretsStoreLocation, String localServerSecretsStoreCollection, int maxPageSize, AuditLog auditLog) throws InvalidParameterException
      Create a new client with no authentication embedded in the HTTP request.
      Parameters:
      serverName - name of the server to connect to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      localServerSecretsStoreProvider - secrets store connector for bearer token
      localServerSecretsStoreLocation - secrets store location for bearer token
      localServerSecretsStoreCollection - secrets store collection for bearer token
      maxPageSize - pre-initialized parameter limit
      auditLog - logging destination
      Throws:
      InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
  • Method Details

    • initiateEngineAction

      public String initiateEngineAction(String userId, String qualifiedName, int domainIdentifier, String displayName, String description, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, List<String> receivedGuards, Date startTime, String governanceEngineName, String requestType, Map<String,String> requestParameters, String processName, String requestSourceName, String originatorServiceName, String originatorEngineName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create an engine action in the metadata store which will trigger the governance service associated with the supplied request type. The engine action remains to act as a record of the actions taken for auditing.
      Parameters:
      userId - caller's userId
      qualifiedName - unique identifier to give this engine action
      domainIdentifier - governance domain associated with this action (0=ALL)
      displayName - display name for this action
      description - description for this action
      actionSourceGUIDs - request source elements for the resulting engine action
      actionCauseGUIDs - request cause elements for the resulting engine action
      actionTargets - list of action target names to GUIDs for the resulting engine action
      receivedGuards - list of guards to initiate the engine action
      startTime - future start time or null for "as soon as possible"
      governanceEngineName - name of the governance engine that should execute the request
      requestType - governance request type from the caller
      requestParameters - properties to pass to the governance service
      processName - name of the process that this action is a part of
      requestSourceName - source of the request
      originatorServiceName - 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 engine action
      Throws:
      InvalidParameterException - null qualified name
      UserNotAuthorizedException - the caller is not authorized to create an engine action
      PropertyServerException - there is a problem with the metadata store
    • initiateGovernanceActionType

      public String initiateGovernanceActionType(String userId, String governanceActionTypeQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, List<NewActionTarget> actionTargets, Date startTime, Map<String,String> requestParameters, String originatorServiceName, String originatorEngineName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Using the named governance action type as a template, initiate an engine action.
      Parameters:
      userId - caller's userId
      governanceActionTypeQualifiedName - unique name of the governance action type to use
      actionSourceGUIDs - request source elements for the resulting engine action
      actionCauseGUIDs - request cause elements for the resulting engine action
      actionTargets - list of action target names to GUIDs for the resulting engine action
      startTime - future start time or null for "as soon as possible".
      requestParameters - request properties to be passed to the engine action
      originatorServiceName - 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 engine action
      Throws:
      InvalidParameterException - null or unrecognized qualified name of the type
      UserNotAuthorizedException - the caller is not authorized to create an engine action
      PropertyServerException - there is a problem with the metadata store
    • initiateGovernanceActionProcess

      public String initiateGovernanceActionProcess(String userId, String processQualifiedName, List<String> actionSourceGUIDs, List<String> actionCauseGUIDs, 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 engine actions.
      Parameters:
      userId - caller's userId
      processQualifiedName - unique name of the governance action process to use
      actionSourceGUIDs - request source elements for the resulting engine action
      actionCauseGUIDs - request cause elements for the resulting engine action
      actionTargets - list of action target names to GUIDs for the resulting engine action
      startTime - future start time or null for "as soon as possible".
      requestParameters - request properties to be passed to the first engine action
      originatorServiceName - 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 governance action process instance
      Throws:
      InvalidParameterException - null or unrecognized qualified name of the process
      UserNotAuthorizedException - the caller is not authorized to create a governance action process
      PropertyServerException - there is a problem with the metadata store
    • getEngineAction

      Request the status of an executing engine action request.
      Parameters:
      userId - identifier of calling user
      engineActionGUID - identifier of the engine 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.
    • cancelEngineAction

      public void cancelEngineAction(String userId, String engineActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Request that execution of an engine action is stopped.
      Parameters:
      userId - identifier of calling user
      engineActionGUID - identifier of the engine 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.
    • getActiveEngineActions

      public List<EngineActionElement> getActiveEngineActions(String userId, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the engine actions that are still in process.
      Parameters:
      userId - userId of caller
      startFrom - starting from element
      pageSize - maximum elements to return
      Returns:
      list of engine 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.
    • getGovernanceActionProcessGraph

      public GovernanceActionProcessGraph getGovernanceActionProcessGraph(String userId, String processGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the governance action process metadata element with the supplied unique identifier along with its process flow implementation. This includes the process steps and the links between them
      Parameters:
      userId - calling user
      processGUID - unique identifier of the requested metadata element
      effectiveTime - effective date/time for query
      Returns:
      requested metadata element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)