Class ChangeSet

java.lang.Object
com.gigaspaces.client.ChangeSet
All Implemented Interfaces:
Textualizable, SmartExternalizable, Externalizable, Serializable

public class ChangeSet extends Object implements SmartExternalizable, Textualizable
The set of changes to apply for matches entries of the change operation
Since:
9.1
Author:
Niv Ingberg
See Also:
  • 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

      public ChangeSet custom(SpaceEntryMutator changeOperation)
      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

      public ChangeSet custom(String name, ChangeFunction<MutableServerEntry,Object> operation)
    • set

      public ChangeSet set(String path, Serializable value)
      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

      public ChangeSet unset(String path)
      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

      public ChangeSet increment(String path, byte delta)
      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

      public ChangeSet increment(String path, short delta)
      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

      public ChangeSet increment(String path, int delta)
      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

      public ChangeSet increment(String path, long delta)
      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

      public ChangeSet increment(String path, float delta)
      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

      public ChangeSet increment(String path, double delta)
      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

      public ChangeSet increment(String path, Number delta)
      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

      public ChangeSet decrement(String path, byte delta)
      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

      public ChangeSet decrement(String path, short delta)
      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

      public ChangeSet decrement(String path, int delta)
      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

      public ChangeSet decrement(String path, long delta)
      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

      public ChangeSet decrement(String path, float delta)
      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

      public ChangeSet decrement(String path, double delta)
      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

      public ChangeSet addToCollection(String path, Serializable newItem)
      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

      public ChangeSet addAllToCollection(String path, Serializable... newItems)
      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

      public ChangeSet addAllToCollection(String path, Collection<? extends Serializable> newItems)
      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

      public ChangeSet removeFromCollection(String path, Serializable itemToRemove)
      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

      public ChangeSet putInMap(String path, Serializable key, Serializable value)
      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 into
      key - The map's key.
      value - The value to associate with the given key.
    • removeFromMap

      public ChangeSet removeFromMap(String path, Serializable key)
      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

      public ChangeSet lease(long 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

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toText

      public void toText(Textualizer textualizer)
      Specified by:
      toText in interface Textualizable
    • disablePathCaching

      public ChangeSet disablePathCaching(String... nonCachedPaths)
      Since 14.2.0