Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I use the new atlassian cache api with earlier versions of Confluence?

Dennis Andersen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2014

On the tutorial page https://developer.atlassian.com/x/lAAf the new version 2 is used as the example. I'm interested in using the api in a plugin with support for earlier versions of confluence as well. E.g. I’d like to use the api on confluence 5.0 as well as on 5.5, but I can’t seem to bundle the latest version of the cache api in my pom on 5.0 as it results in a classdefException (not finding CacheLoader)

Any pointers appreciated.

Edit: After some thought I guess what I really want is to specify to always bundle a certain dependency (in this case atlassian-cache-api) of a certain version (2.3.4) and always use that even if confluence bundles another version of the plugin.

/Denns

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Dennis Andersen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 10, 2014

I ended up using the bundled cache api, only using methods and classes available from the early 0.1 version. This way I can use the cache api across all my desired Confluence versions. Since the new API is backwards compatible with 0.1 this works well, even if I’m missing out on the newer functionality.

0 votes
Yagnesh Bhat
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2014

Hi Dennis,

I dont think we need to do any pom modification to use the cache API. I tried to use it right out of the box for my plugins for v5.3.4 as well as 5.5, and didnt find any issues. For version 5.0 , I guess you can test if you are able to use com.atlassian.cache.Cache and com.atlassian.cache.CacheManager, in your plugin code. If not, then either they are using a diffent java class to do caching or maybe they dont provide the api for it in 5.0.

TAGS
AUG Leaders

Atlassian Community Events