Servertec
Persistent Object Store
1.4.1 09/04/2005

stec.xpos
Class ObjectStoreReference

java.lang.Object
  extended by stec.xpos.ObjectStoreReference

public final class ObjectStoreReference
extends java.lang.Object

Handle to the persistent object store returned by ObjectStore.open() used to interface with the opened persistent object store.

Persistent object stores are simular to java.util.Hashtables, except they do not reside in memory, but on storage media and are not automaically rehashed.

Since:
1.0.0 08/12/2001
See Also:
open, Hashtable

Method Summary
 void clear()
          Removes all the keys and associated values from the persistent object store.
 void close()
          Closes this handle to the persistent object store.
 boolean containsKey(java.lang.Object key)
          Returns whether the persistent object store contains the specified key associated with any value.
 boolean containsValue(java.lang.Object value)
          Returns whether the persistent object store contains the specified object associated with any key.
 ObjectStoreEnumeration elements()
          Returns an ObjectStoreEnumeration of the values in the persistent object store.
 ObjectStoreEnumeration elements(boolean with_locking)
          Returns an ObjectStoreEnumeration of the values in the persistent object store.
 ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter)
          Returns an ObjectStoreEnumeration of the values in the persistent object store.
 ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter, boolean with_locking)
          Returns an ObjectStoreEnumeration of the values in the persistent object store.
 java.lang.Object get(java.lang.Object key)
          Returns the object associated with the specified key from the persistent object store.
 java.lang.String getFilename()
          Returns the filename of the store this reference references.
 ObjectStoreInputStream getInputStream(java.lang.Object key)
          Returns an ObjectStoreInputStream for the specified key.
 ObjectStoreOutputStream getOutputStream(java.lang.Object key)
          Returns an ObjectStoreOutputStream for the specified key.
 ObjectStoreOutputStream getOutputStream(java.lang.Object key, int type, boolean append)
          Returns an ObjectStoreOutputStream for the specified key.
 ObjectStoreOutputStream getOutputStream(java.lang.Object key, java.lang.String class_name, boolean append)
          Returns an ObjectStoreOutputStream for the specified key.
 ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, boolean read_only)
          Returns an ObjectStoreRandomAccessStream for the specified key.
 ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, int type, boolean read_only)
          Returns an ObjectStoreRandomAccessStream for the specified key.
 ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key, java.lang.String class_name, boolean read_only)
          Returns an ObjectStoreRandomAccessStream for the specified key.
 boolean iLocked(java.lang.Object key)
          Returns whether the current ObjectStoreReference has locked the specified key.
 boolean iReadLocked(java.lang.Object key)
          Returns whether the current ObjectStoreReference has read locked the specified key.
 boolean isEmpty()
          Returns whether the persistent object store is empty.
 boolean isLocked(java.lang.Object key)
          Returns whether the specified key is locked.
 boolean isOpen()
          Returns whether the current ObjectStoreReference is still open.
 boolean isReadLocked(java.lang.Object key)
          Returns whether the specified key is read locked.
 boolean isWriteLocked(java.lang.Object key)
          Returns whether the specified key is write locked.
 boolean iWriteLocked(java.lang.Object key)
          Returns whether the current ObjectStoreReference has write locked the specified key.
 ObjectStoreEnumeration keys()
          Returns an ObjectStoreEnumeration of the keys in the persistent object store.
 ObjectStoreEnumeration keys(boolean with_locking)
          Returns an ObjectStoreEnumeration of the keys in the persistent object store.
 ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter)
          Returns an ObjectStoreEnumeration of the keys in the persistent object store.
 ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter, boolean with_locking)
          Returns an ObjectStoreEnumeration of the keys in the persistent object store.
 void lock(java.lang.Object key)
          Write locks the specified key or waits until it can be write locked.
 boolean lock(java.lang.Object key, long timeout)
          Write locks the specified key or waits until it can be write locked or the specified timeout is reached.
 int lockCount()
          Returns the number of locked keys.
 int lockCount(java.lang.Object key)
          Returns the number of locks for the specified key.
 java.util.Enumeration locks()
          Returns an Enumeration of the locked keys.
 java.util.Enumeration locks(java.lang.Object key)
          Returns an Enumeration of the locks on the specified key.
 long lookup_table_page_count(long lookup_table_page_number)
          Returns the number of key, value pairs that map to the specified lookup table page.
 long lookup_table_size()
          Returns the size of the lookup table as specified when the persistent object store was created.
 long lookup_table_usage()
          Returns the number of lookup table pages that are mapped by one (1) or more key, value pairs.
 double lookup_table_utilization()
          Returns the percentage of lookup table pages that are mapped by one (1) or more key, value pairs.
 void put(java.lang.Object key, java.lang.Object value)
          Stores the specified object associated with the given key object in the persistent object store.
 void readLock(java.lang.Object key)
          Read locks the specified key or waits until it can be read locked.
 boolean readLock(java.lang.Object key, long timeout)
          Read locks the specified key or waits until it can be read locked or the specified timeout is reached.
 void remove(java.lang.Object key)
          Removes the specified key and associated value from the persistent object store.
 long size()
          Returns the number of key, value pairs in the persistent object store.
 void unlock(java.lang.Object key)
          Unlocks the specified key.
 void unlockAll()
          Clears all the locks to this persistent object store.
 void unlockMine()
          Clears all the locks for the current ObjectStoreReference.
 void writeLock(java.lang.Object key)
          Write locks the specified key or waits until it can be write locked.
 boolean writeLock(java.lang.Object key, long timeout)
          Write locks the specified key or waits until it can be write locked or the specified timeout is reached.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public final void close()
                 throws java.io.IOException
