com.ontimize.dms.db.delegate
Class DatabaseManager
java.lang.Object
com.ontimize.dms.db.delegate.DatabaseManager
- All Implemented Interfaces:
- IDBManager
public class DatabaseManager
- extends java.lang.Object
- implements IDBManager
|
Method Summary |
java.util.Hashtable |
blockAndGetDocumentDate(Document document)
Document exist:
* Is being used => return null
* Is not being used => return data
Document not exist:
* Create
* return an empty hastable |
boolean |
blockIfNotBeingUsedAndInsert(Document document)
|
static int |
checkOpenPort(int port)
Devuelve el primer puerto libre desde el puerto indicado port. |
void |
createDatabase()
|
protected ILocalFileInfo |
createFileInfo(java.util.Map map)
|
void |
deleteDirectory(Document document)
|
int |
deleteLocalFiles(Document document)
|
java.util.Hashtable |
getDate(Document document)
|
ILocalFileInfo[] |
getDirectoryEntries(java.lang.String filepath)
|
ILocalFileInfo[] |
getPosibleUploadsCancelled()
|
void |
initDatabase()
|
int |
insertLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DCD,
java.sql.Timestamp PMD,
java.lang.Integer status)
path => file path
name => file name
DSD => Download Server Date
DCD => Download Client Date
PMD => Properties Modification Date
STATUS => status |
int |
insertOrUpdateLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DSC,
java.sql.Timestamp PMD,
java.lang.Integer status)
|
boolean |
isBeingUsed(Document document)
|
static boolean |
islocalPortOpen(int port)
Indica si un puerto se encuentra libre. |
void |
loadConfiguration(java.util.Map h)
|
void |
pasteDocument(Document document,
java.lang.String basenew)
|
void |
renameDocument(Document document,
java.lang.String newName)
|
void |
shutdownDatabase()
|
protected ILocalFileInfo[] |
toList(java.sql.ResultSet rs)
|
void |
unblockDocument(Document document)
|
void |
unblockDocument(Document[] document)
|
int |
updateLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DCD,
java.sql.Timestamp PMD,
java.lang.Integer status)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PATH_COLUMN
public static final java.lang.String PATH_COLUMN
- See Also:
- Constant Field Values
NAME_COLUMN
public static final java.lang.String NAME_COLUMN
- See Also:
- Constant Field Values
FILE_COLUMN
public static final java.lang.String FILE_COLUMN
- See Also:
- Constant Field Values
PMD_COLUMN
public static final java.lang.String PMD_COLUMN
- See Also:
- Constant Field Values
STATUS_COLUMN
public static final java.lang.String STATUS_COLUMN
- See Also:
- Constant Field Values
DatabaseManager
public DatabaseManager()
loadConfiguration
public void loadConfiguration(java.util.Map h)
throws java.lang.Exception
- Specified by:
loadConfiguration in interface IDBManager
- Throws:
java.lang.Exception
islocalPortOpen
public static boolean islocalPortOpen(int port)
- Indica si un puerto se encuentra libre.
checkOpenPort
public static int checkOpenPort(int port)
- Devuelve el primer puerto libre desde el puerto indicado
port.
- Returns:
- -1 Si no hay puerto libre en los intentos realizados.
createDatabase
public void createDatabase()
throws java.lang.Exception
- Throws:
java.lang.Exception
initDatabase
public void initDatabase()
throws java.lang.Exception
- Specified by:
initDatabase in interface IDBManager
- Throws:
java.lang.Exception
shutdownDatabase
public void shutdownDatabase()
throws java.lang.Exception
- Specified by:
shutdownDatabase in interface IDBManager
- Throws:
java.lang.Exception
insertLocalFiles
public int insertLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DCD,
java.sql.Timestamp PMD,
java.lang.Integer status)
throws java.lang.Exception
- path => file path
name => file name
DSD => Download Server Date
DCD => Download Client Date
PMD => Properties Modification Date
STATUS => status
- Specified by:
insertLocalFiles in interface IDBManager
- Throws:
java.lang.Exception
insertOrUpdateLocalFiles
public int insertOrUpdateLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DSC,
java.sql.Timestamp PMD,
java.lang.Integer status)
throws java.lang.Exception
- Specified by:
insertOrUpdateLocalFiles in interface IDBManager
- Throws:
java.lang.Exception
updateLocalFiles
public int updateLocalFiles(Document document,
java.sql.Timestamp DSD,
java.sql.Timestamp DCD,
java.sql.Timestamp PMD,
java.lang.Integer status)
throws java.lang.Exception
- Specified by:
updateLocalFiles in interface IDBManager
- Throws:
java.lang.Exception
deleteLocalFiles
public int deleteLocalFiles(Document document)
throws java.lang.Exception
- Specified by:
deleteLocalFiles in interface IDBManager
- Throws:
java.lang.Exception
getDirectoryEntries
public ILocalFileInfo[] getDirectoryEntries(java.lang.String filepath)
- Specified by:
getDirectoryEntries in interface IDBManager
getPosibleUploadsCancelled
public ILocalFileInfo[] getPosibleUploadsCancelled()
- Specified by:
getPosibleUploadsCancelled in interface IDBManager
toList
protected ILocalFileInfo[] toList(java.sql.ResultSet rs)
createFileInfo
protected ILocalFileInfo createFileInfo(java.util.Map map)
isBeingUsed
public boolean isBeingUsed(Document document)
throws java.lang.Exception
- Specified by:
isBeingUsed in interface IDBManager
- Throws:
java.lang.Exception
blockIfNotBeingUsedAndInsert
public boolean blockIfNotBeingUsedAndInsert(Document document)
throws java.lang.Exception
- Specified by:
blockIfNotBeingUsedAndInsert in interface IDBManager
- Throws:
java.lang.Exception
getDate
public java.util.Hashtable getDate(Document document)
throws java.lang.Exception
- Specified by:
getDate in interface IDBManager
- Throws:
java.lang.Exception
blockAndGetDocumentDate
public java.util.Hashtable blockAndGetDocumentDate(Document document)
throws java.lang.Exception
- Document exist:
* Is being used => return null
* Is not being used => return data
Document not exist:
* Create
* return an empty hastable
- Specified by:
blockAndGetDocumentDate in interface IDBManager
- Throws:
java.lang.Exception
unblockDocument
public void unblockDocument(Document document)
throws java.lang.Exception
- Specified by:
unblockDocument in interface IDBManager
- Throws:
java.lang.Exception
unblockDocument
public void unblockDocument(Document[] document)
throws java.lang.Exception
- Specified by:
unblockDocument in interface IDBManager
- Throws:
java.lang.Exception
renameDocument
public void renameDocument(Document document,
java.lang.String newName)
throws java.lang.Exception
- Specified by:
renameDocument in interface IDBManager
- Throws:
java.lang.Exception
pasteDocument
public void pasteDocument(Document document,
java.lang.String basenew)
throws java.lang.Exception
- Specified by:
pasteDocument in interface IDBManager
- Throws:
java.lang.Exception
deleteDirectory
public void deleteDirectory(Document document)
throws java.lang.Exception
- Specified by:
deleteDirectory in interface IDBManager
- Throws:
java.lang.Exception