public class ClusteredHashTableEntry
extends java.lang.Object
implements java.io.Serializable
ClusteredHashTable
class.
Note: This class uses APIs that are available only when connecting to systems running OS/400 V5R2M0 or later.
Modifier and Type | Field and Description |
---|---|
static int |
DUPLICATE_KEY_FAIL
Update option to indicate if the specified key already exists then do not allow the ClusteredHashTable.put() request to succeed.
|
static int |
DUPLICATE_KEY_UPDATE
Update option to indicate if the specified key already exists then allow the entry to be updated on the ClusteredHashTable.put() request.
|
static int |
ENTRY_AUTHORITY_ANY_USER
Entry authority option that identifies any user can access the entry in the clustered hash table.
|
static int |
ENTRY_AUTHORITY_LAST_USER
Entry authority option that identifies a user with *ALLOBJ authority, the user that owns the entry or both can access it.
|
static int |
ENTRY_STATUS_CONSISTENT
Data is consistent across the clustered hash table domain.
|
static int |
ENTRY_STATUS_INCONSISTENT
Data is not consistent across the clustered hash table domain.
|
static int |
MAX_USER_DATA_LENGTH
Maximum amount of user data that can be stored in a clustered hash table entry.
|
Constructor and Description |
---|
ClusteredHashTableEntry()
Constructs a default ClusteredHashTableEntry object.
|
ClusteredHashTableEntry(byte[] key,
byte[] userData,
int timeToLive,
int entryAuthority,
int updateOption)
Constructs a ClusteredHashTableEntry object that represents an entry in the clustered hash table.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property is changed.
|
int |
getEntryAuthority()
Returns the entry authority.
|
int |
getEntryStatus()
Returns the entry status.
|
byte[] |
getKey()
Returns the key.
|
java.lang.String |
getModifiedProfile()
Returns the user profile that last modified the entry.
|
java.lang.String |
getOwnerProfile()
Returns the user profile that created the entry.
|
int |
getTimeToLive()
Returns the time to live (in seconds) that was passed to the constructor.
|
int |
getUpdateOption()
Returns the update option that was passed to the constructor.
|
byte[] |
getUserData()
Returns the user data.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the listener from being notified when a bound property changes.
|
void |
setEntryAuthority(int entryAuthority)
Sets the entry authority.
|
protected void |
setEntryStatus(int entryStatus)
Sets the entry status for the entry.
|
void |
setKey(byte[] key)
Sets the key.
|
protected void |
setModifiedProfile(java.lang.String usr)
Sets the user profile that modified the entry.
|
protected void |
setOwnerProfile(java.lang.String usr)
Sets the user profile that created the entry.
|
void |
setTimeToLive(int timeToLive)
Sets the time to live (in seconds) an entry remains in the clustered hash table.
|
void |
setUpdateOption(int updateOption)
Sets the update option.
|
void |
setUserData(byte[] userData)
Sets the user data to be stored in the clustered hash table.
|
public static final int ENTRY_AUTHORITY_ANY_USER
public static final int ENTRY_AUTHORITY_LAST_USER
public static final int DUPLICATE_KEY_UPDATE
public static final int DUPLICATE_KEY_FAIL
public static final int ENTRY_STATUS_CONSISTENT
public static final int ENTRY_STATUS_INCONSISTENT
public static final int MAX_USER_DATA_LENGTH
public ClusteredHashTableEntry()
ClusteredHashTable.put()
method.public ClusteredHashTableEntry(byte[] key, byte[] userData, int timeToLive, int entryAuthority, int updateOption)
key
- The key that identifies the entry.
The ClusteredHashTable.generateKey()
method can be used to provide a unique key.userData
- The user data to be stored in the clustered hash table.
The length of this data must be 1 through MAX_USER_DATA_LENGTH (61000 bytes).timeToLive
- The time (in seconds) that the entry will be allowed to remain in the clustered hash table. If the value is -1, the entry will never expire.
The value must be -1, greater than or equal to 60 seconds, and less than the seconds in 1 year (31,536,000). This value will be truncated to the nearest minute.entryAuthority
- This field identifies who is allowed to access, for example update
and retrieve, the entry associated with the key. This value must be
ENTRY_AUTHORITY_LAST_USER if the current cluster version is 2.
Valid values are:
updateOption
- This is the action used on a ClusteredHashTable.put() request when the key
specified on the constructor or set using setKey() already exists in the
clustered hash table. This value must be DUPLICATE_KEY_FAIL if the current
cluster version is 2.
It is only valid for the duration of the ClusteredHashTable.put() request. Valid values are:
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.removePropertyChangeListener(java.beans.PropertyChangeListener)
public int getEntryStatus()
public int getEntryAuthority()
public byte[] getKey()
public int getTimeToLive()
public int getUpdateOption()
public byte[] getUserData()
public java.lang.String getOwnerProfile()
protected void setOwnerProfile(java.lang.String usr)
usr
- The user that created the entry.public java.lang.String getModifiedProfile()
protected void setModifiedProfile(java.lang.String usr)
usr
- The user that modified the entry.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setEntryAuthority(int entryAuthority)
entryAuthority
- The value of the entry authority. The default for this parameter is ENTRY_AUTHORITY_LAST_USER.public void setKey(byte[] key)
key
- The key.protected void setEntryStatus(int entryStatus)
entryStatus
- the status of the entry.public void setTimeToLive(int timeToLive)
timeToLive
- The value of the time to live. The default for the timeToLive is 60 seconds.public void setUpdateOption(int updateOption)
updateOption
- The value of the update option.public void setUserData(byte[] userData)
userData
- The user data.