DLESE Tools
v1.6.0

org.dlese.dpc.services.mmd
Class MmdRec

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

public class MmdRec
extends Object
implements Comparable

Describes a single metadata record.


Field Summary
static String[] metastyleNames
           
static int MS_ADN
          Metadata style: adn
static int MS_BRIEFMETA
          Metadata style: briefmeta
static int MS_DC_QUAL
          Metadata style: dc_qual
static int MS_DC_SIMPLE
          Metadata style: dc_simple
static int MS_DLESE_ANNO
          Metadata style: dlese_anno
static int MS_DLESE_COLLECT
          Metadata style: dlese_collect
static int MS_DLESE_IMS
          Metadata style: dlese_ims
static int MS_NEWS_OPPS
          Metadata style: news_opps
static int MS_NSDL_DC
          Metadata style: nsdl_dc
static int MS_OAI_DC
          Metadata style: oai_dc
static int MS_UNKNOWN
          Metadata style: unknown (error)
static int STATUS_ACCESSIONED_DISCOVERABLE
          Record status: accessioned and discoverable
static int STATUS_ACCESSIONED_NONDISCOVERABLE
          Record status: accessioned and not discoverable
static int STATUS_DEACCESSIONED
          Record status: deaccessioned
static int STATUS_NEW
          Record status: new
static int STATUS_REJECTED
          Record status: rejected
static int STATUS_UNKNOWN
          Record status: unknown (error)
static String[] statusNames
           
 
Constructor Summary
MmdRec(String collKey, String id, String fileName, String statusStg, String metastyleStg, long firstAccessionDate, long lastMetaModDate, long recCheckDate, String primaryContent, String primarycontentType, MmdWarning[] warnings)
          Creates new MmdRec with the specified values.
 
Method Summary
static void checkStatusString(String nm)
          Checks that the specified nm is valid; if not throws MmdException.
 int compareTo(Object obj)
          Implement Comparable interface
 boolean equals(Object obj)
          Define equality for HashMap
 String getCollKey()
          Returns the collection key.
 String getFileName()
          Returns the file name of the record's XML file.
 long getFirstAccessionDate()
          Returns the date this record was first accessioned.
 String getId()
          Returns the record id.
 long getLastMetaModDate()
          Returns the date this record was last changed.
 int getMetastyle()
          Returns the metadata format: for example, MS_ADN.
 String getMetastyleString()
          Returns a string representing the metadata style, for example, "adn".
 String getPrimaryContent()
          Gets the primaryContent attribute of the MmdRec object and returns it after cleaning up the illegal character sequences "0x000d" and "0x0009"
 String getPrimaryContentType()
          Gets the primaryContentType attribute of the MmdRec object
 long getRecCheckDate()
          Returns the date this record was last checked by the idmapper.
 int getStatus()
          Returns the record status: for example, STATUS_ACCESSIONED_DISCOVERABLE.
 String getStatusString()
          Returns a string representing the record status, for example, "accessioneddiscoverable".
 MmdWarning[] getWarnings()
          Returns an array of MmdWarning for messages generated during the most recent Idmapper run.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN
Record status: unknown (error)

See Also:
Constant Field Values

STATUS_ACCESSIONED_DISCOVERABLE

public static final int STATUS_ACCESSIONED_DISCOVERABLE
Record status: accessioned and discoverable

See Also:
Constant Field Values

STATUS_ACCESSIONED_NONDISCOVERABLE

public static final int STATUS_ACCESSIONED_NONDISCOVERABLE
Record status: accessioned and not discoverable

See Also:
Constant Field Values

STATUS_DEACCESSIONED

public static final int STATUS_DEACCESSIONED
Record status: deaccessioned

See Also:
Constant Field Values

STATUS_NEW

public static final int STATUS_NEW
Record status: new

See Also:
Constant Field Values

STATUS_REJECTED

public static final int STATUS_REJECTED
Record status: rejected

See Also:
Constant Field Values

statusNames

public static final String[] statusNames

MS_UNKNOWN

public static final int MS_UNKNOWN
Metadata style: unknown (error)

See Also:
Constant Field Values

MS_ADN

public static final int MS_ADN
Metadata style: adn

See Also:
Constant Field Values

MS_BRIEFMETA

public static final int MS_BRIEFMETA
Metadata style: briefmeta

See Also:
Constant Field Values

MS_DC_QUAL

public static final int MS_DC_QUAL
Metadata style: dc_qual

See Also:
Constant Field Values

MS_DC_SIMPLE

public static final int MS_DC_SIMPLE
Metadata style: dc_simple

See Also:
Constant Field Values

MS_DLESE_ANNO

public static final int MS_DLESE_ANNO
Metadata style: dlese_anno

See Also:
Constant Field Values

MS_DLESE_COLLECT

public static final int MS_DLESE_COLLECT
Metadata style: dlese_collect

See Also:
Constant Field Values

MS_DLESE_IMS

public static final int MS_DLESE_IMS
Metadata style: dlese_ims

See Also:
Constant Field Values

MS_NSDL_DC

public static final int MS_NSDL_DC
Metadata style: nsdl_dc

See Also:
Constant Field Values

MS_NEWS_OPPS

public static final int MS_NEWS_OPPS
Metadata style: news_opps

See Also:
Constant Field Values

MS_OAI_DC

public static final int MS_OAI_DC
Metadata style: oai_dc

See Also:
Constant Field Values

metastyleNames

public static final String[] metastyleNames
Constructor Detail

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 Detail

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

DLESE Tools
v1.6.0