|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.n52.wps.server.database.AbstractDatabase
public abstract class AbstractDatabase
An anstract-layer to the databases.
| Field Summary | |
|---|---|
static java.lang.String |
creationString
SQL to create a response in the DB |
protected static int |
INSERT_COLUMN_MIME_TYPE
|
protected static int |
INSERT_COLUMN_REQUEST_DATE
The column of "request_data" in the insert statement. |
protected static int |
INSERT_COLUMN_REQUEST_ID
The column of "request_id" in the insert statement. |
protected static int |
INSERT_COLUMN_RESPONSE
The column of "response" in the insert statement. |
protected static int |
INSERT_COLUMN_RESPONSE_TYPE
The column of "response_type" in the insert statement. |
static java.lang.String |
insertionString
SQL to insert a response into the database |
protected static java.sql.PreparedStatement |
insertSQL
|
static java.lang.String |
PROPERTY_NAME_DATABASE
Property of the path to the location of the database - name of database type: DERBY, HSQL, ... |
static java.lang.String |
PROPERTY_NAME_DATABASE_NAME
Property of the path to the location of the database - Actual name of the database. |
static java.lang.String |
PROPERTY_NAME_DATABASE_PATH
Property of the path to the location of the database |
protected static int |
SELECT_COLUMN_RESPONSE
The column of "response" in the select statement. |
static java.lang.String |
selectionString
SQL to retrieve a response from the database |
protected static java.sql.PreparedStatement |
selectSQL
|
protected static int |
UPDATE_COLUMN_REQUEST_ID
The column of "request_id" in the update statement. |
protected static int |
UPDATE_COLUMN_RESPONSE
The column of "response" in the update statement. |
protected static java.sql.PreparedStatement |
updateSQL
|
static java.lang.String |
updateString
SQL to update a response, that was already stored in the database |
| Constructor Summary | |
|---|---|
AbstractDatabase()
|
|
| Method Summary | |
|---|---|
boolean |
deleteStoredResponse(java.lang.String id)
|
java.lang.String |
generateRetrieveResultURL(java.lang.String id)
The URL referencing the location from which the ExecuteResponse can be retrieved. |
abstract java.sql.Connection |
getConnection()
|
abstract java.lang.String |
getConnectionURL()
|
java.lang.String |
getDatabaseName()
Returns the name of the database. |
protected static java.lang.String |
getDatabasePath()
Returns the path to the database. |
static IDatabase |
getInstance()
Get an instance of the Database object. |
java.lang.String |
getMimeTypeForStoreResponse(java.lang.String id)
|
java.lang.String |
insertResponse(Response response)
Insert a new Response into the Database. |
protected java.lang.String |
insertResultEntity(LargeBufferStream baos,
java.lang.String id,
java.lang.String type,
java.lang.String mimeType)
Inserts any result, which has to be stored in the DB. |
java.io.InputStream |
lookupResponse(java.lang.String request_id)
Retrieve the Response on a previous Request, based on an unique identifier, which was already given to the client for reference. |
java.io.File |
lookupResponseAsFile(java.lang.String id)
|
void |
shutdown()
|
java.lang.String |
storeComplexValue(java.lang.String id,
LargeBufferStream stream,
java.lang.String type,
java.lang.String mimeType)
|
java.lang.String |
storeResponse(Response response)
Store the Response of a deferred Request. |
void |
updateResponse(Response response)
Update the Response in the Database, based on the Identifier. |
| 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 PROPERTY_NAME_DATABASE_PATH
public static final java.lang.String PROPERTY_NAME_DATABASE_NAME
public static final java.lang.String PROPERTY_NAME_DATABASE
public static final java.lang.String creationString
public static final java.lang.String insertionString
public static final java.lang.String updateString
public static final java.lang.String selectionString
protected static final int SELECT_COLUMN_RESPONSE
protected static final int INSERT_COLUMN_REQUEST_ID
protected static final int INSERT_COLUMN_REQUEST_DATE
protected static final int INSERT_COLUMN_RESPONSE_TYPE
protected static final int INSERT_COLUMN_RESPONSE
protected static final int UPDATE_COLUMN_RESPONSE
protected static final int UPDATE_COLUMN_REQUEST_ID
protected static final int INSERT_COLUMN_MIME_TYPE
protected static java.sql.PreparedStatement insertSQL
protected static java.sql.PreparedStatement updateSQL
protected static java.sql.PreparedStatement selectSQL
| Constructor Detail |
|---|
public AbstractDatabase()
| Method Detail |
|---|
public static IDatabase getInstance()
public java.lang.String insertResponse(Response response)
insertResponse in interface IDatabaseresponse - The Response to insert.storeResponse(Response)
protected java.lang.String insertResultEntity(LargeBufferStream baos,
java.lang.String id,
java.lang.String type,
java.lang.String mimeType)
baos - id - type - public void updateResponse(Response response)
updateResponse in interface IDatabaseresponse - The Response to updatestoreResponse(Response)public java.lang.String storeResponse(Response response)
storeResponse in interface IDatabaseresponse - The Response to store.public java.io.InputStream lookupResponse(java.lang.String request_id)
lookupResponse in interface IDatabaserequest_id - The identifier of the Request
public java.lang.String storeComplexValue(java.lang.String id,
LargeBufferStream stream,
java.lang.String type,
java.lang.String mimeType)
storeComplexValue in interface IDatabasepublic java.lang.String generateRetrieveResultURL(java.lang.String id)
generateRetrieveResultURL in interface IDatabasepublic abstract java.sql.Connection getConnection()
public abstract java.lang.String getConnectionURL()
public java.lang.String getDatabaseName()
getDatabaseName in interface IDatabaseprotected static java.lang.String getDatabasePath()
public void shutdown()
shutdown in interface IDatabasejava.lang.Exceptionpublic java.lang.String getMimeTypeForStoreResponse(java.lang.String id)
getMimeTypeForStoreResponse in interface IDatabasepublic boolean deleteStoredResponse(java.lang.String id)
deleteStoredResponse in interface IDatabasepublic java.io.File lookupResponseAsFile(java.lang.String id)
lookupResponseAsFile in interface IDatabase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||