Class MmdRec

java.lang.Object
org.dlese.dpc.services.mmd.MmdRec
All Implemented Interfaces:
Comparable

public class MmdRec extends Object implements Comparable
Describes a single metadata record.
  • Field Details

    • STATUS_UNKNOWN

      public static final int STATUS_UNKNOWN
      Record status: unknown (error)
      See Also:
    • STATUS_ACCESSIONED_DISCOVERABLE

      public static final int STATUS_ACCESSIONED_DISCOVERABLE
      Record status: accessioned and discoverable
      See Also:
    • STATUS_ACCESSIONED_NONDISCOVERABLE

      public static final int STATUS_ACCESSIONED_NONDISCOVERABLE
      Record status: accessioned and not discoverable
      See Also:
    • STATUS_DEACCESSIONED

      public static final int STATUS_DEACCESSIONED
      Record status: deaccessioned
      See Also:
    • STATUS_NEW

      public static final int STATUS_NEW
      Record status: new
      See Also:
    • STATUS_REJECTED

      public static final int STATUS_REJECTED
      Record status: rejected
      See Also:
    • statusNames

      public static final String[] statusNames
    • MS_UNKNOWN

      public static final int MS_UNKNOWN
      Metadata style: unknown (error)
      See Also:
    • MS_ADN

      public static final int MS_ADN
      Metadata style: adn
      See Also:
    • MS_BRIEFMETA

      public static final int MS_BRIEFMETA
      Metadata style: briefmeta
      See Also:
    • MS_DC_QUAL

      public static final int MS_DC_QUAL
      Metadata style: dc_qual
      See Also:
    • MS_DC_SIMPLE

      public static final int MS_DC_SIMPLE
      Metadata style: dc_simple
      See Also:
    • MS_DLESE_ANNO

      public static final int MS_DLESE_ANNO
      Metadata style: dlese_anno
      See Also:
    • MS_DLESE_COLLECT

      public static final int MS_DLESE_COLLECT
      Metadata style: dlese_collect
      See Also:
    • MS_DLESE_IMS

      public static final int MS_DLESE_IMS
      Metadata style: dlese_ims
      See Also:
    • MS_NSDL_DC

      public static final int MS_NSDL_DC
      Metadata style: nsdl_dc
      See Also:
    • MS_NEWS_OPPS

      public static final int MS_NEWS_OPPS
      Metadata style: news_opps
      See Also:
    • MS_OAI_DC

      public static final int MS_OAI_DC
      Metadata style: oai_dc
      See Also:
    • metastyleNames

      public static final String[] metastyleNames
  • Constructor Details

    • MmdRec

      public MmdRec(String collKey, String id, String fileName, String statusStg, String metastyleStg, long firstAccessionDate, long lastMetaModDate, long recCheckDate, String primaryContent, String primarycontentType, MmdWarning[] warnings) throws MmdException
      Creates new MmdRec with the specified values.
      Parameters:
      collKey - DESCRIPTION
      id - DESCRIPTION
      fileName - DESCRIPTION
      statusStg - DESCRIPTION
      metastyleStg - DESCRIPTION
      firstAccessionDate - DESCRIPTION
      lastMetaModDate - DESCRIPTION
      recCheckDate - DESCRIPTION
      primaryContent - DESCRIPTION
      primarycontentType - DESCRIPTION
      warnings - DESCRIPTION
      Throws:
      MmdException - DESCRIPTION
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPrimaryContent

      public String getPrimaryContent()
      Gets the primaryContent attribute of the MmdRec object and returns it after cleaning up the illegal character sequences "0x000d" and "0x0009"
      Returns:
      The primaryContent value
    • getPrimaryContentType

      public String getPrimaryContentType()
      Gets the primaryContentType attribute of the MmdRec object
      Returns:
      The primaryContentType value
    • getCollKey

      public String getCollKey()
      Returns the collection key.
      Returns:
      The collKey value
    • getId

      public String getId()
      Returns the record id.
      Returns:
      The id value
    • getFileName

      public String getFileName()
      Returns the file name of the record's XML file.
      Returns:
      The fileName value
    • getStatus

      public int getStatus()
      Returns the record status: for example, STATUS_ACCESSIONED_DISCOVERABLE. Must be one of the STATUS_ values above.
      Returns:
      The status value
    • getStatusString

      public String getStatusString()
      Returns a string representing the record status, for example, "accessioneddiscoverable".
      Returns:
      The statusString value
    • checkStatusString

      public static void checkStatusString(String nm) throws MmdException
      Checks that the specified nm is valid; if not throws MmdException.
      Parameters:
      nm - DESCRIPTION
      Throws:
      MmdException - DESCRIPTION
    • getMetastyle

      public int getMetastyle()
      Returns the metadata format: for example, MS_ADN. Must be one of the MS_ values above.
      Returns:
      The metastyle value
    • getMetastyleString

      public String getMetastyleString()
      Returns a string representing the metadata style, for example, "adn".
      Returns:
      The metastyleString value
    • getFirstAccessionDate

      public long getFirstAccessionDate()
      Returns the date this record was first accessioned.
      Returns:
      The firstAccessionDate value
    • getLastMetaModDate

      public long getLastMetaModDate()
      Returns the date this record was last changed.
      Returns:
      The lastMetaModDate value
    • getRecCheckDate

      public long getRecCheckDate()
      Returns the date this record was last checked by the idmapper.
      Returns:
      The recCheckDate value
    • getWarnings

      public MmdWarning[] getWarnings()
      Returns an array of MmdWarning for messages generated during the most recent Idmapper run.
      Returns:
      The warnings value
    • equals

      public boolean equals(Object obj)
      Define equality for HashMap
      Overrides:
      equals in class Object
      Parameters:
      obj - DESCRIPTION
      Returns:
      DESCRIPTION
    • compareTo

      public int compareTo(Object obj)
      Implement Comparable interface
      Specified by:
      compareTo in interface Comparable
      Parameters:
      obj - DESCRIPTION
      Returns:
      DESCRIPTION