Package com.atlassian.cache

Examples of com.atlassian.cache.Cache


   
   

  protected AdvancedCodeBlockCache getFromCache(String innerKeyCacheName) {
    if (innerKeyCacheName != null && ! innerKeyCacheName.isEmpty()) {
      Cache cache = cacheManager.getCache(MACRO_CACHE_KEY);   
 
      AdvancedCodeBlockCache cacheObj = null;
      try {
        cacheObj = (AdvancedCodeBlockCache) cache.get(innerKeyCacheName);
      } catch (Exception e) {
        // If Object of old version with different footprint is already there, discard the object.
        log.info("Cache gets renewed because of ClassCastException."+e.getMessage());
        cacheObj = null;
      }
View Full Code Here


    return null;
  }
 
  protected void putToCache(List<Map<String,String>> codeblocks, String innerKeyCacheName) {
    if (innerKeyCacheName != null && ! innerKeyCacheName.isEmpty()) {
      Cache cache = cacheManager.getCache(MACRO_CACHE_KEY);   
     
      Date lastCacheUpdate = newDate();
      AdvancedCodeBlockCache cacheObj = new AdvancedCodeBlockCache();
      cacheObj.setCodeblocks(codeblocks);
      cacheObj.setCreated(lastCacheUpdate);
     
      cache.put(innerKeyCacheName, cacheObj);
    }
  }
View Full Code Here

   

    @Override
    public String execute() throws Exception
    {
    Cache cache = cacheManager.getCache(BaseAdvancedCodeblockMacro.MACRO_CACHE_KEY);
    cache.remove(cachekey);
    log.info("remove cache key from macrocache: "+cachekey);

        return Action.SUCCESS;
    }
View Full Code Here

      String file = extractMacroParameter(parameters, FILE_PARAM_KEY);
     
    StringBuilder gistUrl = createGistUrl(id, file);

      if(parameters.containsKey(PREFETCH_PARAM_KEY) && TRUE.equals(parameters.get(PREFETCH_PARAM_KEY))){
          Cache cache = cacheManager.getCache(CACHE_KEY);
        String key = getCacheKey(id, file);
      String contents = (String) cache.get(key);
        if(contents == null) {
            String proxyHost = extractMacroParameter(parameters, PROXY_HOST_PARAM_KEY);
            String proxyPort = extractMacroParameter(parameters, PROXY_PORT_PARAM_KEY);
          contents = fetchGistUrl(gistUrl.toString(), proxyHost, proxyPort);
          cache.put(key, contents);
        }
      return contents;
    } else {
          StringBuilder sb = new StringBuilder();
          sb.append(SCRIPT_START);
View Full Code Here

TOP

Related Classes of com.atlassian.cache.Cache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.