org.apache.jdo.impl.fostore
Interface RequestFactory

All Known Implementing Classes:
BufferedRequestFactory

interface RequestFactory

Creates different kinds of requests.

Author:
Dave Bristor

Method Summary
 ActivateClassRequest getActivateClassRequest(java.lang.Class cls, Message m, FOStorePMF pmf)
          Creates a request object to activate the class corresponding to the given oid.
 BeginTxRequest getBeginTxRequest(Message m, FOStorePMF pmf, boolean optimistic)
          Creates a request object which notifies the store of the kind of transaction that is starting.
 CommitRequest getCommitRequest(Message m, FOStorePMF pmf)
          Creates a request object which causes previous operations to commit.
 CreateOIDRequest getCreateOIDRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, OID oid, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object that will get a datastore OID for a provisional OID.
 DeleteRequest getDeleteRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause a persistent object in the store to be deleted.
 DumpRequest getDumpRequest(DumpOption option, java.lang.String className, Message m, FOStorePMF pmf)
          Creates a request object to get information from the store.
 FetchRequest getFetchRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause one or more fields of a persistent object to be read from the store.
 GetClassRequest getGetClassRequest(CLID clid, Message m, FOStorePMF pmf, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object to cause the java.lang.Class associated with the given CLID to be provided.
 GetExtentRequest getGetExtentRequest(FOStoreExtent extent, java.lang.Class pcClass, boolean subclasses, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object to cause a particular class's extent to be retrieved.
 GetInstancesRequest getGetInstancesRequest(java.util.ArrayList oids, int start, int numInstances, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm, java.lang.Class cls)
          Creates a request to get instances for some oids.
 InsertRequest getInsertRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause a persistent object to be inserted into the datastore.
 RollbackRequest getRollbackRequest(Message m, FOStorePMF pmf)
          Creates a request object which causes previous operations to rollback.
 UpdateRequest getUpdateRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, java.util.BitSet loadedFields, java.util.BitSet dirtyFields, boolean optimistic)
          Creates a request object to cause one or more fields of a persistent object to be updated in the store.
 VerifyRequest getVerifyRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, boolean verifyFields, java.util.BitSet loadedFields)
          Creates a request object to verify that in-memory data is the same as that in the database.
 

Method Detail

getCreateOIDRequest

public CreateOIDRequest getCreateOIDRequest(org.apache.jdo.state.StateManagerInternal sm,
                                            Message m,
                                            FOStorePMF pmf,
                                            OID oid,
                                            org.apache.jdo.pm.PersistenceManagerInternal pm)
Creates a request object that will get a datastore OID for a provisional OID.


getActivateClassRequest

public ActivateClassRequest getActivateClassRequest(java.lang.Class cls,
                                                    Message m,
                                                    FOStorePMF pmf)
Creates a request object to activate the class corresponding to the given oid.

Parameters:
cls - Class to be activated.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getInsertRequest

public InsertRequest getInsertRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf)
Creates a request object to cause a persistent object to be inserted into the datastore.

Parameters:
sm - StateManagerInternal of the object to be stored in the datastore.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getUpdateRequest

public UpdateRequest getUpdateRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf,
                                      java.util.BitSet loadedFields,
                                      java.util.BitSet dirtyFields,
                                      boolean optimistic)
Creates a request object to cause one or more fields of a persistent object to be updated in the store.

Parameters:
sm - StateManagerInternal of the object to be updated.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
loadedFields - Set of fields loaded from the database.
dirtyFields - Set of fields that are to be flushed and verified against the those in the database, if this update is within the context of an optimistic transaction.
optimistic - If true, then update is happening in context of optimistic transaction, otherwise datastore transaction.

getVerifyRequest

public VerifyRequest getVerifyRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf,
                                      boolean verifyFields,
                                      java.util.BitSet loadedFields)
Creates a request object to verify that in-memory data is the same as that in the database.

Parameters:
sm - StateManagerInternal of the object to be verified.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
verifyFields - If true, verify values of object, otherwise verify only existence (and ignore remaining parameters).
loadedFields - Set of fields to be verified against those in the database.

getFetchRequest

public FetchRequest getFetchRequest(org.apache.jdo.state.StateManagerInternal sm,
                                    Message m,
                                    FOStorePMF pmf)
Creates a request object to cause one or more fields of a persistent object to be read from the store.

Parameters:
sm - StateManagerInternal of the object whose field(s) are to be read.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getGetExtentRequest

public GetExtentRequest getGetExtentRequest(FOStoreExtent extent,
                                            java.lang.Class pcClass,
                                            boolean subclasses,
                                            Message m,
                                            org.apache.jdo.pm.PersistenceManagerInternal pm)
Creates a request object to cause a particular class's extent to be retrieved.

Parameters:
extent - FOStoreExtent for which the request is being created.
pcClass - Class of the objects whose extent is sought. It is required that the caller ensure that the given pcClass implement javax.jdo.PersistenceCapable.
subclasses - If false, retrieve instances of pcClass only; if true retrieve those plus all instances of subclasses of pcClass.
m - Message by which the request is to be sent to the store.
pm - PersistenceManager on whose behalf the request is taking place.

getGetInstancesRequest

public GetInstancesRequest getGetInstancesRequest(java.util.ArrayList oids,
                                                  int start,
                                                  int numInstances,
                                                  Message m,
                                                  org.apache.jdo.pm.PersistenceManagerInternal pm,
                                                  java.lang.Class cls)
Creates a request to get instances for some oids.

Parameters:
oids - List of oids for which instances are needed.
start - Starting index in oids for which instances are needed.
numInstances - Number of instances which are needed.
pm - PersistenceManager on whose behalf the request is taking place.
cls - Candidate Class for which instances are being obtained.

getDeleteRequest

public DeleteRequest getDeleteRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf)
Creates a request object to cause a persistent object in the store to be deleted.

Parameters:
sm - StateManagerInternal of the object to delete in the store.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getGetClassRequest

public GetClassRequest getGetClassRequest(CLID clid,
                                          Message m,
                                          FOStorePMF pmf,
                                          org.apache.jdo.pm.PersistenceManagerInternal pm)
Creates a request object to cause the java.lang.Class associated with the given CLID to be provided.

Parameters:
clid - CLID of the class that is needed.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
pm - PersistenceManager used to load the class. place.

getBeginTxRequest

public BeginTxRequest getBeginTxRequest(Message m,
                                        FOStorePMF pmf,
                                        boolean optimistic)
Creates a request object which notifies the store of the kind of transaction that is starting.

Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
optimistic - Indicates whether an optimistic or datastore transaction is beginning.

getCommitRequest

public CommitRequest getCommitRequest(Message m,
                                      FOStorePMF pmf)
Creates a request object which causes previous operations to commit.

Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getRollbackRequest

public RollbackRequest getRollbackRequest(Message m,
                                          FOStorePMF pmf)
Creates a request object which causes previous operations to rollback.

Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.

getDumpRequest

public DumpRequest getDumpRequest(DumpOption option,
                                  java.lang.String className,
                                  Message m,
                                  FOStorePMF pmf)
Creates a request object to get information from the store.

Parameters:
option - Diagnostic parameter code.
className - Optional class name.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.