org.apache.jdo.impl.fostore
Class GetInstancesRequest

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.AbstractRequest
      extended byorg.apache.jdo.impl.fostore.GetInstancesRequest
All Implemented Interfaces:
Request

class GetInstancesRequest
extends AbstractRequest

Represents a request to fetch a batch of instances.

Author:
Dave Bristor

Field Summary
private  java.lang.Class cls
          Candidate class for which instances are being obtained.
protected  FOStoreSchemaUID fsuid
          uid corresponding to the same java.lang.Class that initializes jdoClass.
private  java.util.ArrayList instances
          ArrayList returned to user.
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
protected static org.apache.jdo.util.I18NHelper msg
           
private  int numInstances
          Number of instances to get.
private  java.util.ArrayList oids
          List of oids from which we get instances.
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  int start
          Starting position in oids ArrayList.
 
Constructor Summary
(package private) GetInstancesRequest(java.util.ArrayList oids, int start, int numInstances, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm, java.lang.Class cls)
           
 
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.
protected  RequestId getId()
           
(package private)  java.util.ArrayList getInstances()
           
 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)
          Processes the results of the effect of the request in the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oids

private final java.util.ArrayList oids
List of oids from which we get instances.


start

private final int start
Starting position in oids ArrayList.


numInstances

private final int numInstances
Number of instances to get.


pm

private final org.apache.jdo.pm.PersistenceManagerInternal pm
The PersistenceManagerInternal that is making this request.


cls

private final java.lang.Class cls
Candidate class for which instances are being obtained.


instances

private java.util.ArrayList instances
ArrayList returned to user.


sm

protected org.apache.jdo.state.StateManagerInternal sm
The state manager which is the subject of this request.


pmf

protected final FOStorePMF pmf
PersistenceManagerFactory via which request is being done.


out

protected final FOStoreOutput out
Stream to which request writes itself.


jdoClass

protected org.apache.jdo.model.jdo.JDOClass jdoClass
Class meta data of the object represented by the constructor's given state manager


fsuid

protected FOStoreSchemaUID fsuid
uid corresponding to the same java.lang.Class that initializes jdoClass.


msg

protected static final org.apache.jdo.util.I18NHelper msg

logger

static final org.apache.commons.logging.Log logger
Logger


LENGTH_COOKIE

protected static final int LENGTH_COOKIE
See Also:
Constant Field Values
Constructor Detail

GetInstancesRequest

GetInstancesRequest(java.util.ArrayList oids,
                    int start,
                    int numInstances,
                    Message m,
                    org.apache.jdo.pm.PersistenceManagerInternal pm,
                    java.lang.Class cls)
Method Detail

getInstances

java.util.ArrayList getInstances()

doRequestBody

protected void doRequestBody()
                      throws java.io.IOException
Description copied from class: AbstractRequest
Subclasses must implement in this method the actual writing of their Request type-specific data.

Specified by:
doRequestBody in class AbstractRequest
Throws:
java.io.IOException

handleReply

public void handleReply(Status status,
                        java.io.DataInput in,
                        int length)
                 throws java.io.IOException
Description copied from interface: Request
Processes the results of the effect of the request in the store. To be invoked after the store has processed the request, and has returned information about that request, such as its status and any accompanying data.

Parameters:
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.
Throws:
java.io.IOException - if any problems reading the stream.

getId

protected RequestId getId()

doRequest

public final void doRequest()
                     throws java.io.IOException
Description copied from interface: Request
Does whatever it is that the kind of request does in actually making a request of the store.

Specified by:
doRequest in interface Request
Throws:
java.io.IOException - in case of errors with the stream.
See Also:
Request.doRequest()

getStateManager

public org.apache.jdo.state.StateManagerInternal getStateManager()
Get the StateManager associated with this request, null if none.

Specified by:
getStateManager in interface Request
Returns:
the StateManager.