ozone core API

org.ozoneDB.core.DbRemote
Class DbCacheChunk

java.lang.Object
  |
  +--org.ozoneDB.DxLib.DxObject
        |
        +--org.ozoneDB.core.DbRemote.DbCommand
              |
              +--org.ozoneDB.core.DbRemote.DbCacheChunk
All Implemented Interfaces:
java.lang.Cloneable, DxCompatible, java.io.Externalizable, java.io.Serializable

public final class DbCacheChunk
extends DbCommand
implements java.io.Externalizable

Read/write a chunk of objects from/to the server. This is used by the ClientCacheDatabase to fetch/sync objects from/to the server.

Version:
$Revision: 1.2 $Date: 2002/06/08 00:49:38 $
Author:
SMB
See Also:
Serialized Form

Field Summary
private  byte[] chunk
           
private  byte mode
           
private static byte MODE_READ
           
private static byte MODE_WRITE
           
private  ObjectID rootID
           
private  int size
           
 
Fields inherited from class org.ozoneDB.core.DbRemote.DbCommand
env, proxyObjectGate, result
 
Fields inherited from class org.ozoneDB.DxLib.DxObject
 
Constructor Summary
DbCacheChunk()
           
DbCacheChunk(byte[] _chunk)
          Store objects in the server.
DbCacheChunk(ObjectID _rootID, int _size)
          Fetch objects from the server.
 
Method Summary
protected  void findProxies(java.lang.Object obj, DxDeque deque)
          Recursivly search the specified object and put all found OzoneProxies in the specified deque.
 void perform(Transaction ta)
          Perform whatever has to be done for this command.
protected  void readChunk(Transaction ta)
           
 void readExternal(java.io.ObjectInput in)
           
protected  void writeChunk(Transaction ta)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.ozoneDB.core.DbRemote.DbCommand
getProxyObjectGate, setProxyObjectGate, shouldResultBeSentToClient, toString
 
Methods inherited from class org.ozoneDB.DxLib.DxObject
clone, isLess
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.DxLib.DxCompatible
equals
 

Field Detail

MODE_READ

private static final byte MODE_READ
See Also:
Constant Field Values

MODE_WRITE

private static final byte MODE_WRITE
See Also:
Constant Field Values

mode

private byte mode

size

private int size

rootID

private ObjectID rootID

chunk

private byte[] chunk
Constructor Detail

DbCacheChunk

public DbCacheChunk()

DbCacheChunk

public DbCacheChunk(ObjectID _rootID,
                    int _size)
Fetch objects from the server.


DbCacheChunk

public DbCacheChunk(byte[] _chunk)
Store objects in the server.

Method Detail

perform

public void perform(Transaction ta)
             throws java.lang.Exception
Description copied from class: DbCommand
Perform whatever has to be done for this command. This method is called within a transaction, within a thread. The result of the command goes in the result member.

Specified by:
perform in class DbCommand
java.lang.Exception

readChunk

protected void readChunk(Transaction ta)
                  throws java.lang.Exception
java.lang.Exception

writeChunk

protected void writeChunk(Transaction ta)
                   throws java.lang.Exception
java.lang.Exception

findProxies

protected void findProxies(java.lang.Object obj,
                           DxDeque deque)
Recursivly search the specified object and put all found OzoneProxies in the specified deque.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.