GigaSpaces XAP 9.7.2 API

com.gigaspaces.client
Class WriteModifiers

java.lang.Object
  extended by com.gigaspaces.client.SpaceProxyOperationModifiers
      extended by com.gigaspaces.client.WriteModifiers
All Implemented Interfaces:
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:
Serialized Form

Field Summary
static WriteModifiers MEMORY_ONLY_SEARCH
          Look only in memory for existence of entry with the same ID - do not use the underlying external data source.
static WriteModifiers NONE
          Empty - use operation default behavior.
static WriteModifiers ONE_WAY
          Operation is executed in one way mode, meaning no return value will be provided.
static WriteModifiers PARTIAL_UPDATE
          Update only non-null properties, ignore null properties.
static WriteModifiers RETURN_PREV_ON_UPDATE
          If the entry already exists in the space, return the old entry in the result.
static WriteModifiers UPDATE_ONLY
          If the entry does not exists in the space throw an EntryNotInSpaceException.
static WriteModifiers UPDATE_OR_WRITE
          If the entry does not exists in the space it is written, otherwise it is updated.
static WriteModifiers WRITE_ONLY
          If the entry already exists in the space throw an EntryAlreadyInSpaceException.
 
Constructor Summary
WriteModifiers()
           
WriteModifiers(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
 WriteModifiers add(WriteModifiers modifiers)
          Creates a new modifiers instance which is a union of the specified modifiers and this instance.
 boolean contains(WriteModifiers modifiers)
          Checks if the specified modifier is set.
protected  WriteModifiers create(int modifiers)
           
protected  Map<Integer,SpaceProxyOperationModifiers> getCache()
           
 boolean isPartialUpdate()
          Checks if this instance contains the PARTIAL_UPDATE setting.
 boolean isReturnPrevOnUpdate()
          Checks if this instance contains the RETURN_PREV_ON_UPDATE setting.
 boolean isUpdateOnly()
          Checks if this instance contains the UPDATE_ONLY setting.
 boolean isUpdateOrWrite()
          Checks if this instance contains the UPDATE_OR_WRITE setting.
 boolean isWriteOnly()
          Checks if this instance contains the WRITE_ONLY setting.
 WriteModifiers 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, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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.

See Also:
SpaceId}

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.

See Also:
SpaceId}

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.

See Also:
SpaceId}

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.

See Also:
SpaceId}

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.


MEMORY_ONLY_SEARCH

public static final WriteModifiers 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 Detail

WriteModifiers

public WriteModifiers()

WriteModifiers

public WriteModifiers(WriteModifiers modifiers1,
                      WriteModifiers modifiers2)
Creates a new modifiers from the specified modifiers.

Parameters:
modifiers1 -
modifiers2 -

WriteModifiers

public WriteModifiers(WriteModifiers modifiers1,
                      WriteModifiers modifiers2,
                      WriteModifiers modifiers3)
Creates a new modifiers from the specified modifiers.

Parameters:
modifiers1 -
modifiers2 -
modifiers3 -

WriteModifiers

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

Parameters:
modifiers -
Method Detail

contains

public boolean contains(WriteModifiers modifiers)
Checks if the specified modifier is set.

Parameters:
modifiers -
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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.