Closes this handle to the persistent object store.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
open

get

public final java.lang.Object get(java.lang.Object key)
                           throws java.io.IOException
Returns the object associated with the specified key from the persistent object store.

Unlike java.util.Hashtable.get(), null is a valid return value and cannot be used to determine whether a value was associated with the specified key, instead stec.xpos.ObjectStoreReference.containsKey(Object) should be used.

Parameters:
key - the key to use. key cannot be null.
Returns:
any value associated with the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
put, remove, containsKey

put

public final void put(java.lang.Object key,
                      java.lang.Object value)
               throws java.io.IOException
Stores the specified object associated with the given key object in the persistent object store.

Unlike java.util.Hashtable.put(), null is a valid value and this method does not return any value previously associated with the specified key.

Parameters:
key - the key to store. key cannot be null.
value - the value to associate with the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
get, remove

remove

public final void remove(java.lang.Object key)
                  throws java.io.IOException
Removes the specified key and associated value from the persistent object store.

Unlike java.util.Hashtable.remove(), this method does not return any value previously associated with the specified key.

Parameters:
key - the key to remove. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
get, put

containsKey

public final boolean containsKey(java.lang.Object key)
                          throws java.io.IOException
Returns whether the persistent object store contains the specified key associated with any value.

Parameters:
key - the key to test.
Returns:
whether the persistent object store contains the specified key associated with any value.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
containsValue

containsValue

public final boolean containsValue(java.lang.Object value)
                            throws java.io.IOException
Returns whether the persistent object store contains the specified object associated with any key.

Searching for a value in a large persistent object store may take a long time.

Parameters:
value - the value to test.
Returns:
whether the persistent object store contains the specified object associated with any key.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
containsKey

size

public final long size()
                throws java.io.IOException
Returns the number of key, value pairs in the persistent object store.

Returns:
the number of key, value pairs in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.

isEmpty

public final boolean isEmpty()
                      throws java.io.IOException
Returns whether the persistent object store is empty.

Returns:
whether the persistent object store was empty.
Throws:
java.io.IOException - if an I/O exception occurred.

keys

public final ObjectStoreEnumeration keys()
                                  throws java.io.IOException
Returns an ObjectStoreEnumeration of the keys in the persistent object store.

Returns:
the ObjectStoreEnumeration of the keys in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
keys, keys, keys, elements, elements, elements, elements, ObjectStoreEnumeration

keys

public final ObjectStoreEnumeration keys(boolean with_locking)
                                  throws java.io.IOException
Returns an ObjectStoreEnumeration of the keys in the persistent object store.

Parameters:
with_locking - whether to enable locking.
Returns:
the ObjectStoreEnumeration of the keys in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
keys, keys, keys, elements, elements, elements, elements, ObjectStoreEnumeration

keys

public final ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter)
                                  throws java.io.IOException
Returns an ObjectStoreEnumeration of the keys in the persistent object store.

