public class Query
extends java.lang.Object
Sample test program:
###
Modifier and Type | Field and Description |
---|---|
static int |
QUERY_BOTH
The queryType parameter for the findDups method: return all results.
|
static int |
QUERY_OTHER
The queryType parameter for the findDups method: only return results not
from the collection collKey.
|
static int |
QUERY_SAME
The queryType parameter for the findDups method: only return results from the
collection collKey.
|
Constructor and Description |
---|
Query(int bugs,
java.lang.String dbUrl)
Constructor: Makes the connection to the database.
|
Modifier and Type | Method and Description |
---|---|
void |
closeDb()
Closes the database connection.
|
MmdRec[] |
findDups(int queryType,
java.lang.String collKey,
java.lang.String id,
java.lang.String exc)
Returns an array of MmdRec representing ids in other collections that appear
identical to the specified (collKey, id).
|
java.lang.String |
getCollectionName(java.lang.String collKey)
Returns the collection name associated with a collection key, or null if none found.
|
java.lang.String |
getDirectory(java.lang.String collKey)
Returns the directory containing the XML records of the given collection key, or null
if none found.
|
MmdRec |
getMmdRec(java.lang.String collKey,
java.lang.String id)
Returns the MmdRec specified, or null if none found.
|
static void |
reloadIdExclusionDocument() |
void |
setStatus(java.lang.String collKey,
java.lang.String id,
java.lang.String newStatus)
Updates the status of a single record.
|
public static final int QUERY_SAME
public static final int QUERY_OTHER
public static final int QUERY_BOTH
public Query(int bugs, java.lang.String dbUrl) throws MmdException
bugs
- DESCRIPTIONdbUrl
- DESCRIPTIONMmdException
- DESCRIPTIONpublic void closeDb() throws MmdException
MmdException
- DESCRIPTIONpublic java.lang.String getCollectionName(java.lang.String collKey) throws MmdException
collKey
- DESCRIPTIONMmdException
- DESCRIPTIONpublic java.lang.String getDirectory(java.lang.String collKey) throws MmdException
collKey
- DESCRIPTIONMmdException
- DESCRIPTIONpublic MmdRec getMmdRec(java.lang.String collKey, java.lang.String id) throws MmdException
id
- The id of the recordcollKey
- DESCRIPTIONMmdException
- DESCRIPTIONpublic void setStatus(java.lang.String collKey, java.lang.String id, java.lang.String newStatus) throws MmdException
MmdRecord
.collKey
- The collection key.id
- The id of the recordnewStatus
- The new status valueMmdException
- DESCRIPTIONpublic static void reloadIdExclusionDocument()
public MmdRec[] findDups(int queryType, java.lang.String collKey, java.lang.String id, java.lang.String exc) throws MmdException
queryType
- One of:
collKey
- The collection key.id
- The id to search forMmdException
- DESCRIPTION