Package org.jbpm.document.marshalling
Class DocumentMarshallingStrategy
- java.lang.Object
-
- org.jbpm.document.marshalling.AbstractDocumentMarshallingStrategy
-
- org.jbpm.document.marshalling.DocumentMarshallingStrategy
-
- All Implemented Interfaces:
org.kie.api.marshalling.ObjectMarshallingStrategy
public class DocumentMarshallingStrategy extends AbstractDocumentMarshallingStrategy
-
-
Constructor Summary
Constructors Constructor Description DocumentMarshallingStrategy()
DocumentMarshallingStrategy(String path)
DocumentMarshallingStrategy(DocumentStorageService documentStorageService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
buildDocument(String name, long size, Date lastModified, Map<String,String> params)
Creates a valid Document instance with the data received.org.kie.api.marshalling.ObjectMarshallingStrategy.Context
createContext()
byte[]
marshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context, ObjectOutputStream objectOutputStream, Object o)
Object
read(ObjectInputStream os)
Object
unmarshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context, ObjectInputStream objectInputStream, byte[] object, ClassLoader classLoader)
void
write(ObjectOutputStream os, Object object)
-
Methods inherited from class org.jbpm.document.marshalling.AbstractDocumentMarshallingStrategy
accept
-
-
-
-
Constructor Detail
-
DocumentMarshallingStrategy
public DocumentMarshallingStrategy()
-
DocumentMarshallingStrategy
public DocumentMarshallingStrategy(String path)
-
DocumentMarshallingStrategy
public DocumentMarshallingStrategy(DocumentStorageService documentStorageService)
-
-
Method Detail
-
buildDocument
public Document buildDocument(String name, long size, Date lastModified, Map<String,String> params)
Description copied from class:AbstractDocumentMarshallingStrategy
Creates a valid Document instance with the data received. This method is called when a document is uploaded to create the Document instance before marshalling the document content.- Specified by:
buildDocument
in classAbstractDocumentMarshallingStrategy
- Parameters:
name
- The document name.size
- The size of the document content.lastModified
- The last modified date of the document.params
- A Map that contain params for the document creation.- Returns:
- A Document instance containing all the document info (including identifier and download link) except the Document content.
-
write
public void write(ObjectOutputStream os, Object object) throws IOException
- Throws:
IOException
-
read
public Object read(ObjectInputStream os) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
marshal
public byte[] marshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context, ObjectOutputStream objectOutputStream, Object o) throws IOException
- Throws:
IOException
-
unmarshal
public Object unmarshal(org.kie.api.marshalling.ObjectMarshallingStrategy.Context context, ObjectInputStream objectInputStream, byte[] object, ClassLoader classLoader) throws IOException, ClassNotFoundException
- Throws:
IOException
ClassNotFoundException
-
createContext
public org.kie.api.marshalling.ObjectMarshallingStrategy.Context createContext()
-
-