public abstract class AttachmentStore
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
POLICY_EXT_STORAGE
This attachment store policy indicates that attachments should be stored on external
media (file system, database, etc.) rather than kept in memory.
|
static int |
POLICY_MEM_BUFFER
This attachment store policy indicates that attachments should be kept within memory
rather than stored on external media (file system, database, etc.).
|
| Constructor and Description |
|---|
AttachmentStore() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cleanup()
Cleans up the attachment store.
|
abstract void |
deleteAttachments(java.lang.String uniqueId)
Delete the attachment from file system if is
FileAttachment and from
AttachmentStore. |
java.lang.String |
getAttachmentPathPrefix() |
static AttachmentStore |
getInstance() |
static int |
getStorePolicy()
Returns the policy for storing attachment raw data used within this current runtime.
|
abstract boolean |
isAvailable(java.lang.String uniqueId,
java.lang.String cid)
Returns true if attachment is available.
|
abstract void |
prepareForAttachments(java.lang.String uniqueId)
Prepares the attachment map for the new attachments with given uniqueId.
|
abstract IncomingAttachment |
resolve(java.lang.String uniqueId,
java.lang.String cid,
long timeToWait)
Resolves an attachment by uniqueId and cid.
|
void |
setAttachmentPathPrefix(java.lang.String prefix) |
static void |
setStorePolicy(int newStorePolicy) |
abstract void |
store(java.lang.String uniqueId,
java.lang.String cid,
boolean isStreamingType,
ContentType contentType,
java.io.InputStream from)
Stores an attachment by uniqueId and cid.
|
public static final int POLICY_MEM_BUFFER
public static final int POLICY_EXT_STORAGE
public static AttachmentStore getInstance() throws AttachmentException
AttachmentExceptionpublic static int getStorePolicy()
POLICY_MEM_BUFFER,
POLICY_EXT_STORAGEpublic static void setStorePolicy(int newStorePolicy)
public abstract IncomingAttachment resolve(java.lang.String uniqueId, java.lang.String cid, long timeToWait) throws AttachmentException
uniqueId - cid - AttachmentExceptionpublic abstract void store(java.lang.String uniqueId,
java.lang.String cid,
boolean isStreamingType,
ContentType contentType,
java.io.InputStream from)
uniqueId - cid - isStreamingType - contentType - from - public abstract boolean isAvailable(java.lang.String uniqueId,
java.lang.String cid)
uniqueId - cid - public abstract void cleanup()
public abstract void deleteAttachments(java.lang.String uniqueId)
FileAttachment and from
AttachmentStore.public abstract void prepareForAttachments(java.lang.String uniqueId)
uniqueId - public java.lang.String getAttachmentPathPrefix()
public void setAttachmentPathPrefix(java.lang.String prefix)