org.apache.jcs.engine
Class ElementAttributes

java.lang.Object
  extended byorg.apache.jcs.engine.ElementAttributes
All Implemented Interfaces:
java.lang.Cloneable, IElementAttributes, java.io.Serializable

public class ElementAttributes
extends java.lang.Object
implements IElementAttributes, java.io.Serializable, java.lang.Cloneable

Element attribute descriptor class.

Version:
$Id: ILateralCacheTCPListener.java,v 1.2 2002/01/18 22:08:26
Author:
Aaron Smuts
See Also:
Serialized Form

Field Summary
 long createTime
          The creation time
 java.util.ArrayList eventHandlers
          The last access time
 long idle
          Description of the Field
 boolean IS_DISTRIBUTE
          Is this item distributable at all.
 boolean IS_ETERNAL
          can turn off expiration
 boolean IS_LATERAL
          Is this item laterally distributable
 boolean IS_REMOTE
          Can this item be sent to the remote cache
 boolean IS_SPOOL
          can this item be flushed to disk
 long lastAccessTime
          The last access time
 long mls
          Max life seconds
 int size
          The byte size of teh field.
 long version
          Description of the Field
 
Constructor Summary
  ElementAttributes()
          Constructor for the IElementAttributes object
private ElementAttributes(ElementAttributes attr)
          Constructor for the IElementAttributes object
 
Method Summary
 void addElementEventHandler(IElementEventHandler eventHandler)
          Adds a ElementEventHandler.
 java.lang.Object clone2()
          Description of the Method
 IElementAttributes copy()
          Description of the Method
 long getCreateTime()
          Gets the createTime attribute of the IElementAttributes object
 java.util.ArrayList getElementEventHandlers()
          Gets the elementEventHandlers.
 long getIdleTime()
          Gets the idleTime attribute of the IElementAttributes object.
 boolean getIsDistribute()
          Gets the {3} attribute of the IElementAttributes object
 boolean getIsEternal()
          can turn off expiration
 boolean getIsLateral()
          Is this item laterally distributable
 boolean getIsRemote()
          Can this item be sent to the remote cache
 boolean getIsSpool()
          can this item be flushed to disk
 long getLastAccessTime()
          Gets the LastAccess attribute of the IAttributes object
 long getMaxLifeSeconds()
          Gets the {3} attribute of the ElementAttributes object
 int getSize()
          Gets the size attribute of the IElementAttributes object
 long getTimeToLiveSeconds()
          If the returned value is negative, the item has expired
 long getVersion()
          Gets the version attribute of the IElementAttributes object
 void setCreateTime()
          Sets the createTime attribute of the IElementAttributes object
 void setIdleTime(long idle)
          Sets the idleTime attribute of the IElementAttributes object
 void setIsDistribute(boolean val)
          Sets the isDistribute attribute of the ElementAttributes object
 void setIsEternal(boolean val)
          Sets the isEternal attribute of the ElementAttributes object
 void setIsLateral(boolean val)
          Sets the isLateral attribute of the ElementAttributes object
 void setIsRemote(boolean val)
          Sets the isRemote attribute of the ElementAttributes object
 void setIsSpool(boolean val)
          Sets the isSpool attribute of the ElementAttributes object
 void setLastAccessTimeNow()
          Sets the LastAccessTime as now of the IElementAttributes object
 void setMaxLifeSeconds(long mls)
          Sets the maxLifeSeconds attribute of the IElementAttributes object
 void setSize(int size)
          Size in bytes.
 void setVersion(long version)
          Sets the version attribute of the IElementAttributes object
 java.lang.String toString()
          For logging and debugging the element IElementAttributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_DISTRIBUTE

public boolean IS_DISTRIBUTE
Is this item distributable at all.


IS_SPOOL

public boolean IS_SPOOL
can this item be flushed to disk


IS_LATERAL

public boolean IS_LATERAL
Is this item laterally distributable


IS_REMOTE

public boolean IS_REMOTE
Can this item be sent to the remote cache


IS_ETERNAL

public boolean IS_ETERNAL
can turn off expiration


version

public long version
Description of the Field


mls

public long mls
Max life seconds


idle

public long idle
Description of the Field


size

public int size
The byte size of teh field. Must be manually set.


createTime

public long createTime
The creation time


lastAccessTime

public long lastAccessTime
The last access time


eventHandlers

public java.util.ArrayList eventHandlers
The last access time

Constructor Detail

ElementAttributes

public ElementAttributes()
Constructor for the IElementAttributes object


ElementAttributes

private ElementAttributes(ElementAttributes attr)
Constructor for the IElementAttributes object

Parameters:
attr -
Method Detail

copy

public IElementAttributes copy()
Description of the Method

Specified by:
copy in interface IElementAttributes
Returns:

clone2

public java.lang.Object clone2()
Description of the Method

Returns:

setVersion

public void setVersion(long version)
Sets the version attribute of the IElementAttributes object

Specified by:
setVersion in interface IElementAttributes
Parameters:
version - The new version value

