edu.ucsb.nceas.metacat

## Class RemoteDocument

- java.lang.Object
- - edu.ucsb.nceas.metacat.RemoteDocument

-     public class RemoteDocument
      extends java.lang.Object

  A class represents a document in remote metacat server. During the replication between two metacats, metadata (xml documents) might be replicated from Metacat A to Metacat B. But data file didn't. Sometime, user in Metacat B might query the data file which doesn't riside in Metacat B. We need to download it from remote metacat server A and output it to user. But it still doesn't reside in Metacat B.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteDocument(java.lang.String myDocIdWithoutRevision, java.lang.String myRevision, java.lang.String myUserName, java.lang.String myPassWord, java.lang.String myZipEntryPath)` Constructor of RemoteDcoument

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDocIdWithoutRevsion()` Method to get docidWithout revision
    `java.lang.String` | `getDocType()` Method to get docType
    `java.lang.String` | `getRevision()` Method to get revsion
    `void` | `readDocumentFromRemoteServer(javax.servlet.ServletOutputStream outPut)` Method to read both xml and data file from remote server and put the output into the given output stream
    `void` | `readDocumentFromRemoteServerByZip(java.util.zip.ZipOutputStream outPut)` Method to read both xml and data file from remote server by zip output and put the output into the given output stream

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

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

- - ### Constructor Detail

    - #### RemoteDocument

          public RemoteDocument(java.lang.String myDocIdWithoutRevision,
                                java.lang.String myRevision,
                                java.lang.String myUserName,
                                java.lang.String myPassWord,
                                java.lang.String myZipEntryPath)
                         throws java.lang.Exception

      Constructor of RemoteDcoument
      Parameters:
        `myDocIdWithoutRevision,` - Docid for this document
        `myRevision,` - revision number for this document
        `myUserName,` - the user who require this document
        `myGroup,` - the gourps the user belong to
        `myPassWord,` - the password of the user
        `myOutPut,` - the output stream the document will be put
        `myZipEntryPath,` - the base line for zip entry
      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### getDocIdWithoutRevsion

          public java.lang.String getDocIdWithoutRevsion()

      Method to get docidWithout revision

    - #### getRevision

          public java.lang.String getRevision()

      Method to get revsion

    - #### getDocType

          public java.lang.String getDocType()

      Method to get docType

    - #### readDocumentFromRemoteServer

          public void readDocumentFromRemoteServer(javax.servlet.ServletOutputStream outPut)
                                            throws java.lang.Exception

      Method to read both xml and data file from remote server and put the output into the given output stream
      Parameters:
        `outPut,` - the serverlstoutputStream which the remote document or data file need to put.
      Throws:
        `java.lang.Exception`

    - #### readDocumentFromRemoteServerByZip

          public void readDocumentFromRemoteServerByZip(java.util.zip.ZipOutputStream outPut)
                                                 throws java.lang.Exception

      Method to read both xml and data file from remote server by zip output and put the output into the given output stream
      Parameters:
        `outPut,` - the serverlstoutputStream which the remote document or data file need to put.
      Throws:
        `java.lang.Exception`

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