edu.ucsb.nceas.metacat

## Class RelationHandler

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

-     public class RelationHandler
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RelationHandler(java.lang.String docid, java.lang.String doctype, DBConnection conn, edu.ucsb.nceas.utilities.triple.TripleCollection list)` Constructor for this class.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deleteRelations(java.lang.String docid)` Deletes all of the relations with a docid of 'docid'.
    `static java.lang.String` | `getAccessFileIDWithRevision(java.lang.String docid)` Get the access file id for a package

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

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

- - ### Constructor Detail

    - #### RelationHandler

          public RelationHandler(java.lang.String docid,
                                 java.lang.String doctype,
                                 DBConnection conn,
                                 edu.ucsb.nceas.utilities.triple.TripleCollection list)
                          throws McdbException,
                                 java.sql.SQLException,
                                 AccessionNumberException

      Constructor for this class. finds all of the relations to a single xml document and writes them to the database. This includes transitive relations.
      Parameters:
        `docid` - the ID of the XML document to index.
        `doctype` - the doctype of this document
        `conn` - the db connection
        `list` - the triple list
      Throws:
        `McdbException`
        `java.sql.SQLException`
        `AccessionNumberException`

  - ### Method Detail

    - #### deleteRelations

          public void deleteRelations(java.lang.String docid)
                               throws java.sql.SQLException

      Deletes all of the relations with a docid of 'docid'.
      Parameters:
        `docid` - the docid of the package which relations to delete.
      Throws:
        `java.sql.SQLException`

    - #### getAccessFileIDWithRevision

          public static java.lang.String getAccessFileIDWithRevision(java.lang.String docid)
                                                              throws java.sql.SQLException

      Get the access file id for a package
      Parameters:
        `docid` - the document identifier of the package
      Returns:
        the document identifier of the access file for that package
      Throws:
        `java.sql.SQLException`

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