org.apache.directory.server.xdbm
Interface MasterTable<E>

All Superinterfaces:
Table<java.lang.Long,E>
All Known Implementing Classes:
JdbmMasterTable

public interface MasterTable<E>
extends Table<java.lang.Long,E>

A master table used to store indexible entries.

Version:
$Rev: 661851 $
Author:
Apache Directory Project

Field Summary
static java.lang.String DBF
          the base name for the db file for this table
static java.lang.String SEQPROP_KEY
          the sequence key - stores last sequence value in the admin table
 
Method Summary
 void delete(java.lang.Long id)
          Deletes a entry from this MasterTable at an index specified by id.
 E get(java.lang.Long id)
          Gets an entry from this MasterTable.
 java.lang.Long getCurrentId()
          Gets the value of the id sequence from this MasterTable's sequence without affecting the value.
 java.lang.Long getNextId()
          Gets the next value from the sequence of this MasterTable.
 java.lang.String getProperty(java.lang.String property)
          Gets a persistant property associated with this MasterTable.
 void put(java.lang.Long id, E entry)
          Puts an entry into this MasterTable with a specified unique id.
 void setProperty(java.lang.String property, java.lang.String value)
          Sets a persistant property associated with this MasterTable.
 
Methods inherited from interface org.apache.directory.server.xdbm.Table
close, count, count, cursor, cursor, getKeyComparator, getName, getValueComparator, greaterThanCount, has, has, hasGreaterOrEqual, hasGreaterOrEqual, hasLessOrEqual, hasLessOrEqual, isCountExact, isDupsEnabled, lessThanCount, remove, remove, valueCursor
 

Field Detail

DBF

static final java.lang.String DBF
the base name for the db file for this table

See Also:
Constant Field Values

SEQPROP_KEY

static final java.lang.String SEQPROP_KEY
the sequence key - stores last sequence value in the admin table

See Also:
Constant Field Values
Method Detail

get

E get(java.lang.Long id)
      throws java.lang.Exception
Gets an entry from this MasterTable.

Specified by:
get in interface Table<java.lang.Long,E>
Parameters:
id - the BigInteger id of the entry to retrieve.
Returns:
the entry with operational attributes and all.
Throws:
java.lang.Exception - if there is a read error on the underlying Db.

put

void put(java.lang.Long id,
         E entry)
         throws java.lang.Exception
Puts an entry into this MasterTable with a specified unique id. Used both to create new entries and update existing ones.

Specified by:
put in interface Table<java.lang.Long,E>
Parameters:
entry - the entry to add
id - unique identifier of the entry to put
Throws:
java.lang.Exception - if there is a write error on the underlying Db.

delete

void delete(java.lang.Long id)
            throws java.lang.Exception
Deletes a entry from this MasterTable at an index specified by id.

Parameters:
id - unique identifier of the entry to delete
Throws:
java.lang.Exception - if there is a write error on the underlying Db

getCurrentId

java.lang.Long getCurrentId()
                            throws java.lang.Exception
Gets the value of the id sequence from this MasterTable's sequence without affecting the value.

Throws:
java.lang.Exception - if the admin table storing sequences cannot be read

getNextId

java.lang.Long getNextId()
                         throws java.lang.Exception
Gets the next value from the sequence of this MasterTable. This has the side-effect of incrementing the sequence values perminantly.

Returns:
the current value of this MasterTable's sequence incremented by one
Throws:
java.lang.Exception - on failure to update the id sequence

getProperty

java.lang.String getProperty(java.lang.String property)
                             throws java.lang.Exception
Gets a persistant property associated with this MasterTable.

Parameters:
property - the key of the property to get the value of
Returns:
the value of the property
Throws:
java.lang.Exception - on failure to read the property

setProperty

void setProperty(java.lang.String property,
                 java.lang.String value)
                 throws java.lang.Exception
Sets a persistant property associated with this MasterTable.

Parameters:
property - the key of the property to set the value of
value - the value of the property
Throws:
java.lang.Exception - on failure to write the property


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.