Class RightsManager
java.lang.Object
org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
org.odpi.openmetadata.accessservices.governanceprogram.client.RightsManager
- All Implemented Interfaces:
RelatedElementsManagementInterface
,RightsManagementInterface
RightsManager is the java client for managing license types and the licensing of elements.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.accessservices.governanceprogram.client.GovernanceProgramBaseClient
nullRequestBody
-
Constructor Summary
ConstructorDescriptionRightsManager
(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.RightsManager
(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request.RightsManager
(String serverName, String serverPlatformURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request.RightsManager
(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.RightsManager
(String serverName, String serverPlatformURLRoot, GovernanceProgramRESTClient restClient, int maxPageSize) Create a new client that uses the supplied rest client. -
Method Summary
Modifier and TypeMethodDescriptioncreateLicenseType
(String userId, LicenseTypeProperties properties, GovernanceDefinitionStatus initialStatus) Create a description of the license type.void
deleteLicenseType
(String userId, String licenseTypeGUID) Delete the properties of the license type.getLicensedElements
(String userId, String licenseGUID, int startFrom, int pageSize) Return information about the elements linked to a license.getLicenses
(String userId, String elementGUID, int startFrom, int pageSize) Return information about the licenses linked to an element.getLicenseTypeByDocId
(String userId, String documentIdentifier) Retrieve the license type by its assigned unique document identifier.getLicenseTypeByDomainId
(String userId, int domainIdentifier, int startFrom, int pageSize) Retrieve all the license type definitions for a specific governance domain.getLicenseTypeByGUID
(String userId, String licenseTypeGUID) Retrieve the license type by the unique identifier assigned by this service when it was created.getLicenseTypesByTitle
(String userId, String title, int startFrom, int pageSize) Retrieve all the license types for a particular title.licenseElement
(String userId, String elementGUID, String licenseTypeGUID, LicenseProperties properties) Link an element to a license type and include details of the license in the relationship properties.void
setLicenseTypeStatus
(String userId, String licenseTypeGUID, GovernanceDefinitionStatus newStatus) Update the status of a license typevoid
unlicenseElement
(String userId, String licenseGUID) Remove the license for an element.void
updateLicense
(String userId, String licenseGUID, boolean isMergeUpdate, LicenseProperties properties) Update the properties of a license.void
updateLicenseType
(String userId, String licenseTypeGUID, boolean isMergeUpdate, LicenseTypeProperties properties) Update the properties of the license type.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
-
RightsManager
public RightsManager(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
-
RightsManager
public RightsManager(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
-
RightsManager
public RightsManager(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
-
RightsManager
public RightsManager(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
-
RightsManager
public RightsManager(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
-
createLicenseType
public String createLicenseType(String userId, LicenseTypeProperties properties, GovernanceDefinitionStatus initialStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a description of the license type.- Specified by:
createLicenseType
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userproperties
- license propertiesinitialStatus
- what is the initial status for the license type definition - default value is DRAFT- Returns:
- unique identifier of new definition
- Throws:
InvalidParameterException
- documentIdentifier or userId is null; documentIdentifier is not uniquePropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
updateLicenseType
public void updateLicenseType(String userId, String licenseTypeGUID, boolean isMergeUpdate, LicenseTypeProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the properties of the license type.- Specified by:
updateLicenseType
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseTypeGUID
- identifier of the governance definition to changeisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?properties
- license properties- Throws:
InvalidParameterException
- guid, documentIdentifier or userId is null; documentIdentifier is not uniquePropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
setLicenseTypeStatus
public void setLicenseTypeStatus(String userId, String licenseTypeGUID, GovernanceDefinitionStatus newStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the status of a license type- Specified by:
setLicenseTypeStatus
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseTypeGUID
- identifier of the governance definition to changenewStatus
- new status- Throws:
InvalidParameterException
- guid, documentIdentifier or userId is null; documentIdentifier is not uniquePropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
deleteLicenseType
public void deleteLicenseType(String userId, String licenseTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Delete the properties of the license type.- Specified by:
deleteLicenseType
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseTypeGUID
- identifier of the governance definition to delete- Throws:
InvalidParameterException
- guid or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getLicenseTypeByGUID
public LicenseTypeElement getLicenseTypeByGUID(String userId, String licenseTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the license type by the unique identifier assigned by this service when it was created.- Specified by:
getLicenseTypeByGUID
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseTypeGUID
- identifier of the governance definition to retrieve- Returns:
- properties of the license type
- Throws:
InvalidParameterException
- guid or userId is null; guid is not recognizedPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getLicenseTypeByDocId
public LicenseTypeElement getLicenseTypeByDocId(String userId, String documentIdentifier) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the license type by its assigned unique document identifier.- Specified by:
getLicenseTypeByDocId
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userdocumentIdentifier
- identifier to search for- Returns:
- properties of the matching license type
- Throws:
InvalidParameterException
- documentIdentifier or userId is null; documentIdentifier is not recognizedPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getLicenseTypesByTitle
public List<LicenseTypeElement> getLicenseTypesByTitle(String userId, String title, int startFrom, int pageSize) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException Retrieve all the license types for a particular title. The title can include regEx wildcards.- Specified by:
getLicenseTypesByTitle
in interfaceRightsManagementInterface
- Parameters:
userId
- calling usertitle
- short description of the licensestartFrom
- 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
-
getLicenseTypeByDomainId
public List<LicenseTypeElement> getLicenseTypeByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve all the license type definitions for a specific governance domain.- Specified by:
getLicenseTypeByDomainId
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userdomainIdentifier
- identifier to search forstartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- properties of the matching license type definitions
- Throws:
InvalidParameterException
- domainIdentifier or userId is null; domainIdentifier is not recognizedPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
licenseElement
public String licenseElement(String userId, String elementGUID, String licenseTypeGUID, LicenseProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link an element to a license type and include details of the license in the relationship properties.- Specified by:
licenseElement
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userelementGUID
- unique identifier of the element being certifiedlicenseTypeGUID
- unique identifier for the license typeproperties
- the properties of the license- Returns:
- unique identifier of the new relationship
- Throws:
InvalidParameterException
- one of the properties is invalidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
updateLicense
public void updateLicense(String userId, String licenseGUID, boolean isMergeUpdate, LicenseProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the properties of a license.- Specified by:
updateLicense
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseGUID
- unique identifier for the license relationshipisMergeUpdate
- should the supplied properties overlay the existing properties or replace themproperties
- the properties of the license- Throws:
InvalidParameterException
- one of the properties is invalidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
unlicenseElement
public void unlicenseElement(String userId, String licenseGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the license for an element.- Specified by:
unlicenseElement
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseGUID
- unique identifier for the license relationship- Throws:
InvalidParameterException
- one of the properties is invalidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getLicensedElements
public List<RelatedElement> getLicensedElements(String userId, String licenseGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about the elements linked to a license.- Specified by:
getLicensedElements
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userlicenseGUID
- unique identifier for the licensestartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- properties of the subject area
- Throws:
InvalidParameterException
- qualifiedName or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getLicenses
public List<LicenseElement> getLicenses(String userId, String elementGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about the licenses linked to an element.- Specified by:
getLicenses
in interfaceRightsManagementInterface
- Parameters:
userId
- calling userelementGUID
- unique identifier for the licensestartFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- properties of the subject area
- Throws:
InvalidParameterException
- qualifiedName or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-