org.spicefactory.pimento.transaction
Class TransactionResponse

java.lang.Object
  extended by org.spicefactory.pimento.transaction.TransactionResponse
All Implemented Interfaces:
Externalizable

public class TransactionResponse
extends Object
implements Externalizable

Represents a transaction response to be sent to the client. Contains snapshots for loaded or refreshed entities as well as the return values for all operations that were executed within the transaction. Those return values may include non-entity values not managed by Pimento.

Author:
Jens Halm

Constructor Summary
TransactionResponse()
          Creates a new instance.
 
Method Summary
 void addLoadedSnapshot(EntitySnapshot snapshot)
          Adds a snapshot for an entity to be loaded into the client.
 void addOperation(ServiceResponse response)
          Adds the response for an operation that was executed within this transaction.
 void addPersistedSnapshot(EntitySnapshot snapshot)
          Adds a snapshot for an entity that was persisted in this transaction.
 void addRefreshedSnapshot(EntitySnapshot snapshot)
          Adds a snapshot for an entity that must be synchronized in the client.
 void addRemovedSnapshot(EntitySnapshot snapshot)
          Adds a snapshot for an entity that needs to be removed from the client cache.
 void readExternal(DataInput input)
          Restores the content of this object from the DataInput instance.
 void writeExternal(DataOutput output)
          Saves the content of this object to the DataOutput instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionResponse

public TransactionResponse()
Creates a new instance.

Method Detail

addLoadedSnapshot

public void addLoadedSnapshot(EntitySnapshot snapshot)
Adds a snapshot for an entity to be loaded into the client.

Parameters:
snapshot - a snapshot for an entity to be loaded into the client

addPersistedSnapshot

public void addPersistedSnapshot(EntitySnapshot snapshot)
Adds a snapshot for an entity that was persisted in this transaction.

Parameters:
snapshot - a snapshot for an entity that was persisted in this transaction

addRefreshedSnapshot

public void addRefreshedSnapshot(EntitySnapshot snapshot)
Adds a snapshot for an entity that must be synchronized in the client.

Parameters:
snapshot - a snapshot for an entity that must be synchronized in the client

addRemovedSnapshot

public void addRemovedSnapshot(EntitySnapshot snapshot)
Adds a snapshot for an entity that needs to be removed from the client cache.

Parameters:
snapshot - a snapshot for an entity that needs to be removed from the client cache

addOperation

public void addOperation(ServiceResponse response)
Adds the response for an operation that was executed within this transaction.

Parameters:
response - a response for an operation that was executed within this transaction

readExternal

public void readExternal(DataInput input)
Description copied from interface: Externalizable
Restores the content of this object from the DataInput instance. Values must be read in the same sequence as they were written on the client side.

Specified by:
readExternal in interface Externalizable
Parameters:
input - the AMF3 data to read from

writeExternal

public void writeExternal(DataOutput output)
Description copied from interface: Externalizable
Saves the content of this object to the DataOutput instance.

Specified by:
writeExternal in interface Externalizable
Parameters:
output - the output to write to