|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.beasys.commerce.axiom.document.ref.RefCleanupHelper
A helper class which can cleanup a reference implementation database.
cleanup(java.sql.Connection, java.lang.String, boolean)| Field Summary | |
static java.lang.String |
addEmptyDocSql
The sql to insert a document into the document table with default values. |
static java.lang.String |
DEF_MIME_TYPE
A default mime type the cleaner uses when adding to the document table. |
static java.lang.String |
DOC_MD_TABLE
The wlcs_document_metadata table name. |
static java.lang.String |
DOC_TABLE
The wlcs_document table name. |
static java.lang.String |
getDocsSql
The sql to pull the ids and mime types from the document table. |
static java.lang.String |
missingDocSql
The sql to pull document ids of document that don't exist in the document table, but have entries in the document_metadata table. |
static java.lang.String |
updateDocSql
The sql to update a row in the document table. |
| Constructor Summary | |
RefCleanupHelper()
|
|
| Method Summary | |
static void |
cleanup(java.sql.Connection con,
java.lang.String docBase,
boolean deleteMissing)
Clean up a reference implementation document and document_metadata table based only upon what's in the database. |
static void |
cleanupDocs(java.sql.Connection con,
java.lang.String docBase,
boolean deleteMissing)
Cleans up the document table. |
static void |
deleteDoc(java.sql.Connection con,
java.lang.String path)
|
static void |
fixMissingDocs(java.sql.Connection con)
Cleanup the document table based upon what's in the document_metadata table. |
| 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 DOC_TABLE
RefDocumentProvider.DOC_TABLEpublic static final java.lang.String DOC_MD_TABLE
RefDocumentProvider.DOC_MD_TABLEpublic static final java.lang.String DEF_MIME_TYPE
public static final java.lang.String missingDocSql
public static final java.lang.String addEmptyDocSql
public static final java.lang.String getDocsSql
public static final java.lang.String updateDocSql
| Constructor Detail |
public RefCleanupHelper()
| Method Detail |
public static void cleanup(java.sql.Connection con,
java.lang.String docBase,
boolean deleteMissing)
throws java.sql.SQLException
This will not investigate the contents of the docBase except to gather file information about a file already in the database.
con - the database connection.docBase - the document base.deleteMissing - true to delete documents which are missing from
the docBase, false to set their size to 0.fixMissingDocs(java.sql.Connection),
cleanupDocs(java.sql.Connection, java.lang.String, boolean)
public static void fixMissingDocs(java.sql.Connection con)
throws java.sql.SQLException
This will add entries in the document table that don't exist from those in the document_metadata table.
public static void cleanupDocs(java.sql.Connection con,
java.lang.String docBase,
boolean deleteMissing)
throws java.sql.SQLException
This will update the document_size based upon the files under docBase and update the modified_date to now. Additionally, this will attempt to fix up invalid or empty mimeTypes.
con - the database connection.docBase - the document base.deleteMissing - true to delete documents which are missing from
the docBase, false to set their size to 0.
public static void deleteDoc(java.sql.Connection con,
java.lang.String path)
throws java.sql.SQLException
|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||