ostore.client
Class OSCreateObjectRequest

java.lang.Object
  |
  +--ostore.client.OSRequest
        |
        +--ostore.client.OSCreateObjectRequest
All Implemented Interfaces:
QueueElementIF, QuickSerializable

public class OSCreateObjectRequest
extends OSRequest

An application uses the OSCreateObjectRequest to create a new data object in OceanStore. In response to this request, the application will receive an OSCreateObjectResult. To create a new object, the system requires four pieces of information: the principal's public key, the principal's private key, the responsible party's public key, and the desired name of the new data object.

The combination of the principal's public key, the responsible party's key, and the desired name of the new data object is called a responsible party certificate, or an RPCert. The principal's private key is used to sign the RPCert. The signed RPCert asserts that the signing principal elects to be represented by the given responsible party and requests that an object be created on its behalf.

The principal's private key is used only by the ClientStage to sign the RPCert. It is not transmitted further to the system and is discarded after the result of the request is known.

Version:
$Id: OSCreateObjectRequest.java,v 1.23 2004/02/13 23:14:42 rrubin Exp $
Author:
Patrick R. Eaton
See Also:
OSCreateObjectResult

Field Summary
 
Fields inherited from class ostore.client.OSRequest
app_id
 
Constructor Summary
OSCreateObjectRequest(InputBuffer buffer)
           
OSCreateObjectRequest(OSAppId app_id, QSPublicKey principal_pkey, QSPrivateKey principal_skey, QSPublicKey rp_key, String obj_name)
           
OSCreateObjectRequest(OSAppId app_id, QSPublicKey principal_pkey, QSPrivateKey principal_skey, QSPublicKey rp_key, String obj_name, byte[] data)
           
OSCreateObjectRequest(OSAppId app_id, QSPublicKey principal_pkey, QSPrivateKey principal_skey, QSPublicKey rp_key, String obj_name, Pair branch)
          Create a new OSCreateObjectRequest.
OSCreateObjectRequest(OSAppId app_id, QSPublicKey principal_pkey, QSPrivateKey principal_skey, QSPublicKey rp_key, String obj_name, Pair branch, byte[] data)
          Create a new OSCreateObjectRequest and append some initial data onto it immediately after creation.
 
Method Summary
 void appendInitialAction(OSAction action)
          Append an action to the initial update list.
 SecureHash getAguid()
          Returns the Aguid of the data object to be created.
 Pair getBranch()
           
 SecureHash getBranchAGUID()
           
 SecureHash getBranchVGUID()
           
 QSArray getInitialUpdate()
          Compile (if necessary) and return the initial_update action array for this create request.
 String getName()
          Returns the desired name of the data object to be created.
 QSPrivateKey getPrincipalPrivateKey()
          Returns the principal's private (secret) key.
 QSPublicKey getPrincipalPublicKey()
          Returns the principal's public key.
 RPCert getRPCert()
          Returns the responsible party certificate needed for this request.
 QSPublicKey getRPKey()
          Returns the responsible party's public key.
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
Methods inherited from class ostore.client.OSRequest
clone, getAppId, getDispatchTime, getSeqNum, getUserTag, setUserTag
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OSCreateObjectRequest

public OSCreateObjectRequest(OSAppId app_id,
                             QSPublicKey principal_pkey,
                             QSPrivateKey principal_skey,
                             QSPublicKey rp_key,
                             String obj_name,
                             Pair branch)
Create a new OSCreateObjectRequest.

Parameters:
app_id - the OSAppId to identify the requesting application
principal_pkey - the principal's public key
principal_skey - the principal's private (secret) key
rp_key - the responsible party's public key
obj_name - the desired name of the new data object

OSCreateObjectRequest

public OSCreateObjectRequest(OSAppId app_id,
                             QSPublicKey principal_pkey,
                             QSPrivateKey principal_skey,
                             QSPublicKey rp_key,
                             String obj_name)

OSCreateObjectRequest

public OSCreateObjectRequest(OSAppId app_id,
                             QSPublicKey principal_pkey,
                             QSPrivateKey principal_skey,
                             QSPublicKey rp_key,
                             String obj_name,
                             byte[] data)

OSCreateObjectRequest

public OSCreateObjectRequest(OSAppId app_id,
                             QSPublicKey principal_pkey,
                             QSPrivateKey principal_skey,
                             QSPublicKey rp_key,
                             String obj_name,
                             Pair branch,
                             byte[] data)
Create a new OSCreateObjectRequest and append some initial data onto it immediately after creation.

NOTE: please use the appendInitialAction() method instead.

Parameters:
app_id - the OSAppId to identify the requesting application
principal_pkey - the principal's public key
principal_skey - the principal's private (secret) key
rp_key - the responsible party's public key
obj_name - the desired name of the new data object
data - the initial data to append

OSCreateObjectRequest

public OSCreateObjectRequest(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 OSRequest
Parameters:
buffer - the output buffer to add the object to

getPrincipalPublicKey

public QSPublicKey getPrincipalPublicKey()
Returns the principal's public key.

Returns:
the principal's public key

getPrincipalPrivateKey

public QSPrivateKey getPrincipalPrivateKey()
Returns the principal's private (secret) key.

Returns:
the principal's private key

getRPKey

public QSPublicKey getRPKey()
Returns the responsible party's public key.

Returns:
the responsible party's public key

getName

public String getName()
Returns the desired name of the data object to be created.

Returns:
the desired name of the data object to be created

getAguid

public SecureHash getAguid()
Returns the Aguid of the data object to be created.

Returns:
the Aguid of the data object to be created

getRPCert

public RPCert getRPCert()
Returns the responsible party certificate needed for this request. The certificate contains the principal's public key, the responsible party's public key, and the desired name of the data object to be created.

Returns:
the responsible party certificate for this request

toString

public String toString()
Overrides:
toString in class Object

appendInitialAction

public void appendInitialAction(OSAction action)
Append an action to the initial update list. This action will be applied immediately to the object immediately after it is created. The action must only target the new object.

FIXME: must know the aguid of the object to create the action... shouldn't need to.

FIXME: should disallow actions that don't target this object.

Parameters:
action - the action to append

getInitialUpdate

public QSArray getInitialUpdate()
Compile (if necessary) and return the initial_update action array for this create request.

Returns:
QSArray of Actions for an initial update to this object. null if none.

getBranchVGUID

public SecureHash getBranchVGUID()

getBranchAGUID

public SecureHash getBranchAGUID()

getBranch

public Pair getBranch()