org.neodatis.odb.impl.main
Class ODBExtImpl

java.lang.Object
  extended by org.neodatis.odb.impl.main.ODBExtImpl
All Implemented Interfaces:
ODBExt

public class ODBExtImpl
extends java.lang.Object
implements ODBExt


Field Summary
protected  IStorageEngine engine
           
 
Constructor Summary
ODBExtImpl(IStorageEngine storageEngine)
           
 
Method Summary
 ExternalOID convertToExternalOID(OID oid)
          Convert an OID to External OID
 TransactionId getCurrentTransactionId()
          Gets the current transaction Id
 DatabaseId getDatabaseId()
          Get the Database ID
 long getObjectCreationDate(OID oid)
          Returns the object creation date in ms since 1/1/1970
 ExternalOID getObjectExternalOID(java.lang.Object object)
          Gets the external OID of an Object.
 long getObjectUpdateDate(OID oid, boolean useCache)
          Returns the object last update date in ms since 1/1/1970
 int getObjectVersion(OID oid, boolean useCache)
          Returns the object version of the object that has the specified OID
 OID replace(OID oid, java.lang.Object o)
          Replace the object with the specific OID by the object passed as a parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

protected IStorageEngine engine
Constructor Detail

ODBExtImpl

public ODBExtImpl(IStorageEngine storageEngine)
Method Detail

convertToExternalOID

public ExternalOID convertToExternalOID(OID oid)
Description copied from interface: ODBExt
Convert an OID to External OID

Specified by:
convertToExternalOID in interface ODBExt
Returns:
The external OID

getCurrentTransactionId

public TransactionId getCurrentTransactionId()
Description copied from interface: ODBExt
Gets the current transaction Id

Specified by:
getCurrentTransactionId in interface ODBExt
Returns:
The current transaction Id

getDatabaseId

public DatabaseId getDatabaseId()
Description copied from interface: ODBExt
Get the Database ID

Specified by:
getDatabaseId in interface ODBExt
Returns:

getObjectExternalOID

public ExternalOID getObjectExternalOID(java.lang.Object object)
Description copied from interface: ODBExt
Gets the external OID of an Object. The external OID contains the ID of the database + the oid of the object. The External OID can be used to identify objects outside the ODB database as it should be unique across databases. It can be used for example to implement a replication process.

Specified by:
getObjectExternalOID in interface ODBExt
Returns:

getObjectVersion

public int getObjectVersion(OID oid,
                            boolean useCache)
Description copied from interface: ODBExt
Returns the object version of the object that has the specified OID

Specified by:
getObjectVersion in interface ODBExt
useCache - if false, force a disk read. else use the version that has already been loaded in the cache
Returns:

getObjectCreationDate

public long getObjectCreationDate(OID oid)
Description copied from interface: ODBExt
Returns the object creation date in ms since 1/1/1970

Specified by:
getObjectCreationDate in interface ODBExt
Returns:
The creation date

getObjectUpdateDate

public long getObjectUpdateDate(OID oid,
                                boolean useCache)
Description copied from interface: ODBExt
Returns the object last update date in ms since 1/1/1970

Specified by:
getObjectUpdateDate in interface ODBExt
useCache - if false, force a disk read. else use the date that has already been loaded in the cache
Returns:
The last update date

replace

public OID replace(OID oid,
                   java.lang.Object o)
Description copied from interface: ODBExt
Replace the object with the specific OID by the object passed as a parameter

Specified by:
replace in interface ODBExt
Returns: