edu.ucsb.nceas.metacat.object.handler

## Class NonXMLMetadataHandler

- java.lang.Object
- - edu.ucsb.nceas.metacat.object.handler.NonXMLMetadataHandler

- Direct Known Subclasses:
    JsonLDHandler

      public abstract class NonXMLMetadataHandler
      extends java.lang.Object

  The abstract class to save and validate non-xml meta data objects
  Author:
    tao

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NonXMLMetadataHandler()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `save(java.io.InputStream source, org.dataone.service.types.v1.SystemMetadata sysmeta, org.dataone.service.types.v1.Session session, EventLogData event)` Save the bytes to the disk
    `void` | `saveReplication(java.io.InputStream source, java.lang.String localId, org.dataone.service.types.v1.SystemMetadata sysmeta, java.lang.String owner, int serverCode, java.lang.String replicationNotificationServer, EventLogData event)` Save the bytes to the disk from a replication process
    `abstract boolean` | `validate(java.io.InputStream source)` The abstract method to validate the non-xml object

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NonXMLMetadataHandler

          public NonXMLMetadataHandler()

  - ### Method Detail

    - #### save

          public java.lang.String save(java.io.InputStream source,
                                       org.dataone.service.types.v1.SystemMetadata sysmeta,
                                       org.dataone.service.types.v1.Session session,
                                       EventLogData event)
                                throws org.dataone.service.exceptions.UnsupportedType,
                                       org.dataone.service.exceptions.ServiceFailure,
                                       org.dataone.service.exceptions.InvalidRequest,
                                       org.dataone.service.exceptions.InvalidSystemMetadata,
                                       org.dataone.service.exceptions.NotAuthorized

      Save the bytes to the disk
      Parameters:
        `source` - the input stream contains the content of the meta data object
        `sysmeta` - the sysmeta associated with the input stream
        `session` - the user's session who makes this call
        `event` - the event log information associated with this action
      Returns:
        the local document id. It can be null.
      Throws:
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidSystemMetadata`
        `org.dataone.service.exceptions.NotAuthorized`

    - #### saveReplication

          public void saveReplication(java.io.InputStream source,
                                      java.lang.String localId,
                                      org.dataone.service.types.v1.SystemMetadata sysmeta,
                                      java.lang.String owner,
                                      int serverCode,
                                      java.lang.String replicationNotificationServer,
                                      EventLogData event)
                               throws org.dataone.service.exceptions.UnsupportedType,
                                      org.dataone.service.exceptions.ServiceFailure,
                                      org.dataone.service.exceptions.InvalidRequest,
                                      org.dataone.service.exceptions.InvalidSystemMetadata,
                                      org.dataone.service.exceptions.NotAuthorized

      Save the bytes to the disk from a replication process
      Parameters:
        `source` - the input stream contains the content of the meta data object
        `sysmeta` - the system meta data associated with the source
        `replicationNtofication` - server the server name notifying the replication (only for the replication process)
        `event` - the event log information associated with this action
      Throws:
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidSystemMetadata`
        `org.dataone.service.exceptions.NotAuthorized`

    - #### validate

          public abstract boolean validate(java.io.InputStream source)
                                    throws org.dataone.service.exceptions.InvalidRequest

      The abstract method to validate the non-xml object
      Parameters:
        `source` - the input stream contains the content of the meta data object
      Returns:
        true if the content is valid; false otherwise.
      Throws:
        `org.dataone.service.exceptions.InvalidRequest` - when the content is not valid

Copyright © 2023 Regents of the University of California. All Rights Reserved.