org.jboss.cache
Class Modification

java.lang.Object
  extended by org.jboss.cache.Modification
All Implemented Interfaces:
Externalizable, Serializable

public class Modification
extends Object
implements Externalizable

Represents a modification in the cache. Contains the nature of the modification (e.g. PUT, REMOVE), the fqn of the node, the new value and the previous value. A list of modifications will be sent to all nodes in a cluster when a transaction has been committed (PREPARE phase). A Modification is also used to roll back changes, e.g. since we know the previous value, we can reconstruct the previous state by applying the changes in a modification listin reverse order.

Version:
$Revision: 7168 $
Author:
Bela Ban Apr 12, 2003
See Also:
Serialized Form

Nested Class Summary
static class Modification.ModificationType
           
 
Constructor Summary
Modification()
          Constructs a new modification.
Modification(Modification.ModificationType type, Fqn fqn)
          Constructs a new modification with fqn only.
Modification(Modification.ModificationType type, Fqn fqn1, Fqn fqn2)
          Constructs a new modification with fqn only.
Modification(Modification.ModificationType type, Fqn fqn, Map data)
          Constructs a new modification with data map.
Modification(Modification.ModificationType type, Fqn fqn, Object key)
          Constructs a new modification with key.
Modification(Modification.ModificationType type, Fqn fqn, Object key, Object value)
          Constructs a new modification with details.
 
Method Summary
 Map getData()
          Returns the modification Map set.
 Fqn getFqn()
          Returns the modification fqn.
 Fqn getFqn2()
           
 Object getKey()
          Returns the modification key.
 Object getOldValue()
          Returns the post modification old value.
 Modification.ModificationType getType()
          Returns the type of modification.
 Object getValue()
          Returns the modification value.
 void readExternal(ObjectInput in)
          Reads data from an external stream.
 void setData(Map data)
          Sets the modification Map set.
 void setFqn(Fqn fqn)
          Sets the modification fqn.
 void setFqn2(Fqn fqn2)
           
 void setKey(Object key)
          Sets the modification key.
 void setOldValue(Object old_value)
          Sets the post modification old value.
 void setType(Modification.ModificationType type)
          Sets the type of modification.
 void setValue(Object value)
          Sets the modification value.
 String toString()
          Returns debug information about this modification.
 void writeExternal(ObjectOutput out)
          Writes data to an external stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Modification

public Modification()
Constructs a new modification.


Modification

public Modification(Modification.ModificationType type,
                    Fqn fqn,
                    Object key,
                    Object value)
Constructs a new modification with details.


Modification

public Modification(Modification.ModificationType type,
                    Fqn fqn,
                    Object key)
Constructs a new modification with key.


Modification

public Modification(Modification.ModificationType type,
                    Fqn fqn,
                    Map data)
Constructs a new modification with data map.


Modification

public Modification(Modification.ModificationType type,
                    Fqn fqn)
Constructs a new modification with fqn only.


Modification

public Modification(Modification.ModificationType type,
                    Fqn fqn1,
                    Fqn fqn2)
Constructs a new modification with fqn only.

Method Detail

getType

public Modification.ModificationType getType()
Returns the type of modification.


setType

public void setType(Modification.ModificationType type)
Sets the type of modification.


getFqn

public Fqn getFqn()
Returns the modification fqn.


setFqn

public void setFqn(Fqn fqn)
Sets the modification fqn.


setFqn2

public void setFqn2(Fqn fqn2)

getFqn2

public Fqn getFqn2()

getKey

public Object getKey()
Returns the modification key.


setKey

public void setKey(Object key)
Sets the modification key.


getValue

public Object getValue()
Returns the modification value.


setValue

public void setValue(Object value)
Sets the modification value.


getOldValue

public Object getOldValue()
Returns the post modification old value.


setOldValue

public void setOldValue(Object old_value)
Sets the post modification old value.


getData

public Map getData()
Returns the modification Map set.


setData

public void setData(Map data)
Sets the modification Map set.


writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Writes data to an external stream.

Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Reads data from an external stream.

Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

toString

public String toString()
Returns debug information about this modification.

Overrides:
toString in class Object


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.