ozone API

org.ozoneDB
Class OzoneObject

java.lang.Object
  |
  +--org.ozoneDB.OzoneObject
All Implemented Interfaces:
OzoneCompatible, OzoneCompatibleOrProxy, java.io.Serializable
Direct Known Subclasses:
BLOBContainerImpl, BLOBPageImpl

public class OzoneObject
extends java.lang.Object
implements OzoneCompatible

This class can be extended to build actual database objects. It provides a default implementation of the OzoneCompatible interface.

Version:
$Revision: 1.4 $Date: 2002/07/12 09:25:11 $
Author:
SMB
See Also:
Serialized Form

Constructor Summary
OzoneObject()
           
 
Method Summary
 org.ozoneDB.core.ObjectContainer container()
          Return the container of the receiver.
 OzoneInterface database()
          Return the database link
 void deleteRecursive()
           
 org.ozoneDB.core.ObjectID getObjectID()
          Returns the ObjectID of the represented ozone object.
 java.lang.String handle()
          Retrieves a handle to a specific instance of an OzoneObject.
 int hashCode()
           
 void onCreate()
          This default implementation of the onCreate() method does nothing.
 void onDelete()
          This default implementation of the onDelete() method does nothing.
 OzoneProxy self()
          Return a proxy for the receiver.
 void setContainer(org.ozoneDB.core.ObjectContainer _container)
          Set the container of the receiver.
 java.lang.String toString()
           
 boolean toXML(org.xml.sax.ContentHandler ch)
          This default implementation of the toSAX() method.
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OzoneObject

public OzoneObject()
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setContainer

public void setContainer(org.ozoneDB.core.ObjectContainer _container)
Description copied from interface: OzoneCompatible
Set the container of the receiver. The member that holds the actual reference must be transient.

Specified by:
setContainer in interface OzoneCompatible

self

public OzoneProxy self()
Description copied from interface: OzoneCompatible
Return a proxy for the receiver.

Specified by:
self in interface OzoneCompatible

container

public org.ozoneDB.core.ObjectContainer container()
Description copied from interface: OzoneCompatible
Return the container of the receiver.

Specified by:
container in interface OzoneCompatible

handle

public java.lang.String handle()
Retrieves a handle to a specific instance of an OzoneObject. A handle is the externalizeable equivalent of OzoneProxy. The purpose of handles is to enable detached systems (such as web interfaces) that are not able to use OzoneProxy objects directly a means to access specific objects where object naming is not practical or convenient. A handle is valid for the lifetime of the OzoneObject it references. Unlike OzoneProxy, retrieving a handle on an object does nothing to guarantee its existence. While the handle is valid for the lifetime of the object it refers to, that object's lifetime may be shorter than the handle's.

The resultant string representation will be composed entirely of alphanumeric characters [A-Z], [a-z], and [0-9]; as such, it can safely and reliably be used in URLs without need for escaping.


database

public OzoneInterface database()
Description copied from interface: OzoneCompatible
Return the database link

Specified by:
database in interface OzoneCompatible

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

onCreate

public void onCreate()
              throws java.lang.Exception
This default implementation of the onCreate() method does nothing.

Specified by:
onCreate in interface OzoneCompatible
java.lang.Exception

onDelete

public void onDelete()
              throws java.lang.Exception
This default implementation of the onDelete() method does nothing.

Specified by:
onDelete in interface OzoneCompatible
java.lang.Exception

toXML

public boolean toXML(org.xml.sax.ContentHandler ch)
              throws org.xml.sax.SAXException
This default implementation of the toSAX() method. It returns just false to signal that a default value should be used.

Specified by:
toXML in interface OzoneCompatible
Returns:
The to be expected size of the object or -1 if a default value should be used. public int size() throws Exception;
org.xml.sax.SAXException

deleteRecursive

public void deleteRecursive()

getObjectID

public org.ozoneDB.core.ObjectID getObjectID()
Returns the ObjectID of the represented ozone object. ObjectIDs are equal for equal ozone objects and different for different ozone objects. They are comparable, so that ozone objects may use {@link ObjectID#compareTo) in comparison functions.

Currently, ObjectID exposes other methods than {@link ObjectID#equals) and {@link ObjectID#compareTo). However, they should not be used, as ObjectIDs should be, apart from this methods, opaque.

Specified by:
getObjectID in interface OzoneCompatibleOrProxy

ozone API

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