Subversion Repositories SmartDukaan

Rev

Rev 5228 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5228 Rev 5275
Line 34... Line 34...
34
    private static final String COMING_SOON_CACHE_KEY = "COMING_SOON";
34
    private static final String COMING_SOON_CACHE_KEY = "COMING_SOON";
35
    private static final String COMING_SOON_COUNT_CACHE_KEY = "COMING_SOON_COUNT";
35
    private static final String COMING_SOON_COUNT_CACHE_KEY = "COMING_SOON_COUNT";
36
	
36
	
37
	private long beginIndex = 0;
37
	private long beginIndex = 0;
38
	
38
	
39
	private Long totalItems = 0l;
39
	private Long totalItems = -1l;
40
	
40
	
41
	private String id;
41
	private String id;
42
	
42
	
43
	List<Long> items = null;
43
	List<Long> items = null;
44
	
44
	
Line 75... Line 75...
75
        EhcacheWrapper<String, Object> showcasePageSnippetsCache = new EhcacheWrapper<String, Object>(
75
        EhcacheWrapper<String, Object> showcasePageSnippetsCache = new EhcacheWrapper<String, Object>(
76
                EhcacheWrapper.SHOWCASE_PAGE_SNIPPET_CACHE_NAME, CacheManager.create());
76
                EhcacheWrapper.SHOWCASE_PAGE_SNIPPET_CACHE_NAME, CacheManager.create());
77
        if(sourceId == -1){
77
        if(sourceId == -1){
78
	        this.snippets = (List<String>)showcasePageSnippetsCache.get(COMING_SOON_CACHE_KEY + beginIndex);
78
	        this.snippets = (List<String>)showcasePageSnippetsCache.get(COMING_SOON_CACHE_KEY + beginIndex);
79
	        this.totalItems = (Long)showcasePageSnippetsCache.get(COMING_SOON_COUNT_CACHE_KEY);
79
	        this.totalItems = (Long)showcasePageSnippetsCache.get(COMING_SOON_COUNT_CACHE_KEY);
80
	        if(this.snippets != null && !this.snippets.isEmpty() && this.totalItems > 0) {
80
	        if(this.snippets != null && !this.snippets.isEmpty() && this.totalItems > -1) {
81
	            log.info("Using Cache.");
81
	            log.info("Using Cache.");
82
	            return new DefaultHttpHeaders("show");
82
	            return new DefaultHttpHeaders("show");
83
	        }
83
	        }
84
        }
84
        }
85
        log.info("Getting coming soon products snippets.");
85
        log.info("Getting coming soon products snippets.");