org.sandev.tools.ConfigEditor
Class ConfigDataCache

java.lang.Object
  extended by org.sandev.tools.ConfigEditor.ConfigDataCache
All Implemented Interfaces:
org.sandev.basics.util.IDCache

public class ConfigDataCache
extends java.lang.Object
implements org.sandev.basics.util.IDCache

An extremely simple mechanism to return any persistent object within a Configuration via its ID. This makes no attempt at being super efficient since the number of elements in the initialData is presumed to be relatively small.

There is no messaging going on here, this is just for lookup.


Field Summary
protected  org.sandev.basics.sandmessages.Configuration config
           
 
Constructor Summary
ConfigDataCache(org.sandev.basics.sandmessages.Configuration config)
           
 
Method Summary
 void cleanup()
          Does nothing
 void clear()
          does nothing
 org.sandev.basics.structs.SandCollectionMessage find(org.sandev.basics.structs.SandQueryMessage sqm)
          Returns null.
 org.sandev.basics.util.IDCacheCallback getCallback()
          Returns null
 org.sandev.basics.sandmessages.Configuration getConfig()
          accessor for config
 org.sandev.basics.structs.SandPersistMessage getInstance(long id)
           
 java.util.Map getMap()
          ConfigDataCache is not Map-based; returns null
 org.sandev.basics.sandmessages.CacheStats getStats(int nold)
          Returns null.
 long getTimeToLiveMillis()
          Returns zero
 boolean putInstance(org.sandev.basics.structs.SandPersistMessage msg)
          This cache does not actually accept any new instances for caching, it is initialized with a Configuration instead.
 org.sandev.basics.structs.SandPersistMessage removeInstance(long id)
          This cache does not actually remove any instances from caching, the Configuration is not affected.
 void setCallback(org.sandev.basics.util.IDCacheCallback callback)
          Does nothing.
 void setConfig(org.sandev.basics.sandmessages.Configuration config)
          mutator for config
 void setTimeToLiveMillis(long val)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.sandev.basics.sandmessages.Configuration config
Constructor Detail

ConfigDataCache

public ConfigDataCache(org.sandev.basics.sandmessages.Configuration config)
Method Detail

getConfig

public org.sandev.basics.sandmessages.Configuration getConfig()
accessor for config


setConfig

public void setConfig(org.sandev.basics.sandmessages.Configuration config)
mutator for config


putInstance

public boolean putInstance(org.sandev.basics.structs.SandPersistMessage msg)
This cache does not actually accept any new instances for caching, it is initialized with a Configuration instead.

Specified by:
putInstance in interface org.sandev.basics.util.IDCache

getInstance

public org.sandev.basics.structs.SandPersistMessage getInstance(long id)
Specified by:
getInstance in interface org.sandev.basics.util.IDCache

removeInstance

public org.sandev.basics.structs.SandPersistMessage removeInstance(long id)
This cache does not actually remove any instances from caching, the Configuration is not affected.

Specified by:
removeInstance in interface org.sandev.basics.util.IDCache

clear

public void clear()
does nothing

Specified by:
clear in interface org.sandev.basics.util.IDCache

getMap

public java.util.Map getMap()
ConfigDataCache is not Map-based; returns null

Specified by:
getMap in interface org.sandev.basics.util.IDCache

find

public org.sandev.basics.structs.SandCollectionMessage find(org.sandev.basics.structs.SandQueryMessage sqm)
Returns null. Not implemented.

Specified by:
find in interface org.sandev.basics.util.IDCache

getStats

public org.sandev.basics.sandmessages.CacheStats getStats(int nold)
Returns null. Not implemented.

Specified by:
getStats in interface org.sandev.basics.util.IDCache

getCallback

public org.sandev.basics.util.IDCacheCallback getCallback()
Returns null

Specified by:
getCallback in interface org.sandev.basics.util.IDCache

setCallback

public void setCallback(org.sandev.basics.util.IDCacheCallback callback)
Does nothing.

Specified by:
setCallback in interface org.sandev.basics.util.IDCache

getTimeToLiveMillis

public long getTimeToLiveMillis()
Returns zero

Specified by:
getTimeToLiveMillis in interface org.sandev.basics.util.IDCache

setTimeToLiveMillis

public void setTimeToLiveMillis(long val)
Does nothing.

Specified by:
setTimeToLiveMillis in interface org.sandev.basics.util.IDCache

cleanup

public void cleanup()
Does nothing

Specified by:
cleanup in interface org.sandev.basics.util.IDCache