Class GovernanceContextClientBase
java.lang.Object
org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
org.odpi.openmetadata.frameworkservices.gaf.client.GovernanceContextClientBase
- All Implemented Interfaces:
ActionControlInterface,GovernanceActionProcessInterface,GovernanceCompletionInterface,WatchdogEventInterface
- Direct Known Subclasses:
GovernanceContextClient
public class GovernanceContextClientBase
extends OpenGovernanceClientBase
implements WatchdogEventInterface
GovernanceContextClientBase 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GovernanceListenerManagerManages registered listenersFields inherited from class org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
invalidParameterHandler, restClientFields inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
propertyHelper, serverName, serverPlatformURLRoot -
Constructor Summary
ConstructorsConstructorDescriptionGovernanceContextClientBase(String serverName, String serverPlatformURLRoot, String localServerSecretsStoreProvider, String localServerSecretsStoreLocation, String localServerSecretsStoreCollection, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnectListener(String listenerId) Called during the disconnect processing of the watchdog governance action service.voidregisterListener(String listenerId, WatchdogGovernanceListener listener, List<OpenMetadataEventType> interestingEventTypes, List<String> interestingMetadataTypes, String specificInstance) Register a listener to receive events about changes to metadata elements in the open metadata store.voidsetListenerManager(GovernanceListenerManager governanceListenerManager) Set up the listener manager.Methods inherited from class org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase
cancelEngineAction, claimEngineAction, getActiveClaimedEngineActions, getActiveEngineActions, getEngineAction, getGovernanceActionProcessGraph, initiateEngineAction, initiateGovernanceActionProcess, initiateGovernanceActionType, recordCompletionStatus, updateActionTargetStatus, updateEngineActionStatusMethods inherited from class org.odpi.openmetadata.frameworks.opengovernance.client.OpenGovernanceClient
toString
-
Field Details
-
governanceListenerManager
Manages registered listeners
-
-
Constructor Details
-
GovernanceContextClientBase
public GovernanceContextClientBase(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 toserverPlatformURLRoot- the network address of the server running the OMAS REST serviceslocalServerSecretsStoreProvider- secrets store connector for bearer tokenlocalServerSecretsStoreLocation- secrets store location for bearer tokenlocalServerSecretsStoreCollection- secrets store collection for bearer tokenmaxPageSize- pre-initialized parameter limitauditLog- logging destination- Throws:
InvalidParameterException- a problem creating the client-side components to issue any REST API calls.
-
-
Method Details
-
setListenerManager
Set up the listener manager. Called once for each governance engine handler.- Parameters:
governanceListenerManager- aggregates listeners from governance services
-
registerListener
public void registerListener(String listenerId, WatchdogGovernanceListener listener, List<OpenMetadataEventType> interestingEventTypes, List<String> interestingMetadataTypes, String specificInstance) throws InvalidParameterException Register a listener to receive events about changes to metadata elements in the open metadata store. There can be only one registered listener. If this method is called more than once, the new parameters replace the existing parameters. This means the watchdog governance action service can change the listener and the parameters that control the types of events received while it is running.
The types of events passed to the listener are controlled by the combination of the interesting event types and the interesting metadata types. That is an event is only passed to the listener if it matches both the interesting event types and the interesting metadata types.
If specific instance, interestingEventTypes or interestingMetadataTypes are null, it defaults to "any". If the listener parameter is null, no more events are passed to the listener.- Specified by:
registerListenerin interfaceWatchdogEventInterface- Parameters:
listenerId- identifier used to maintain topic event pointer in event managerlistener- 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 for- Throws:
InvalidParameterException- one or more of the type names are unrecognized
-
disconnectListener
Called during the disconnect processing of the watchdog governance action service.- Specified by:
disconnectListenerin interfaceWatchdogEventInterface- Parameters:
listenerId- identifier used to maintain topic event pointer in event manager
-