public abstract class PrintJobStatus
extends java.lang.Object
| Constructor and Description |
|---|
PrintJobStatus(java.lang.String referenceId,
java.lang.String appId,
java.util.Date startDate,
java.util.Date completionDate,
long requestCount,
java.lang.String fileName,
AccessAssertion accessAssertion)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addExtraParameters(org.json.JSONObject metadata)
Add extra information to the metadata object being put in the registry.
|
void |
assertAccess()
Assert that the current is authorized to access this job.
|
AccessAssertion |
getAccess() |
java.lang.String |
getAppId() |
java.util.Date |
getCompletionDate() |
long |
getElapsedTime()
Get the elapsed time in ms.
|
java.lang.String |
getFileName() |
java.lang.String |
getReferenceId() |
long |
getRequestCount() |
java.util.Date |
getStartDate() |
static com.google.common.base.Optional<? extends PrintJobStatus> |
load(java.lang.String referenceId,
Registry registry,
AccessAssertionPersister persister)
Construct a print job by reading the data from a registry.
|
void |
setCompletionDate(java.util.Date completionDate) |
void |
store(Registry registry,
AccessAssertionPersister persister)
Store the data of a print job in the registry.
|
public PrintJobStatus(java.lang.String referenceId,
java.lang.String appId,
java.util.Date startDate,
java.util.Date completionDate,
long requestCount,
java.lang.String fileName,
AccessAssertion accessAssertion)
referenceId - reference of the report.appId - the appId used for loading the configuration.fileName - the fileName to send to the client.startDate - the time when the print job started.completionDate - the time when the print job ended.requestCount - the total number of requests made when the job was submitted.accessAssertion - the an access control object for downloading this report. Typically this is combined access of the
template and the configuration.public final void assertAccess()
public final void store(Registry registry, AccessAssertionPersister persister) throws org.json.JSONException
registry - the registry to writer topersister - a persister for converting the access assertion to jsonorg.json.JSONExceptionprotected abstract void addExtraParameters(org.json.JSONObject metadata)
throws org.json.JSONException
metadata - the json object that contains the metadataorg.json.JSONExceptionpublic static com.google.common.base.Optional<? extends PrintJobStatus> load(java.lang.String referenceId, Registry registry, AccessAssertionPersister persister) throws org.json.JSONException, NoSuchReferenceException
referenceId - the reference id of the report to get information about.registry - the registry to read from.persister - the access persister to use for reading the access data from the registryorg.json.JSONExceptionNoSuchReferenceExceptionpublic final java.lang.String getReferenceId()
public final java.lang.String getAppId()
public final java.lang.String getFileName()
public final java.util.Date getStartDate()
public final void setCompletionDate(java.util.Date completionDate)
public final java.util.Date getCompletionDate()
public final long getRequestCount()
public final AccessAssertion getAccess()
public final long getElapsedTime()