com.googlecode.hibernate.memcached
Class AbstractKeyStrategy

java.lang.Object
  extended by com.googlecode.hibernate.memcached.AbstractKeyStrategy
All Implemented Interfaces:
KeyStrategy
Direct Known Subclasses:
DigestKeyStrategy, HashCodeKeyStrategy, StringKeyStrategy

public abstract class AbstractKeyStrategy
extends Object
implements KeyStrategy

KeyStrategy base class that handles concatenation, cleaning, and truncating the final cache key.

Concatenates the three key components; regionName, clearIndex and key.
Subclasses are responsible for transforming the Key object into something identifyable.

Author:
Ray Krueger

Field Summary
protected  org.slf4j.Logger log
           
static int MAX_KEY_LENGTH
           
 
Constructor Summary
AbstractKeyStrategy()
           
 
Method Summary
protected  String concatenateKey(String regionName, long clearIndex, Object key)
           
 String toKey(String regionName, long clearIndex, Object key)
           
protected abstract  String transformKeyObject(Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_KEY_LENGTH

public static final int MAX_KEY_LENGTH
See Also:
Constant Field Values

log

protected final org.slf4j.Logger log
Constructor Detail

AbstractKeyStrategy

public AbstractKeyStrategy()
Method Detail

toKey

public String toKey(String regionName,
                    long clearIndex,
                    Object key)
Specified by:
toKey in interface KeyStrategy

transformKeyObject

protected abstract String transformKeyObject(Object key)

concatenateKey

protected String concatenateKey(String regionName,
                                long clearIndex,
                                Object key)


Copyright © 2015. All rights reserved.