Package com.gigaspaces.client
Class ChangeSet
java.lang.Object
com.gigaspaces.client.ChangeSet
- All Implemented Interfaces:
Textualizable,SmartExternalizable,Externalizable,Serializable
The set of changes to apply for matches entries of the change operation
- Since:
- 9.1
- Author:
- Niv Ingberg
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllToCollection(String path, Serializable... newItems) Adds the given items to a collection propertyaddAllToCollection(String path, Collection<? extends Serializable> newItems) Adds the given items to a collection propertyaddToCollection(String path, Serializable newItem) Adds the given item to a collection property.custom(SpaceEntryMutator changeOperation) Adds a custom change operation to be executed.custom(String name, ChangeFunction<MutableServerEntry, Object> operation) Decrement a byte property with the given delta.Decrement a double property with the given delta.Decrement a float property with the given delta.Decrement a integer property with the given delta.Decrement a long property with the given delta.Decrement a short property with the given delta.disablePathCaching(String... nonCachedPaths) Since 14.2.0Increment a byte property with the given delta.Increment a double property with the given delta.Increment a float property with the given delta.Increment a integer property with the given delta.Increment a long property with the given delta.Increment a short property with the given delta.Increment a numeric property with the given delta.booleanisEmpty()Returns true if the change set is empty, i.e.lease(long lease) Change the entry lease with the new lease.putInMap(String path, Serializable key, Serializable value) Puts the given key and value in a map property.voidremoveFromCollection(String path, Serializable itemToRemove) Removes the given item from a collection property.removeFromMap(String path, Serializable key) Removes the given key from a map property.set(String path, Serializable value) Sets the value of the given path.toString()voidtoText(Textualizer textualizer) Unsets the specified path.voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.gigaspaces.serialization.SmartExternalizable
enabledSmartExternalizableWithReference
-
Constructor Details
-
ChangeSet
public ChangeSet()Constructs an empty change set
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns true if the change set is empty, i.e. does not contain any change operations- Since:
- 14.0
-
custom
Adds a custom change operation to be executed. Note that when using a replicated topology (e.g. backup space, gateway, mirror) the change operation itself is replicated (and *NOT* the modified entry). Hence, it is imperative that this method will always cause the exact same affect on the entry assuming the same entry was provided, for example it should not rely on variables that may change between executions, such as system time, random, machine name etc. If the operation is not structured that way, the state can be inconsistent in the different locations after being replicated ("With great power comes great responsibility"). In a secured space, unlike built-in change operations, the security privilege required for custom change operation is EXECUTE instead of WRITE. -
custom
-
set
Sets the value of the given path.- Parameters:
path- The path that needs its value set.value- The value to set for the given path.
-
unset
Unsets the specified path. If the path points to a dynamic property or a map key it will be removed, if it points to a fixed property it will be set to null, in that case, the target path must point to a nullable property otherwise an error will occur.- Parameters:
path- Path pointing to the requested property.
-
increment
Increment a byte property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a short property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a integer property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a long property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a float property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a double property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
increment
Increment a numeric property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value increased.delta- The delta to increment by.
-
decrement
Decrement a byte property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
decrement
Decrement a short property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
decrement
Decrement a integer property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
decrement
Decrement a long property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
decrement
Decrement a float property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
decrement
Decrement a double property with the given delta.- Parameters:
path- The path pointing to a numeric property that needs its value decreased.delta- The delta to decrement by.
-
addToCollection
Adds the given item to a collection property.- Parameters:
path- The path pointing to the collection that the item should be added to.newItem- The item to add to the collection.
-
addAllToCollection
Adds the given items to a collection property- Parameters:
path- The path pointing to the collection that the item should be added to.newItems- The items to add to the collection.
-
addAllToCollection
Adds the given items to a collection property- Parameters:
path- The path pointing to the collection that the item should be added to.newItems- The items to add to the collection.
-
removeFromCollection
Removes the given item from a collection property.- Parameters:
path- The path pointing to the collection that the item should be removed from.itemToRemove- The item to remove from the collection.
-
putInMap
Puts the given key and value in a map property.- Parameters:
path- The path pointing to the map that the key and value should be put intokey- The map's key.value- The value to associate with the given key.
-
removeFromMap
Removes the given key from a map property.- Parameters:
path- The path pointing to the map that the key should be removed from.key- The map's key.
-
lease
Change the entry lease with the new lease.- Parameters:
lease- Change the lease duration with the new lease, the lease specifies how much time the lease of a changed entry should be after the change operation takes affect in milliseconds.
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toString
-
toText
- Specified by:
toTextin interfaceTextualizable
-
disablePathCaching
Since 14.2.0
-