|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object proai.cache.RCDatabase
public class RCDatabase
Java interface to the database.
Field Summary | |
---|---|
static java.lang.String |
RCADMIN_TABLE_IS_EMPTY
|
Constructor Summary | |
---|---|
RCDatabase(java.sql.Connection conn,
DDLConverter ddlc,
boolean mySQLTrickling,
boolean backslashIsEscape,
boolean pollingEnabled,
RCDisk rcDisk)
|
Method Summary | |
---|---|
void |
addFailure(java.sql.Connection conn,
java.lang.String identifier,
java.lang.String mdPrefix,
java.lang.String sourceInfo,
java.lang.String failDate,
java.lang.String failReason)
|
void |
deleteFormat(java.sql.Connection conn,
java.lang.String prefix)
|
void |
deletePrunables(java.sql.Connection conn,
int[] keys,
int num)
Delete one or more items from the prunable list, by database key. |
void |
deleteSet(java.sql.Connection conn,
java.lang.String setSpec)
|
int |
dumpPrunables(java.sql.Connection conn,
java.io.PrintWriter writer)
|
void |
dumpQueue(java.sql.Connection conn,
java.io.PrintWriter writer)
|
CloseableIterator<java.lang.String[]> |
findRecordInfo(java.sql.Connection conn,
java.util.Date from,
java.util.Date until,
java.lang.String prefix,
java.lang.String set)
|
long |
getEarliestPollDate(java.sql.Connection conn)
|
int |
getFailCount(java.sql.Connection conn,
java.lang.String identifier,
java.lang.String mdPrefix)
|
java.util.Map<java.lang.String,java.lang.Integer> |
getFormatKeyMap(java.sql.Connection conn)
Get a map of prefix (String) to formatKey (Integer) for all formats in the database. |
java.util.List<CachedMetadataFormat> |
getFormats(java.sql.Connection conn)
|
java.util.List<CachedMetadataFormat> |
getFormats(java.sql.Connection conn,
java.lang.String identifier)
|
java.lang.String |
getIdentifyPath(java.sql.Connection conn)
Get the relative path to the Identify.xml file in the cache, or null if identifyPath is null (first update cycle hasn't run). |
long |
getLastPollDate(java.sql.Connection conn,
java.lang.String mdPrefix)
|
long |
getLongValue(java.sql.Connection conn,
java.lang.String query)
Execute the given query and return the long value in the
first column of the first row of the ResultSet ,
or zero if there are no results. |
int |
getPrunableCount(java.sql.Connection conn)
|
int |
getQueueSize(java.sql.Connection conn)
|
java.lang.String[] |
getRecordInfo(java.sql.Connection conn,
java.lang.String itemID,
java.lang.String mdPrefix)
|
java.util.List<SetInfo> |
getSetInfo(java.sql.Connection conn)
|
java.util.List<java.lang.String[]> |
getSetInfoPaths(java.sql.Connection conn)
|
boolean |
isPollingEnabled(java.sql.Connection conn)
|
boolean |
itemExists(java.sql.Connection conn,
java.lang.String itemID)
|
void |
putFormat(java.sql.Connection conn,
MetadataFormat format)
Add or modify the given format. |
void |
putRecord(java.sql.Connection conn,
ParsedRecord rec,
java.util.Map<java.lang.String,java.lang.Integer> formatKeyMap)
Add or update a record. |
void |
putSetInfo(java.sql.Connection conn,
java.lang.String setSpec,
java.lang.String xmlPath)
|
void |
queueFailedRecords(java.sql.Connection conn,
int maxFailedRetries)
Copy all qualifying records from rcFailure to rcQueue. |
void |
queueRemoteRecord(java.sql.Connection conn,
java.lang.String identifier,
java.lang.String mdPrefix,
java.lang.String sourceInfo)
|
void |
removeFailure(java.sql.Connection conn,
java.lang.String identifier,
java.lang.String mdPrefix)
|
void |
removeFromQueue(java.sql.Connection conn,
int queueKey)
|
void |
setIdentifyPath(java.sql.Connection conn,
java.lang.String path)
|
void |
setLastPollDate(java.sql.Connection conn,
java.lang.String mdPrefix,
long lastPollDate)
|
void |
setPollingEnabled(java.sql.Connection conn,
boolean pollingEnabled)
|
void |
setUncommittedRecordDates(java.sql.Connection conn,
java.util.Date newDate)
|
void |
updateFailure(java.sql.Connection conn,
java.lang.String identifier,
java.lang.String mdPrefix,
java.lang.String sourceInfo,
int newFailCount,
java.lang.String failDate,
java.lang.String failReason)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RCADMIN_TABLE_IS_EMPTY
Constructor Detail |
---|
public RCDatabase(java.sql.Connection conn, DDLConverter ddlc, boolean mySQLTrickling, boolean backslashIsEscape, boolean pollingEnabled, RCDisk rcDisk) throws ServerException
ServerException
Method Detail |
---|
public java.lang.String getIdentifyPath(java.sql.Connection conn) throws ServerException
null
if identifyPath is null (first update cycle hasn't run).
ServerException
public void setIdentifyPath(java.sql.Connection conn, java.lang.String path) throws ServerException
ServerException
public void setPollingEnabled(java.sql.Connection conn, boolean pollingEnabled) throws ServerException
ServerException
public boolean isPollingEnabled(java.sql.Connection conn) throws ServerException
ServerException
public void putFormat(java.sql.Connection conn, MetadataFormat format) throws ServerException
ServerException
public long getEarliestPollDate(java.sql.Connection conn) throws ServerException
ServerException
public long getLastPollDate(java.sql.Connection conn, java.lang.String mdPrefix) throws ServerException
ServerException
public void setLastPollDate(java.sql.Connection conn, java.lang.String mdPrefix, long lastPollDate) throws ServerException
ServerException
public long getLongValue(java.sql.Connection conn, java.lang.String query) throws java.sql.SQLException
long
value in the
first column of the first row of the ResultSet
,
or zero if there are no results.
java.sql.SQLException
public java.util.List<CachedMetadataFormat> getFormats(java.sql.Connection conn) throws ServerException
ServerException
public java.util.List<CachedMetadataFormat> getFormats(java.sql.Connection conn, java.lang.String identifier) throws ServerException
ServerException
public java.util.Map<java.lang.String,java.lang.Integer> getFormatKeyMap(java.sql.Connection conn) throws ServerException
ServerException
public void deleteFormat(java.sql.Connection conn, java.lang.String prefix) throws ServerException
ServerException
public void putSetInfo(java.sql.Connection conn, java.lang.String setSpec, java.lang.String xmlPath) throws ServerException
ServerException
public java.util.List<SetInfo> getSetInfo(java.sql.Connection conn) throws ServerException
ServerException
public java.util.List<java.lang.String[]> getSetInfoPaths(java.sql.Connection conn) throws ServerException
ServerException
public void deleteSet(java.sql.Connection conn, java.lang.String setSpec) throws ServerException
ServerException
public void setUncommittedRecordDates(java.sql.Connection conn, java.util.Date newDate) throws ServerException
ServerException
public void putRecord(java.sql.Connection conn, ParsedRecord rec, java.util.Map<java.lang.String,java.lang.Integer> formatKeyMap) throws ServerException
ServerException
public boolean itemExists(java.sql.Connection conn, java.lang.String itemID) throws ServerException
ServerException
public java.lang.String[] getRecordInfo(java.sql.Connection conn, java.lang.String itemID, java.lang.String mdPrefix) throws ServerException
ServerException
public CloseableIterator<java.lang.String[]> findRecordInfo(java.sql.Connection conn, java.util.Date from, java.util.Date until, java.lang.String prefix, java.lang.String set) throws ServerException
ServerException
public void queueFailedRecords(java.sql.Connection conn, int maxFailedRetries) throws ServerException
ServerException
public void queueRemoteRecord(java.sql.Connection conn, java.lang.String identifier, java.lang.String mdPrefix, java.lang.String sourceInfo) throws ServerException
ServerException
public int getQueueSize(java.sql.Connection conn) throws ServerException
ServerException
public void dumpQueue(java.sql.Connection conn, java.io.PrintWriter writer) throws ServerException
ServerException
public void removeFromQueue(java.sql.Connection conn, int queueKey) throws ServerException
ServerException
public void removeFailure(java.sql.Connection conn, java.lang.String identifier, java.lang.String mdPrefix) throws ServerException
ServerException
public int getFailCount(java.sql.Connection conn, java.lang.String identifier, java.lang.String mdPrefix)
public void addFailure(java.sql.Connection conn, java.lang.String identifier, java.lang.String mdPrefix, java.lang.String sourceInfo, java.lang.String failDate, java.lang.String failReason) throws ServerException
ServerException
public void updateFailure(java.sql.Connection conn, java.lang.String identifier, java.lang.String mdPrefix, java.lang.String sourceInfo, int newFailCount, java.lang.String failDate, java.lang.String failReason) throws ServerException
ServerException
public int getPrunableCount(java.sql.Connection conn) throws ServerException
ServerException
public void deletePrunables(java.sql.Connection conn, int[] keys, int num) throws java.sql.SQLException
java.sql.SQLException
public int dumpPrunables(java.sql.Connection conn, java.io.PrintWriter writer) throws ServerException
ServerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |