com.sun.jdo.api.persistence.support
Interface PersistenceManagerFactory

All Superinterfaces:
java.io.Serializable

public interface PersistenceManagerFactory
extends java.io.Serializable

Version:
0.1
Author:
Craig Russell

Method Summary
 java.lang.String getConnectionDriverName()
          Returns JDBC driver name
 java.lang.Object getConnectionFactory()
          Returns Connection Factory object that can be one of ConnectionFactory or javax.sql.DataSource
 java.lang.String getConnectionFactoryName()
          Returns ConnectionFactory name
 int getConnectionLoginTimeout()
          Returns the number of seconds to wait for a new connection to be established to the data source
 java.io.PrintWriter getConnectionLogWriter()
          Returns the LogWriter to which messages should be sent
 int getConnectionMaxPool()
          Returns maximum number of connections in the connection pool
 int getConnectionMinPool()
          Returns minimum number of connections in the connection pool
 int getConnectionMsInterval()
          Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
 int getConnectionMsWait()
          Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
 int getConnectionTransactionIsolation()
          Returns current transaction isolation level for connections of this PersistenceManagerFactory.
 java.lang.String getConnectionURL()
          Returns connection URL
 java.lang.String getConnectionUserName()
          Returns database user name
 java.lang.String getIdentifier()
          Gets Identifier.
 boolean getIgnoreCache()
          Returns the boolean value for the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.
 int getMaxPool()
          Returns maximum number of PersistenceManager instances in the pool
 int getMinPool()
          Returns minimum number of PersistenceManager instances in the pool
 boolean getNontransactionalRead()
          Returns the boolean value for the flag that allows non-transactional instances to be managed in the cache.
 boolean getOptimistic()
          Returns the boolean value of the optimistic flag for all PersistenceManagers
 PersistenceManager getPersistenceManager()
          Creates new PersistenceManager without extra info
 PersistenceManager getPersistenceManager(java.lang.String username, java.lang.String password)
          Creates new PersistenceManager with specific username and password.
 java.util.Properties getProperties()
          Returns non-operational properties to be available to the application via a Properties instance.
 int getQueryTimeout()
          Gets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.
 boolean getRequireCopyObjectId()
          Returns the default value of the requireCopyObjectId flag for this PersistenceManagerFactory.
 boolean getRequireTrackedSCO()
          Returns the boolean value of the requireTrackedSCO flag for this PersistenceManagerFactory.
 boolean getRetainValues()
          Returns the boolean value for the flag that will not cause the eviction of persistent instances after transaction completion.
 boolean getSupersedeDeletedInstance()
          Returns the boolean value of the supersedeDeletedInstance flag for all PersistenceManagers.
 int getUpdateTimeout()
          Gets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.
 void setConnectionDriverName(java.lang.String driverName)
          Sets JDBC driver name
 void setConnectionFactory(java.lang.Object cf)
          Sets Connection Factory as ConnectionFactory or javax.sql.DataSource
 void setConnectionFactoryName(java.lang.String connectionFactoryName)
          Sets ConnectionFactory name
 void setConnectionLoginTimeout(int LoginTimeout)
          Sets the number of seconds to wait for a new connection to be established to the data source
 void setConnectionLogWriter(java.io.PrintWriter pw)
          Sets the LogWriter to which messages should be sent
 void setConnectionMaxPool(int MaxPool)
          Sets maximum number of connections in the connection pool
 void setConnectionMinPool(int MinPool)
          Sets minimum number of connections in the connection pool
 void setConnectionMsInterval(int MsInterval)
          Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
 void setConnectionMsWait(int MsWait)
          Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
 void setConnectionPassword(java.lang.String password)
          Sets database user password
 void setConnectionTransactionIsolation(int level)
          Sets transaction isolation level for all connections of this PersistenceManagerFactory.
 void setConnectionURL(java.lang.String URL)
          Sets JDBC connection URL
 void setConnectionUserName(java.lang.String userName)
          Sets database user
 void setIdentifier(java.lang.String identifier)
          Sets Identifier.
 void setIgnoreCache(boolean flag)
          Sets the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.
 void setMaxPool(int MaxPool)
          Sets maximum number of PersistenceManager instances in the pool
 void setMinPool(int MinPool)
          Sets minimum number of PersistenceManager instances in the pool
 void setNontransactionalRead(boolean flag)
          Sets the flag that allows non-transactional instances to be managed in the cache.
 void setOptimistic(boolean flag)
          Sets the optimistic flag for all PersistenceManagers
 void setQueryTimeout(int timeout)
          Sets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.
 void setRequireCopyObjectId(boolean flag)
          Sets the default value of the requireCopyObjectId flag.
 void setRequireTrackedSCO(boolean flag)
          Sets the requireTrackedSCO flag for this PersistenceManagerFactory.
 void setRetainValues(boolean flag)
          Sets flag that will not cause the eviction of persistent instances after transaction completion.
 void setSupersedeDeletedInstance(boolean flag)
          Sets the supersedeDeletedInstance flag for all PersistenceManagers.
 void setUpdateTimeout(int timeout)
          Sets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.
 

