Package com.gigaspaces.client
Class WriteModifiers
java.lang.Object
com.gigaspaces.client.SpaceProxyOperationModifiers
com.gigaspaces.client.WriteModifiers
- All Implemented Interfaces:
SmartExternalizable,Externalizable,Serializable
Provides modifiers to customize the behavior of write operations.
- Since:
- 9.0.1
- Author:
- Niv Ingberg
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WriteModifiersLook only in memory for existence of entry with the same ID - do not use the underlying external data source.static final WriteModifiersEmpty - use operation default behavior.static final WriteModifiersOperation is executed in one way mode, meaning no return value will be provided.static final WriteModifiersUpdate only non-null properties, ignore null properties.static final WriteModifiersIf the entry already exists in the space, return the old entry in the result.static final WriteModifiersIf the entry does not exists in the space throw an EntryNotInSpaceException.static final WriteModifiersIf the entry does not exists in the space it is written, otherwise it is updated.static final WriteModifiersIf the entry already exists in the space throw an EntryAlreadyInSpaceException. -
Constructor Summary
ConstructorsConstructorDescriptionWriteModifiers(WriteModifiers... modifiers) Creates a new modifiers from the specified modifiers.WriteModifiers(WriteModifiers modifiers1, WriteModifiers modifiers2) Creates a new modifiers from the specified modifiers.WriteModifiers(WriteModifiers modifiers1, WriteModifiers modifiers2, WriteModifiers modifiers3) Creates a new modifiers from the specified modifiers. -
Method Summary
Modifier and TypeMethodDescriptionadd(WriteModifiers modifiers) Creates a new modifiers instance which is a union of the specified modifiers and this instance.booleancontains(WriteModifiers modifiers) Checks if the specified modifier is set.protected WriteModifierscreate(int modifiers) protected Map<Integer,SpaceProxyOperationModifiers> getCache()booleanChecks if this instance contains thePARTIAL_UPDATEsetting.booleanChecks if this instance contains theRETURN_PREV_ON_UPDATEsetting.booleanChecks if this instance contains theUPDATE_ONLYsetting.booleanChecks if this instance contains theUPDATE_OR_WRITEsetting.booleanChecks if this instance contains theWRITE_ONLYsetting.remove(WriteModifiers modifiers) Creates a new modifiers instance which excludes the specified modifiers from this instance.Methods inherited from class com.gigaspaces.client.SpaceProxyOperationModifiers
add, contains, createIfNeeded, equals, getCode, hashCode, readExternal, remove, writeExternalMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Field Details
-
NONE
Empty - use operation default behavior. -
WRITE_ONLY
If the entry already exists in the space throw an EntryAlreadyInSpaceException. Notice: cannot be used in together withUPDATE_OR_WRITE,UPDATE_ONLY,PARTIAL_UPDATE. -
UPDATE_ONLY
If the entry does not exists in the space throw an EntryNotInSpaceException. Notice: cannot be used in together withUPDATE_OR_WRITE,WRITE_ONLY. -
UPDATE_OR_WRITE
If the entry does not exists in the space it is written, otherwise it is updated. Notice: cannot be used in together withWRITE_ONLY,UPDATE_ONLY. -
PARTIAL_UPDATE
Update only non-null properties, ignore null properties. Notice: cannot be used in together withWRITE_ONLY. -
RETURN_PREV_ON_UPDATE
If the entry already exists in the space, return the old entry in the result. -
ONE_WAY
Operation is executed in one way mode, meaning no return value will be provided. Using this mode provides no guarantee whether the operation succeeded or not, the only guarantee is that the operation was successfully written to the local network buffer. As a result, using this modifier will cause the operation not to guarantee automatic fail-over if the primary space instance failed, and it cannot be done under a transaction. When used with an auto generated id space entry, the local entry instance will not be updated with the generated id as this is done on the server. The same applies for version property. -
MEMORY_ONLY_SEARCH
Look only in memory for existence of entry with the same ID - do not use the underlying external data source. We assume that if an entry with the same ID does not reside in cache - it does not exist in the underlying external data source either. When using this modifier special care should be taken into consideration, it is the responsibility of the caller when using this modifier to make sure the entry does not reside in the external data source, failing to do so may cause inconsistent and fatal behavior of the system at a later point when this entry is trying to be persisted into the external data source but it already exists there.- Since:
- 9.1.1
-
-
Constructor Details
-
WriteModifiers
public WriteModifiers() -
WriteModifiers
Creates a new modifiers from the specified modifiers. -
WriteModifiers
public WriteModifiers(WriteModifiers modifiers1, WriteModifiers modifiers2, WriteModifiers modifiers3) Creates a new modifiers from the specified modifiers. -
WriteModifiers
Creates a new modifiers from the specified modifiers.
-
-
Method Details
-
contains
Checks if the specified modifier is set.- Returns:
- true if the specified modifier is set, false otherwise.
-
add
Creates a new modifiers instance which is a union of the specified modifiers and this instance.- Parameters:
modifiers- Modifiers to add.- Returns:
- A union of the current modifiers and the specified modifiers.
-
remove
Creates a new modifiers instance which excludes the specified modifiers from this instance.- Parameters:
modifiers- Modifiers to remove.- Returns:
- The modifiers from this instance without the modifiers from the specified instance.
-
isWriteOnly
public boolean isWriteOnly()Checks if this instance contains theWRITE_ONLYsetting.- Returns:
- true if this instance contains the
WRITE_ONLYsetting, false otherwise.
-
isUpdateOnly
public boolean isUpdateOnly()Checks if this instance contains theUPDATE_ONLYsetting.- Returns:
- true if this instance contains the
UPDATE_ONLYsetting, false otherwise.
-
isUpdateOrWrite
public boolean isUpdateOrWrite()Checks if this instance contains theUPDATE_OR_WRITEsetting.- Returns:
- true if this instance contains the
UPDATE_OR_WRITEsetting, false otherwise.
-
isPartialUpdate
public boolean isPartialUpdate()Checks if this instance contains thePARTIAL_UPDATEsetting.- Returns:
- true if this instance contains the
PARTIAL_UPDATEsetting, false otherwise.
-
isReturnPrevOnUpdate
public boolean isReturnPrevOnUpdate()Checks if this instance contains theRETURN_PREV_ON_UPDATEsetting.- Returns:
- true if this instance contains the
RETURN_PREV_ON_UPDATEsetting, false otherwise.
-
create
- Specified by:
createin classSpaceProxyOperationModifiers
-
getCache
- Specified by:
getCachein classSpaceProxyOperationModifiers
-