com.ibm.commerce.payments.configurator
Class CassetteConfigurator

java.lang.Object
  |
  +--com.ibm.commerce.payments.configurator.CassetteConfigurator

public class CassetteConfigurator
extends java.lang.Object

Provides generic configuration behaviour that is common to all cassette instances and delegation functionality for specific cassettes.


Constructor Summary
CassetteConfigurator()
           
 
Method Summary
static void addToInstance(java.lang.String cassetteName, com.ibm.commerce.payments.configurator.IPMInstance instance, java.util.Properties properties)
          Adds a cassette to a Payments instance.
 long getLastCopiedTime(java.lang.String cassetteName)
          Get time of last copy
static java.lang.String[] listInstalledCassettes()
          Returns the names of the cassettes that are installed.
static void migrate(java.lang.String cassetteName, com.ibm.commerce.payments.configurator.IPMInstance instance)
          Performs cassette migration
static void removeFromInstance(java.lang.String cassetteName, com.ibm.commerce.payments.configurator.IPMInstance instance)
          Removes a cassette from a Payments instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CassetteConfigurator

public CassetteConfigurator()
Method Detail

addToInstance

public static void addToInstance(java.lang.String cassetteName,
                                 com.ibm.commerce.payments.configurator.IPMInstance instance,
                                 java.util.Properties properties)
                          throws CassetteAlreadyExistsException,
                                 CassetteCannotBeAddedException,
                                 CassetteNotInstalledException,
                                 DatabaseConnectionFailedException
Adds a cassette to a Payments instance.
Parameters:
cassetteName - The name of the cassette to be added.
instance - The Payments instance to add the cassette to.
properties - The cassette properties
Throws:
CassetteAlreadyExistsException - Thrown if the cassette is already added for the Payments instance.
CassetteCannotBeAddedException - Thrown if the cassette cannot be added to the Payments instance.
CassetteNotInstalledException - Thrown if the cassette is not installed in the Payments instance.
DatabaseConnectionFailedException - Thrown if the DBMS object can not be initialized. This should never happen.

removeFromInstance

public static void removeFromInstance(java.lang.String cassetteName,
                                      com.ibm.commerce.payments.configurator.IPMInstance instance)
                               throws CassetteCannotBeRemovedException,
                                      CassetteDoesNotExistException,
                                      CassetteNotInstalledException,
                                      DatabaseConnectionFailedException
Removes a cassette from a Payments instance.
Parameters:
cassetteName - Name of the cassette to be removed.
instance - Name of the Payments instance.
Throws:
CassetteCannotBeRemovedException - if the cassette cannot be removed from the Payments instance.
CassetteDoesNotExistException - Thrown if the cassette is not currently added to the Payments instance.
CassetteNotInstalledException - Thrown if the cassette is not installed in the Payments instance.
DatabaseConnectionFailedException - Thrown if the DBMS object can not be initialized. This should never happen.

migrate

public static void migrate(java.lang.String cassetteName,
                           com.ibm.commerce.payments.configurator.IPMInstance instance)
                    throws CassetteNotInstalledException,
                           MigrationErrorException,
                           DatabaseConnectionFailedException
Performs cassette migration
Parameters:
cassetteName - The cassette name to migrate
instance - The instance the cassette is associated with
Throws:
CassetteNotInstalledException - Thrown if the cassette is not installed in the Payments instance.
MigrationErrorException - Thrown if there any error during cassette migration.
DatabaseConnectionFailedException - Thrown if the DBMS object can not be initialized. This should never happen.

listInstalledCassettes

public static java.lang.String[] listInstalledCassettes()
Returns the names of the cassettes that are installed.
Returns:
The names of the cassettes that are installed.

getLastCopiedTime

public long getLastCopiedTime(java.lang.String cassetteName)
Get time of last copy
Parameters:
cassetteName - name of cassette
Returns:
time of last copy