|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PersistentStorage
An interface defining how to store results, and other characteristics of service invocations ("jobs"), in more persistent way. Typical implementations will use a file system or a local database.
Some implementations may be actually just "data consumers", or
"sinks", that will never return any data back. This may be used for
various user interfaces displaying or transforming analysis
results. A storage that behaves like that returns true from
the isSink
method.
Method Summary | |
---|---|
java.lang.String |
getDescription()
Return a (human-readable) description of this persistent storage. |
java.util.Properties |
getJobProperties(java.lang.String jobId)
Return known properties of the given job. |
org.soaplab.services.JobState |
getJobState(java.lang.String jobId)
This is as close to re-creating a stored job as possible. |
java.lang.Object |
getResult(java.lang.String jobId,
java.lang.String name)
Find in this persistent storage the given result for the given job and return them back. |
java.util.Map<java.lang.String,java.lang.Object> |
getResults(java.lang.String jobId)
Find in this persistent storage all results for the given job and return them back. |
java.util.Map<java.lang.String,java.lang.String>[] |
getResultsInfo(java.lang.String jobId)
Return properties associated with all results from the given job. |
boolean |
isSink()
Return 'true' if this storage allows only setting data (jobs, state, results, etc.) but never returns them back. |
java.lang.String[] |
listJobs()
Return names (job Ids) of all jobs still available from this storage handler. |
void |
removeJob(java.lang.String jobId)
Remove given job from this persistent storage. |
void |
removeJobs(java.util.Date fromDate,
java.util.Date toDate)
Remove jobs from this persistent storage that were last updated within given time interval. |
void |
removeJobs(java.lang.String jobIdPattern)
Remove jobs from this persistent storage whose IDs contain the string specified by 'jobIdPattern'. |
void |
setJob(Job job)
Store Job's state information to the persistent storage. |
void |
setJobProperties(java.lang.String jobId,
java.util.Properties props)
Store properties for the given job. |
void |
setResult(Job job,
java.lang.String name,
java.lang.Object result)
Store result in the persistent storage. |
Method Detail |
---|
java.lang.String getDescription()
java.lang.String[] listJobs()
org.soaplab.services.JobState getJobState(java.lang.String jobId) throws SoaplabException
jobId
- an identifier of a job whose state will be returned
SoaplabException
- if the permanent storage cannot be
accessed, or if the given 'jobId' does not exist therejava.util.Properties getJobProperties(java.lang.String jobId) throws SoaplabException
jobId
- identifies the job whose properties are asked for
SoaplabException
- if the permanent storage cannot be
accessed, or if the given 'jobId' does not exist therevoid setJobProperties(java.lang.String jobId, java.util.Properties props) throws SoaplabException
jobId
- identifies the job whose properties are being saved
SoaplabException
- if the permanent storage cannot be
accessed, or if the given 'jobId' does not exist therevoid setJob(Job job) throws SoaplabException
job
- whose state is being saved
SoaplabException
- if the permanent storage cannot be
accessedvoid removeJob(java.lang.String jobId) throws SoaplabException
SoaplabException
- if the storage cannot be accessedvoid removeJobs(java.lang.String jobIdPattern)
jobIdPattern
- is a simple pattern, not a regular
expressionvoid removeJobs(java.util.Date fromDate, java.util.Date toDate)
fromDate
- begins the interval of removaltoDate
- finishes the interval of removaljava.util.Map<java.lang.String,java.lang.Object> getResults(java.lang.String jobId) throws SoaplabException
jobId
- a job whose results to return
SoaplabException
- if the permanent storage cannot be
accessed, or if the given 'jobId' does not exist therejava.lang.Object getResult(java.lang.String jobId, java.lang.String name) throws SoaplabException
jobId
- a job whose result to returnname
- of a result to be returned
SoaplabException
- if the permanent storage cannot be
accessed, or if the given 'jobId' does not exist therejava.util.Map<java.lang.String,java.lang.String>[] getResultsInfo(java.lang.String jobId) throws SoaplabException
jobId
- identifies a job whose results are being
investigated
SoaplabException
- if the storage cannot be accessedvoid setResult(Job job, java.lang.String name, java.lang.Object result) throws SoaplabException
job
- where the result belongs toname
- of the result (as defined in the service metadata)result
- to be stored (allowed types may depend on the
storage handler, but reasonable effort should be made to store
most of the common types)
SoaplabException
- if the storage cannot be accessedboolean isSink()
This may be used if the "storage" is a user interface for displaying job's data. For example, the HTML pages may be a "persistent storage", showing results and job state.
|
Version: ${maven.project.version} | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |