ozone core API

org.ozoneDB.core.storage.gammaStore
Class ObjectStreamClasses

java.lang.Object
  extended byorg.ozoneDB.core.storage.gammaStore.ObjectStreamClasses
All Implemented Interfaces:
PropertyConfigurable

public class ObjectStreamClasses
extends java.lang.Object
implements PropertyConfigurable

Takes care of storing ObjectStreamClass instances into another medium, while providing for a replacement in the form of an int.

Author:
Leo

Field Summary
private  java.io.File directory
           
static PropertyInfo DIRECTORY
           
private  java.util.Map handleToOsc
           
private  java.util.Map keyToHandle
           
private  java.lang.String prefix
           
 
Constructor Summary
ObjectStreamClasses(java.util.Properties properties, java.lang.String prefix, boolean initialize)
           
 
Method Summary
 int getHandle(java.io.ObjectStreamClass objectStreamClass)
          Gives the handle for a particular ObjectStreamClass.
 java.io.ObjectStreamClass getObjectStreamClass(int handle)
          Retrieves the ObjectStreamClass given its handle.
 java.lang.String getPrefix()
           
 java.util.Collection getPropertyInfos()
          Returns a Collection with all the properties this instance supports.
static byte[] toImage(java.io.ObjectStreamClass objectStreamClass)
          Converts this instance to a byte[] that can be directly saved to disk or used to find the handle of an ObjectStreamClass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY

public static final PropertyInfo DIRECTORY

handleToOsc

private java.util.Map handleToOsc

keyToHandle

private java.util.Map keyToHandle

prefix

private java.lang.String prefix

directory

private java.io.File directory
Constructor Detail

ObjectStreamClasses

public ObjectStreamClasses(java.util.Properties properties,
                           java.lang.String prefix,
                           boolean initialize)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Throws:
ConfigurationException - if error in properties
java.io.IOException - if directory could not be created (initialize == true)
java.io.IOException - if file in directory could not be read (initialize == false)
java.lang.ClassNotFoundException - invalid file in directory (initialize == false)
java.lang.NumberFormatException - invalid file in directory (initialize == false)
Method Detail

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface PropertyConfigurable

toImage

public static byte[] toImage(java.io.ObjectStreamClass objectStreamClass)
Converts this instance to a byte[] that can be directly saved to disk or used to find the handle of an ObjectStreamClass.


getObjectStreamClass

public java.io.ObjectStreamClass getObjectStreamClass(int handle)
Retrieves the ObjectStreamClass given its handle.


getHandle

public int getHandle(java.io.ObjectStreamClass objectStreamClass)
Gives the handle for a particular ObjectStreamClass. This handle can be used as a unique identifier. If the given ObjectStreamClass is unknown a new handle is allocated and returned. When a new handle is returned the same handle will always be returned for that same instance.


getPropertyInfos

public java.util.Collection getPropertyInfos()
Description copied from interface: PropertyConfigurable

Returns a Collection with all the properties this instance supports.

Specified by:
getPropertyInfos in interface PropertyConfigurable
Returns:
Collection with PropertyInfo elements

ozone core API

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