diff options
author | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2014-06-04 18:50:50 +0200 |
---|---|---|
committer | Alexander Marsalek <amarsalek@iaik.tugraz.at> | 2014-06-04 18:56:07 +0200 |
commit | f81b3716ac27094ab1845668cb38a1fe6a2d5f8c (patch) | |
tree | 933cd9ae96e6c7c01b78aea37b904b31419b1b0f /DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java | |
parent | 31c8bad4214bfee45eef0ca98faf3f6f32fe5b23 (diff) | |
download | moa-id-spss-f81b3716ac27094ab1845668cb38a1fe6a2d5f8c.tar.gz moa-id-spss-f81b3716ac27094ab1845668cb38a1fe6a2d5f8c.tar.bz2 moa-id-spss-f81b3716ac27094ab1845668cb38a1fe6a2d5f8c.zip |
added DocumentService
Diffstat (limited to 'DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java')
-rw-r--r-- | DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java b/DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java new file mode 100644 index 000000000..26bd0c405 --- /dev/null +++ b/DocumentService/src/eu/stork/documentservice/data/DatabaseConnector.java @@ -0,0 +1,117 @@ +package eu.stork.documentservice.data; + +import eu.stork.documentservice.exceptions.DatabaseException; +import eu.stork.documentservice.model.DocumentModel; +import eu.stork.documentservice.model.RequestModel; +import eu.stork.documentservice.model.TempDocumentModel; + +public interface DatabaseConnector { + + /** + * Add document to database + * @param document The document model to add + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean addDocument(DocumentModel document) + throws DatabaseException; + + /** + * Update document in database + * @param document The document model to update + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean updateDocument(DocumentModel document) + throws DatabaseException; + + /** + * Get Document from database + * @param docId Document ID + * @return The document found + * @throws DatabaseException + */ + public abstract DocumentModel getDocument(String docId) + throws DatabaseException; + + /** + * Delete Document from database + * @param docId Document ID + * @return true if successful + * @throws DatabaseException + */ + public abstract boolean deleteDocument(String docId) + throws DatabaseException; + + /** + * Add request to database + * @param request The request to add + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean addRequest(RequestModel request) + throws DatabaseException; + + /** + * Get request from database + * @param requestId The request id + * @return The request found + * @throws DatabaseException + */ + public abstract RequestModel getRequest(String requestId) + throws DatabaseException; + + /** + * Get request from database + * @param docId The document id + * @return The request found + * @throws DatabaseException + */ + public abstract RequestModel getRequestByDocId(String docId) + throws DatabaseException; + + /** + * Update request in database + * @param request The request to update + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean updateRequest(RequestModel request) + throws DatabaseException; + + /** + * Add temp document to database + * @param document The document model to add + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean addTempDocument(TempDocumentModel document) + throws DatabaseException; + + /** + * Get temp document from database + * @param docId Document ID + * @return The document found + * @throws DatabaseException + */ + public abstract TempDocumentModel getTempDocument(String docId) + throws DatabaseException; + + /** + * Update temp document in database + * @param document The document model to update + * @return True if successful + * @throws DatabaseException + */ + public abstract boolean updateTempDocument(TempDocumentModel document) + throws DatabaseException; + + /** + * Delete temp document from database + * @param docId Document ID + * @return true if successful + * @throws DatabaseException + */ + public abstract boolean deleteTempDocument(String docId) + throws DatabaseException; +}
\ No newline at end of file |