|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mm.sdk.common.DKDatastorePool
DKDatastorePool: A DKDatastorePool object will manage the datastore connection pool. An object can only handle the connection pool for one datastore type based on the full path java class name. Use getConnection(userid, password) and returnConnection(datastore) for the connected datastore with no session Id. And use getConnection(userid, password, sessionId) and returnConnection(DKSession) for the connected datastore with session Id. With the session Id you will get the same datastore back, but not guaranteed if you leave it in the pool too long. To guarantee the same connection information, after a connected datastore is created, you can not change the setted information including datastore name, connect string, configuration string, maxPoolSize, minPoolsize, time out etc.
Fields inherited from interface com.ibm.mm.sdk.common.DKConstant |
For details, see the class or interface |
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId |
For details, see the class or interface |
Constructor Summary | |
DKDatastorePool(java.lang.String fullClassName)
Constructs the datastore pool and indicates the type of datastore based on the fullClassName. |
Method Summary | |
void |
clearConnections()
Clears this object instance including all the setted data and the connections in the free pool. |
java.lang.String |
datastoreType()
Gets the datastore type for this datastore pool objects A instance of DKDatastorePool can only handle one datastore type |
void |
destroy()
Destroy this data object including all connections in both free pool and used pool |
java.lang.String |
getConfigurationString()
Gets the configuration string which supplies the specific initialization parameters for datastore. |
dkDatastore |
getConnection(java.lang.String userId,
java.lang.String passwd)
Gets a connected datastore with no session Id from the pool This will search the connected datastore with no session Id, if no matched one it will create a new one. |
DKDatastoreSession |
getConnection(java.lang.String userId,
java.lang.String passwd,
int aSessionId)
Gets a connected datastore with sessionId from the pool |
java.lang.String |
getConnectString()
Gets the connection string that is used to provide additional connection options. |
java.lang.String |
getDatastoreName()
Gets the name of the datastore object. |
int |
getMaxPoolSize()
Gets the maximum number of connections that the pool should contain. |
int |
getMinPoolSize()
Gets the minimum number of connections that the pool should keep. |
int |
getTimeOut()
Gets the number of minutes that a datastore connection should remain unused in the pool before the datastore is disconnect & destroyed. |
void |
initConnections(java.lang.String userId,
java.lang.String passwd,
int initSize)
Initialize number of connections and store them in the pool This is only for the datastore with no session Id |
void |
returnConnection(dkDatastore ds)
Returns a connected datastore with no session Id to the pool |
void |
returnConnection(DKDatastoreSession aDSsession)
Returns a connected datastore with session Id to the pool |
void |
setConfigurationString(java.lang.String configString)
Sets the configuration string which supplies the specific initialization parameters for datastore. |
void |
setConnectString(java.lang.String connectString)
Sets the connection string that is used to provide additional connection options. |
void |
setDatastoreName(java.lang.String aDSName)
Sets the name of the datastore object. |
void |
setMaxPoolSize(int poolSize)
Sets the maximum number of connections that the pool should contain. |
void |
setMinPoolSize(int poolSize)
Sets the minimum number of connections that the pool should keep. |
void |
setNextLevel(DKNVPair nvp)
Sets the next level pool. |
void |
setTimeOut(int timeOut)
Sets the number of minutes that a datastore connection should remain unused in the pool before the datastore is disconnect & destroyed. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DKDatastorePool(java.lang.String fullClassName) throws DKException, java.lang.Exception
fullClassName
- a full path java class name
For example: com.ibm.mm.sdk.server.DKDatastoreDL indicates this pool is for DL datastore type in server package.
Method Detail |
public java.lang.String getDatastoreName()
public void setDatastoreName(java.lang.String aDSName) throws DKException, java.lang.Exception
aDSName
- a datastore namepublic java.lang.String getConnectString()
public void setConnectString(java.lang.String connectString) throws DKException, java.lang.Exception
connectString
- the connect string used for connection. This
is used to provide additional connection options.public java.lang.String getConfigurationString()
public void setConfigurationString(java.lang.String configString) throws DKException, java.lang.Exception
Once a datastore has been created and connected, you can not set this to a different configuration string
configString
- for example: the location of the CC2MIME filepublic int getMaxPoolSize()
public void setMaxPoolSize(int poolSize) throws DKException, java.lang.Exception
poolSize
- the maximum number of connection pool sizepublic int getMinPoolSize()
public void setMinPoolSize(int poolSize) throws DKException, java.lang.Exception
poolSize
- the minimum number of connection pool sizepublic int getTimeOut()
public void setTimeOut(int timeOut) throws DKException, java.lang.Exception
timeOut
- the number of minutespublic void setNextLevel(DKNVPair nvp) throws DKException, java.lang.Exception
nvp
- specify pool object to use in name-value pair
The valid names are:
for example to use DKPoolJDBC the name-value will be "dkPool" - aDKPoolJDBC instant. To use DKDatastorePool the name-value will be "DKDatastorePool"- aDKDatastorePool instance.
public java.lang.String datastoreType() throws java.lang.Exception
public dkDatastore getConnection(java.lang.String userId, java.lang.String passwd) throws DKException, java.lang.Exception
userId
- the user name used for connectionpasswd
- the password used for connectionpublic DKDatastoreSession getConnection(java.lang.String userId, java.lang.String passwd, int aSessionId) throws DKException, java.lang.Exception
userId
- the user name used for connectionpasswd
- the password used for connectionaSessionId
- a specified datastore session Id
if aSessionId is ==0, it will return a DKDatastoreSession object that contains a new connected datastore with next avaliable session Id. When reach the max pool, it will search the available datastore with no session Id and return DKDatastoreSession containing datastore & next available session Id. Application should call DKDatastoreSession getId() to obtain the session Id.
if aSessionId is >0, the following search sequence will be performed:
The application should call DKDatastoreSession getDatastore() to obtain the dkDatastore and getId() to check the session Id.
public void returnConnection(dkDatastore ds) throws DKException, java.lang.Exception
ds
- a connected datastorepublic void returnConnection(DKDatastoreSession aDSsession) throws DKException, java.lang.Exception
aDsSession
- a DKDatastoreSession object instancepublic void initConnections(java.lang.String userId, java.lang.String passwd, int initSize) throws DKException, java.lang.Exception
userId
- the user Id used for connectionpasswd
- the password used for connectioninitSize
- the number of connected datastore to be createdpublic void clearConnections() throws DKException, java.lang.Exception
public void destroy() throws DKException, java.lang.Exception
|
EIP Java APIs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |