org.n52.wps.server.database
Class DatabaseFactory

java.lang.Object
  extended by org.n52.wps.server.database.DatabaseFactory
All Implemented Interfaces:
IDatabase

public class DatabaseFactory
extends java.lang.Object
implements IDatabase


Field Summary
static java.lang.String PROPERTY_NAME_DATABASE_CLASS_NAME
           
 
Constructor Summary
DatabaseFactory()
           
 
Method Summary
 boolean deleteStoredResponse(java.lang.String id)
           
protected  void finalize()
           
 java.lang.String generateRetrieveResultURL(java.lang.String id)
          The URL referencing the location from which the ExecuteResponse can be retrieved.
static IDatabase getDatabase()
           
 java.lang.String getDatabaseName()
          Returns some name for the database, like DERBY, HSQL, ...
 java.lang.String getMimeTypeForStoreResponse(java.lang.String id)
           
 java.lang.String insertResponse(Response response)
          Insert a new Response into the Database.
 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()
          Shutdown the database in a clean, safe way.
 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME_DATABASE_CLASS_NAME

public static final java.lang.String PROPERTY_NAME_DATABASE_CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

DatabaseFactory

public DatabaseFactory()
Method Detail

getDatabase

public static IDatabase getDatabase()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

shutdown

public void shutdown()
Shutdown the database in a clean, safe way.

Specified by:
shutdown in interface IDatabase

insertResponse

public java.lang.String insertResponse(Response response)
Insert a new Response into the Database.

Specified by:
insertResponse in interface IDatabase
Parameters:
response - The Response to insert.
See Also:
storeResponse(Response)

updateResponse

public void updateResponse(Response response)
Update the Response in the Database, based on the Identifier.

Specified by:
updateResponse in interface IDatabase
Parameters:
response - The Response to update
See Also:
storeResponse(Response)

storeResponse

public java.lang.String storeResponse(Response response)
Store the Response of a deferred Request. It either gets inserted into the databse, or it updates a previous Response, based on the identifier.

Specified by:
storeResponse in interface IDatabase
Parameters:
response - The Response to store.

lookupResponse

public 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.

Specified by:
lookupResponse in interface IDatabase
Parameters:
request_id - The identifier of the Request
Returns:
null, if an SQLException occurred, else an InputStream with the Response

storeComplexValue

public java.lang.String storeComplexValue(java.lang.String id,
                                          LargeBufferStream stream,
                                          java.lang.String type,
                                          java.lang.String mimeType)
Specified by:
storeComplexValue in interface IDatabase

generateRetrieveResultURL

public java.lang.String generateRetrieveResultURL(java.lang.String id)
The URL referencing the location from which the ExecuteResponse can be retrieved. If "status" is "true" in the Execute request, the ExecuteResponse should also be found here as soon as the process returns the initial response to the client. It should persist at this location as long as the outputs are accessible from the server. The outputs may be stored for as long as the implementer of the server decides. If the process takes a long time, this URL can be repopulated on an ongoing basis in order to keep the client updated on progress. Before the process has succeeded, the ExecuteResponse contains information about the status of the process, including whether or not processing has started, and the percentage completed. It may also optionally contain the inputs and any ProcessStartedType interim results. When the process has succeeded, the ExecuteResponse found at this URL shall contain the output values or references to them.

Specified by:
generateRetrieveResultURL in interface IDatabase

getDatabaseName

public java.lang.String getDatabaseName()
Returns some name for the database, like DERBY, HSQL, ...

Specified by:
getDatabaseName in interface IDatabase

getMimeTypeForStoreResponse

public java.lang.String getMimeTypeForStoreResponse(java.lang.String id)
Specified by:
getMimeTypeForStoreResponse in interface IDatabase

deleteStoredResponse

public boolean deleteStoredResponse(java.lang.String id)
Specified by:
deleteStoredResponse in interface IDatabase

lookupResponseAsFile

public java.io.File lookupResponseAsFile(java.lang.String id)
Specified by:
lookupResponseAsFile in interface IDatabase


Copyright © 2007-2011 52north.org. All Rights Reserved.