Class SnapshotRestService

java.lang.Object
org.imixs.archive.core.api.SnapshotRestService
All Implemented Interfaces:
Serializable

@Named @RequestScoped @Path("/snapshot") @Produces({"text/html","application/xml","application/json","text/xml"}) public class SnapshotRestService extends Object implements Serializable
The SnapshotRestService provides a Rest API to access the snapshot data.

The method getWorkitemFile is a wrapper for the WorkflowRestService and returns the file content based on the $uniqueid of the origin workitem.

The method getDocumentsBySyncPoint returns snapshot data from a given modified timestamp. This method is used by an external archive service to sync the snapshot data.

In case the environment variable 'ARCHIVE_SERVICE_ENDPOINT' is set the file content is fetched directly form the Cassandra archive.

Author:
rsoika
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.imixs.workflow.xml.XMLDataCollection
    getDocumentsBySyncPoint(long lSyncpoint)
    This method returns the next workitem from a given syncpoint.
    javax.ws.rs.core.Response
    getWorkItemFile(String uniqueid, String file, javax.ws.rs.core.UriInfo uriInfo)
    This method wraps the WorkflowRestService method 'getWorkItemFile' and verifies the target id which can be either a $snapshotid or the deprecated $blobWorkitemid.
    Ping service
    javax.ws.rs.core.Response
    postSnapshot(org.imixs.workflow.xml.XMLDocument xmlworkitem)
    The method restores a snapshot provided in xml format.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SnapshotRestService

      public SnapshotRestService()
  • Method Details

    • getWorkItemFile

      @GET @Path("/{uniqueid : ([0-9a-f]{8}-.*|[0-9a-f]{11}-.*)}/file/{file}") public javax.ws.rs.core.Response getWorkItemFile(@PathParam("uniqueid") String uniqueid, @PathParam("file") @Encoded String file, @Context javax.ws.rs.core.UriInfo uriInfo)
      This method wraps the WorkflowRestService method 'getWorkItemFile' and verifies the target id which can be either a $snapshotid or the deprecated $blobWorkitemid. Finally the method calls the origin method getWorkItemFile
      Parameters:
      uniqueid -
      file - - file name
      Returns:
      byte stream with file data.
    • getDocumentsBySyncPoint

      @GET @Path("/syncpoint/{syncpoint}") public org.imixs.workflow.xml.XMLDataCollection getDocumentsBySyncPoint(@PathParam("syncpoint") long lSyncpoint)
      This method returns the next workitem from a given syncpoint. A syncpoint is defined in milliseconds after January 1, 1970 00:00:00 GMT.

      The syncpoint is compared to the internal modified date of the document entity which can not be modified from businss logic.

      If not data is found, the method returns null.

      Parameters:
      syncpoint -
      Returns:
    • postSnapshot

      @POST @Produces("application/xml") @Consumes({"application/xml","text/xml"}) public javax.ws.rs.core.Response postSnapshot(org.imixs.workflow.xml.XMLDocument xmlworkitem)
      The method restores a snapshot provided in xml format.

      The method updates the origin document as also the snapshot data if needed.

      Parameters:
      xmlworkitem - - entity to be saved
      Returns:
    • ping

      @GET @Path("/ping") public String ping()
      Ping service
      Parameters:
      lSyncpoint -
      Returns: