@Test public void testCreateKey() { String key = handle.getKey(); assertNotNull(key); for (CacheTag tag : primaryTags) { assertTrue(key.contains(tag.getName())); assertTrue(key.contains(tag.getValue())); } }
protected String createKey(CacheTag[] tags) { if (tags == null || tags.length == 0) throw new IllegalArgumentException("Tags must not be null or empty"); StringBuffer key = new StringBuffer(); Set<CacheTag> s = new TreeSet<CacheTag>(new TagComparator()); s.addAll(Arrays.asList(tags)); for (CacheTag tag : s) { if (CacheTag.Site.equals(tag.getName())) continue; if (key.length() > 0) key.append("; "); key.append(tag.getName()).append("=").append(tag.getValue()); } return key.toString(); }
TaggedCacheHandle extends CacheHandleImpl { protected String createKey(CacheTag[] tags) { if (tags == null || tags.length == 0) throw new IllegalArgumentException("Tags must not be null or empty"); StringBuffer key = new StringBuffer(); Set<CacheTag> s = new TreeSet<CacheTag>(new TagComparator()); s.addAll(Arrays.asList(tags)); for (CacheTag tag : s) { if (CacheTag.Site.equals(tag.getName())) continue; if (key.length() > 0) key.append("; "); key.append(tag.getName()).append("=").append(tag.getValue()); } return key.toString(); } }
TaggedCacheHandle extends CacheHandleImpl { protected String createKey(CacheTag[] tags) { if (tags == null || tags.length == 0) throw new IllegalArgumentException("Tags must not be null or empty"); StringBuffer key = new StringBuffer(); Set<CacheTag> s = new TreeSet<CacheTag>(new TagComparator()); s.addAll(Arrays.asList(tags)); for (CacheTag tag : s) { if (CacheTag.Site.equals(tag.getName())) continue; if (key.length() > 0) key.append("; "); key.append(tag.getName()).append("=").append(tag.getValue()); } return key.toString(); } TaggedCacheHandle(CacheTag[] primary, long expirationTime, long revalidationTime); }
TaggedCacheHandle extends CacheHandleImpl { protected String createKey(CacheTag[] tags) { if (tags == null || tags.length == 0) throw new IllegalArgumentException("Tags must not be null or empty"); StringBuffer key = new StringBuffer(); Set<CacheTag> s = new TreeSet<CacheTag>(new TagComparator()); s.addAll(Arrays.asList(tags)); for (CacheTag tag : s) { if (CacheTag.Site.equals(tag.getName())) continue; if (key.length() > 0) key.append("; "); key.append(tag.getName()).append("=").append(tag.getValue()); } return key.toString(); } TaggedCacheHandle(CacheTag[] primary, long expirationTime, long revalidationTime); CacheTag[] getPrimaryTags(); }
TaggedCacheHandle extends CacheHandleImpl { protected String createKey(CacheTag[] tags) { if (tags == null || tags.length == 0) throw new IllegalArgumentException("Tags must not be null or empty"); StringBuffer key = new StringBuffer(); Set<CacheTag> s = new TreeSet<CacheTag>(new TagComparator()); s.addAll(Arrays.asList(tags)); for (CacheTag tag : s) { if (CacheTag.Site.equals(tag.getName())) continue; if (key.length() > 0) key.append("; "); key.append(tag.getName()).append("=").append(tag.getValue()); } return key.toString(); } TaggedCacheHandle(CacheTag[] primary, long expirationTime, long revalidationTime); CacheTag[] getPrimaryTags();  }