ostore.update
Class GuidVersionMap

java.lang.Object
  |
  +--ostore.update.GuidVersionMap

public class GuidVersionMap
extends Object

The GuidVersionMap records a mapping from Aguid to Vguid. When the inner ring initiates the execution of an update, it provides the update stage with a mapping which contains an entry for every potential target of the update. The update stage uses this map to ensure that it is applying an update against the correct versions of the target data objects.

Version:
$Id: GuidVersionMap.java,v 1.7 2001/10/27 11:23:42 hweather Exp $
Author:
Patrick R. Eaton

Constructor Summary
GuidVersionMap()
          Construct a new GuidVersionMap.
 
Method Summary
 SecureHash getVguid(SecureHash aguid)
          Returns the Vguid of the current version of the data object identified by an Aguid.
 SecureHash getVhash(SecureHash aguid)
          Returns the Vhash of the current version of the data object identified by an Aguid.
 void insertVguidMapping(SecureHash aguid, SecureHash vguid)
          Records a mapping from the Aguid of a data object to the Vguid of a version of that data object.
 void insertVhashMapping(SecureHash aguid, SecureHash vhash)
          Records a mapping from the Aguid of a data object to the Vhash of a version of that data object.
 String toString()
          Returns a string which displays all of the mapping contained in this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GuidVersionMap

public GuidVersionMap()
Construct a new GuidVersionMap. The new object will contain no mappings.

Method Detail

getVguid

public SecureHash getVguid(SecureHash aguid)
Returns the Vguid of the current version of the data object identified by an Aguid.

Parameters:
aguid - the Aguid of a data object
Returns:
the Vguid of the corresponding version of that data object; null if this map does not contain an entry for aguid

getVhash

public SecureHash getVhash(SecureHash aguid)
Returns the Vhash of the current version of the data object identified by an Aguid.

Parameters:
aguid - the Aguid of a data object
Returns:
the Vhash of the corresponding version of that data object; null if this map does not contain an entry for aguid

insertVguidMapping

public void insertVguidMapping(SecureHash aguid,
                               SecureHash vguid)
Records a mapping from the Aguid of a data object to the Vguid of a version of that data object.

Parameters:
aguid - the Aguid of a data object
vguid - the Vguid of the corresponding version of that data aobject

insertVhashMapping

public void insertVhashMapping(SecureHash aguid,
                               SecureHash vhash)
Records a mapping from the Aguid of a data object to the Vhash of a version of that data object.

Parameters:
aguid - the Aguid of a data object
vhash - the Vhash of the corresponding version of that data aobject

toString

public String toString()
Returns a string which displays all of the mapping contained in this map.

Overrides:
toString in class Object