Class GovernanceExchangeClient
java.lang.Object
org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient
org.odpi.openmetadata.accessservices.assetmanager.client.exchange.ExchangeClientBase
org.odpi.openmetadata.accessservices.assetmanager.client.exchange.GovernanceExchangeClient
- All Implemented Interfaces:
GovernanceExchangeInterface
public class GovernanceExchangeClient
extends ExchangeClientBase
implements GovernanceExchangeInterface
GovernanceExchangeClient is the client for managing governance policies and rules.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient
invalidParameterHandler, nullRequestBody, restClient, serverName, serverPlatformURLRoot, urlTemplatePrefix
-
Constructor Summary
ConstructorsConstructorDescriptionGovernanceExchangeClient
(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.GovernanceExchangeClient
(String serverName, String serverPlatformURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request.GovernanceExchangeClient
(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.GovernanceExchangeClient
(String serverName, String serverPlatformURLRoot, AssetManagerRESTClient restClient, int maxPageSize, AuditLog auditLog) Create a new client that is going to be used in an OMAG Server.GovernanceExchangeClient
(String serverName, String serverPlatformURLRoot, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearGovernanceDelegation
(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, String delegatedToDefinitionGUID) Remove the link between a governance definition and a governance definition that is delegated to (ie provides an implementation of).createGovernanceDefinition
(String userId, String assetManagerGUID, String assetManagerName, String typeName, ExternalIdentifierProperties externalIdentifierProperties, GovernanceDefinitionProperties definitionProperties) Create a new definition.void
deleteGovernanceDefinition
(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID) Delete a specific governance definition.findGovernanceActionProcesses
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of governance action process metadata elements that contain the search string.findGovernanceActionTypes
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of governance action type metadata elements that contain the search string.getActiveGovernanceActions
(String userId, int startFrom, int pageSize) Retrieve the governance actions that are still in process.getFirstActionType
(String userId, String processGUID) Return the governance action type that is the first step in a governance action process.getGovernanceAction
(String userId, String governanceActionGUID) Request the status of an executing governance action request.getGovernanceActionProcessByGUID
(String userId, String processGUID) Retrieve the governance action process metadata element with the supplied unique identifier.getGovernanceActionProcessesByName
(String userId, String name, int startFrom, int pageSize) Retrieve the list of governance action process metadata elements with a matching qualified or display name.getGovernanceActions
(String userId, int startFrom, int pageSize) Retrieve the governance actions known to the server.getGovernanceActionTypeByGUID
(String userId, String actionTypeGUID) Retrieve the governance action type metadata element with the supplied unique identifier.getGovernanceActionTypesByName
(String userId, String name, int startFrom, int pageSize) Retrieve the list of governance action type metadata elements with a matching qualified or display name.getGovernanceDefinitionByDocId
(String userId, String assetManagerGUID, String assetManagerName, String documentIdentifier) Retrieve the governance definition by its assigned unique document identifier.getGovernanceDefinitionByGUID
(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID) Retrieve the governance definition by the unique identifier assigned by this service when it was created.getNextGovernanceActionTypes
(String userId, String actionTypeGUID, int startFrom, int pageSize) Return the lust of next action type defined for the governance action process.void
linkDefinitions
(String userId, String assetManagerGUID, String assetManagerName, String definitionOneGUID, String definitionTwoGUID, String description) Link two related definitions together.void
setupGovernanceDelegation
(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, String delegatedToDefinitionGUID, String rationale) Create a link to show that a governance definition supports the requirements of one of the governance drivers.void
unlinkDefinitions
(String userId, String assetManagerGUID, String assetManagerName, String definitionOneGUID, String definitionTwoGUID) Remove the link between two definitions.void
updateGovernanceDefinition
(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, boolean isMergeUpdate, GovernanceDefinitionProperties definitionProperties) Update an existing definition.Methods inherited from class org.odpi.openmetadata.accessservices.assetmanager.client.AssetManagerBaseClient
clearRelationship, clearRelationship, createFeedbackFromTemplateWithParent, createFeedbackWithParent, createReferenceable, createReferenceableFromTemplate, createReferenceableFromTemplate, createReferenceableFromTemplateWithParent, createReferenceableFromTemplateWithParent, createReferenceableWithParent, getAssetManagerIdentifiersRequestBody, getClassifiedElements, getCorrelationProperties, getCorrelationProperties, getCorrelationProperties, getEffectiveTimeQueryRequestBody, getGlossaryTermRelationshipRequestBody, getNameRequestBody, getNameRequestBody, getQualifiedNameRequestBody, getRelatedElements, getRelationshipRequestBody, getSearchStringRequestBody, getUpdateRequestBody, handleMissingScope, removeReferenceable, removeReferenceableClassification, setReferenceableClassification, setupRelationship, setupRelationship, updateFeedback, updateReferenceable
-
Constructor Details
-
GovernanceExchangeClient
public GovernanceExchangeClient(String serverName, String serverPlatformURLRoot, 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 servicesauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceExchangeClient
public GovernanceExchangeClient(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 services- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceExchangeClient
public GovernanceExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceExchangeClient
public GovernanceExchangeClient(String serverName, String serverPlatformURLRoot, AssetManagerRESTClient restClient, int maxPageSize, AuditLog auditLog) throws InvalidParameterException Create a new client that is going to be used in an OMAG Server.- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST servicesrestClient
- client that issues the REST API callsmaxPageSize
- maximum number of results supported by this serverauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
GovernanceExchangeClient
public GovernanceExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password) 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- 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.
-
-
Method Details
-
createGovernanceDefinition
public String createGovernanceDefinition(String userId, String assetManagerGUID, String assetManagerName, String typeName, ExternalIdentifierProperties externalIdentifierProperties, GovernanceDefinitionProperties definitionProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new definition.- Specified by:
createGovernanceDefinition
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerexternalIdentifierProperties
- optional properties used to define an external identifiertypeName
- type of definitiondefinitionProperties
- properties of the definition- Returns:
- unique identifier of the definition
- Throws:
InvalidParameterException
- typeName, documentIdentifier or userId is null; documentIdentifier is not unique; typeName is not validPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
updateGovernanceDefinition
public void updateGovernanceDefinition(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, boolean isMergeUpdate, GovernanceDefinitionProperties definitionProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update an existing definition.- Specified by:
updateGovernanceDefinition
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionGUID
- unique identifier of the definition to updateisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?definitionProperties
- properties to update- Throws:
InvalidParameterException
- guid, documentIdentifier or userId is null; documentIdentifier is not unique; guid is not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
deleteGovernanceDefinition
public void deleteGovernanceDefinition(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Delete a specific governance definition.- Specified by:
deleteGovernanceDefinition
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionGUID
- unique identifier of the definition to remove- Throws:
InvalidParameterException
- guid is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
linkDefinitions
public void linkDefinitions(String userId, String assetManagerGUID, String assetManagerName, String definitionOneGUID, String definitionTwoGUID, String description) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link two related definitions together. If the link already exists the description is updated.- Specified by:
linkDefinitions
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionOneGUID
- unique identifier of the first definitiondefinitionTwoGUID
- unique identifier of the second definitiondescription
- description of their relationship- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
unlinkDefinitions
public void unlinkDefinitions(String userId, String assetManagerGUID, String assetManagerName, String definitionOneGUID, String definitionTwoGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the link between two definitions.- Specified by:
unlinkDefinitions
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionOneGUID
- unique identifier of the first definitiondefinitionTwoGUID
- unique identifier of the second definition- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
setupGovernanceDelegation
public void setupGovernanceDelegation(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, String delegatedToDefinitionGUID, String rationale) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a link to show that a governance definition supports the requirements of one of the governance drivers. If the link already exists the rationale is updated.- Specified by:
setupGovernanceDelegation
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionGUID
- unique identifier of the governance definitiondelegatedToDefinitionGUID
- unique identifier of the governance definition that is delegated torationale
- description of how the delegation supports the definition- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
clearGovernanceDelegation
public void clearGovernanceDelegation(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID, String delegatedToDefinitionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the link between a governance definition and a governance definition that is delegated to (ie provides an implementation of).- Specified by:
clearGovernanceDelegation
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionGUID
- unique identifier of the governance definitiondelegatedToDefinitionGUID
- unique identifier of the governance definition that is delegated to- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getGovernanceDefinitionByGUID
public GovernanceDefinitionElement getGovernanceDefinitionByGUID(String userId, String assetManagerGUID, String assetManagerName, String definitionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance definition by the unique identifier assigned by this service when it was created.- Specified by:
getGovernanceDefinitionByGUID
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdefinitionGUID
- identifier of the governance definition to retrieve- Returns:
- properties of the matching definition
- Throws:
InvalidParameterException
- documentIdentifier or userId is null; guid is not recognizedPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getGovernanceDefinitionByDocId
public GovernanceDefinitionElement getGovernanceDefinitionByDocId(String userId, String assetManagerGUID, String assetManagerName, String documentIdentifier) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance definition by its assigned unique document identifier.- Specified by:
getGovernanceDefinitionByDocId
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerdocumentIdentifier
- identifier to search for- Returns:
- properties of the matching definition
- Throws:
InvalidParameterException
- documentIdentifier or userId is null; documentIdentifier is not recognizedPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
findGovernanceActionProcesses
public List<GovernanceActionProcessElement> findGovernanceActionProcesses(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action process metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findGovernanceActionProcesses
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling usersearchString
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceActionProcessesByName
public List<GovernanceActionProcessElement> getGovernanceActionProcessesByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action process metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getGovernanceActionProcessesByName
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling username
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceActionProcessByGUID
public GovernanceActionProcessElement getGovernanceActionProcessByGUID(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance action process metadata element with the supplied unique identifier.- Specified by:
getGovernanceActionProcessByGUID
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userprocessGUID
- unique identifier of the requested metadata element- Returns:
- requested metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
findGovernanceActionTypes
public List<GovernanceActionTypeElement> findGovernanceActionTypes(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action type metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findGovernanceActionTypes
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling usersearchString
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceActionTypesByName
public List<GovernanceActionTypeElement> getGovernanceActionTypesByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of governance action type metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getGovernanceActionTypesByName
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling username
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceActionTypeByGUID
public GovernanceActionTypeElement getGovernanceActionTypeByGUID(String userId, String actionTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the governance action type metadata element with the supplied unique identifier.- Specified by:
getGovernanceActionTypeByGUID
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling useractionTypeGUID
- unique identifier of the governance action type- Returns:
- requested metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getFirstActionType
public GovernanceActionTypeElement getFirstActionType(String userId, String processGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the governance action type that is the first step in a governance action process.- Specified by:
getFirstActionType
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling userprocessGUID
- unique identifier of the governance action process- Returns:
- properties of the governance action type
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getNextGovernanceActionTypes
public List<NextGovernanceActionTypeElement> getNextGovernanceActionTypes(String userId, String actionTypeGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the lust of next action type defined for the governance action process.- Specified by:
getNextGovernanceActionTypes
in interfaceGovernanceExchangeInterface
- Parameters:
userId
- calling useractionTypeGUID
- unique identifier of the current governance action typestartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- return the list of relationships and attached governance action types.
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getGovernanceAction
public GovernanceActionElement getGovernanceAction(String userId, String governanceActionGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Request the status of an executing governance action request.- Specified by:
getGovernanceAction
in interfaceGovernanceExchangeInterface
- 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.
-
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:
getGovernanceActions
in interfaceGovernanceExchangeInterface
- 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:
getActiveGovernanceActions
in interfaceGovernanceExchangeInterface
- 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.
-