setMaxLifeSeconds

public void setMaxLifeSeconds(long mls)
Sets the maxLifeSeconds attribute of the IElementAttributes object

Specified by:
setMaxLifeSeconds in interface IElementAttributes
Parameters:
mls - The new {3} value

getMaxLifeSeconds

public long getMaxLifeSeconds()
Gets the {3} attribute of the ElementAttributes object

Specified by:
getMaxLifeSeconds in interface IElementAttributes
Returns:
The {3} value

setIdleTime

public void setIdleTime(long idle)
Sets the idleTime attribute of the IElementAttributes object

Specified by:
setIdleTime in interface IElementAttributes
Parameters:
idle - The new idleTime value

setSize

public void setSize(int size)
Size in bytes.

Specified by:
setSize in interface IElementAttributes
Parameters:
size - The new size value

getSize

public int getSize()
Gets the size attribute of the IElementAttributes object

Specified by:
getSize in interface IElementAttributes
Returns:
The size value

getCreateTime

public long getCreateTime()
Gets the createTime attribute of the IElementAttributes object

Specified by:
getCreateTime in interface IElementAttributes
Returns:
The createTime value

setCreateTime

public void setCreateTime()
Sets the createTime attribute of the IElementAttributes object


getVersion

public long getVersion()
Gets the version attribute of the IElementAttributes object

Specified by:
getVersion in interface IElementAttributes
Returns:
The version value

getIdleTime

public long getIdleTime()
Gets the idleTime attribute of the IElementAttributes object. Keeping track of this will require storing the last access time. This could get expensive.

Specified by:
getIdleTime in interface IElementAttributes
Returns:
The idleTime value

getTimeToLiveSeconds

public long getTimeToLiveSeconds()
If the returned value is negative, the item has expired

Specified by:
getTimeToLiveSeconds in interface IElementAttributes
Returns:
The timeToLive value

getLastAccessTime

public long getLastAccessTime()
Gets the LastAccess attribute of the IAttributes object

Specified by:
getLastAccessTime in interface IElementAttributes
Returns:
The LastAccess value

setLastAccessTimeNow

public void setLastAccessTimeNow()
Sets the LastAccessTime as now of the IElementAttributes object

Specified by:
setLastAccessTimeNow in interface IElementAttributes

getIsDistribute

public boolean getIsDistribute()
Gets the {3} attribute of the IElementAttributes object

Specified by:
getIsDistribute in interface IElementAttributes
Returns:
The {3} value

setIsDistribute

public void setIsDistribute(boolean val)
Sets the isDistribute attribute of the ElementAttributes object

Specified by:
setIsDistribute in interface IElementAttributes
Parameters:
val - The new isDistribute value

getIsSpool

public boolean getIsSpool()
can this item be flushed to disk

Specified by:
getIsSpool in interface IElementAttributes
Returns:
The {3} value

setIsSpool

public void setIsSpool(boolean val)
Sets the isSpool attribute of the ElementAttributes object

Specified by:
setIsSpool in interface IElementAttributes
Parameters:
val - The new isSpool value

getIsLateral

public boolean getIsLateral()
Is this item laterally distributable

Specified by:
getIsLateral in interface IElementAttributes
Returns:
The {3} value

setIsLateral

public void setIsLateral(boolean val)
Sets the isLateral attribute of the ElementAttributes object

Specified by:
setIsLateral in interface IElementAttributes
Parameters:
val - The new isLateral value

getIsRemote

public boolean getIsRemote()
Can this item be sent to the remote cache

Specified by:
getIsRemote in interface IElementAttributes
Returns:
The {3} value

setIsRemote

public void setIsRemote(boolean val)
Sets the isRemote attribute of the ElementAttributes object

Specified by:
setIsRemote in interface IElementAttributes
Parameters:
val - The new isRemote value

getIsEternal

public boolean getIsEternal()
can turn off expiration

Specified by:
getIsEternal in interface IElementAttributes
Returns:
The {3} value

setIsEternal

public void setIsEternal(boolean val)
Sets the isEternal attribute of the ElementAttributes object

Specified by:
setIsEternal in interface IElementAttributes
Parameters:
val - The new isEternal value

addElementEventHandler

public void addElementEventHandler(IElementEventHandler eventHandler)
Adds a ElementEventHandler. Handler's can be registered for multiple events. A registered handler will be called at every recognized event. The alternative would be to register handlers for each event. Or maybe The handler interface should ahve a method to return whether it cares about certain events.

Specified by:
addElementEventHandler in interface IElementAttributes
Parameters:
eventHandler - The ElementEventHandler to be added to the list.

getElementEventHandlers

public java.util.ArrayList getElementEventHandlers()
Gets the elementEventHandlers. Returns null if none exist. Makes checking easy.

Specified by:
getElementEventHandlers in interface IElementAttributes
Returns:
The elementEventHandlers value

toString

public java.lang.String toString()
For logging and debugging the element IElementAttributes.

Returns: