org.objectweb.cjdbc.requestplayer
Class RequestPlayerProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.objectweb.cjdbc.requestplayer.RequestPlayerProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class RequestPlayerProperties
extends java.util.Properties

Checks and gets all properties needed by the request player tools.

Version:
1.0
Author:
Emmanuel Cecchet, Julie Marguerite, Mathieu Peltier
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
private  java.io.File configFile
          Configuration file.
private  int connectionType
          Connection management type used in client emulator: standard, fixed or pooling.
private  java.lang.String databaseDriver
          Database driver.
private  java.lang.String databaseLogin
          Database login.
private  java.lang.String databasePassword
          Database password.
private  java.lang.String databaseUrl
          Database URL.
static java.lang.String DEFAULT_CONFIG_FILE
          Default Request player configuration file.
static int FIXED_CONNECTION
          Optimized connection management type.
private  int nbClients
          Number of clients to run in parallel to issue the requests.
private  int nbRequests
          How many requests from the trace file should be executed (0 means the whole trace is executed).
static int POOLING_CONNECTION
          Pooling connection management type.
private  int poolSize
          Connection pool size.
static int STANDARD_CONNECTION
          Standard connection management type.
private  int timeout
          Request timeout in seconds (0 means no timeout).
private  java.lang.String traceFile
          Trace file.
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
RequestPlayerProperties(java.lang.String configFileString)
          Creates a new RequestPlayerProperties instance.
 
Method Summary
 boolean checkPropertiesFile()
          Checks for all needed fields in requestplayer.properties and initialize corresponding values.
 int getConnectionType()
          Returns the connection type.
 java.lang.String getDatabaseDriver()
          Gets the database driver class name for the SQL database.
 java.lang.String getDatabasePassword()
          Gets the password for the SQL database
 java.lang.String getDatabaseURL()
          Gets the database URL for the SQL database.
 java.lang.String getDatabaseUsername()
          Gets the login for the SQL database.
 int getNbClients()
          Returns the number of clients to run in parallel to issue the requests.
 int getNbRequests()
          Gets the number of requests to execute from the trace file (0 means the whole trace is executed).
 int getPoolSize()
          Returns the connection pool size.
 int getTimeout()
          Returns the request timeout in seconds (0 means no timeout).
 java.lang.String getTraceFile()
          Gets the trace file.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG_FILE

public static final java.lang.String DEFAULT_CONFIG_FILE
Default Request player configuration file.

See Also:
Constant Field Values

STANDARD_CONNECTION

public static final int STANDARD_CONNECTION
Standard connection management type.

See Also:
Constant Field Values

FIXED_CONNECTION

public static final int FIXED_CONNECTION
Optimized connection management type.

See Also:
Constant Field Values

POOLING_CONNECTION

public static final int POOLING_CONNECTION
Pooling connection management type.

See Also:
Constant Field Values

configFile

private java.io.File configFile
Configuration file. Default value is DEFAULT_CONFIG_FILE.


traceFile

private java.lang.String traceFile
Trace file.


nbRequests

private int nbRequests
How many requests from the trace file should be executed (0 means the whole trace is executed).


nbClients

private int nbClients
Number of clients to run in parallel to issue the requests.


timeout

private int timeout
Request timeout in seconds (0 means no timeout).


databaseDriver

private java.lang.String databaseDriver
Database driver.


databaseUrl

private java.lang.String databaseUrl
Database URL.


databaseLogin

private java.lang.String databaseLogin
Database login.


databasePassword

private java.lang.String databasePassword
Database password.


connectionType

private int connectionType
Connection management type used in client emulator: standard, fixed or pooling.


poolSize

private int poolSize
Connection pool size. Must be greater than 0 if connection type is pooling.

Constructor Detail

RequestPlayerProperties

public RequestPlayerProperties(java.lang.String configFileString)
Creates a new RequestPlayerProperties instance. If the given configuration file cannot be read or if the DEFAULT_CONFIG_FILEfile is not found in the classpath, the current thread is killed.

Parameters:
configFileString - configuration file or null if the default file must be used.
Method Detail

checkPropertiesFile

public boolean checkPropertiesFile()
Checks for all needed fields in requestplayer.properties and initialize corresponding values.

Returns:
true if so

getTraceFile

public java.lang.String getTraceFile()
Gets the trace file.

Returns:
name of the trace file

getNbRequests

public int getNbRequests()
Gets the number of requests to execute from the trace file (0 means the whole trace is executed).

Returns:
number of requests

getDatabaseURL

public java.lang.String getDatabaseURL()
Gets the database URL for the SQL database.

Returns:
the database url

getDatabaseDriver

public java.lang.String getDatabaseDriver()
Gets the database driver class name for the SQL database.

Returns:
database driver class name

getDatabaseUsername

public java.lang.String getDatabaseUsername()
Gets the login for the SQL database.

Returns:
username

getDatabasePassword

public java.lang.String getDatabasePassword()
Gets the password for the SQL database

Returns:
password

getNbClients

public int getNbClients()
Returns the number of clients to run in parallel to issue the requests.

Returns:
the number of clients

getConnectionType

public int getConnectionType()
Returns the connection type.

Returns:
the connection type

getPoolSize

public int getPoolSize()
Returns the connection pool size.

Returns:
the pool size

getTimeout

public int getTimeout()
Returns the request timeout in seconds (0 means no timeout).

Returns:
an int value


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.