Class GovernanceRoleManager
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceRoleManager
-
- All Implemented Interfaces:
GovernanceRolesInterface
public class GovernanceRoleManager extends Object implements GovernanceRolesInterface
GovernanceRoleManager provides one of the client-side interface for the Governance Program Open Metadata Access Service (OMAS). This client manages all of 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.
-
-
Constructor Summary
Constructors Constructor Description GovernanceRoleManager(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringappointGovernanceRole(String userId, String governanceRoleGUID, String profileGUID, Date startDate)Link a person to a governance role.StringcreateGovernanceRole(String userId, GovernanceRoleProperties properties)Create the governance role.voiddeleteGovernanceRole(String userId, String governanceRoleGUID)Remove the requested governance role.List<GovernanceRoleAppointee>getCurrentGovernanceRoleAppointments(String userId, int domainIdentifier, int startFrom, int pageSize)Return all of the governance roles and their incumbents (if any).GovernanceRoleElementgetGovernanceRoleByGUID(String userId, String governanceRoleGUID)Retrieve a governance role description by unique guid.List<GovernanceRoleElement>getGovernanceRoleByRoleId(String userId, String roleId)Retrieve the properties of a governance role using its unique name.GovernanceRoleHistorygetGovernanceRoleHistoryByGUID(String userId, String governanceRoleGUID)Retrieve a governance role description by unique guid along with the history of who has been appointed to the role.List<GovernanceRoleElement>getGovernanceRolesByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize)Return all of the defined governance roles for a specific governance domain.List<GovernanceRoleElement>getGovernanceRolesByTitle(String userId, String title, int startFrom, int pageSize)Retrieve all of the governance roles for a particular title.voidlinkRoleToResource(String userId, String governanceRoleGUID, String resourceGUID)Link a governance role to the description of a resource that the role is responsible for.voidlinkRoleToResponsibility(String userId, String governanceRoleGUID, String responsibilityGUID)Link a governance role to a governance control that defines a governance responsibility that a person fulfils.voidrelieveGovernanceRole(String userId, String governanceRoleGUID, String profileGUID, String appointmentGUID, Date endDate)Unlink a person from a governance role appointment.voidunlinkRoleFromResource(String userId, String governanceRoleGUID, String resourceGUID)Remove the link between a governance role and a resource.voidunlinkRoleFromResponsibility(String userId, String governanceRoleGUID, String responsibilityGUID)Remove the link between a governance role and a governance responsibility.voidupdateGovernanceRole(String userId, String governanceRoleGUID, boolean isMergeUpdate, GovernanceRoleProperties properties)Update selected fields for the governance role.
-
-
-
Constructor Detail
-
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 servers- 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 serversuserId- 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 serversmaxPageSize- 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 serversuserId- 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 fro manother OMAG Server.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- internal client for rest callsmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- bad input parameters
-
-
Method Detail
-
createGovernanceRole
public String createGovernanceRole(String userId, GovernanceRoleProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Create the governance role.- Specified by:
createGovernanceRolein 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:
updateGovernanceRolein 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 the existing values associated with the governanceRoleGUID.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
linkRoleToResponsibility
public void linkRoleToResponsibility(String userId, String governanceRoleGUID, String responsibilityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Link a governance role to a governance control that defines a governance responsibility that a person fulfils.- Specified by:
linkRoleToResponsibilityin interfaceGovernanceRolesInterface- Parameters:
userId- calling usergovernanceRoleGUID- unique identifier of the governance roleresponsibilityGUID- unique identifier of the governance responsibility control- Throws:
InvalidParameterException- one of the guids is null or not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
unlinkRoleFromResponsibility
public void unlinkRoleFromResponsibility(String userId, String governanceRoleGUID, String responsibilityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the link between a governance role and a governance responsibility.- Specified by:
unlinkRoleFromResponsibilityin interfaceGovernanceRolesInterface- Parameters:
userId- calling usergovernanceRoleGUID- unique identifier of the governance roleresponsibilityGUID- unique identifier of the governance responsibility control- Throws:
InvalidParameterException- one of the guids is null or not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
linkRoleToResource
public void linkRoleToResource(String userId, String governanceRoleGUID, String resourceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Link a governance role to the description of a resource that the role is responsible for.- Specified by:
linkRoleToResourcein interfaceGovernanceRolesInterface- Parameters:
userId- calling usergovernanceRoleGUID- unique identifier of the governance roleresourceGUID- unique identifier of the resource description- Throws:
InvalidParameterException- one of the guids is null or not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
unlinkRoleFromResource
public void unlinkRoleFromResource(String userId, String governanceRoleGUID, String resourceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the link between a governance role and a resource.- Specified by:
unlinkRoleFromResourcein interfaceGovernanceRolesInterface- Parameters:
userId- calling usergovernanceRoleGUID- unique identifier of the governance roleresourceGUID- unique identifier of the resource description- Throws:
InvalidParameterException- one of the guids is null or not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
deleteGovernanceRole
public void deleteGovernanceRole(String userId, String governanceRoleGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove the requested governance role.- Specified by:
deleteGovernanceRolein 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:
getGovernanceRoleByGUIDin 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:
getGovernanceRoleHistoryByGUIDin 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 of the search results here it is possible to manage the duplicates through this interface.- Specified by:
getGovernanceRoleByRoleIdin 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 of the defined governance roles for a specific governance domain.- Specified by:
getGovernanceRolesByDomainIdin 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 of the governance roles for a particular title. The title can include regEx wildcards.- Specified by:
getGovernanceRolesByTitlein 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 of the governance roles and their incumbents (if any).- Specified by:
getCurrentGovernanceRoleAppointmentsin 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:
appointGovernanceRolein 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:
relieveGovernanceRolein 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.
-
-