|
||||||||||
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.GetExtentRequest
Represents a request to get the extent of a class and possibly its subclasses.
Field Summary | |
private java.lang.Class |
cls
The class of the extent sought by this request. |
private FOStoreExtent |
extent
Extent returned to user. |
protected FOStoreSchemaUID |
fsuid
uid corresponding to the same java.lang.Class that initializes jdoClass. |
private java.util.ArrayList |
instances
List of returned instances |
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 static int |
maxInstances
Maximum number of instances that should be returned at a time. |
protected static org.apache.jdo.util.I18NHelper |
msg
|
private java.util.ArrayList |
oids
List of returned object Ids |
protected FOStoreOutput |
out
Stream to which request writes itself. |
private org.apache.jdo.pm.PersistenceManagerInternal |
pm
The PersistenceManagerInternal that is making this request. |
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. |
private boolean |
subclasses
If true retrieve instances of cls and its subclasses, otherwise just of cls. |
Constructor Summary | |
(package private) |
GetExtentRequest(FOStoreExtent extent,
java.lang.Class cls,
boolean subclasses,
Message m,
org.apache.jdo.pm.PersistenceManagerInternal pm)
|
Method Summary | |
void |
doRequest()
Does whatever it is that the kind of request does in actually making a request of the store. |
protected void |
doRequestBody()
Subclasses must implement in this method the actual writing of their Request type-specific data. |
(package private) javax.jdo.Extent |
getExtent()
Returns the Extent associated with this request |
protected RequestId |
getId()
|
(package private) java.util.ArrayList |
getInstances()
Returns the list of instances |
(package private) int |
getMaxInstances()
Returns max number of instances |
(package private) java.util.ArrayList |
getOIDs()
Returns the list of object id's |
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)
Handles replies to GetExtentRequests. |
(package private) static java.util.ArrayList |
readInstances(java.io.DataInput in,
int numInstances,
FOStoreModel model,
org.apache.jdo.pm.PersistenceManagerInternal pm,
java.lang.Class cls)
Reads instances from given DataInput using a FieldFetcher . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final org.apache.jdo.pm.PersistenceManagerInternal pm
private final java.lang.Class cls
private final boolean subclasses
private static final int maxInstances
private FOStoreExtent extent
private java.util.ArrayList instances
private java.util.ArrayList oids
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 |
GetExtentRequest(FOStoreExtent extent, java.lang.Class cls, boolean subclasses, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm)
Method Detail |
protected void doRequestBody() throws java.io.IOException
AbstractRequest
doRequestBody
in class AbstractRequest
java.io.IOException
AbstractRequest.doRequestBody()
,
InsertRequest.doRequestBody()
public void handleReply(Status status, java.io.DataInput in, int length) throws java.io.IOException
int: count of number of instances in the extent int: count of the number of instances returned int: count of the number of oids returned that many instancesThe number of instances returned + number of oid returned = number of instances in the extent. This is for performance: we don't want to return *all* the instances at once: we return some, plus information so that we can get the rest, if the user requests so.
The status might be Status.WARN, in which case there were OID's in the database extent which were unreadable. But the count should be for the actual number of objects returned.
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.static java.util.ArrayList readInstances(java.io.DataInput in, int numInstances, FOStoreModel model, org.apache.jdo.pm.PersistenceManagerInternal pm, java.lang.Class cls) throws java.io.IOException
FieldFetcher
.
in
- DataInput from which instances are read.numInstances
- Number of instances to read from in
.model
- Model required to by FieldFetcher
.pm
- PersistenceManagerInternal required FieldFetcher
.cls
- Candidate Class for which instances are being obtained.
java.io.IOException
int getMaxInstances()
java.util.ArrayList getInstances()
java.util.ArrayList getOIDs()
javax.jdo.Extent getExtent()
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 |