|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jdo.impl.fostore.OID
org.apache.jdo.impl.fostore.AID
Represents the identity of a JDO object in the File/Object store. This implementation uses application identity. The identity is based on the class of the object and a byte[] buffer that represents values in the user object Id instance which creates a unique identifier within that class. These ID's are unique only within a single datastore.
| Field Summary | |
private byte[] |
buffer
|
private int |
hashCode
|
private static char[] |
hexDigit
A table of hex digits |
private static javax.jdo.spi.JDOImplHelper |
jdoImplHelper
JDOImplHelper instance |
private static I18NHelper |
msg
I18N support. |
private long |
sCLIDBits
|
| Fields inherited from class org.apache.jdo.impl.fostore.OID |
CLID_MASK, CLID_SHIFT, logger, MAX_CLID, MAX_UID, oid, PROV_CLID_MASK, PROV_UID_MASK, RESERVED_MASK, RESERVED_SHIFT, UID_MASK |
| Constructor Summary | |
AID()
Default constructor. |
|
AID(long oid)
Creates an AID with the given value. |
|
| Method Summary | |
private long |
computeUID()
Compute unique user Id from the buffer. |
(package private) OID |
copy()
Returns copy of the requested oid. |
(package private) void |
copyKeyFieldsToPC(StateManagerInternal sm,
FOStorePMF pmf,
java.lang.Class pcClass,
int[] pkfields)
Copy key fields from OID into PC instance. |
(package private) static AID |
create(java.lang.Class pcClass,
javax.jdo.spi.PersistenceCapable pc,
java.lang.Object userOid,
PersistenceManagerInternal pm,
FOStorePMF pmf)
Create and return a new instance of AID. |
private void |
createBuffer(java.lang.Object userOid,
java.lang.Class pcClass,
FOStorePMF pmf,
boolean fromPC,
javax.jdo.spi.PersistenceCapable pc)
|
boolean |
equals(java.lang.Object other)
Determines if this AID is equal to another. |
(package private) java.lang.Object |
getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
Returns copy of the requested oid to be accessed by the user. |
int |
hashCode()
Provides a unique hashCode for this AID. |
(package private) boolean |
isApplicationIdentity()
Returns true for application identity type for this OID. |
(package private) boolean |
isDataStoreIdentity()
Returns false for datastore identity type for this OID. |
java.lang.String |
oidString()
Returns the id itself in String form, for debugging. |
(package private) void |
readBuffer(java.io.DataInput in)
Reads AID buffer's value from the input stream. |
void |
readObject(java.io.ObjectInputStream in)
Reads this AID's value from the input stream. |
(package private) void |
replaceProvisionalOIDWithReal(OID realOID,
FOStorePMF pmf,
StateManagerInternal sm)
Replaces provisional oid with real oid (datastore identity only) |
private void |
setSuperCLIDBits(java.lang.Class pcClass,
java.lang.Class keyClass,
PersistenceManagerInternal pm,
FOStorePMF pmf)
Sets CLID bits for the superclass that corresponds to the user defined key class. |
private static java.lang.String |
toHexString(int b)
Covert byte into 2-digit hexadecimal String. |
java.lang.String |
toString()
Returns a String representation of this AID. |
(package private) void |
write(java.io.DataOutput out)
Writes this AID to the output stream. |
void |
writeObject(java.io.ObjectOutputStream out)
Writes this AID to the output stream. |
| Methods inherited from class org.apache.jdo.impl.fostore.OID |
compareTo, create, create, create, getCLID, getPCClass, getUID, isProvisional, keyValue, read, skip |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private byte[] buffer
private int hashCode
private long sCLIDBits
private static final I18NHelper msg
private static final javax.jdo.spi.JDOImplHelper jdoImplHelper
private static final char[] hexDigit
| Constructor Detail |
public AID()
public AID(long oid)
| Method Detail |
static AID create(java.lang.Class pcClass,
javax.jdo.spi.PersistenceCapable pc,
java.lang.Object userOid,
PersistenceManagerInternal pm,
FOStorePMF pmf)
public boolean equals(java.lang.Object other)
equals in class OIDother - The other AID in the equality comparison.
public java.lang.String toString()
toString in class OIDpublic java.lang.String oidString()
oidString in class OIDpublic int hashCode()
hashCode in class OIDboolean isApplicationIdentity()
isApplicationIdentity in class OIDboolean isDataStoreIdentity()
isDataStoreIdentity in class OIDjava.lang.Object getExternalObjectId(javax.jdo.spi.PersistenceCapable pc)
getExternalObjectId in class OID
public void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
java.io.IOException
public void readObject(java.io.ObjectInputStream in)
throws java.io.IOException
java.io.IOException
void write(java.io.DataOutput out)
throws java.io.IOException
write in class OIDjava.io.IOException
void readBuffer(java.io.DataInput in)
throws java.io.IOException
java.io.IOException
void replaceProvisionalOIDWithReal(OID realOID,
FOStorePMF pmf,
StateManagerInternal sm)
replaceProvisionalOIDWithReal in class OIDrealOID - as OID instancepmf - as FOStorePMFsm - as StateManagerInternalOID copy()
copy in class OID
void copyKeyFieldsToPC(StateManagerInternal sm,
FOStorePMF pmf,
java.lang.Class pcClass,
int[] pkfields)
copyKeyFieldsToPC in class OIDsm - as StateManagerInternalpmf - as FOStorePMFpcClass - Class of the PC instance.pkfields - array of PK field numbers.
private void createBuffer(java.lang.Object userOid,
java.lang.Class pcClass,
FOStorePMF pmf,
boolean fromPC,
javax.jdo.spi.PersistenceCapable pc)
private void setSuperCLIDBits(java.lang.Class pcClass,
java.lang.Class keyClass,
PersistenceManagerInternal pm,
FOStorePMF pmf)
pcClass - the class of the persisntence-capable instance or
null if not known.keyClass - the class of the user defined key or null if not
known.pm - the PersistenceManagerInternal that requested the operation.pmf - the FOStorePMF that requested the operation.private long computeUID()
private static java.lang.String toHexString(int b)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||