Package com.j_spaces.core.client
Class UpdateModifiers
java.lang.Object
com.j_spaces.core.client.UpdateModifiers
The Modifier class provides
static methods and constants to decode update types
modifiers. The sets of modifiers are represented as integers with distinct bit positions
representing different modifiers.- Version:
- 4.0
- Author:
- Yechiel Fefer, Igor Goldenberg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLook only in memory for existence of entry with the same ID -do not use the underlying EDS.static final intIf set, the write or update operations will returnnullinstead of the lease object (write) or previous value (update).static final intTheintvalue representing thePARTIAL_UPDATEmodifier.static final intDetermines if an update operation should return the previous entry in the lease.static final intTheintvalue representing theUPDATE_OR_ONLYmodifier.static final intTheintvalue representing theUPDATE_OR_WRITEmodifier.static final intTheintvalue representing theWRITE_ONLYmodifier. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisMemoryOnlySearch(int mod) Return true if the integer argument includes the MEMORY_ONLY_SEARCH modifier, false otherwise.static booleanisNoReturnValue(int mod) Return true if the integer argument includes the NO_RETURN_VALUE modifier, false otherwise.static booleanisPartialUpdate(int mod) Return true if the integer argument includes the PARTIAL_UPDATE modifier, false otherwise.static booleanisPotentialUpdate(int mod) static booleanisReturnPrevOnUpdate(int mod) Return true if the integer argument includes the RETURN_PREV_ON_UPDATE modifier, false otherwise.static booleanisUpdate(int mod) Return true if the integer argument includes the UPDATE_ONLY modifier or PARTIAL_UPDATE modifier or UPDATE_OR_WRITE modifier, false otherwise.static booleanisUpdateOnly(int mod) Return true if the integer argument includes the UPDATE_ONLY modifier, false otherwise.static booleanisUpdateOrWrite(int mod) Return true if the integer argument includes the UPDATE_OR_WRITE modifier, false otherwise.static booleanisWriteOnly(int mod) Return true if the integer argument includes the WRITE_ONLY modifier, false otherwise.
-
Field Details
-
WRITE_ONLY
public static final int WRITE_ONLYTheintvalue representing theWRITE_ONLYmodifier. When set: the entry to be written must not reside in the space, no new entry will be written otherwise and anEntryAlreadyInSpaceExceptionwill be thrown. Notice: can't be used in together withUPDATE_OR_WRITEorUPDATE_ONLY.- See Also:
-
UPDATE_ONLY
public static final int UPDATE_ONLYTheintvalue representing theUPDATE_OR_ONLYmodifier. When set alone: the entry to be updated must be reside in the space, no new entry will be written otherwise and anEntryNotInSpaceExceptionwill be thrown.- See Also:
-
UPDATE_OR_WRITE
public static final int UPDATE_OR_WRITETheintvalue representing theUPDATE_OR_WRITEmodifier. When set: if the entry to be updated does not reside in the space, a new entry is writtenNotice: can't be used in together with
PARTIAL_UPDATE- See Also:
-
PARTIAL_UPDATE
public static final int PARTIAL_UPDATETheintvalue representing thePARTIAL_UPDATEmodifier. If set, null values in the updated entry are treated as "leave as it is"Notice: can't be used in together with
UPDATE_OR_WRITEorWRITE_ONLY.- See Also:
-
NO_RETURN_VALUE
public static final int NO_RETURN_VALUEIf set, the write or update operations will returnnullinstead of the lease object (write) or previous value (update). Using this option will improve application write operation performance - null return value yields less network traffic and less memory consumption. Note: This modifier does not replace ONE_WAY modifier- See Also:
-
RETURN_PREV_ON_UPDATE
public static final int RETURN_PREV_ON_UPDATEDetermines if an update operation should return the previous entry in the lease.- Since:
- 9.0.1
- See Also:
-
MEMORY_ONLY_SEARCH
public static final int MEMORY_ONLY_SEARCHLook only in memory for existence of entry with the same ID -do not use the underlying EDS. We assume that if an entry with the same ID does not reside in cache- it does exist in the underlying EDS either. It is the responsibility of the caller using this modifier to make sure the entry does not reside in the EDS - failing to do so may cause inconsistent behaviour of the system- Since:
- 9.1.1
- See Also:
-
-
Constructor Details
-
UpdateModifiers
public UpdateModifiers()
-
-
Method Details
-
isUpdateOrWrite
public static boolean isUpdateOrWrite(int mod) Return true if the integer argument includes the UPDATE_OR_WRITE modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the public modifier; false otherwise.
-
isPartialUpdate
public static boolean isPartialUpdate(int mod) Return true if the integer argument includes the PARTIAL_UPDATE modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the PARTIAL_UPDATE modifier; false otherwise.
-
isUpdateOnly
public static boolean isUpdateOnly(int mod) Return true if the integer argument includes the UPDATE_ONLY modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the UPDATE_ONLY modifier; false otherwise.
-
isUpdate
public static boolean isUpdate(int mod) Return true if the integer argument includes the UPDATE_ONLY modifier or PARTIAL_UPDATE modifier or UPDATE_OR_WRITE modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the UPDATE_ONLY modifier or PARTIAL_UPDATE modifier or UPDATE_OR_WRITE modifier; false otherwise.
-
isWriteOnly
public static boolean isWriteOnly(int mod) Return true if the integer argument includes the WRITE_ONLY modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the WRITE_ONLY modifier; false otherwise.
-
isNoReturnValue
public static boolean isNoReturnValue(int mod) Return true if the integer argument includes the NO_RETURN_VALUE modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the NO_RETURN_VALUE modifier; false otherwise.
-
isReturnPrevOnUpdate
public static boolean isReturnPrevOnUpdate(int mod) Return true if the integer argument includes the RETURN_PREV_ON_UPDATE modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the RETURN_PREV_ON_UPDATE modifier; false otherwise.
-
isMemoryOnlySearch
public static boolean isMemoryOnlySearch(int mod) Return true if the integer argument includes the MEMORY_ONLY_SEARCH modifier, false otherwise.- Parameters:
mod- a set of modifiers- Returns:
- true if
modincludes the MEMORY_ONLY_SEARCH modifier; false otherwise.
-
isPotentialUpdate
public static boolean isPotentialUpdate(int mod)
-