org.w3c.www.protocol.http.cache
Class StoreState

java.lang.Object
  extended by org.w3c.tools.resources.AttributeHolder
      extended by org.w3c.www.protocol.http.cache.StoreState
All Implemented Interfaces:
java.lang.Cloneable

public class StoreState
extends AttributeHolder


Field Summary
protected static int ATTR_BYTE_COUNT
          Attribute index - The the current cache size
protected static int ATTR_CR_COUNT
          Attribute index - The current number of CachedResource in memory
protected static int ATTR_CURRENT_GENERATION
          Attribute index - The current generation number (id)
protected static int ATTR_ENTRY_NUM
          Attribute index - The number used to store the file
protected static int ATTR_NB_GENERATION
          Attribute index - The nb of generations (mem+disk)
protected static int ATTR_STORE_COUNT
          Attribute index - The the current store count
 
Fields inherited from class org.w3c.tools.resources.AttributeHolder
attributes, values
 
Constructor Summary
StoreState()
          Constructor.
 
Method Summary
 int decrGenerationNum()
          decrement the current generation number
 long getByteCount()
          Get the current cached byte count.
 int getCrCount()
          Get the current CachedResource count
 int getCurrentGeneration()
          Get the current Generation number
 int getEntryNum()
          Get the current entry number
 int getNbGeneration()
          Get the number of generation
 long getStoreCount()
          Get the current stored byte count
 int incrCurrentGeneration()
          Modify the current generation value
 int incrEntryNum()
          Modify the current entry number
 int incrGenerationNum()
          increment the current generation number
 void notifyGenerationCreated(CacheGeneration cg)
          Notify the store state, a generation has just been created
 void notifyGenerationLoaded(CacheGeneration cg)
          Notify the store state, a generation has just been loaded
 void notifyGenerationUnloaded(CacheGeneration cg)
          Notify the store state, a generation has just been unloaded
 void notifyResourceAdded(CachedResource cr, long oldsize)
          Notify the store state, a resource has just been added
 void notifyResourceDeleted(CachedResource cr)
          Notify the store state, a resource has just been deleted
 void notifyResourceRemoved(CachedResource cr)
          Notify the store state, a resource has been removed (from cache)
 void notifyResourceReplaced(CachedResource cr, long oldsize)
          Notify the store state, a resource has just been updated
 void notifyResourceToBeDeleted(CachedResource cr)
          Notify the store state, a resource has been moved in the "to be deleted" list
 void pickleValues(java.util.Hashtable defs)
          The basic initialization
 void sync()
          Synchronize the state
 java.lang.String toString()
           
 
Methods inherited from class org.w3c.tools.resources.AttributeHolder
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, getValue, initialize, initialize, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString, unsafeGetValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_CURRENT_GENERATION

protected static int ATTR_CURRENT_GENERATION
Attribute index - The current generation number (id)


ATTR_NB_GENERATION

protected static int ATTR_NB_GENERATION
Attribute index - The nb of generations (mem+disk)


ATTR_BYTE_COUNT

protected static int ATTR_BYTE_COUNT
Attribute index - The the current cache size


ATTR_STORE_COUNT

protected static int ATTR_STORE_COUNT
Attribute index - The the current store count


ATTR_CR_COUNT

protected static int ATTR_CR_COUNT
Attribute index - The current number of CachedResource in memory


ATTR_ENTRY_NUM

protected static int ATTR_ENTRY_NUM
Attribute index - The number used to store the file

Constructor Detail

StoreState

public StoreState()
Constructor.

Parameters:
file - the store state file
Method Detail

sync

public void sync()
Synchronize the state


incrCurrentGeneration

public int incrCurrentGeneration()
Modify the current generation value

Returns:
the new value

getCurrentGeneration

public int getCurrentGeneration()
Get the current Generation number

Returns:
an integer

getNbGeneration

public int getNbGeneration()
Get the number of generation

Returns:
an integer

getByteCount

public long getByteCount()
Get the current cached byte count.

Returns:
a long

getStoreCount

public long getStoreCount()
Get the current stored byte count

Returns:
a long

getCrCount

public int getCrCount()
Get the current CachedResource count

Returns:
a long

incrEntryNum

public int incrEntryNum()
Modify the current entry number

Returns:
the new value

getEntryNum

public int getEntryNum()
Get the current entry number

Returns:
an int

incrGenerationNum

public int incrGenerationNum()
increment the current generation number

Returns:
the new value

decrGenerationNum

public int decrGenerationNum()
decrement the current generation number

Returns:
an int

notifyGenerationCreated

public void notifyGenerationCreated(CacheGeneration cg)
Notify the store state, a generation has just been created

Parameters:
cg - the new generation

notifyGenerationLoaded

public void notifyGenerationLoaded(CacheGeneration cg)
Notify the store state, a generation has just been loaded

Parameters:
cg - the loaded generation

notifyGenerationUnloaded

public void notifyGenerationUnloaded(CacheGeneration cg)
Notify the store state, a generation has just been unloaded

Parameters:
cg - the unloaded generation

notifyResourceAdded

public void notifyResourceAdded(CachedResource cr,
                                long oldsize)
Notify the store state, a resource has just been added

Parameters:
cr - the added resource

notifyResourceReplaced

public void notifyResourceReplaced(CachedResource cr,
                                   long oldsize)
Notify the store state, a resource has just been updated

Parameters:
cr - the updated resource

notifyResourceRemoved

public void notifyResourceRemoved(CachedResource cr)
Notify the store state, a resource has been removed (from cache)

Parameters:
cr - the resource removed

notifyResourceToBeDeleted

public void notifyResourceToBeDeleted(CachedResource cr)
Notify the store state, a resource has been moved in the "to be deleted" list

Parameters:
cr - the resource to delete

notifyResourceDeleted

public void notifyResourceDeleted(CachedResource cr)
Notify the store state, a resource has just been deleted

Parameters:
cr - the deleted resource

pickleValues

public void pickleValues(java.util.Hashtable defs)
The basic initialization

Overrides:
pickleValues in class AttributeHolder
Parameters:
values - the values

toString

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