Package org.glassfish.ha.store.util
Class SimpleMetadata
- java.lang.Object
-
- org.glassfish.ha.store.util.SimpleMetadata
-
- All Implemented Interfaces:
Serializable,Storeable
public class SimpleMetadata extends Object implements Storeable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleMetadata()SimpleMetadata(long version, long lastAccesstime, long maxInactiveInterval, byte[] state)Construct a SimpleMetadata object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]_storeable_getAttributeNames()Providers can cache thisboolean[]_storeable_getDirtyStatus()Providers can cache thislong_storeable_getLastAccessTime()long_storeable_getMaxIdleTime()long_storeable_getVersion()Get the version of this entry.void_storeable_readState(InputStream is)void_storeable_setLastAccessTime(long val)void_storeable_setMaxIdleTime(long val)void_storeable_setVersion(long val)void_storeable_writeState(OutputStream os)longgetLastAccessTime()Get the last access time of the state.longgetMaxInactiveInterval()Get the maximum time that this state can be idle in the store before it can be removed.byte[]getState()longgetVersion()Get the verion of the state.voidsetLastAccessTime(long lastAccessTime)voidsetMaxInactiveInterval(long maxInactiveInterval)voidsetState(byte[] state)voidsetVersion(long version)StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
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)
-
_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
public String[] _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
public void _storeable_writeState(OutputStream os) throws IOException
- Specified by:
_storeable_writeStatein interfaceStoreable- Throws:
IOException
-
_storeable_readState
public void _storeable_readState(InputStream is) throws IOException
- Specified by:
_storeable_readStatein interfaceStoreable- Throws:
IOException
-
-