Package org.dlese.dpc.services.mmd
Class Query
java.lang.Object
org.dlese.dpc.services.mmd.Query
Provides access to the meta-metadata database.
Sample test program:
###
- Author:
- Sonal Bhushan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe queryType parameter for the findDups method: return all results.static final intThe queryType parameter for the findDups method: only return results not from the collection collKey.static final intThe queryType parameter for the findDups method: only return results from the collection collKey. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseDb()Closes the database connection.MmdRec[]Returns an array of MmdRec representing ids in other collections that appear identical to the specified (collKey, id).getCollectionName(String collKey) Returns the collection name associated with a collection key, or null if none found.getDirectory(String collKey) Returns the directory containing the XML records of the given collection key, or null if none found.Returns the MmdRec specified, or null if none found.static voidvoidUpdates the status of a single record.
-
Field Details
-
QUERY_SAME
public static final int QUERY_SAMEThe queryType parameter for the findDups method: only return results from the collection collKey.- See Also:
-
QUERY_OTHER
public static final int QUERY_OTHERThe queryType parameter for the findDups method: only return results not from the collection collKey.- See Also:
-
QUERY_BOTH
public static final int QUERY_BOTHThe queryType parameter for the findDups method: return all results.- See Also:
-
-
Constructor Details
-
Query
Constructor: Makes the connection to the database.- Parameters:
bugs- DESCRIPTIONdbUrl- DESCRIPTION- Throws:
MmdException- DESCRIPTION
-
-
Method Details
-
closeDb
Closes the database connection. After close, this Query object is useless.- Throws:
MmdException- DESCRIPTION
-
getCollectionName
Returns the collection name associated with a collection key, or null if none found.- Parameters:
collKey- DESCRIPTION- Returns:
- The collectionName value
- Throws:
MmdException- DESCRIPTION
-
getDirectory
Returns the directory containing the XML records of the given collection key, or null if none found.- Parameters:
collKey- DESCRIPTION- Returns:
- The directory value
- Throws:
MmdException- DESCRIPTION
-
getMmdRec
Returns the MmdRec specified, or null if none found.- Parameters:
collKey- DESCRIPTIONid- The id of the record- Returns:
- The mmdRec value
- Throws:
MmdException- DESCRIPTION
-
setStatus
Updates the status of a single record. The new status must be one of the legal values defined in.invalid reference
MmdRecord- Parameters:
collKey- The collection key.id- The id of the recordnewStatus- The new status value- Throws:
MmdException- DESCRIPTION
-
reloadIdExclusionDocument
public static void reloadIdExclusionDocument() -
findDups
Returns an array of MmdRec representing ids in other collections that appear identical to the specified (collKey, id).- Parameters:
queryType- One of:- QUERY_SAME: only return results from collection collKey
- QUERY_OTHER: only return results not from collection collKey
- QUERY_BOTH: return all results.
collKey- The collection key.id- The id to search for- Returns:
- An array of MmdRecod, each of which represents a resource from a different collection having possibly identical content.
- Throws:
MmdException- DESCRIPTION
-