public class NoteHandler<B> extends ReferenceableHandler<B>
NoteLogHandler manages NoteLog objects. It runs server-side in the OMAG Server Platform and retrieves NoteLog entities through the OMRSRepositoryConnector.
  • Constructor Details

    • NoteHandler

      public NoteHandler(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

    • attachNewNote

      public String attachNewNote(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String noteLogGUID, String noteLogGUIDParameterName, String suppliedQualifiedName, String title, String text, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Adds a note and link it to the supplied parent entity.
      Parameters:
      userId - String - userId of user making request.
      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
      anchorGUID - head of the note chain
      noteLogGUID - String - unique id for a referenceable entity that the note is to be attached to.
      noteLogGUIDParameterName - name of parameter that supplied the entity's unique identifier.
      suppliedQualifiedName - ordinal of note enum.
      title - ordinal of note enum.
      text - String - the text of the note.
      effectiveFrom - the date when this element is active - null for active now
      effectiveTo - the date when this element becomes inactive - null for active until deleted
      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:
      guid of new note.
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - There is a problem adding the asset properties to the property server.
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • updateNote

      public void updateNote(String userId, String externalSourceGUID, String externalSourceName, String noteGUID, String noteGUIDParameterName, String qualifiedName, String title, String noteText, boolean isMergeUpdate, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Update an existing note.
      Parameters:
      userId - userId of user making request.
      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
      noteGUID - unique identifier for the note to change
      noteGUIDParameterName - name of parameter for noteGUID
      qualifiedName - unique name of the note
      title - title of the note
      noteText - the text of the note
      isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
      effectiveFrom - the date when this element is active - null for active now
      effectiveTo - the date when this element becomes inactive - null for active until deleted
      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
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem adding the asset properties to the property server.
      UserNotAuthorizedException - the requesting user is not authorized to issue this request.
    • removeNoteFromElement

      public void removeNoteFromElement(String userId, String externalSourceGUID, String externalSourceName, String noteGUID, String noteGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Removes a note added to the parent by this user.
      Parameters:
      userId - userId of user making request.
      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
      noteGUIDParameterName - parameter supplying the
      noteGUID - unique identifier for the note object.
      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
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      PropertyServerException - there is a problem updating the asset properties in the property server.
      UserNotAuthorizedException - the user does not have permission to perform this request.
    • getNotes

      public List<B> getNotes(String userId, String noteLogGUID, String noteLogGUIDParameterName, String noteLogTypeName, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the notes attached to an anchor note log.
      Parameters:
      userId - calling user
      noteLogGUID - identifier for the entity that the note is attached to
      noteLogGUIDParameterName - name of parameter supplying the GUID
      noteLogTypeName - name of the type of object being attached to
      startingFrom - 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 retrieved objects 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
    • getNotes

      public List<B> getNotes(String userId, String noteLogGUID, String noteLogGUIDParameterName, String noteLogTypeName, List<String> serviceSupportedZones, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the notes attached to an anchor note log.
      Parameters:
      userId - calling user
      noteLogGUID - identifier for the entity that the note is attached to
      noteLogGUIDParameterName - name of parameter supplying the GUID
      noteLogTypeName - name of the type of object being attached to
      serviceSupportedZones - supported zones for calling service
      startingFrom - 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 retrieved objects 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
    • findNotes

      public List<B> findNotes(String userId, String searchString, String searchStringParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      userId - calling user
      searchString - string to find in the properties
      searchStringParameterName - name of parameter supplying the search string
      startFrom - paging start point
      pageSize - maximum 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 matching metadata elements
      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)