|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.fostore.AbstractRequest
org.apache.jdo.impl.fostore.AbstractFieldRequest
org.apache.jdo.impl.fostore.InsertRequest
Represents a request to write a new object to the datastore.
Field Summary | |
private int[] |
clidOffsets
|
private java.util.Set |
clids
|
private java.lang.Class |
cls
|
protected FOStoreSchemaUID |
fsuid
uid corresponding to the same java.lang.Class that initializes jdoClass. |
protected org.apache.jdo.model.jdo.JDOClass |
jdoClass
Class meta data of the object represented by the constructor's given state manager |
protected static int |
LENGTH_COOKIE
|
(package private) static org.apache.commons.logging.Log |
logger
Logger |
private FOStoreModel |
model
|
protected static org.apache.jdo.util.I18NHelper |
msg
|
private int |
numClidOffsets
|
private int |
numOidOffsets
|
private OID |
oid
|
private java.util.ArrayList |
oidOffsets
|
protected FOStoreOutput |
out
Stream to which request writes itself. |
protected FOStorePMF |
pmf
PersistenceManagerFactory via which request is being done. |
protected org.apache.jdo.state.StateManagerInternal |
sm
The state manager which is the subject of this request. |
Constructor Summary | |
(package private) |
InsertRequest(org.apache.jdo.state.StateManagerInternal sm,
Message m,
FOStorePMF pmf)
|
Method Summary | |
private void |
addArrayCLIDs(java.lang.Object arr)
|
private void |
addCLID(java.lang.Object o)
|
private void |
addCollectionCLIDs(java.util.Collection c)
|
private void |
addMapCLIDs(java.util.Map m)
|
void |
doRequest()
Does whatever it is that the kind of request does in actually making a request of the store. |
protected void |
doRequestBody()
Provides detail about data being inserted in an InsertRequest. |
boolean |
fetchBooleanField(int fieldNum)
|
byte |
fetchByteField(int fieldNum)
|
char |
fetchCharField(int fieldNum)
|
double |
fetchDoubleField(int fieldNum)
|
float |
fetchFloatField(int fieldNum)
|
int |
fetchIntField(int fieldNum)
|
long |
fetchLongField(int fieldNum)
|
java.lang.Object |
fetchObjectField(int fieldNum)
|
short |
fetchShortField(int fieldNum)
|
java.lang.String |
fetchStringField(int fieldNum)
|
protected RequestId |
getId()
|
protected OID |
getOID()
|
org.apache.jdo.state.StateManagerInternal |
getStateManager()
Get the StateManager associated with this request, null if none. |
void |
handleReply(Status status,
java.io.DataInput in,
int length)
Reads the oid, and notifies the persistence manager and state manager of the new oid. |
private void |
insertFields(int[] fields,
boolean identifying)
Writes values of the specified fields. |
void |
storeBooleanField(int fieldNum,
boolean value)
|
void |
storeByteField(int fieldNum,
byte value)
|
void |
storeCharField(int fieldNum,
char value)
|
void |
storeDoubleField(int fieldNum,
double value)
|
void |
storeFloatField(int fieldNum,
float value)
|
void |
storeIntField(int fieldNum,
int value)
|
void |
storeLongField(int fieldNum,
long value)
|
void |
storeObjectField(int fieldNum,
java.lang.Object value)
|
void |
storeShortField(int fieldNum,
short value)
|
void |
storeStringField(int fieldNum,
java.lang.String value)
|
protected int |
writeBlock(int[] fields,
boolean identifying)
Writes a data block, which consists of the values of the specified fields, plus the CLID's and corresponding class names of referenced objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final OID oid
private final FOStoreModel model
private final java.lang.Class cls
private java.util.Set clids
private java.util.ArrayList oidOffsets
private int numOidOffsets
private int[] clidOffsets
private int numClidOffsets
protected org.apache.jdo.state.StateManagerInternal sm
protected final FOStorePMF pmf
protected final FOStoreOutput out
protected org.apache.jdo.model.jdo.JDOClass jdoClass
protected FOStoreSchemaUID fsuid
protected static final org.apache.jdo.util.I18NHelper msg
static final org.apache.commons.logging.Log logger
protected static final int LENGTH_COOKIE
Constructor Detail |
InsertRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
Method Detail |
protected void doRequestBody() throws java.io.IOException
oid: OID length of data block containing classname, field values, CLID info: int className: String (fully qualified name of class of object) fostoreSchemaUID for class length of the field values part of this block: int fieldValue: Object... (repeats numFields times) number of [CLID, classname] pairs for Object fields of this object [CLID, classname]... (the following are not in the above noted length bytes of this block) number of provisional OID's written in this request OID offset... number of the above written CLIDs that are provisional CLID offset...In the case of both the OID and CLID offsets, the offset is from the beginning of the block. In the case of the CLIDs and the OID and CLID offsets, the size of each set written may be zero but that size is always written.
Note that the number of CLID/classname pairs and the CLID/classname pairs themselves are part of the data block that is intended to be stored by the database server (and hence later returned upon fetch/getExtent). That is, the size written includes those pairs. The offsets, however, are not part of the datablock; they are used by the database server and discarded.
doRequestBody
in class AbstractRequest
java.io.IOException
AbstractRequest.doRequestBody()
public void handleReply(Status status, java.io.DataInput in, int length) throws java.io.IOException
in
- the input stream.length
- the length of data in the stream.status
- Indication as to the success, failure, etc. of the
request as handled by the store.
java.io.IOException
- if any problems reading the stream.Request.handleReply(org.apache.jdo.impl.fostore.Status, java.io.DataInput, int)
public void storeBooleanField(int fieldNum, boolean value)
storeBooleanField
in interface org.apache.jdo.state.FieldManager
storeBooleanField
in class AbstractFieldRequest
FieldManager.storeBooleanField(int fieldNum,
boolean value)
public void storeCharField(int fieldNum, char value)
storeCharField
in interface org.apache.jdo.state.FieldManager
storeCharField
in class AbstractFieldRequest
FieldManager.storeCharField(int fieldNum,
char value)
public void storeByteField(int fieldNum, byte value)
storeByteField
in interface org.apache.jdo.state.FieldManager
storeByteField
in class AbstractFieldRequest
FieldManager.storeByteField(int fieldNum,
byte value)
public void storeShortField(int fieldNum, short value)
storeShortField
in interface org.apache.jdo.state.FieldManager
storeShortField
in class AbstractFieldRequest
FieldManager.storeShortField(int fieldNum,
short value)
public void storeIntField(int fieldNum, int value)
storeIntField
in interface org.apache.jdo.state.FieldManager
storeIntField
in class AbstractFieldRequest
FieldManager.storeIntField(int fieldNum, int value)
public void storeLongField(int fieldNum, long value)
storeLongField
in interface org.apache.jdo.state.FieldManager
storeLongField
in class AbstractFieldRequest
FieldManager.storeLongField(int fieldNum,
long value)
public void storeFloatField(int fieldNum, float value)
storeFloatField
in interface org.apache.jdo.state.FieldManager
storeFloatField
in class AbstractFieldRequest
FieldManager.storeFloatField(int fieldNum,
float value)
public void storeDoubleField(int fieldNum, double value)
storeDoubleField
in interface org.apache.jdo.state.FieldManager
storeDoubleField
in class AbstractFieldRequest
FieldManager.storeDoubleField(int fieldNum,
double value)
public void storeStringField(int fieldNum, java.lang.String value)
storeStringField
in interface org.apache.jdo.state.FieldManager
storeStringField
in class AbstractFieldRequest
FieldManager.storeStringField(int fieldNum,
String value)
public void storeObjectField(int fieldNum, java.lang.Object value)
storeObjectField
in interface org.apache.jdo.state.FieldManager
storeObjectField
in class AbstractFieldRequest
FieldManager.storeObjectField(int fieldNum,
Object value)
protected OID getOID()
protected int writeBlock(int[] fields, boolean identifying) throws java.io.IOException
fields
- Field numbers of the fields to be writtenidentifying
- If true, write before/flushed image fields,
otherwise write current fields.
java.io.IOException
private void insertFields(int[] fields, boolean identifying) throws java.io.IOException
java.io.IOException
private void addCollectionCLIDs(java.util.Collection c)
private void addMapCLIDs(java.util.Map m)
private void addArrayCLIDs(java.lang.Object arr)
private void addCLID(java.lang.Object o)
public boolean fetchBooleanField(int fieldNum)
fetchBooleanField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchBooleanField(int fieldNum)
public char fetchCharField(int fieldNum)
fetchCharField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchCharField(int fieldNum)
public byte fetchByteField(int fieldNum)
fetchByteField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchByteField(int fieldNum)
public short fetchShortField(int fieldNum)
fetchShortField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchShortField(int fieldNum)
public int fetchIntField(int fieldNum)
fetchIntField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchIntField(int fieldNum)
public long fetchLongField(int fieldNum)
fetchLongField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchLongField(int fieldNum)
public float fetchFloatField(int fieldNum)
fetchFloatField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchFloatField(int fieldNum)
public double fetchDoubleField(int fieldNum)
fetchDoubleField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchDoubleField(int fieldNum)
public java.lang.String fetchStringField(int fieldNum)
fetchStringField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchStringField(int fieldNum)
public java.lang.Object fetchObjectField(int fieldNum)
fetchObjectField
in interface org.apache.jdo.state.FieldManager
FieldManager.fetchObjectField(int fieldNum)
protected RequestId getId()
public final void doRequest() throws java.io.IOException
Request
doRequest
in interface Request
java.io.IOException
- in case of errors with the stream.Request.doRequest()
public org.apache.jdo.state.StateManagerInternal getStateManager()
getStateManager
in interface Request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |