ostore.dataobj
Class Metadata

java.lang.Object
  |
  +--ostore.dataobj.Metadata
All Implemented Interfaces:
QuickSerializable

public class Metadata
extends Object
implements QuickSerializable

Metadata is the class which contains all of the Metadata for a DataObject

Version:
$Id: Metadata.java,v 1.38 2004/02/13 23:16:39 rrubin Exp $
Author:
Chris WElls

Field Summary
protected  Hashtable _metadata
          All metadata will be stored in this Hashtable.
static int ACL
           
static int ACL_GUID
           
static int ACTIVE_GUID
           
static int BLOCK_SIZE
           
static int BRANCH_AGUID
           
static int BRANCH_HEAD
           
static int BRANCH_NUM
           
static int BRANCH_VGUID
           
static boolean DEBUG
           
static int EXPIRATION_DATE
           
static int INTEGER_TYPE
          These are the types of names possible for Metadata objects.
static int IS_LOG
           
static int LAST_CKPT_GUID
           
static int LAST_LOG_GUID
           
static int LAST_VHASH
           
static int OBJECT_CREATE_TIME
           
static int PRCERT
           
static int PRCERT_GUID
           
static int RESULTING_VHASH
           
static int RPCERT
           
static int RPCERT_GUID
           
static int SIZE
          These are standard constants for use with Metadata.
static int STRING_TYPE
           
static int VERSION_CREATE_TIME
           
static int VERSION_SEQNUM
           
 
Constructor Summary
Metadata()
           
Metadata(InputBuffer buffer)
           
Metadata(Metadata other)
           
 
Method Summary
 boolean flush()
          flush routine.
 QuickSerializable get(int name)
          Retrieve an element from Metadata
 QuickSerializable get(String name)
          Retrieve an element from Metadata
protected  QuickSerializable internalGet(Object name)
          Retrieve an element from Metadata
protected  boolean internalPut(Object name, QuickSerializable qs)
          Insert an element into the Metadata
 Set keys()
          Get a set of all the keys in the Metadata.
 boolean put(int name, QuickSerializable qs)
          Insert an element into the Metadata
 boolean put(String name, QuickSerializable qs)
          Insert an element into the Metadata
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 boolean uncache()
          uncache routine.
 
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

SIZE

public static final int SIZE
These are standard constants for use with Metadata. All standard Metadata elements (like active GUID) should be put into and retrieved from the Metadata using these constants. Constants which have _GUID alternatives are for items which may be in the Metadata, or are merely indirectly referenced via a GUID (for example, RPCERT vs. RPCERT_GUID). Other Metadata elements can be indexed using Strings.

See Also:
Constant Field Values

BLOCK_SIZE

public static final int BLOCK_SIZE
See Also:
Constant Field Values

ACTIVE_GUID

public static final int ACTIVE_GUID
See Also:
Constant Field Values

VERSION_SEQNUM

public static final int VERSION_SEQNUM
See Also:
Constant Field Values

LAST_CKPT_GUID

public static final int LAST_CKPT_GUID
See Also:
Constant Field Values

LAST_LOG_GUID

public static final int LAST_LOG_GUID
See Also:
Constant Field Values

RPCERT

public static final int RPCERT
See Also:
Constant Field Values

RPCERT_GUID

public static final int RPCERT_GUID
See Also:
Constant Field Values

PRCERT

public static final int PRCERT
See Also:
Constant Field Values

PRCERT_GUID

public static final int PRCERT_GUID
See Also:
Constant Field Values

ACL

public static final int ACL
See Also:
Constant Field Values

ACL_GUID

public static final int ACL_GUID
See Also:
Constant Field Values

RESULTING_VHASH

public static final int RESULTING_VHASH
See Also:
Constant Field Values

IS_LOG

public static final int IS_LOG
See Also:
Constant Field Values

OBJECT_CREATE_TIME

public static final int OBJECT_CREATE_TIME
See Also:
Constant Field Values

VERSION_CREATE_TIME

public static final int VERSION_CREATE_TIME
See Also:
Constant Field Values

EXPIRATION_DATE

public static final int EXPIRATION_DATE
See Also:
Constant Field Values

LAST_VHASH

public static final int LAST_VHASH
See Also:
Constant Field Values

BRANCH_NUM

public static final int BRANCH_NUM
See Also:
Constant Field Values

BRANCH_VGUID

public static final int BRANCH_VGUID
See Also:
Constant Field Values

BRANCH_AGUID

public static final int BRANCH_AGUID
See Also:
Constant Field Values

BRANCH_HEAD

public static final int BRANCH_HEAD
See Also:
Constant Field Values

_metadata

protected Hashtable _metadata
All metadata will be stored in this Hashtable. A Metadata item will be indexed by a String name.


INTEGER_TYPE

public static final int INTEGER_TYPE
These are the types of names possible for Metadata objects. NOTE: there are two types: Integers and Strings.

See Also:
Constant Field Values

STRING_TYPE

public static final int STRING_TYPE
See Also:
Constant Field Values
Constructor Detail

Metadata

public Metadata()

Metadata

public Metadata(Metadata other)

Metadata

public Metadata(InputBuffer buffer)
         throws QSException
Method Detail

internalPut

protected boolean internalPut(Object name,
                              QuickSerializable qs)
Insert an element into the Metadata

Parameters:
name - == name of the element
qs - == the piece of metadata we wish to store
Returns:
return == true iff there was no element with name already in this Metadata, and we have successfully inserted element

put

public boolean put(int name,
                   QuickSerializable qs)
Insert an element into the Metadata

Parameters:
name - == name of the element
qs - == the piece of metadata we wish to store
Returns:
return == true iff there was no element with name already in this Metadata, and we have successfully inserted element

put

public boolean put(String name,
                   QuickSerializable qs)
Insert an element into the Metadata

Parameters:
name - == name of the element
qs - == the piece of metadata we wish to store
Returns:
return == true iff there was no element with name already in this Metadata, and we have successfully inserted element

internalGet

protected QuickSerializable internalGet(Object name)
Retrieve an element from Metadata

Parameters:
name - == name of the element
Returns:
return == the metadata element named by name, or null if no element was found

get

public QuickSerializable get(int name)
Retrieve an element from Metadata

Parameters:
name - == name of the element
Returns:
return == the metadata element named by name, or null if no element was found

get

public QuickSerializable get(String name)
Retrieve an element from Metadata

Parameters:
name - == name of the element
Returns:
return == the metadata element named by name, or null if no element was found

keys

public Set keys()
Get a set of all the keys in the Metadata. Elements named by ints are keyed by Integers, otherwise they are keyed by Strings.

Returns:
the set of keys in the Metadata

uncache

public boolean uncache()
uncache routine. This does nothing.


flush

public boolean flush()
flush routine. Does nothing.


toString

public String toString()
Overrides:
toString in class Object

serialize

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

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