Class WriteModifiers

All Implemented Interfaces:
SmartExternalizable, Externalizable, Serializable

public class WriteModifiers extends SpaceProxyOperationModifiers
Provides modifiers to customize the behavior of write operations.
Since:
9.0.1
Author:
Niv Ingberg
See Also:
  • Field Details

    • NONE

      public static final WriteModifiers NONE
      Empty - use operation default behavior.
    • WRITE_ONLY

      public static final WriteModifiers WRITE_ONLY
      If the entry already exists in the space throw an EntryAlreadyInSpaceException. Notice: cannot be used in together with UPDATE_OR_WRITE, UPDATE_ONLY, PARTIAL_UPDATE.
    • UPDATE_ONLY

      public static final WriteModifiers UPDATE_ONLY
      If the entry does not exists in the space throw an EntryNotInSpaceException. Notice: cannot be used in together with UPDATE_OR_WRITE, WRITE_ONLY.
    • UPDATE_OR_WRITE

      public static final WriteModifiers 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 with WRITE_ONLY, UPDATE_ONLY.
    • PARTIAL_UPDATE

      public static final WriteModifiers PARTIAL_UPDATE
      Update only non-null properties, ignore null properties. Notice: cannot be used in together with WRITE_ONLY.
    • RETURN_PREV_ON_UPDATE

      public static final WriteModifiers RETURN_PREV_ON_UPDATE
      If the entry already exists in the space, return the old entry in the result.
    • ONE_WAY

      public static final WriteModifiers 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.
  • Constructor Details

    • WriteModifiers

      public WriteModifiers()
    • WriteModifiers

      public WriteModifiers(WriteModifiers modifiers1, WriteModifiers modifiers2)
      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

      public WriteModifiers(WriteModifiers... modifiers)
      Creates a new modifiers from the specified modifiers.
  • Method Details

    • contains

      public boolean contains(WriteModifiers modifiers)
      Checks if the specified modifier is set.
      Returns:
      true if the specified modifier is set, false otherwise.
    • add

      public WriteModifiers add(WriteModifiers modifiers)
      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

      public WriteModifiers remove(WriteModifiers modifiers)
      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 the WRITE_ONLY setting.
      Returns:
      true if this instance contains the WRITE_ONLY setting, false otherwise.
    • isUpdateOnly

      public boolean isUpdateOnly()
      Checks if this instance contains the UPDATE_ONLY setting.
      Returns:
      true if this instance contains the UPDATE_ONLY setting, false otherwise.
    • isUpdateOrWrite

      public boolean isUpdateOrWrite()
      Checks if this instance contains the UPDATE_OR_WRITE setting.
      Returns:
      true if this instance contains the UPDATE_OR_WRITE setting, false otherwise.
    • isPartialUpdate

      public boolean isPartialUpdate()
      Checks if this instance contains the PARTIAL_UPDATE setting.
      Returns:
      true if this instance contains the PARTIAL_UPDATE setting, false otherwise.
    • isReturnPrevOnUpdate

      public boolean isReturnPrevOnUpdate()
      Checks if this instance contains the RETURN_PREV_ON_UPDATE setting.
      Returns:
      true if this instance contains the RETURN_PREV_ON_UPDATE setting, false otherwise.
    • create

      protected WriteModifiers create(int modifiers)
      Specified by:
      create in class SpaceProxyOperationModifiers
    • getCache

      protected Map<Integer,SpaceProxyOperationModifiers> getCache()
      Specified by:
      getCache in class SpaceProxyOperationModifiers