Parameters:
filter - the ObjectStoreEnumerationFilter. null if none.
Returns:
the ObjectStoreEnumeration of the keys in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
keys, keys, keys, elements, elements, elements, elements, ObjectStoreEnumeration, ObjectStoreEnumerationFilter

keys

public final ObjectStoreEnumeration keys(ObjectStoreEnumerationFilter filter,
                                         boolean with_locking)
                                  throws java.io.IOException
Returns an ObjectStoreEnumeration of the keys in the persistent object store.

Parameters:
filter - the ObjectStoreEnumerationFilter. null if none.
with_locking - whether to enable locking.
Returns:
the ObjectStoreEnumeration of the keys in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
keys, keys, keys, elements, elements, elements, elements, ObjectStoreEnumeration, ObjectStoreEnumerationFilter

elements

public final ObjectStoreEnumeration elements()
                                      throws java.io.IOException
Returns an ObjectStoreEnumeration of the values in the persistent object store.

Returns:
the ObjectStoreEnumeration of the values in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
elements, elements, elements, keys, keys, keys, keys, ObjectStoreEnumeration

elements

public final ObjectStoreEnumeration elements(boolean with_locking)
                                      throws java.io.IOException
Returns an ObjectStoreEnumeration of the values in the persistent object store.

Parameters:
with_locking - whether to enable locking.
Returns:
the ObjectStoreEnumeration of the values in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
elements, elements, elements, keys, keys, keys, keys, ObjectStoreEnumeration

elements

public final ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter)
                                      throws java.io.IOException
Returns an ObjectStoreEnumeration of the values in the persistent object store.

Parameters:
filter - the ObjectStoreEnumerationFilter. null if none.
Returns:
the ObjectStoreEnumeration of the values in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
elements, elements, elements, keys, keys, keys, keys, ObjectStoreEnumeration, ObjectStoreEnumerationFilter

elements

public final ObjectStoreEnumeration elements(ObjectStoreEnumerationFilter filter,
                                             boolean with_locking)
                                      throws java.io.IOException
Returns an ObjectStoreEnumeration of the values in the persistent object store.

Parameters:
filter - the ObjectStoreEnumerationFilter. null if none.
with_locking - whether to enable locking.
Returns:
the ObjectStoreEnumeration of the values in the persistent object store.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
elements, elements, elements, keys, keys, keys, keys, ObjectStoreEnumeration, ObjectStoreEnumerationFilter

lookup_table_size

public final long lookup_table_size()
                             throws java.io.IOException
Returns the size of the lookup table as specified when the persistent object store was created.

Returns:
the size of the lookup table as specified when the persistent object store was created.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
create, create, create

lookup_table_page_count

public final long lookup_table_page_count(long lookup_table_page_number)
                                   throws java.io.IOException
Returns the number of key, value pairs that map to the specified lookup table page.

Parameters:
lookup_table_page_number - the lookup table page number, 0 to lookup_table_size() - 1
Returns:
the number of key, value pairs that map to the specified lookup table page.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lookup_table_size

lookup_table_utilization

public final double lookup_table_utilization()
                                      throws java.io.IOException
Returns the percentage of lookup table pages that are mapped by one (1) or more key, value pairs.

Returns:
the percentage of lookup table pages that are mapped by one (1) or more key, value pairs.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lookup_table_usage

lookup_table_usage

public final long lookup_table_usage()
                              throws java.io.IOException
Returns the number of lookup table pages that are mapped by one (1) or more key, value pairs.

Returns:
the number of lookup table pages that are mapped by one (1) or more key, value pairs.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lookup_table_utilization

clear

public final void clear()
                 throws java.io.IOException
Removes all the keys and associated values from the persistent object store.

Also removes all locks.

Throws:
java.io.IOException - if an I/O exception occurred.

lock

public final void lock(java.lang.Object key)
                throws java.io.IOException
Write locks the specified key or waits until it can be write locked.

Same as writeLock().

If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be write locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
readLock, writeLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

readLock

public final void readLock(java.lang.Object key)
                    throws java.io.IOException
Read locks the specified key or waits until it can be read locked.

If the key is already write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be read locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to read lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, writeLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

writeLock

public final void writeLock(java.lang.Object key)
                     throws java.io.IOException
Write locks the specified key or waits until it can be write locked.

If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the specified key can be write locked.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, lock, readLock, writeLock, unlock, unlockAll, unlockMine

lock

public final boolean lock(java.lang.Object key,
                          long timeout)
                   throws java.io.IOException
Write locks the specified key or waits until it can be write locked or the specified timeout is reached.

Same as writeLock().

If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, readLock, writeLock, unlock, unlockAll, unlockMine

readLock

public final boolean readLock(java.lang.Object key,
                              long timeout)
                       throws java.io.IOException
Read locks the specified key or waits until it can be read locked or the specified timeout is reached.

If the key is already write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be read locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to read lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be read locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, writeLock, lock, writeLock, unlock, unlockAll, unlockMine

writeLock

public final boolean writeLock(java.lang.Object key,
                               long timeout)
                        throws java.io.IOException
Write locks the specified key or waits until it can be write locked or the specified timeout is reached.

If the key is already read or write locked by another stec.xpos.ObjectStoreReference the current thread will be blocked until the key can be write locked or the specified timeout is reached.

Once a key is locked it remains locked until the key is explicitly unlocked by a call to stec.xpos.ObjectStoreReference.unlock(Object), the persistent object store is cleared by a call to stec.xpos.ObjectStoreReference.clear() or the stec.xpos.ObjectStoreReference is closed.

Parameters:
key - the key to write lock. key cannot be null.
timeout - the number of milliseconds to wait. -1 for unlimited.
Returns:
whether or not the specified key could be write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lock, readLock, writeLock, lock, readLock, unlock, unlockAll, unlockMine

unlock

public final void unlock(java.lang.Object key)
                  throws java.io.IOException
Unlocks the specified key.

Parameters:
key - the key to unlock. key cannot be null.
Throws:
java.io.IOException - if the specified key is locked by another stec.xpos.ObjectStoreReference or if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlockAll, unlockMine

unlockAll

public final void unlockAll()
                     throws java.io.IOException
Clears all the locks to this persistent object store.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlock, unlockMine

unlockMine

public final void unlockMine()
                      throws java.io.IOException
Clears all the locks for the current ObjectStoreReference.

Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
lock, readLock, writeLock, lock, readLock, writeLock, unlock, unlockAll

isLocked

public final boolean isLocked(java.lang.Object key)
                       throws java.io.IOException
Returns whether the specified key is locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is locked.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
isReadLocked, isWriteLocked, iLocked, iReadLocked, iWriteLocked

isReadLocked

public final boolean isReadLocked(java.lang.Object key)
                           throws java.io.IOException
Returns whether the specified key is read locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is read locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isWriteLocked, iLocked, iReadLocked, iWriteLocked

isWriteLocked

public final boolean isWriteLocked(java.lang.Object key)
                            throws java.io.IOException
Returns whether the specified key is write locked.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is write locked.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, iLocked, iReadLocked, iWriteLocked

iLocked

public final boolean iLocked(java.lang.Object key)
                      throws java.io.IOException
Returns whether the current ObjectStoreReference has locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is locked by the current ObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
isLocked, isReadLocked, isWriteLocked, iReadLocked, iWriteLocked

iReadLocked

public final boolean iReadLocked(java.lang.Object key)
                          throws java.io.IOException
Returns whether the current ObjectStoreReference has read locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is read locked by the current ObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, isWriteLocked, iLocked, iWriteLocked

iWriteLocked

public final boolean iWriteLocked(java.lang.Object key)
                           throws java.io.IOException
Returns whether the current ObjectStoreReference has write locked the specified key.

Parameters:
key - the key to test. key cannot be null.
Returns:
whether the specified key is write locked by the current ObjectStoreReference.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
isLocked, isReadLocked, isWriteLocked, iLocked, iReadLocked

lockCount

public int lockCount()
              throws java.io.IOException
Returns the number of locked keys.

Returns:
the number of locked keys.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.2.0 12/03/2002
See Also:
lockCount

lockCount

public int lockCount(java.lang.Object key)
              throws java.io.IOException
Returns the number of locks for the specified key.

Parameters:
key - the key check to use.
Returns:
the number of locks for the specified key.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
lockCount

locks

public java.util.Enumeration locks()
                            throws java.io.IOException
Returns an Enumeration of the locked keys.

Returns:
the Enumeration of the locked keys.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
locks, Enumeration, LinkedList

locks

public java.util.Enumeration locks(java.lang.Object key)
                            throws java.io.IOException
