|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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,
String fileName)
Returns true if the cache contains the composite key of content ID + file name. |
Long |
get(long contentId,
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,
String fileName)
public void put(Attachment attachment)
throws IllegalArgumentException
IllegalArgumentException - if the attachment's content reference is
null.
public Long get(long contentId,
String fileName)
public void remove(Attachment attachment)
throws IllegalArgumentException
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 | |||||||||