Class LicenseHandler<B>


public class LicenseHandler<B> extends GovernanceDefinitionHandler<B>
LicenseHandler manages License objects. It runs server-side in the OMAG Server Platform and retrieves License entities through the OMRSRepositoryConnector.
  • Constructor Details

    • LicenseHandler

      public LicenseHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
      Construct the handler information needed to interact with the repository services
      Parameters:
      converter - specific converter for this bean class
      beanClass - name of bean class that is represented by the generic class B
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      repositoryHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      localServerUserId - userId for this server
      securityVerifier - open metadata security services verifier
      supportedZones - list of zones that the access service is allowed to serve Asset instances from.
      defaultZones - list of zones that the access service should set in all new Asset instances.
      publishZones - list of zones that the access service sets up in published Asset instances.
      auditLog - destination for audit log events.
  • Method Details

    • getLicenses

      public List<B> getLicenses(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the Licenses attached to an anchor entity.
      Parameters:
      userId - calling user
      elementGUID - identifier for the entity that the license is attached to
      elementGUIDParameterName - name of parameter supplying the GUID
      elementTypeName - name of the type of object being attached to
      startFrom - where to start from in the list
      pageSize - maximum number of results that can be returned
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - what is the effective time for related queries needed to do the update
      methodName - calling method
      Returns:
      list of licenses or null if none found
      Throws:
      InvalidParameterException - the input properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • getLicenses

      public List<B> getLicenses(String userId, String elementGUID, String elementGUIDParameterName, String elementTypeName, List<String> serviceSupportedZones, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the Licenses attached to an element.
      Parameters:
      userId - calling user
      elementGUID - identifier for the entity that the license is attached to
      elementGUIDParameterName - name of parameter supplying the GUID
      elementTypeName - name of the type of object being attached to
      serviceSupportedZones - supported zones for calling service
      startFrom - where to start from in the list
      pageSize - maximum number of results that can be returned
      forLineage - return elements marked with the Memento classification?
      forDuplicateProcessing - do not merge elements marked as duplicates?
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of licenses or null if none found
      Throws:
      InvalidParameterException - the input properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • licenseElement

      public String licenseElement(String userId, String externalSourceGUID, String externalSourceName, String elementGUID, String elementGUIDParameterName, String elementTypeName, String licenseTypeGUID, String licenseTypeGUIDParameterName, String licenseTypeGUIDTypeName, String licenseGUID, Date start, Date end, String conditions, String licensedBy, String licensedByTypeName, String licensedByPropertyName, String custodian, String custodianTypeName, String custodianPropertyName, String licensee, String licenseeTypeName, String licenseePropertyName, String notes, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a link between a license type and an element that has achieved the license.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      elementGUID - unique identifier of the element
      elementGUIDParameterName - parameter supplying the elementGUID
      elementTypeName - typename of super-definition
      licenseTypeGUID - unique identifier of the license type
      licenseTypeGUIDParameterName - parameter supplying licenseTypeGUID
      licenseTypeGUIDTypeName - type name of the licenseTypeGUID
      licenseGUID - unique identifier of the license (maybe from an external system)
      start - when did the license start
      end - when will the license end
      conditions - any conditions added to the license
      licensedBy - unique name/identifier of the element for the person/organization licensing the element
      licensedByTypeName - type of the licensedBy element
      licensedByPropertyName - property name for the unique identifier from the licensedBy element
      custodian - unique name/identifier of the element for the person/organization responsible for maintaining the license status
      custodianTypeName - type of the custodian element
      custodianPropertyName - property name for the unique identifier from the custodian element
      licensee - unique name/identifier of the element for the person/organization receiving the license
      licenseeTypeName - type of the licensee element
      licenseePropertyName - property name for the unique identifier from the licensee element
      notes - additional information, endorsements etc
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      guid of license relationship
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • updateLicense

      public void updateLicense(String userId, String externalSourceGUID, String externalSourceName, String licenseGUID, String licenseGUIDParameterName, String licenseId, Date start, Date end, String conditions, String licensedBy, String licensedByTypeName, String licensedByPropertyName, String custodian, String custodianTypeName, String custodianPropertyName, String licensee, String licenseeTypeName, String licenseePropertyName, String notes, boolean isMergeUpdate, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Update the license relationship.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      licenseGUID - unique identifier for the relationship
      licenseGUIDParameterName - parameter
      licenseId - unique identifier of the license (maybe from an external system)
      start - when did the license start
      end - when will the license end
      conditions - any conditions added to the license
      licensedBy - unique name/identifier of the element for the person/organization licensing the element
      licensedByTypeName - type of the licensedBy element
      licensedByPropertyName - property name for the unique identifier from the licensedBy element
      custodian - unique name/identifier of the element for the person/organization responsible for maintaining the license status
      custodianTypeName - type of the custodian element
      custodianPropertyName - property name for the unique identifier from the custodian element
      licensee - unique name/identifier of the element for the person/organization receiving the license
      licenseeTypeName - type of the licensee element
      licenseePropertyName - property name for the unique identifier from the licensee element
      notes - additional information, endorsements etc
      isMergeUpdate - are unspecified properties unchanged (true) or replaced with null?
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • unlicenseElement

      public void unlicenseElement(String userId, String externalSourceGUID, String externalSourceName, String licenseGUID, String licenseGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove a relationship between two definitions.
      Parameters:
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      userId - calling user
      licenseGUID - unique identifier of the license relationship
      licenseGUIDParameterName - parameter supplying licenseGUID
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)