org.apache.chemistry.opencmis.client.bindings.cache.impl
Class AbstractMapCacheLevel

java.lang.Object
  extended by org.apache.chemistry.opencmis.client.bindings.cache.impl.AbstractMapCacheLevel
All Implemented Interfaces:
java.io.Serializable, CacheLevel
Direct Known Subclasses:
LruCacheLevelImpl, MapCacheLevelImpl

public abstract class AbstractMapCacheLevel
extends java.lang.Object
implements CacheLevel

Abstract Map cache.

Author:
Florian Müller
See Also:
Serialized Form

Constructor Summary
AbstractMapCacheLevel()
           
 
Method Summary
protected  void disableKeyFallback()
          Disables the fallback key.
protected  void disableSingeValueFallback()
          Disables the single value fallback.
protected  void enableKeyFallback(java.lang.String key)
          Enables a fallback key if no value was found for a requested key.
protected  void enableSingeValueFallback()
          Enables the single value fallback.
 java.lang.Object get(java.lang.String key)
          Retrieves an object from the cache level.
protected  boolean getBooleanParameter(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String name, boolean defValue)
          Extracts a boolean parameter from the parameters.
protected  float getFloatParameter(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String name, float defValue)
          Extracts a float parameter from the parameters.
protected  int getIntParameter(java.util.Map<java.lang.String,java.lang.String> parameters, java.lang.String name, int defValue)
          Extracts an integer parameter from the parameters.
protected  java.util.Map<java.lang.String,java.lang.Object> getMap()
          Returns the internal map.
abstract  void initialize(java.util.Map<java.lang.String,java.lang.String> parameters)
          Initialize the cache level.
 void put(java.lang.Object value, java.lang.String key)
          Adds an object to the cache level.
 void remove(java.lang.String key)
          Removes an object from this cache level.
protected  void setMap(java.util.Map<java.lang.String,java.lang.Object> map)
          Sets the internal map.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractMapCacheLevel

public AbstractMapCacheLevel()
Method Detail

initialize

public abstract void initialize(java.util.Map<java.lang.String,java.lang.String> parameters)
Description copied from interface: CacheLevel
Initialize the cache level.

Specified by:
initialize in interface CacheLevel
Parameters:
parameters - level parameters

get

public java.lang.Object get(java.lang.String key)
Description copied from interface: CacheLevel
Retrieves an object from the cache level.

Specified by:
get in interface CacheLevel
Parameters:
key - the key at this cache level
Returns:
the object or null if the object doesn't exist

put

public void put(java.lang.Object value,
                java.lang.String key)
Description copied from interface: CacheLevel
Adds an object to the cache level.

Specified by:
put in interface CacheLevel
Parameters:
value - the object
key - the key at this level

remove

public void remove(java.lang.String key)
Description copied from interface: CacheLevel
Removes an object from this cache level.

Specified by:
remove in interface CacheLevel
Parameters:
key - the key at this cache level

getMap

protected java.util.Map<java.lang.String,java.lang.Object> getMap()
Returns the internal map.


setMap

protected void setMap(java.util.Map<java.lang.String,java.lang.Object> map)
Sets the internal map.


enableKeyFallback

protected void enableKeyFallback(java.lang.String key)
Enables a fallback key if no value was found for a requested key.


disableKeyFallback

protected void disableKeyFallback()
Disables the fallback key.


enableSingeValueFallback

protected void enableSingeValueFallback()
Enables the single value fallback.


disableSingeValueFallback

protected void disableSingeValueFallback()
Disables the single value fallback.


getIntParameter

protected int getIntParameter(java.util.Map<java.lang.String,java.lang.String> parameters,
                              java.lang.String name,
                              int defValue)
Extracts an integer parameter from the parameters.

Parameters:
parameters - the parameter map
name - the parameter name
defValue - the default value if the parameter can't be found

getFloatParameter

protected float getFloatParameter(java.util.Map<java.lang.String,java.lang.String> parameters,
                                  java.lang.String name,
                                  float defValue)
Extracts a float parameter from the parameters.

Parameters:
parameters - the parameter map
name - the parameter name
defValue - the default value if the parameter can't be found

getBooleanParameter

protected boolean getBooleanParameter(java.util.Map<java.lang.String,java.lang.String> parameters,
                                      java.lang.String name,
                                      boolean defValue)
Extracts a boolean parameter from the parameters.

Parameters:
parameters - the parameter map
name - the parameter name
defValue - the default value if the parameter can't be found

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.