Returns an Enumeration of the locks on the specified key.

Parameters:
key - the object to use.
Returns:
the Enumeration of of the locks.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.4.0 08/23/2004
See Also:
locks, Enumeration, Lock

isOpen

public final boolean isOpen()
                     throws java.io.IOException
Returns whether the current ObjectStoreReference is still open.

Returns:
whether the current ObjectStoreReference is open.
Throws:
java.io.IOException - if an I/O exception occurred.
See Also:
open, close

getRandomAccessStream

public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key,
                                                                 boolean read_only)
                                                          throws java.io.IOException
Returns an ObjectStoreRandomAccessStream for the specified key.

Parameters:
key - the key to create an ObjectStoreRandomAccessStream for.
read_only - whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty byte[] value will be created.
Returns:
the ObjectStoreRandomAccessStream for the specified key. null if read only and the key did not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
ObjectStoreRandomAccessStream

getRandomAccessStream

public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key,
                                                                 java.lang.String class_name,
                                                                 boolean read_only)
                                                          throws java.io.IOException
Returns an ObjectStoreRandomAccessStream for the specified key.

Parameters:
key - the key to create an ObjectStoreRandomAccessStream for.
class_name - the name of the value type.
read_only - whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty value of the specfied class will be created.
Returns:
the ObjectStoreRandomAccessStream for the specified key. null if read only and the key did not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
ObjectStoreRandomAccessStream

getRandomAccessStream

public final ObjectStoreRandomAccessStream getRandomAccessStream(java.lang.Object key,
                                                                 int type,
                                                                 boolean read_only)
                                                          throws java.io.IOException
Returns an ObjectStoreRandomAccessStream for the specified key.

Parameters:
key - the key to create an ObjectStoreRandomAccessStream for.
type - the value type.
read_only - whether read-only or whether updates are allowed. If not read-only and the key does not exist then an empty value of the specfied class will be created.
Returns:
the ObjectStoreRandomAccessStream for the specified key. null if read only and the key did not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
ObjectStoreRandomAccessStream

getInputStream

public final ObjectStoreInputStream getInputStream(java.lang.Object key)
                                            throws java.io.IOException
Returns an ObjectStoreInputStream for the specified key.

Parameters:
key - the key to create an ObjectStoreInputStream for.
Returns:
the ObjectStoreInputStream for the specified key. null if the key does not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
getOutputStream, ObjectStoreInputStream

getOutputStream

public final ObjectStoreOutputStream getOutputStream(java.lang.Object key,
                                                     int type,
                                                     boolean append)
                                              throws java.io.IOException
Returns an ObjectStoreOutputStream for the specified key.

Parameters:
key - the key to create an ObjectStoreOutputStream for.
type - the value type.
append - whether to append to any existing value or whether to delete any exist value and create a new value.
Returns:
the ObjectStoreOutputStream for the specified key. Creates the key if it does not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
getInputStream, ObjectStoreOutputStream

getOutputStream

public final ObjectStoreOutputStream getOutputStream(java.lang.Object key,
                                                     java.lang.String class_name,
                                                     boolean append)
                                              throws java.io.IOException
Returns an ObjectStoreOutputStream for the specified key.

Parameters:
key - the key to create an ObjectStoreOutputStream for.
class_name - the name of the value type.
append - whether to append to any existing value or whether to delete any exist value and create a new value.
Returns:
the ObjectStoreOutputStream for the specified key. Creates the key if it does not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
getInputStream, ObjectStoreOutputStream

getOutputStream

public final ObjectStoreOutputStream getOutputStream(java.lang.Object key)
                                              throws java.io.IOException
Returns an ObjectStoreOutputStream for the specified key.

Deletes any existing value and creates a new value.

Parameters:
key - the key to create an ObjectStoreOutputStream for.
Returns:
the ObjectStoreOutputStream for the specified key. Creates the key if it does not exist.
Throws:
java.io.IOException - if an I/O exception occurred.
Since:
1.3.0 10/19/2003
See Also:
getInputStream, ObjectStoreOutputStream

getFilename

public final java.lang.String getFilename()
Returns the filename of the store this reference references.

Returns:
the filename of the store this reference references.
Since:
1.3.1 11/26/2003

Servertec
Persistent Object Store
1.4.1 09/04/2005

Copyright © 2001-2005 Servertec. All rights reserved.