com.gentics.api.lib.cache
Interface PortalCacheAttributes


public interface PortalCacheAttributes

The PortalCacheAttributes interface defines attributes which can be stored to cached elements.


Method Summary
 long getCreateDate()
          get the creation date as timestamp in milliseconds from the entry.
 boolean getIsEternal()
          true if this cache object should not be expired - maxLive will be ignored
 long getLastAccessDate()
          get the last access date of the cache element as timestamp in milliseconds.
 int getMaxAge()
          get the maximum age that the cache entry may exist in seconds.
 int getMaxIdleTime()
          get the maximum idle time of the cache entry in seconds.
 int getSize()
          get the approximate size of the entry in bytes.
 void setIsEternal(boolean isEternal)
          Sets this cache object eternal - it will live not expire.
 void setLastAccessDateToNow()
          update the current access time to the current timestamp.
 void setMaxAge(int maxAge)
          set the maximum age of a cache entry - has to be > 0
 void setMaxIdleTime(int maxIdleTime)
          set the maximum idle time of the cache entry in seconds.
 void setSize(int size)
          set the cache entry size in bytes.
 

Method Detail

getIsEternal

boolean getIsEternal()
true if this cache object should not be expired - maxLive will be ignored

Returns:
true if object should not expire

setIsEternal

void setIsEternal(boolean isEternal)
Sets this cache object eternal - it will live not expire.


getCreateDate

long getCreateDate()
get the creation date as timestamp in milliseconds from the entry. The value is required for maxAge to work.

Returns:
the creation date of an entry in milliseconds.

getLastAccessDate

long getLastAccessDate()
get the last access date of the cache element as timestamp in milliseconds. The value is required for maxIdleTime to work.

Returns:
the last access date of an entry.

setLastAccessDateToNow

void setLastAccessDateToNow()
update the current access time to the current timestamp.


getMaxAge

int getMaxAge()
get the maximum age that the cache entry may exist in seconds.

Returns:
the max age of an object in seconds.
See Also:
getIsEternal()

setMaxAge

void setMaxAge(int maxAge)
set the maximum age of a cache entry - has to be > 0

Parameters:
maxAge - the max age of the entry in seconds.
See Also:
setIsEternal(boolean)

getMaxIdleTime

int getMaxIdleTime()
get the maximum idle time of the cache entry in seconds. If the last accesstime or the value is 0, the idle time is ignored.

Returns:
the max idle time of the cache entry in seconds.

setMaxIdleTime

void setMaxIdleTime(int maxIdleTime)
set the maximum idle time of the cache entry in seconds.

Parameters:
maxIdleTime - the max idle time of the entry in seconds.

getSize

int getSize()
get the approximate size of the entry in bytes. The value may be used by the cache to calculate the current cache size.

Returns:
the size of the entry in bytes.

setSize

void setSize(int size)
set the cache entry size in bytes.

Parameters:
size - the approximate size of the entry in bytes.


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.