public class AttachmentCache
extends java.lang.Object
Session.get(Class, java.io.Serializable)
.
Doesn't cache misses.
Because the persistent ID of the latest version of an attachment never
changes, there's no need to synchronise this cache when an attachment is modified.CachingAttachmentDao
Constructor and Description |
---|
AttachmentCache(com.atlassian.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(long contentId,
java.lang.String fileName)
Returns true if the cache contains the composite key of content ID + file
name.
|
java.lang.Long |
get(long contentId,
java.lang.String fileName)
Returns the ID of the attachment with the given content ID, file name
and version, or null if no attachment is in the cache.
|
void |
put(Attachment attachment)
Caches the ID of the current version of an attachment (which should
never change) against its content ID + file name.
|
void |
remove(Attachment attachment)
Removes the given attachment from the cache.
|
void |
removeAll()
Removes all entries from the cache.
|
public AttachmentCache(com.atlassian.cache.CacheManager cacheManager)
public boolean contains(long contentId, java.lang.String fileName)
public void put(Attachment attachment) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the attachment's content reference is
null.public java.lang.Long get(long contentId, java.lang.String fileName)
public void remove(Attachment attachment) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the attachment's content reference is
null.public void removeAll()
Copyright © 2003-2014 Atlassian. All Rights Reserved.