org.objectweb.cjdbc.controller.cache.result.entries
Interface CacheEntry

All Known Implementing Classes:
ResultCacheEntry

public interface CacheEntry

This describes a reauest cache entry.


Field Summary
static int CACHE_DIRTY
          This entry is dirty
static int CACHE_INVALID
          This entry is no more valid and is not consistent with real data.
static int CACHE_VALID
          State this entry is valid
static int NO_DEADLINE
          This entry has no deadline
 
Method Summary
 CacheEntry getNext()
          Gets the value of next ResultCacheEntry in LRU.
 CacheEntry getPrev()
          Gets the value of previous CacheEntry in LRU.
 SelectRequest getRequest()
          Returns the SELECT request of this cache entry.
 ControllerResultSet getResult()
          Returns the ControllerResultSet of the cached select request
 int getSizeOfResult()
          Size of the result in bytes
 java.lang.String getState()
          Get the state of this entry as a string
 java.lang.String getType()
          Get the type of this entry as a string
 void invalidate()
          Invalidates this cache entry (removes the ResultSet and turn state to CACHE_INVALID).
 boolean isDirty()
          Returns true if cache entry state is marked dirty (state is CACHE_DIRTY).
 boolean isValid()
          Return true if cache entry state is valid (state is CACHE_VALID).
 void markDirty()
          Marks this entry dirty (state becomes CACHE_DIRTY).
 void setNext(CacheEntry next)
          Sets the value of next CacheEntry in LRU.
 void setPrev(CacheEntry prev)
          Sets the value of previous CacheEntry in LRU.
 void setResult(ControllerResultSet result)
          Set a new ControllerResultSet of the cached select request (cache update).
 void setValid()
          Marks this entry valid (state becomes CACHE_VALID).
 java.lang.String[] toStringTable()
          Get data about this entry
 

Field Detail

NO_DEADLINE

public static final int NO_DEADLINE
This entry has no deadline

See Also:
Constant Field Values

CACHE_VALID

public static final int CACHE_VALID
State this entry is valid

See Also:
Constant Field Values

CACHE_DIRTY

public static final int CACHE_DIRTY
This entry is dirty

See Also:
Constant Field Values

CACHE_INVALID

public static final int CACHE_INVALID
This entry is no more valid and is not consistent with real data.

See Also:
Constant Field Values
Method Detail

getType

public java.lang.String getType()
Get the type of this entry as a string

Returns:
NoCache or Eager or Relaxed

getState

public java.lang.String getState()
Get the state of this entry as a string

Returns:
Valid or Dirty or Invalid

isValid

public boolean isValid()
Return true if cache entry state is valid (state is CACHE_VALID).

Returns:
a boolean value

isDirty

public boolean isDirty()
Returns true if cache entry state is marked dirty (state is CACHE_DIRTY).

Returns:
a boolean value

getRequest

public SelectRequest getRequest()
Returns the SELECT request of this cache entry.

Returns:
a SelectRequest value

getResult

public ControllerResultSet getResult()
Returns the ControllerResultSet of the cached select request

Returns:
a ControllerResultSet value

setResult

public void setResult(ControllerResultSet result)
Set a new ControllerResultSet of the cached select request (cache update).

The cache state is automatically set to valid (CACHE_VALID).

Parameters:
result - a ControllerResultSet value

invalidate

public void invalidate()
Invalidates this cache entry (removes the ResultSet and turn state to CACHE_INVALID).


markDirty

public void markDirty()
Marks this entry dirty (state becomes CACHE_DIRTY).

The ResultSet if not affected by this method.


setValid

public void setValid()
Marks this entry valid (state becomes CACHE_VALID).


getNext

public CacheEntry getNext()
Gets the value of next ResultCacheEntry in LRU.

Returns:
value of next.

setNext

public void setNext(CacheEntry next)
Sets the value of next CacheEntry in LRU.

Parameters:
next - value to assign to next.

getPrev

public CacheEntry getPrev()
Gets the value of previous CacheEntry in LRU.

Returns:
value of previous.

setPrev

public void setPrev(CacheEntry prev)
Sets the value of previous CacheEntry in LRU.

Parameters:
prev - value to assign to prev.

toStringTable

public java.lang.String[] toStringTable()
Get data about this entry

Returns:
an array [request,type,status(valid,notvalid,dirty),deadLine]

getSizeOfResult

public int getSizeOfResult()
Size of the result in bytes

Returns:
an integer


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.