edu.ucsb.nceas.metacat

## Class AccessionNumber

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

-     public class AccessionNumber
      extends java.lang.Object

  (on insert of XML document) Generates a unique Accession Number or if provided check it for uniqueness and register it into the db connection (on update or delete of XML document) Check for existance of provided Accession Number

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccessionNumber(java.lang.String accnum, java.lang.String action)` NEW - WHEN CLIENT ALWAYS PROVIDE ACCESSION NUMBER INCLUDING REV IN IT Construct an AccessionNumber

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `accNumberUsed(java.lang.String accNumber)` check for existence of Accesssion Number xml_acc_numbers table
    `java.lang.String` | `getDocid()` returns the docid encoded in this accession number
    `java.lang.String` | `getRev()` returns the revision number encoded in this accession number

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

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

- - ### Constructor Detail

    - #### AccessionNumber

          public AccessionNumber(java.lang.String accnum,
                                 java.lang.String action)
                          throws AccessionNumberException,
                                 java.sql.SQLException,
                                 java.lang.NumberFormatException

      NEW - WHEN CLIENT ALWAYS PROVIDE ACCESSION NUMBER INCLUDING REV IN IT Construct an AccessionNumber
      Parameters:
        `conn` - the db connection to read Accession number from
        `accnum` - the accession number to be checked for validness
      Throws:
        `AccessionNumberException`
        `java.sql.SQLException`
        `java.lang.NumberFormatException`

  - ### Method Detail

    - #### accNumberUsed

          public static boolean accNumberUsed(java.lang.String accNumber)
                                       throws java.sql.SQLException

      check for existence of Accesssion Number xml_acc_numbers table
      Throws:
        `java.sql.SQLException`

    - #### getDocid

          public java.lang.String getDocid()

      returns the docid encoded in this accession number

    - #### getRev

          public java.lang.String getRev()

      returns the revision number encoded in this accession number

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