ostore.update
Class ActionReplaceBlocks

java.lang.Object
  |
  +--ostore.update.Action
        |
        +--ostore.update.ActionReplaceBlocks
All Implemented Interfaces:
QuickSerializable

public class ActionReplaceBlocks
extends Action

This action replaces encryption-block sized blocks of data in a data object. It can only replace whole blocks of data at block boundaries. See ActionReplacePartialBlock (when it exists).

Version:
$Id: ActionReplaceBlocks.java,v 1.31 2002/08/31 21:53:06 srhea Exp $
Author:
Patrick R. Eaton

Field Summary
static boolean DEBUG
           
 
Constructor Summary
ActionReplaceBlocks(InputBuffer buffer)
           
ActionReplaceBlocks(SecureHash target, int num_blocks, int block_offset, int block_size, byte[] data)
          Construct an ActionReplaceBlocks action.
 
Method Summary
 long getLength()
          getLength returns the length of the ActionReplaceBlocks.
 long getOffset()
          getOffset returns the offset of the ActionReplaceBlocks.
 Set getTargets()
           
 void perform(GuidVersionMap guid_map, VersionHandleCache version_cache, UpdateContinuation continuation, DataCache cache)
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Return a representation of this action as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

ActionReplaceBlocks

public ActionReplaceBlocks(SecureHash target,
                           int num_blocks,
                           int block_offset,
                           int block_size,
                           byte[] data)
Construct an ActionReplaceBlocks action.

Parameters:
target - the Aguid of the target data object
num_blocks - the number of blocks to be replaced
block_offset - the block offset at which to start the replacement
block_size - the size of the blocks to be replaced
data - the data to be replaced. The byte array must contain (num_blocks * block_size) bytes of data.

ActionReplaceBlocks

public ActionReplaceBlocks(InputBuffer buffer)
                    throws QSException
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class Action
Parameters:
buffer - the output buffer to add the object to

perform

public void perform(GuidVersionMap guid_map,
                    VersionHandleCache version_cache,
                    UpdateContinuation continuation,
                    DataCache cache)
             throws ostore.update.UpdateException
Overrides:
perform in class Action
ostore.update.UpdateException

getLength

public long getLength()
getLength returns the length of the ActionReplaceBlocks.

Specified by:
getLength in class Action
Returns:
length of ctionReplaceBlocks

getOffset

public long getOffset()
getOffset returns the offset of the ActionReplaceBlocks.

Returns:
offset of ctionReplaceBlocks

getTargets

public Set getTargets()
Overrides:
getTargets in class Action

toString

public String toString()
Description copied from class: Action
Return a representation of this action as a string.

Specified by:
toString in class Action
Returns:
a string representation of this action