Class CertificationManager
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.governanceprogram.client.CertificationManager
-
- All Implemented Interfaces:
CertificationManagementInterface
public class CertificationManager extends Object implements CertificationManagementInterface
CertificationManager is the java client for managing certification types and the certification of elements.
-
-
Constructor Summary
Constructors Constructor Description CertificationManager(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.CertificationManager(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.CertificationManager(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.CertificationManager(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.CertificationManager(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 voidcertifyElement(String userId, String elementGUID, String certificationTypeGUID, CertificationProperties properties)Link an element to a certification type and include details of the certification in the relationship properties.StringcreateCertificationType(String userId, CertificationTypeProperties properties, GovernanceDefinitionStatus initialStatus)Create a description of the certification type.voiddecertifyElement(String userId, String elementGUID, String certificationTypeGUID, String certificateId)Remove the certification for an element.voiddeleteCertificationType(String userId, String certificationTypeGUID)Delete the properties of the certification type.CertificationTypeElementgetCertificationTypeByDocId(String userId, String documentIdentifier)Retrieve the certification type by its assigned unique document identifier.List<CertificationTypeElement>getCertificationTypeByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize)Retrieve all of the certification type definitions for a specific governance domain.CertificationTypeElementgetCertificationTypeByGUID(String userId, String certificationTypeGUID)Retrieve the certification type by the unique identifier assigned by this service when it was created.List<CertificationTypeElement>getCertificationTypesByTitle(String userId, String title, int startFrom, int pageSize)Retrieve all of the certification types for a particular title.voidupdateCertification(String userId, String elementGUID, String certificationTypeGUID, boolean isMergeUpdate, CertificationProperties properties)Update the properties of a certification.voidupdateCertificationType(String userId, String certificationTypeGUID, boolean isMergeUpdate, CertificationTypeProperties properties)Update the properties of the certification type.
-
-
-
Constructor Detail
-
CertificationManager
public CertificationManager(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
-
CertificationManager
public CertificationManager(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
-
CertificationManager
public CertificationManager(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
-
CertificationManager
public CertificationManager(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
-
CertificationManager
public CertificationManager(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
-
createCertificationType
public String createCertificationType(String userId, CertificationTypeProperties properties, GovernanceDefinitionStatus initialStatus) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a description of the certification type.- Specified by:
createCertificationTypein interfaceCertificationManagementInterface- Parameters:
userId- calling userproperties- certification propertiesinitialStatus- what is the initial status for the certification type - 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
-
updateCertificationType
public void updateCertificationType(String userId, String certificationTypeGUID, boolean isMergeUpdate, CertificationTypeProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of the certification type.- Specified by:
updateCertificationTypein interfaceCertificationManagementInterface- Parameters:
userId- calling usercertificationTypeGUID- identifier of the governance definition to changeisMergeUpdate- are unspecified properties unchanged (true) or replaced with null?properties- certification properties- Throws:
InvalidParameterException- guid, documentIdentifier or userId is null; documentIdentifier is not uniquePropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
deleteCertificationType
public void deleteCertificationType(String userId, String certificationTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Delete the properties of the certification type.- Specified by:
deleteCertificationTypein interfaceCertificationManagementInterface- Parameters:
userId- calling usercertificationTypeGUID- identifier of the governance definition to delete- Throws:
InvalidParameterException- guid or userId is nullPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
getCertificationTypeByGUID
public CertificationTypeElement getCertificationTypeByGUID(String userId, String certificationTypeGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the certification type by the unique identifier assigned by this service when it was created.- Specified by:
getCertificationTypeByGUIDin interfaceCertificationManagementInterface- Parameters:
userId- calling usercertificationTypeGUID- identifier of the governance definition to retrieve- Returns:
- properties of the certification type
- Throws:
InvalidParameterException- guid or userId is null; guid is not recognizedPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
getCertificationTypeByDocId
public CertificationTypeElement getCertificationTypeByDocId(String userId, String documentIdentifier) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the certification type by its assigned unique document identifier.- Specified by:
getCertificationTypeByDocIdin interfaceCertificationManagementInterface- Parameters:
userId- calling userdocumentIdentifier- identifier to search for- Returns:
- properties of the matching certification type
- Throws:
InvalidParameterException- documentIdentifier or userId is null; documentIdentifier is not recognizedPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
getCertificationTypesByTitle
public List<CertificationTypeElement> getCertificationTypesByTitle(String userId, String title, int startFrom, int pageSize) throws UserNotAuthorizedException, InvalidParameterException, PropertyServerException
Retrieve all of the certification types for a particular title. The title can include regEx wildcards.- Specified by:
getCertificationTypesByTitlein interfaceCertificationManagementInterface- 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
-
getCertificationTypeByDomainId
public List<CertificationTypeElement> getCertificationTypeByDomainId(String userId, int domainIdentifier, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve all of the certification type definitions for a specific governance domain.- Specified by:
getCertificationTypeByDomainIdin interfaceCertificationManagementInterface- 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 certification type definitions
- Throws:
InvalidParameterException- domainIdentifier or userId is null; domainIdentifier is not recognizedPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
certifyElement
public void certifyElement(String userId, String elementGUID, String certificationTypeGUID, CertificationProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Link an element to a certification type and include details of the certification in the relationship properties.- Specified by:
certifyElementin interfaceCertificationManagementInterface- Parameters:
userId- calling userelementGUID- unique identifier of the element being certifiedcertificationTypeGUID- unique identifier for the certification typeproperties- the properties of the certification- Throws:
InvalidParameterException- one of the properties is invalidPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
updateCertification
public void updateCertification(String userId, String elementGUID, String certificationTypeGUID, boolean isMergeUpdate, CertificationProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of a certification. Remember to include the certificationId in the properties if the element has multiple certifications for the same certification type.- Specified by:
updateCertificationin interfaceCertificationManagementInterface- Parameters:
userId- calling userelementGUID- unique identifier of the element being certifiedcertificationTypeGUID- unique identifier for the certification typeisMergeUpdate- should the supplied properties overlay the existing properties or replace themproperties- the properties of the certification- Throws:
InvalidParameterException- one of the properties is invalidPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
decertifyElement
public void decertifyElement(String userId, String elementGUID, String certificationTypeGUID, String certificateId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the certification for an element.- Specified by:
decertifyElementin interfaceCertificationManagementInterface- Parameters:
userId- calling userelementGUID- unique identifier of the element being certifiedcertificationTypeGUID- unique identifier for the certification typecertificateId- optional unique identifier from the certification authority - it is used to disambiguate the certifications for the element.- Throws:
InvalidParameterException- one of the properties is invalidPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
-