Package org.glassfish.ha.store.util
Class SimpleMetadata
java.lang.Object
org.glassfish.ha.store.util.SimpleMetadata
- All Implemented Interfaces:
Serializable,Storeable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleMetadata(long version, long lastAccesstime, long maxInactiveInterval, byte[] state) Construct a SimpleMetadata object -
Method Summary
Modifier and TypeMethodDescriptionString[]Providers can cache thisboolean[]Providers can cache thislonglonglongGet the version of this entry.voidvoid_storeable_setLastAccessTime(long val) void_storeable_setMaxIdleTime(long val) void_storeable_setVersion(long val) voidlongGet the last access time of the state.longGet the maximum time that this state can be idle in the store before it can be removed.byte[]getState()longGet the verion of the state.voidsetLastAccessTime(long lastAccessTime) voidsetMaxInactiveInterval(long maxInactiveInterval) voidsetState(byte[] state) voidsetVersion(long version) toString()
-
Constructor Details
-
SimpleMetadata
public SimpleMetadata() -
SimpleMetadata
public SimpleMetadata(long version, long lastAccesstime, long maxInactiveInterval, byte[] state) Construct a SimpleMetadata object- Parameters:
version- The version of the data. A freshly created state has a version == 0lastAccesstime- the last access time of the state. This must be used in conjunction with getMaxInactiveInterval to determine if the state is idle enough to be removed.maxInactiveInterval- the maximum time that this state can be idle in the store before it can be removed.
-
-
Method Details
-
getVersion
public long getVersion()Get the verion of the state. A freshly created state has a version == 0- Returns:
- the version.
-
setVersion
public void setVersion(long version) -
getLastAccessTime
public long getLastAccessTime()Get the last access time of the state. This must be used in conjunction with getMaxInactiveInterval to determine if the state is idle enough to be removed.- Returns:
- The time when the state was accessed last
-
setLastAccessTime
public void setLastAccessTime(long lastAccessTime) -
getMaxInactiveInterval
public long getMaxInactiveInterval()Get the maximum time that this state can be idle in the store before it can be removed.- Returns:
- the maximum idle time. If zero or negative, then the component has no idle timeout limit
-
setMaxInactiveInterval
public void setMaxInactiveInterval(long maxInactiveInterval) -
getState
public byte[] getState() -
setState
public void setState(byte[] state) -
toString
-
_storeable_getVersion
public long _storeable_getVersion()Description copied from interface:StoreableGet the version of this entry. -1 means that this entry has no version- Specified by:
_storeable_getVersionin interfaceStoreable- Returns:
- The version or null if this entry has no version
-
_storeable_setVersion
public void _storeable_setVersion(long val) - Specified by:
_storeable_setVersionin interfaceStoreable
-
_storeable_getLastAccessTime
public long _storeable_getLastAccessTime()- Specified by:
_storeable_getLastAccessTimein interfaceStoreable
-
_storeable_setLastAccessTime
public void _storeable_setLastAccessTime(long val) - Specified by:
_storeable_setLastAccessTimein interfaceStoreable
-
_storeable_getMaxIdleTime
public long _storeable_getMaxIdleTime()- Specified by:
_storeable_getMaxIdleTimein interfaceStoreable
-
_storeable_setMaxIdleTime
public void _storeable_setMaxIdleTime(long val) - Specified by:
_storeable_setMaxIdleTimein interfaceStoreable
-
_storeable_getAttributeNames
Description copied from interface:StoreableProviders can cache this- Specified by:
_storeable_getAttributeNamesin interfaceStoreable- Returns:
- an array of attribute names
-
_storeable_getDirtyStatus
public boolean[] _storeable_getDirtyStatus()Description copied from interface:StoreableProviders can cache this- Specified by:
_storeable_getDirtyStatusin interfaceStoreable- Returns:
- A boolean array each representing the dirty status of the attribute whose name can be found at the same index in the array returned by _getAttributeNames()
-
_storeable_writeState
- Specified by:
_storeable_writeStatein interfaceStoreable- Throws:
IOException
-
_storeable_readState
- Specified by:
_storeable_readStatein interfaceStoreable- Throws:
IOException
-