public class PostgreSQLDBInterface extends JdbcDBInterface implements DBQueueInterface, DBDataInterface, DBObjectIdInterface
PostgreSQL specific implementation of the database interface used by the database filesystem driver (DBDiskDriver).
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LockFileName |
static long |
MaxMemoryBuffer |
static int |
OIDBufferSize |
static long |
OIDFileSize |
DataTable, DefaultFragSize, FileSysTable, JarDataTable, m_connPool, m_dataFragSize, m_dataTable, m_dbCtx, m_dbInitConns, m_dbMaxConns, m_debug, m_driver, m_dsn, m_jarDataTable, m_objectIdTable, m_onlineCheckInterval, m_password, m_pendingSaveRequests, m_queueTable, m_retentionPeriod, m_retentionTable, m_specialChars, m_sqlDebug, m_streamTable, m_structTable, m_symLinkTable, m_transactTable, m_userName, MaxFragSize, MinFragSize, NumPoolConnections, ObjectIdTable, QueueTable, RetentionTable, StreamsTable, SymLinkTable, TransactQueueTableFeatureData, FeatureJarData, FeatureNTFS, FeatureObjectId, FeatureQueue, FeatureRetention, FeatureSecDescriptor, FeatureSymLinks, FileAll, FileIds, FileNameOnly, StreamAll, StreamIds, StreamNameOnly| Constructor and Description |
|---|
PostgreSQLDBInterface()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
createFileRecord(java.lang.String fname,
int dirId,
FileOpenParams params,
boolean retain)
Create a file record for a new file or folder
|
protected void |
createQueueStatements()
Create the prepared statements used by the file request queueing database
|
int |
createStreamRecord(java.lang.String sname,
int fid)
Create a stream record for a new file stream
|
void |
deleteFileData(int fileId,
int streamId)
Delete the file data for the specified file/stream
|
void |
deleteFileRecord(int dirId,
int fid,
boolean markOnly)
Delete a file or folder record
|
void |
deleteFileRequest(FileRequest fileReq)
Delete a file request from the pending queue.
|
void |
deleteJarData(int jarId)
Delete the file data for the specified Jar file
|
void |
deleteObjectId(int fileId,
int streamId,
java.lang.String objectId)
Delete a file id/object id mapping
|
void |
deleteStreamRecord(int fid,
int stid,
boolean markOnly)
Delete a file stream record
|
void |
deleteSymbolicLinkRecord(int dirId,
int fid)
Delete a symbolic link record
|
int |
fileExists(int dirId,
java.lang.String fname)
Check if a file/folder exists
|
java.lang.String |
getDBInterfaceName()
Return the database interface name
|
DBDataDetails |
getFileDataDetails(int fileId,
int streamId)
Return the file data details for the specified file or stream.
|
int |
getFileId(int dirId,
java.lang.String fname,
boolean dirOnly,
boolean caseLess)
Get the id for a file/folder, or -1 if the file/folder does not exist.
|
DBFileInfo |
getFileInformation(int dirId,
int fid,
int infoLevel)
Get information for a file or folder
|
RetentionDetails |
getFileRetentionDetails(int dirId,
int fid)
Return the retention period expiry date/time for the specified file, or zero if the
file/folder is not under retention.
|
long |
getMaximumFragmentSize()
Return the maximum data fragment size supported
|
StreamInfo |
getStreamInformation(int fid,
int stid,
int infoLevel)
Get information for a file stream
|
StreamInfoList |
getStreamsList(int fid,
int infoLevel)
Return the list of streams for the specified file
|
protected int |
getSupportedFeatures()
Get the supported database features mask
|
long |
getUsedFileSpace()
Return the used file space, or -1 if not supported.
|
boolean |
hasQueuedRequest(java.lang.String tempFile,
boolean lastFile)
Check if the specified temporary file has a queued request.
|
void |
initializeDatabase(DBDeviceContext dbCtx,
org.springframework.extensions.config.ConfigElement params)
Initialize the database interface
|
void |
loadFileData(int fileId,
int streamId,
FileSegment fileSeg)
Load file data from the database into a temporary/local file
|
int |
loadFileRequests(int fromSeqNo,
int reqType,
FileRequestQueue reqQueue,
int recLimit)
Load a block of file request from the database into the specified queue.
|
void |
loadJarData(int jarId,
FileSegment jarSeg)
Load Jar file data from the database into a temporary file
|
java.lang.String |
loadObjectId(int fileId,
int streamId)
Load the object id for the specified file id
|
MultipleFileRequest |
loadTransactionRequest(MultipleFileRequest tranReq)
Load a transaction request from the queue.
|
FileRequestQueue |
performQueueCleanup(java.io.File tempDir,
java.lang.String tempDirPrefix,
java.lang.String tempFilePrefix,
java.lang.String jarFilePrefix)
Perform a queue cleanup deleting temporary cache files that do not have an associated save or
transaction request.
|
void |
queueFileRequest(FileRequest req)
Queue a file request.
|
java.lang.String |
readSymbolicLink(int dirId,
int fid)
Return the data for a symbolic link
|
void |
renameFileRecord(int dirId,
int fid,
java.lang.String newName,
int newDir)
Rename a file or folder, may also change the parent directory.
|
void |
renameStreamRecord(int dirId,
int fid,
int stid,
java.lang.String newName)
Rename a file stream
|
int |
saveFileData(int fileId,
int streamId,
FileSegment fileSeg)
Save the file data from the temporary/local file to the database
|
int |
saveJarData(java.lang.String jarPath,
DBDataDetailsList fileList)
Save the file data from a Jar file to the database
|
void |
saveObjectId(int fileId,
int streamId,
java.lang.String objectId)
Create a file id to object id mapping
|
void |
setFileInformation(int dirId,
int fid,
FileInfo finfo)
Set file information for a file or folder
|
void |
setStreamInformation(int dirId,
int fid,
int stid,
StreamInfo sinfo)
Set information for a file stream
|
void |
shutdownDatabase(DBDeviceContext context)
Shutdown the database interface, release resources.
|
DBSearchContext |
startSearch(int dirId,
java.lang.String searchPath,
int attrib,
int infoLevel,
int maxRecords)
Start a directory search
|
checkNameForSpecialChars, createConnectionPool, databaseOnlineStatus, getConnection, getConnection, getConnectionPool, getDataFragmentSize, getDataTableName, getDriverName, getDSNString, getFileSysTableName, getJarDataTableName, getLockFile, getObjectIdTableName, getPassword, getQueueTableName, getRetentionPeriod, getRetentionTableName, getStreamsTableName, getSymLinksTableName, getTransactionTableName, getUserName, hasCrashRecovery, hasDataTableName, hasDebug, hasJarDataTableName, hasObjectIdTableName, hasOfflineFileRequests, hasQueuedRequest, hasQueueTableName, hasRetentionPeriod, hasRetentionTableName, hasSQLDebug, hasStreamsTableName, hasSymLinksTableName, hasTransactionTableName, isDataEnabled, isJarDataEnabled, isNTFSEnabled, isObjectIdEnabled, isOnline, isQueueEnabled, isRetentionEnabled, isSymbolicLinksEnabled, queueOfflineSaveRequest, queueTransactionRequest, releaseConnection, requestFeatures, setDataFragmentSize, setDriverName, setDSNString, setLockFile, supportsFeaturepublic static final long MaxMemoryBuffer
public static final java.lang.String LockFileName
public static final int OIDBufferSize
public static final long OIDFileSize
public java.lang.String getDBInterfaceName()
getDBInterfaceName in interface DBInterfaceprotected int getSupportedFeatures()
getSupportedFeatures in class JdbcDBInterfacepublic void initializeDatabase(DBDeviceContext dbCtx, org.springframework.extensions.config.ConfigElement params) throws InvalidConfigurationException
initializeDatabase in interface DBInterfaceinitializeDatabase in class JdbcDBInterfacedbCtx - DBDeviceContextparams - ConfigElementInvalidConfigurationExceptionpublic int fileExists(int dirId,
java.lang.String fname)
throws DBException
fileExists in interface DBInterfacedirId - intfname - StringDBExceptionpublic int createFileRecord(java.lang.String fname,
int dirId,
FileOpenParams params,
boolean retain)
throws DBException,
FileExistsException
createFileRecord in interface DBInterfacefname - StringdirId - intparams - FileOpenParamsretain - booleanDBExceptionFileExistsExceptionpublic int createStreamRecord(java.lang.String sname,
int fid)
throws DBException
createStreamRecord in interface DBInterfacesname - Stringfid - intDBExceptionpublic void deleteFileRecord(int dirId,
int fid,
boolean markOnly)
throws DBException
deleteFileRecord in interface DBInterfacedirId - intfid - intmarkOnly - booleanDBExceptionpublic void deleteStreamRecord(int fid,
int stid,
boolean markOnly)
throws DBException
deleteStreamRecord in interface DBInterfacefid - intstid - intmarkOnly - booleanDBExceptionpublic void setFileInformation(int dirId,
int fid,
FileInfo finfo)
throws DBException
setFileInformation in interface DBInterfacedirId - intfid - intfinfo - FileInfoDBExceptionpublic void setStreamInformation(int dirId,
int fid,
int stid,
StreamInfo sinfo)
throws DBException
setStreamInformation in interface DBInterfacedirId - intfid - intstid - intsinfo - StreamInfoDBExceptionpublic int getFileId(int dirId,
java.lang.String fname,
boolean dirOnly,
boolean caseLess)
throws DBException
getFileId in interface DBInterfacedirId - intfname - StringdirOnly - booleancaseLess - booleanDBExceptionpublic DBFileInfo getFileInformation(int dirId, int fid, int infoLevel) throws DBException
getFileInformation in interface DBInterfacedirId - intfid - intinfoLevel - intDBExceptionpublic StreamInfo getStreamInformation(int fid, int stid, int infoLevel) throws DBException
getStreamInformation in interface DBInterfacefid - intstid - intinfoLevel - intDBExceptionpublic StreamInfoList getStreamsList(int fid, int infoLevel) throws DBException
getStreamsList in interface DBInterfacefid - intinfoLevel - intDBExceptionpublic void renameFileRecord(int dirId,
int fid,
java.lang.String newName,
int newDir)
throws DBException,
java.io.FileNotFoundException
renameFileRecord in interface DBInterfacedirId - intfid - intnewName - StringnewDir - intDBExceptionjava.io.FileNotFoundExceptionpublic void renameStreamRecord(int dirId,
int fid,
int stid,
java.lang.String newName)
throws DBException
renameStreamRecord in interface DBInterfacedirId - intfid - intstid - intnewName - DBExceptionpublic RetentionDetails getFileRetentionDetails(int dirId, int fid) throws DBException
getFileRetentionDetails in interface DBInterfacedirId - intfid - intDBExceptionpublic DBSearchContext startSearch(int dirId, java.lang.String searchPath, int attrib, int infoLevel, int maxRecords) throws DBException
startSearch in interface DBInterfacedirId - intsearchPath - Stringattrib - intinfoLevel - intmaxRecords - intDBExceptionpublic long getUsedFileSpace()
getUsedFileSpace in interface DBInterfacepublic void queueFileRequest(FileRequest req) throws DBException
queueFileRequest in interface DBQueueInterfacequeueFileRequest in class JdbcDBInterfacereq - FileRequestDBExceptionpublic FileRequestQueue performQueueCleanup(java.io.File tempDir, java.lang.String tempDirPrefix, java.lang.String tempFilePrefix, java.lang.String jarFilePrefix) throws DBException
performQueueCleanup in interface DBQueueInterfacetempDir - FiletempDirPrefix - StringtempFilePrefix - StringjarFilePrefix - StringDBExceptionpublic boolean hasQueuedRequest(java.lang.String tempFile,
boolean lastFile)
throws DBException
tempFile - StringlastFile - booleanDBExceptionpublic void deleteFileRequest(FileRequest fileReq) throws DBException
deleteFileRequest in interface DBQueueInterfacedeleteFileRequest in class JdbcDBInterfacefileReq - FileRequestDBExceptionpublic int loadFileRequests(int fromSeqNo,
int reqType,
FileRequestQueue reqQueue,
int recLimit)
throws DBException
loadFileRequests in interface DBQueueInterfaceloadFileRequests in class JdbcDBInterfacefromSeqNo - intreqType - intreqQueue - FileRequestQueuerecLimit - intDBExceptionpublic MultipleFileRequest loadTransactionRequest(MultipleFileRequest tranReq) throws DBException
loadTransactionRequest in interface DBQueueInterfaceloadTransactionRequest in class JdbcDBInterfacetranReq - MultiplFileRequestDBExceptionpublic void shutdownDatabase(DBDeviceContext context)
shutdownDatabase in interface DBInterfaceshutdownDatabase in class JdbcDBInterfacecontext - DBDeviceContextprotected final void createQueueStatements()
throws java.sql.SQLException
java.sql.SQLExceptionpublic DBDataDetails getFileDataDetails(int fileId, int streamId) throws DBException
getFileDataDetails in interface DBDataInterfacefileId - streamId - DBExceptionpublic long getMaximumFragmentSize()
getMaximumFragmentSize in interface DBDataInterfacepublic void loadFileData(int fileId,
int streamId,
FileSegment fileSeg)
throws DBException,
java.io.IOException
loadFileData in interface DBDataInterfacefileId - intstreamId - intfileSeg - FileSegmentDBExceptionjava.io.IOExceptionpublic void loadJarData(int jarId,
FileSegment jarSeg)
throws DBException,
java.io.IOException
loadJarData in interface DBDataInterfacejarId - intjarSeg - FileSegmentDBExceptionjava.io.IOExceptionpublic int saveFileData(int fileId,
int streamId,
FileSegment fileSeg)
throws DBException,
java.io.IOException
saveFileData in interface DBDataInterfacefileId - intstreamId - intfileSeg - FileSegmentDBExceptionjava.io.IOExceptionpublic int saveJarData(java.lang.String jarPath,
DBDataDetailsList fileList)
throws DBException,
java.io.IOException
saveJarData in interface DBDataInterfacejarPath - StringfileList - DBDataDetailsListDBExceptionjava.io.IOExceptionpublic void deleteFileData(int fileId,
int streamId)
throws DBException,
java.io.IOException
deleteFileData in interface DBDataInterfacefileId - intstreamId - intDBExceptionjava.io.IOExceptionpublic void deleteJarData(int jarId)
throws DBException,
java.io.IOException
deleteJarData in interface DBDataInterfacejarId - intDBExceptionjava.io.IOExceptionpublic void saveObjectId(int fileId,
int streamId,
java.lang.String objectId)
throws DBException
saveObjectId in interface DBObjectIdInterfacefileId - intstreamId - intobjectId - StringDBExceptionpublic java.lang.String loadObjectId(int fileId,
int streamId)
throws DBException
loadObjectId in interface DBObjectIdInterfacefileId - intstreamId - intDBExceptionpublic void deleteObjectId(int fileId,
int streamId,
java.lang.String objectId)
throws DBException
deleteObjectId in interface DBObjectIdInterfacefileId - intstreamId - intobjectId - StringDBExceptionpublic java.lang.String readSymbolicLink(int dirId,
int fid)
throws DBException
readSymbolicLink in interface DBInterfacedirId - intfid - intDBExceptionpublic void deleteSymbolicLinkRecord(int dirId,
int fid)
throws DBException
deleteSymbolicLinkRecord in interface DBInterfacedirId - intfid - intDBExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.