ostore.update
Class ActionSetMetadata

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

public class ActionSetMetadata
extends Action

The ActionSetMetadata action assigns a value to a metadata field. It can be used for both system-defined fields (specified by integer constants) and user-defined fields (specified by strings) See Metadata for a description of these two types of metadata fields. The action will overwrite any old value held by the field; if the value of the field was previously unset, the action will assign the value to the field.

Version:
$Id: ActionSetMetadata.java,v 1.18 2002/08/02 19:38:08 geels Exp $
Author:
Patrick R. Eaton

Field Summary
static boolean DEBUG
           
 
Constructor Summary
ActionSetMetadata(InputBuffer buffer)
           
ActionSetMetadata(SecureHash target, int field, QuickSerializable value)
          Construct an ActionSetMetadata action to modify a field in the metadata that is described by an integer constant (see Metadata).
ActionSetMetadata(SecureHash target, String field, QuickSerializable value)
          Construct an ActionSetMetadata action to modify a user-defined field in the metadata that cannot be described by an integer constant (see Metadata).
 
Method Summary
 long getLength()
          getLength returns the length of the ActionSetMetadata.
 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

ActionSetMetadata

public ActionSetMetadata(SecureHash target,
                         int field,
                         QuickSerializable value)
Construct an ActionSetMetadata action to modify a field in the metadata that is described by an integer constant (see Metadata).

Parameters:
target - the Aguid of the target data object
field - the integer constant described in Metadata representing the metadata field to be changed
value - the new value for the field in the metadata

ActionSetMetadata

public ActionSetMetadata(SecureHash target,
                         String field,
                         QuickSerializable value)
Construct an ActionSetMetadata action to modify a user-defined field in the metadata that cannot be described by an integer constant (see Metadata).

Parameters:
target - the Aguid of the target data object
field - the string representing the name of the metadata field to be changed
value - the new value for the field in the metadata

ActionSetMetadata

public ActionSetMetadata(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 ActionSetMetadata.

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

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