Class GovernanceRoleManager
java.lang.Object
org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceRoleManager
- All Implemented Interfaces:
GovernanceRolesInterface
,RelatedElementsManagementInterface
public class GovernanceRoleManager
extends GovernanceProgramBaseClient
implements GovernanceRolesInterface
GovernanceRoleManager provides one of the client-side interface for the Governance Program Open Metadata Access Service (OMAS).
This client manages all the interaction with an open metadata repository. It is initialized with the URL
of the server that is running the Open Metadata Access Services. This server is responsible for locating and
managing the governance program definitions exchanged with this client.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
nullRequestBody
-
Constructor Summary
ConstructorDescriptionGovernanceRoleManager
(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.GovernanceRoleManager
(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request.GovernanceRoleManager
(String serverName, String serverPlatformURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request.GovernanceRoleManager
(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.GovernanceRoleManager
(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize) Create a new client that uses the supplied rest client. -
Method Summary
Modifier and TypeMethodDescriptionappointGovernanceRole
(String userId, String governanceRoleGUID, String profileGUID, Date startDate) Link a person to a governance role.createGovernanceRole
(String userId, GovernanceRoleProperties properties) Create the governance role.void
deleteGovernanceRole
(String userId, String governanceRoleGUID) Remove the requested governance role.getCurrentGovernanceRoleAppointments
(String userId, int domainIdentifier, int startFrom, int pageSize) Return all the governance roles and their incumbents (if any).getGovernanceRoleByGUID
(String userId, String governanceRoleGUID) Retrieve a governance role description by unique guid.getGovernanceRoleByRoleId
(String userId, String roleId) Retrieve the properties of a governance role using its unique name.getGovernanceRoleHistoryByGUID
(String userId, String governanceRoleGUID) Retrieve a governance role description by unique guid along with the history of who has been appointed to the role.getGovernanceRolesByDomainId
(String userId, int domainIdentifier, int startFrom, int pageSize) Return all the defined governance roles for a specific governance domain.getGovernanceRolesByTitle
(String userId, String title, int startFrom, int pageSize) Retrieve all the governance roles for a particular title.void
relieveGovernanceRole
(String userId, String governanceRoleGUID, String profileGUID, String appointmentGUID, Date endDate) Unlink a person from a governance role appointment.void
updateGovernanceRole
(String userId, String governanceRoleGUID, boolean isMergeUpdate, GovernanceRoleProperties properties) Update selected fields for the governance role.Methods inherited from class org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
clearAssignmentScope, clearGovernanceDefinitionScope, clearGovernanceResponsibilityAssignment, clearGovernedBy, clearMoreInformation, clearResource, clearStakeholder, getAssignedActors, getAssignedScopes, getDescriptiveElements, getGovernanceDefinitionScopes, getGovernanceDefinitionsForElement, getGovernedElements, getMoreInformation, getResourceList, getResponsibleRoles, getRoleResponsibilities, getScopedGovernanceDefinitions, getStakeholderCommissionedElements, getStakeholders, getSupportedByResource, removeReferenceable, setupAssignmentScope, setupGovernanceDefinitionScope, setupGovernanceResponsibilityAssignment, setupGovernedBy, setupMoreInformation, setupResource, setupStakeholder, updateGovernanceDefinitionStatus, updateRelationship
-
Constructor Details
-
GovernanceRoleManager
public GovernanceRoleManager(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
- bad input parameters
-
GovernanceRoleManager
public GovernanceRoleManager(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
- bad input parameters
-
GovernanceRoleManager
public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, 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 servicesmaxPageSize
- pre-initialized parameter limitauditLog
- logging destination- Throws:
InvalidParameterException
- bad input parameters
-
GovernanceRoleManager
public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, 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 requestsmaxPageSize
- pre-initialized parameter limitauditLog
- logging destination- Throws:
InvalidParameterException
- bad input parameters
-
GovernanceRoleManager
public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize) throws InvalidParameterException Create a new client that uses the supplied rest client. This is typically used when called from another OMAG Server.- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST servicesrestClient
- internal client for rest callsmaxPageSize
- pre-initialized parameter limit- Throws:
InvalidParameterException
- bad input parameters
-
-
Method Details
-
createGovernanceRole
public String createGovernanceRole(String userId, GovernanceRoleProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Create the governance role.- Specified by:
createGovernanceRole
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling user.properties
- the description of the governance role- Returns:
- Unique identifier (guid) of the governance role
- Throws:
InvalidParameterException
- the governance domain, title or appointment id is null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
updateGovernanceRole
public void updateGovernanceRole(String userId, String governanceRoleGUID, boolean isMergeUpdate, GovernanceRoleProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update selected fields for the governance role.- Specified by:
updateGovernanceRole
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling user.governanceRoleGUID
- unique identifier (guid) of the governance roleisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?properties
- the description of the governance role- Throws:
InvalidParameterException
- the title is null or the governanceDomain/appointmentId does not match the existing values associated with the governanceRoleGUID.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
deleteGovernanceRole
public void deleteGovernanceRole(String userId, String governanceRoleGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Remove the requested governance role.- Specified by:
deleteGovernanceRole
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling usergovernanceRoleGUID
- unique identifier (guid) of the governance role- Throws:
InvalidParameterException
- the appointmentId or governance domain is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getGovernanceRoleByGUID
public GovernanceRoleElement getGovernanceRoleByGUID(String userId, String governanceRoleGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve a governance role description by unique guid.- Specified by:
getGovernanceRoleByGUID
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling user.governanceRoleGUID
- unique identifier (guid) of the governance role.- Returns:
- governance role object
- Throws:
InvalidParameterException
- the unique identifier of the governance role is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getGovernanceRoleHistoryByGUID
public GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, String governanceRoleGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve a governance role description by unique guid along with the history of who has been appointed to the role.- Specified by:
getGovernanceRoleHistoryByGUID
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling user.governanceRoleGUID
- unique identifier (guid) of the governance role.- Returns:
- governance role object
- Throws:
InvalidParameterException
- the unique identifier of the governance role is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getGovernanceRoleByRoleId
public List<GovernanceRoleElement> getGovernanceRoleByRoleId(String userId, String roleId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve the properties of a governance role using its unique name. The results are returned as a list since it is possible that two roles have the same identifier due to the distributed nature of the open metadata ecosystem. By returning all the search results here it is possible to manage the duplicates through this interface.- Specified by:
getGovernanceRoleByRoleId
in interfaceGovernanceRolesInterface
- Parameters:
userId
- calling userroleId
- unique name- Returns:
- list of roles retrieved
- Throws:
InvalidParameterException
- name or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getGovernanceRolesByDomainId
public List<GovernanceRoleElement> getGovernanceRolesByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return all the defined governance roles for a specific governance domain.- Specified by:
getGovernanceRolesByDomainId
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling userdomainIdentifier
- domain of interest - 0 means all domainsstartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- list of governance role objects
- Throws:
InvalidParameterException
- the governance domain is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getGovernanceRolesByTitle
public List<GovernanceRoleElement> getGovernanceRolesByTitle(String userId, String title, int startFrom, int pageSize) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Retrieve all the governance roles for a particular title. The title can include regEx wildcards.- Specified by:
getGovernanceRolesByTitle
in interfaceGovernanceRolesInterface
- Parameters:
userId
- calling usertitle
- short description of the rolestartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- list of matching roles (null if no matching elements)
- Throws:
InvalidParameterException
- title or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getCurrentGovernanceRoleAppointments
public List<GovernanceRoleAppointee> getCurrentGovernanceRoleAppointments(String userId, int domainIdentifier, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return all the governance roles and their incumbents (if any).- Specified by:
getCurrentGovernanceRoleAppointments
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling userdomainIdentifier
- identifier of domain - 0 means allstartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- list of governance role objects
- Throws:
InvalidParameterException
- the userId is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
appointGovernanceRole
public String appointGovernanceRole(String userId, String governanceRoleGUID, String profileGUID, Date startDate) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Link a person to a governance role.- Specified by:
appointGovernanceRole
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling user.governanceRoleGUID
- unique identifier (guid) of the governance roleprofileGUID
- unique identifier for the profilestartDate
- the official start date of the appointment - null means effective immediately- Returns:
- unique identifier (guid) of the appointment relationship
- Throws:
InvalidParameterException
- the unique identifier of the governance role or profile is either null or invalid.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
relieveGovernanceRole
public void relieveGovernanceRole(String userId, String governanceRoleGUID, String profileGUID, String appointmentGUID, Date endDate) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Unlink a person from a governance role appointment.- Specified by:
relieveGovernanceRole
in interfaceGovernanceRolesInterface
- Parameters:
userId
- the name of the calling usergovernanceRoleGUID
- unique identifier (guid) of the governance roleprofileGUID
- unique identifier for the profileappointmentGUID
- unique identifier (guid) of the appointment relationshipendDate
- the official end of the appointment - null means effective immediately- Throws:
InvalidParameterException
- the profile is not linked to this governance role.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-