Method Detail

setConnectionDriverName

void setConnectionDriverName(java.lang.String driverName)
Sets JDBC driver name

Parameters:
driverName - JDBC driver name

getConnectionDriverName

java.lang.String getConnectionDriverName()
Returns JDBC driver name

Returns:
driver name

setConnectionUserName

void setConnectionUserName(java.lang.String userName)
Sets database user

Parameters:
userName - database user

getConnectionUserName

java.lang.String getConnectionUserName()
Returns database user name

Returns:
current database user name

setConnectionPassword

void setConnectionPassword(java.lang.String password)
Sets database user password

Parameters:
password - database user password

setConnectionMaxPool

void setConnectionMaxPool(int MaxPool)
Sets maximum number of connections in the connection pool

Parameters:
MaxPool - maximum number of connections

getConnectionMaxPool

int getConnectionMaxPool()
Returns maximum number of connections in the connection pool

Returns:
connectionMaxPool

setConnectionMinPool

void setConnectionMinPool(int MinPool)
Sets minimum number of connections in the connection pool

Parameters:
MinPool - minimum number of connections

getConnectionMinPool

int getConnectionMinPool()
Returns minimum number of connections in the connection pool

Returns:
connectionMinPool

setMaxPool

void setMaxPool(int MaxPool)
Sets maximum number of PersistenceManager instances in the pool

Parameters:
MaxPool - maximum number of instances

getMaxPool

int getMaxPool()
Returns maximum number of PersistenceManager instances in the pool

Returns:
maxPool

setMinPool

void setMinPool(int MinPool)
Sets minimum number of PersistenceManager instances in the pool

Parameters:
MinPool - minimum number of PersistenceManager instances

getMinPool

int getMinPool()
Returns minimum number of PersistenceManager instances in the pool

Returns:
minPool

setConnectionMsWait

void setConnectionMsWait(int MsWait)
Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception

Parameters:
MsWait - number in milliseconds

getConnectionMsWait

int getConnectionMsWait()
Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception

Returns:
number in milliseconds

setConnectionMsInterval

void setConnectionMsInterval(int MsInterval)
Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.

Parameters:
MsInterval - the interval between attempts to get a database connection, in milliseconds.

getConnectionMsInterval

int getConnectionMsInterval()
Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.

Returns:
the length of the interval between tries in milliseconds

setConnectionLoginTimeout

void setConnectionLoginTimeout(int LoginTimeout)
Sets the number of seconds to wait for a new connection to be established to the data source

Parameters:
LoginTimeout - wait time in seconds

getConnectionLoginTimeout

int getConnectionLoginTimeout()
Returns the number of seconds to wait for a new connection to be established to the data source

Returns:
wait time in seconds

setConnectionURL

void setConnectionURL(java.lang.String URL)
Sets JDBC connection URL

Parameters:
URL - connection URL

getConnectionURL

java.lang.String getConnectionURL()
Returns connection URL

Returns:
connection URL

setConnectionFactory

void setConnectionFactory(java.lang.Object cf)
Sets Connection Factory as ConnectionFactory or javax.sql.DataSource

Parameters:
cf - as java.lang.Object

getConnectionFactory

java.lang.Object getConnectionFactory()
Returns Connection Factory object that can be one of ConnectionFactory or javax.sql.DataSource

Returns:
Connection Factory as java.lang.Object

setConnectionLogWriter

void setConnectionLogWriter(java.io.PrintWriter pw)
Sets the LogWriter to which messages should be sent

Parameters:
pw - LogWriter

getConnectionLogWriter

java.io.PrintWriter getConnectionLogWriter()
Returns the LogWriter to which messages should be sent

Returns:
LogWriter

setConnectionTransactionIsolation

void setConnectionTransactionIsolation(int level)
Sets transaction isolation level for all connections of this PersistenceManagerFactory. All validation is done by java.sql.Connection itself, so e.g. while Oracle will not allow to set solation level to TRANSACTION_REPEATABLE_READ, this method does not have any explicit restrictions

Parameters:
level - - one of the java.sql.Connection.TRANSACTION_* isolation values

getConnectionTransactionIsolation

int getConnectionTransactionIsolation()
Returns current transaction isolation level for connections of this PersistenceManagerFactory.

Returns:
the current transaction isolation mode value as java.sql.Connection.TRANSACTION_*

setConnectionFactoryName

void setConnectionFactoryName(java.lang.String connectionFactoryName)
Sets ConnectionFactory name

Parameters:
connectionFactoryName - ConnectionFactory name

getConnectionFactoryName

java.lang.String getConnectionFactoryName()
Returns ConnectionFactory name

Returns:
ConnectionFactoryName

setIdentifier

void setIdentifier(java.lang.String identifier)
Sets Identifier. An Identifier is a string that user can use to identify the PersistenceManagerFacory in a given environment. Identifier can be particularly useful in an environment where multiple PersistenceManagerFacories are initialized in a system.

Parameters:
identifier -

getIdentifier

java.lang.String getIdentifier()
Gets Identifier. An Identifier is a string that user can use to identify the PersistenceManagerFacory in a given environment. Identifier can be particularly useful in an environment where multiple PersistenceManagerFacories are initialized in a system.

Returns:
identifier

getPersistenceManager

PersistenceManager getPersistenceManager()
Creates new PersistenceManager without extra info

Returns:
the persistence manager

getPersistenceManager

PersistenceManager getPersistenceManager(java.lang.String username,
                                         java.lang.String password)
Creates new PersistenceManager with specific username and password. Used to call ConnectionFactory.getConnection(String, String)

Parameters:
username - datasource user
password - datasource user password
Returns:
the persistence manager

setOptimistic

void setOptimistic(boolean flag)
Sets the optimistic flag for all PersistenceManagers

Parameters:
flag - boolean optimistic flag

getOptimistic

boolean getOptimistic()
Returns the boolean value of the optimistic flag for all PersistenceManagers

Returns:
boolean optimistic flag

setRetainValues

void setRetainValues(boolean flag)
Sets flag that will not cause the eviction of persistent instances after transaction completion.

Parameters:
flag - boolean flag passed

getRetainValues

boolean getRetainValues()
Returns the boolean value for the flag that will not cause the eviction of persistent instances after transaction completion.

Returns:
boolean setting for the flag

setNontransactionalRead

void setNontransactionalRead(boolean flag)
Sets the flag that allows non-transactional instances to be managed in the cache.

Parameters:
flag - boolean flag passed

getNontransactionalRead

boolean getNontransactionalRead()
Returns the boolean value for the flag that allows non-transactional instances to be managed in the cache.

Returns:
boolean setting for the flag

setIgnoreCache

void setIgnoreCache(boolean flag)
Sets the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.

Parameters:
flag - boolean flag passed

getIgnoreCache

boolean getIgnoreCache()
Returns the boolean value for the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.

Returns:
boolean setting for the flag

setQueryTimeout

void setQueryTimeout(int timeout)
Sets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.

Parameters:
timeout - new timout value in seconds; zero means unlimited

getQueryTimeout

int getQueryTimeout()
Gets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.

Returns:
timout value in seconds; zero means unlimited

setUpdateTimeout

void setUpdateTimeout(int timeout)
Sets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.

Parameters:
timeout - new timout value in seconds; zero means unlimited

getUpdateTimeout

int getUpdateTimeout()
Gets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.

Returns:
timout value in seconds; zero means unlimited

getProperties

java.util.Properties getProperties()
Returns non-operational properties to be available to the application via a Properties instance.

Returns:
Properties object

getSupersedeDeletedInstance

boolean getSupersedeDeletedInstance()
Returns the boolean value of the supersedeDeletedInstance flag for all PersistenceManagers. If set to true, deleted instances are allowed to be replaced with persistent-new instances with the equal Object Id.

Returns:
boolean supersedeDeletedInstance flag

setSupersedeDeletedInstance

void setSupersedeDeletedInstance(boolean flag)
Sets the supersedeDeletedInstance flag for all PersistenceManagers.

Parameters:
flag - boolean supersedeDeletedInstance flag

getRequireCopyObjectId

boolean getRequireCopyObjectId()
Returns the default value of the requireCopyObjectId flag for this PersistenceManagerFactory. If set to false, the PersistenceManager will not create a copy of an ObjectId for PersistenceManager.getObjectId(Object pc) and PersistenceManager.getObjectById(Object oid) requests.

Returns:
boolean requireCopyObjectId flag
See Also:
PersistenceManager.getObjectId(Object pc), PersistenceManager.getObjectById(Object oid)

setRequireCopyObjectId

void setRequireCopyObjectId(boolean flag)
Sets the default value of the requireCopyObjectId flag. If set to false, by default a PersistenceManager will not create a copy of an ObjectId for PersistenceManager.getObjectId(Object pc) and PersistenceManager.getObjectById(Object oid) requests.

Parameters:
flag - boolean requireCopyObjectId flag
See Also:
PersistenceManager.getObjectId(Object pc), PersistenceManager.getObjectById(Object oid)

getRequireTrackedSCO

boolean getRequireTrackedSCO()
Returns the boolean value of the requireTrackedSCO flag for this PersistenceManagerFactory. If set to false, by default the PersistenceManager will not create tracked SCO instances for new persistent instances at commit with retainValues set to true and while retrieving data from a datastore.

Returns:
boolean requireTrackedSCO flag

setRequireTrackedSCO

void setRequireTrackedSCO(boolean flag)
Sets the requireTrackedSCO flag for this PersistenceManagerFactory. If set to false, by default the PersistenceManager will not create tracked SCO instances for new persistent instances at commit with retainValues set to true and while retrieving data from a datastore.

Parameters:
flag - boolean requireTrackedSCO flag


Copyright © 2012 GlassFish Community. All Rights Reserved.