Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.cli.interpreter.session
Class SessionImpl

java.lang.Object
  extended by org.infinispan.cli.interpreter.session.SessionImpl
All Implemented Interfaces:
Session

public class SessionImpl
extends Object
implements Session


Field Summary
static Log log
           
 
Constructor Summary
SessionImpl(CodecRegistry codecRegistry, EmbeddedCacheManager cacheManager, String id)
           
 
Method Summary
 void createCache(String cacheName, String baseCacheName)
          Creates a new cache
<K,V> Cache<K,V>
getCache(String cacheName)
          Returns a named cache.
 EmbeddedCacheManager getCacheManager()
          Obtains the CacheManager to which this session is attached
 Codec getCodec()
          Returns the currently active codec used to encode/decode keys/values
 Codec getCodec(String codec)
          Returns a specific codec
 Collection<Codec> getCodecs()
          Returns the list of available key/value codecs
<K,V> Cache<K,V>
getCurrentCache()
          Obtains the currently selected cache.
 String getCurrentCacheName()
          Returns the name of the currently selected cache.
 String getId()
          Returns the unique id of this session
 long getTimestamp()
          Returns the time the session was last accessed
 void reset()
          Resets the session, by aborting any dangling batches and transactions and updating the timestamp
 void setCodec(String codec)
          Sets the codec to use for encoding/decoding keys/values
 void setCurrentCache(String cacheName)
          Sets the current cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final Log log
Constructor Detail

SessionImpl

public SessionImpl(CodecRegistry codecRegistry,
                   EmbeddedCacheManager cacheManager,
                   String id)
Method Detail

getCacheManager

public EmbeddedCacheManager getCacheManager()
Description copied from interface: Session
Obtains the CacheManager to which this session is attached

Specified by:
getCacheManager in interface Session

getId

public String getId()
Description copied from interface: Session
Returns the unique id of this session

Specified by:
getId in interface Session

getCurrentCache

public <K,V> Cache<K,V> getCurrentCache()
Description copied from interface: Session
Obtains the currently selected cache. If none has been selected, the default cache is returned

Specified by:
getCurrentCache in interface Session

getCurrentCacheName

public String getCurrentCacheName()
Description copied from interface: Session
Returns the name of the currently selected cache. If none has been selected, the default cache is returned

Specified by:
getCurrentCacheName in interface Session

getCache

public <K,V> Cache<K,V> getCache(String cacheName)
Description copied from interface: Session
Returns a named cache. If the cacheName parameter is null, the current cache is returned

Specified by:
getCache in interface Session
Returns:
the cache identified by cacheName

setCurrentCache

public void setCurrentCache(String cacheName)
Description copied from interface: Session
Sets the current cache.

Specified by:
setCurrentCache in interface Session

createCache

public void createCache(String cacheName,
                        String baseCacheName)
Description copied from interface: Session
Creates a new cache

Specified by:
createCache in interface Session
Parameters:
cacheName - the name of the new cache
baseCacheName - the existing named cache to use for defaults

reset

public void reset()
Description copied from interface: Session
Resets the session, by aborting any dangling batches and transactions and updating the timestamp

Specified by:
reset in interface Session

getTimestamp

public long getTimestamp()
Description copied from interface: Session
Returns the time the session was last accessed

Specified by:
getTimestamp in interface Session

setCodec

public void setCodec(String codec)
              throws CodecException
Description copied from interface: Session
Sets the codec to use for encoding/decoding keys/values

Specified by:
setCodec in interface Session
Parameters:
codec - the name of the codec to use
Throws:
CodecException

getCodecs

public Collection<Codec> getCodecs()
Description copied from interface: Session
Returns the list of available key/value codecs

Specified by:
getCodecs in interface Session

getCodec

public Codec getCodec()
Description copied from interface: Session
Returns the currently active codec used to encode/decode keys/values

Specified by:
getCodec in interface Session

getCodec

public Codec getCodec(String codec)
               throws CodecException
Description copied from interface: Session
Returns a specific codec

Specified by:
getCodec in interface Session
Throws:
CodecException

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.