java.lang.Object
org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceRoleManager
All Implemented Interfaces:
org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface, org.odpi.openmetadata.accessservices.governanceprogram.api.RelatedElementsManagementInterface

public class GovernanceRoleManager extends GovernanceProgramBaseClient implements org.odpi.openmetadata.accessservices.governanceprogram.api.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.
  • Constructor Details

    • GovernanceRoleManager

      public GovernanceRoleManager(String serverName, String serverPlatformURLRoot) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - bad input parameters
    • GovernanceRoleManager

      public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, String userId, String password) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      userId - caller's userId embedded in all HTTP requests
      password - caller's userId embedded in all HTTP requests
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - bad input parameters
    • GovernanceRoleManager

      public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, int maxPageSize, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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
      maxPageSize - pre-initialized parameter limit
      auditLog - logging destination
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - bad input parameters
    • GovernanceRoleManager

      public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, org.odpi.openmetadata.frameworks.auditlog.AuditLog auditLog) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      userId - caller's userId embedded in all HTTP requests
      password - caller's userId embedded in all HTTP requests
      maxPageSize - pre-initialized parameter limit
      auditLog - logging destination
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - bad input parameters
    • GovernanceRoleManager

      public GovernanceRoleManager(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.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 to
      serverPlatformURLRoot - the network address of the server running the OMAS REST services
      restClient - internal client for rest calls
      maxPageSize - pre-initialized parameter limit
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - bad input parameters
  • Method Details

    • createGovernanceRole

      public String createGovernanceRole(String userId, org.odpi.openmetadata.frameworks.openmetadata.properties.governance.GovernanceRoleProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Create the governance role.
      Specified by:
      createGovernanceRole in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user.
      properties - the description of the governance role
      Returns:
      Unique identifier (guid) of the governance role
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the governance domain, title or appointment id is null.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • updateGovernanceRole

      public void updateGovernanceRole(String userId, String governanceRoleGUID, boolean isMergeUpdate, org.odpi.openmetadata.frameworks.openmetadata.properties.governance.GovernanceRoleProperties properties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Update selected fields for the governance role.
      Specified by:
      updateGovernanceRole in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user.
      governanceRoleGUID - unique identifier (guid) of the governance role
      isMergeUpdate - are unspecified properties unchanged (true) or replaced with null?
      properties - the description of the governance role
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the title is null or the governanceDomain/appointmentId does not match the existing values associated with the governanceRoleGUID.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • deleteGovernanceRole

      public void deleteGovernanceRole(String userId, String governanceRoleGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Remove the requested governance role.
      Specified by:
      deleteGovernanceRole in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user
      governanceRoleGUID - unique identifier (guid) of the governance role
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the appointmentId or governance domain is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • getGovernanceRoleByGUID

      public org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleElement getGovernanceRoleByGUID(String userId, String governanceRoleGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Retrieve a governance role description by unique guid.
      Specified by:
      getGovernanceRoleByGUID in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user.
      governanceRoleGUID - unique identifier (guid) of the governance role.
      Returns:
      governance role object
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the unique identifier of the governance role is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • getGovernanceRoleHistoryByGUID

      public org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleHistory getGovernanceRoleHistoryByGUID(String userId, String governanceRoleGUID) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.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 interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user.
      governanceRoleGUID - unique identifier (guid) of the governance role.
      Returns:
      governance role object
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the unique identifier of the governance role is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • getGovernanceRoleByRoleId

      public List<org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleElement> getGovernanceRoleByRoleId(String userId, String roleId) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.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 interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - calling user
      roleId - unique name
      Returns:
      list of roles retrieved
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - name or userId is null
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing property server
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - security access problem
    • getGovernanceRolesByDomainId

      public List<org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleElement> getGovernanceRolesByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Return all the defined governance roles for a specific governance domain.
      Specified by:
      getGovernanceRolesByDomainId in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user
      domainIdentifier - domain of interest - 0 means all domains
      startFrom - where to start from in the list of definitions
      pageSize - max number of results to return in one call
      Returns:
      list of governance role objects
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the governance domain is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • getGovernanceRolesByTitle

      public List<org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleElement> getGovernanceRolesByTitle(String userId, String title, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Retrieve all the governance roles for a particular title. The title can include regEx wildcards.
      Specified by:
      getGovernanceRolesByTitle in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - calling user
      title - short description of the role
      startFrom - where to start from in the list of definitions
      pageSize - max number of results to return in one call
      Returns:
      list of matching roles (null if no matching elements)
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - title or userId is null
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing property server
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - security access problem
    • getCurrentGovernanceRoleAppointments

      public List<org.odpi.openmetadata.frameworks.openmetadata.metadataelements.GovernanceRoleAppointee> getCurrentGovernanceRoleAppointments(String userId, int domainIdentifier, int startFrom, int pageSize) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Return all the governance roles and their incumbents (if any).
      Specified by:
      getCurrentGovernanceRoleAppointments in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user
      domainIdentifier - identifier of domain - 0 means all
      startFrom - where to start from in the list of definitions
      pageSize - max number of results to return in one call
      Returns:
      list of governance role objects
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the userId is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.
    • appointGovernanceRole

      public String appointGovernanceRole(String userId, String governanceRoleGUID, String profileGUID, Date startDate) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Link a person to a governance role.
      Specified by:
      appointGovernanceRole in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user.
      governanceRoleGUID - unique identifier (guid) of the governance role
      profileGUID - unique identifier for the profile
      startDate - the official start date of the appointment - null means effective immediately
      Returns:
      unique identifier (guid) of the appointment relationship
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the unique identifier of the governance role or profile is either null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.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 org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Unlink a person from a governance role appointment.
      Specified by:
      relieveGovernanceRole in interface org.odpi.openmetadata.accessservices.governanceprogram.api.GovernanceRolesInterface
      Parameters:
      userId - the name of the calling user
      governanceRoleGUID - unique identifier (guid) of the governance role
      profileGUID - unique identifier for the profile
      appointmentGUID - unique identifier (guid) of the appointment relationship
      endDate - the official end of the appointment - null means effective immediately
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the profile is not linked to this governance role.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the server is not available.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the calling user is not authorized to issue the call.