|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.pages.attachments.AttachmentCache
public class AttachmentCache
Caches the IDs of current attachments by the normal lookup mechanism: content ID +
file name. The returned ID can be used for a second-level cache lookup in
Hibernate via Session.get(Class, java.io.Serializable)
.
CachingAttachmentDao
Constructor Summary | |
---|---|
AttachmentCache(com.atlassian.cache.CacheManager cacheManager)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AttachmentCache(com.atlassian.cache.CacheManager cacheManager)
Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |