ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.platform
Interface PlatformPersistenceService

All Superinterfaces:
AblePlatformService, AblePlatformServiceEventGenerator, javax.agent.service.Service
All Known Implementing Classes:
RmiPlatformPersistenceServiceProxy

public interface PlatformPersistenceService
extends javax.agent.service.Service, AblePlatformService

The PlatformPersistenceService interface defines the operations that can be requested of the platform persistence service object.

A Platform Persistence Service can be used to persist important platform information.


Field Summary
static java.lang.String BLOB_TYPE
          The BLOB type being used depends on the JDBC driver the PersistenceService is using.
static int DELETE_TYPE
           
static int INSERT_TYPE
          The different types of persist actions
static java.lang.String PERSISTENCE_DB_FLUSH_TIME
           
static java.lang.String PERSISTENCE_DB_RESET_ALL
           
static java.lang.String PERSISTENCE_DRIVER
          These string will represent the properties that the PlatformPersistenceService will expect to be defined in the AblePlatform.preferences file.
static java.lang.String PERSISTENCE_PASSWORD
           
static java.lang.String PERSISTENCE_PROTOCOL
           
static java.lang.String PERSISTENCE_SUBPROTOCOL
           
static java.lang.String PERSISTENCE_USERID
           
static java.lang.String SERVICE_TYPE
          The well-known service type.
static int UPDATE_TYPE
           
 
Method Summary
 void close(java.lang.String databaseName, java.lang.String tableName, AbleSecureKey key)
          Closes all connections, both the AbleDBImport and AbleDBExport beans for this database table.
 void createTableConnection(java.lang.String databaseName, java.lang.String tableName, java.lang.String schemaName, java.lang.String[] columnNames, java.lang.String[] columnTypes, AbleSecureKey key, boolean writeOnly)
          This creates an AbleDBExport and optionally an AbleDBImport bean and the table these beans will be dealing with if the table does not already exist.
 void delete(java.lang.String databaseName, java.lang.String tableName, java.util.Map whereMap, AbleSecureKey key)
          Deletes rows from a table.
 void delete(java.lang.String databaseName, java.lang.String tableName, java.lang.String whereString, AbleSecureKey key)
          Deletes rows from a table.
 void insert(java.lang.String databaseName, java.lang.String tableName, java.io.Serializable[] insertData, AbleSecureKey key)
          Insert a record into a table.
 java.lang.Object[] select(java.lang.String databaseName, java.lang.String tableName, java.lang.String columnString, java.lang.String whereString, AbleSecureKey key)
          Selects data from a table.
 void update(java.lang.String databaseName, java.lang.String tableName, java.util.Map updateMap, java.util.Map whereMap, AbleSecureKey key)
          Updates a row in a table.
 
Methods inherited from interface javax.agent.service.Service
getServiceProperties, setServiceProperties
 
Methods inherited from interface com.ibm.able.platform.AblePlatformService
getState, terminateService
 
Methods inherited from interface com.ibm.able.platform.AblePlatformServiceEventGenerator
addAblePlatformServiceEventListener, getAblePlatformServiceEventListeners, removeAblePlatformServiceEventListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
The well-known service type.

See Also:
Constant Field Values

INSERT_TYPE

public static final int INSERT_TYPE
The different types of persist actions

See Also:
Constant Field Values

UPDATE_TYPE

public static final int UPDATE_TYPE
See Also:
Constant Field Values

DELETE_TYPE

public static final int DELETE_TYPE
See Also:
Constant Field Values

PERSISTENCE_DRIVER

public static final java.lang.String PERSISTENCE_DRIVER
These string will represent the properties that the PlatformPersistenceService will expect to be defined in the AblePlatform.preferences file.

See Also:
Constant Field Values

PERSISTENCE_PROTOCOL

public static final java.lang.String PERSISTENCE_PROTOCOL
See Also:
Constant Field Values

PERSISTENCE_SUBPROTOCOL

public static final java.lang.String PERSISTENCE_SUBPROTOCOL
See Also:
Constant Field Values

PERSISTENCE_DB_FLUSH_TIME

public static final java.lang.String PERSISTENCE_DB_FLUSH_TIME
See Also:
Constant Field Values

PERSISTENCE_DB_RESET_ALL

public static final java.lang.String PERSISTENCE_DB_RESET_ALL
See Also:
Constant Field Values

PERSISTENCE_USERID

public static final java.lang.String PERSISTENCE_USERID
See Also:
Constant Field Values

PERSISTENCE_PASSWORD

public static final java.lang.String PERSISTENCE_PASSWORD
See Also:
Constant Field Values

BLOB_TYPE

public static final java.lang.String BLOB_TYPE
The BLOB type being used depends on the JDBC driver the PersistenceService is using. When setting up an AblePersistenceSupport Object, one would identify the column names and types. When this BLOB_TYPE is used, the current BLOB type specified in the preferences file will be used to define the column.

For DB2 for example, include the string blob-type : BLOB in the Persistence-Service.Properties values.

See Also:
Constant Field Values
Method Detail

createTableConnection

public void createTableConnection(java.lang.String databaseName,
                                  java.lang.String tableName,
                                  java.lang.String schemaName,
                                  java.lang.String[] columnNames,
                                  java.lang.String[] columnTypes,
                                  AbleSecureKey key,
                                  boolean writeOnly)
                           throws PlatformPersistenceException
This creates an AbleDBExport and optionally an AbleDBImport bean and the table these beans will be dealing with if the table does not already exist. The Export bean will be used in the future to alter the table in any way, and the Import bean will be used to read info from the table.

Parameters:
databaseName - The name of the Database that the table will exist in.

tableName - The name of the table.

schemaName - The schema of the table.

columnNames - String[] containing the name of each column for this table.

columnTypes - String[] containing the type of each column for this table.

key - AbleSecureKey used to secure communication.

writeOnly - When true, the service is output only.

Throws:
AbleException - On all errors creating and initializing the AbleDBExport or AbleDBImport beans.

PlatformPersistenceException -

If unable to verify the key when the platform is secure.

If databaseName is null.

If tableName is null.

If columnNames is null.

If columnTypes is null.

If columnTypes and columnNames are of different lengths.

On errors creating the table.


insert

public void insert(java.lang.String databaseName,
                   java.lang.String tableName,
                   java.io.Serializable[] insertData,
                   AbleSecureKey key)
            throws PlatformPersistenceException
Insert a record into a table.

Parameters:
databaseName - The name of the Database that the table will exist in.

tableName - The name of the table to insert into.

insertData - Serializable[] containing the data that is to be inserted into the table.

key - AbleSecureKey used to secure communication.

Throws:
PlatformPersistenceException -

If the insertData is null.

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.


update

public void update(java.lang.String databaseName,
                   java.lang.String tableName,
                   java.util.Map updateMap,
                   java.util.Map whereMap,
                   AbleSecureKey key)
            throws PlatformPersistenceException
Updates a row in a table.

Parameters:
databaseName - The name of the DB that the table will exist in.

tableName - The name of the table.

updateMap - This is the new data for the record that is to be updated. This is a Map where the keys are the column names and the values are the column values. When using a Map the columns that are not changing do not have to be presents.

whereMap - This is a Map that will be used to build the where clause. The keys will be the column names, and the values will be the Object to match to for their respective column. If left null, or empty, everything will be deleted.

key - AbleSecureKey used to secure communication.

Throws:
PlatformPersistenceException -

If the updateMap is null.

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.


delete

public void delete(java.lang.String databaseName,
                   java.lang.String tableName,
                   java.lang.String whereString,
                   AbleSecureKey key)
            throws PlatformPersistenceException
Deletes rows from a table.

Parameters:
databaseName - The name of the DB that the table will exist in.

tableName - The name of the table.

whereString - This is the simple String that states the where clause of the delete. If left null or blank, everything will be deleted.

key - AbleSecureKey used to secure communication.

Throws:
PlatformPersistenceException -

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.


delete

public void delete(java.lang.String databaseName,
                   java.lang.String tableName,
                   java.util.Map whereMap,
                   AbleSecureKey key)
            throws PlatformPersistenceException
Deletes rows from a table.

Parameters:
databaseName - The name of the DB that the table will exist in

tableName - The name of the table

whereMap - This is a Map that will be used to build the where clause. The keys will be the column names, and the values will be the Object to match to for their respective column. If left null or empty, everything will be deleted.

key - AbleSecureKey used to secure communication.

Throws:
PlatformPersistenceException -

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.


select

public java.lang.Object[] select(java.lang.String databaseName,
                                 java.lang.String tableName,
                                 java.lang.String columnString,
                                 java.lang.String whereString,
                                 AbleSecureKey key)
                          throws PlatformPersistenceException
Selects data from a table.

Parameters:
databaseName - The name of the DB that the table will exist in.

tableName - The name of the table.

columnString - The columns that are to be returned in a select statement. If left blank or null, all columns will be returned.

whereString - The where string of the select statement. If left blank or null, everything will be returned.

key - AbleSecureKey used to secure communication.

Returns:
An Object[] of Object[]s, each containing a returned row from the select statement.

Throws:
PlatformPersistenceException -

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.

On errors deserializing a Blob.

If the persisted data selected is not of a valid type.


close

public void close(java.lang.String databaseName,
                  java.lang.String tableName,
                  AbleSecureKey key)
           throws PlatformPersistenceException
Closes all connections, both the AbleDBImport and AbleDBExport beans for this database table.

Parameters:
databaseName - The name of the DB that the table will exist in.

tableName - The name of the table.

key - AbleSecureKey used to secure communication.

Throws:
PlatformPersistenceException -

If unable to verify the key when the platform is secure.

If secure and the caller is not the one who originally set up the connection to this table.

If the table connection does not exist.


ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005