|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.etill.framework.admin.AdminObject
AdminObject is the base class for all classes that represent primary administrative objects within the Payment Engine.
Cassette writers extend this class to define their own
primary administrative objects. Such classes should be developed in conjunction with
a corresponding subclass of com.ibm.etill.framework.xdm.PSServerAdminObject
to support query API commands. This is explained in more detail in
Relationship to Query Classes below. For now, however
it is important to understand that instances of classes that extend AdminObject
exist in the Payment Engine and represent the effective configuration for the
Commerce Payments instance as long as they exist.
Overview of Commerce Payments Administrative Objects
There are two types of administrative objects that cassettes need to manipulate:
Cassettes may define their own primary objects when the payment protocol depends upon some type of configurable entity that does not exist in the Commerce Payments Framework. There are two forms of cassette-specific primary objects:
While cassette extensions are typically contained
within a single cassette-defined object, there is no predefined way that
cassettes must build such objects.
In other words, "extension" does not imply that the cassette must extend any
particular base class in the Java sense of the word.
Instead, administration API commands are simply forwarded to the Cassette
object's service
method for processing. From there, the
cassette decides how to handle the request, including which of its internal
objects to update.
Properties maintained by AdminObject
All primary administrative objects share certain properties which are
implemented through this base class. These properties describe the current state of
the object as the Payment Engine sees it. Specifically, these are:
setEnabled
and
getEnabled
) are defined within this class.
setActive
and
getActive
) are defined within this class.
true
once the object has started successfully. If the start operation fails, the
subclass should throw an ETillAbortOperation
exception, causing the
value to be set to false
.
setActive
and
getActive
) are defined within this class.
Responsibilities of AdminObject subclasses
Since AdminObject is an abstract class, classes that extend AdminObject must implement
the abstract methods described below. Furthermore, all properties and characteristics
required by the objects represented by the subclass (other than those described
above) must be defined and implemented within the subclass.
Database Tables
Each type of primary administrative object is expected to have a dedicated table in the
Commerce Payments database. Every instance of that object would occupy one row in the
table. While the layout and contents of that table are up to the cassette writer,
AdminObject does impose a small number of requirements. Specifically, AdminObject
contains code that creates, updates and reads from specific columns in the database
table identified by the subclass. This code assumes that the column names are as
follows and that they appear consecutively, in the specified order, within the table
definition:
Relationship to Query Classes
As cassettes are developed, each of these types of classes should be
developed to represent each of the cassette's primary objects.
As previously mentioned, each administrative object exists and is maintained
within the Payment Engine. The external view of these objects through
the Commerce Payments Query commands typically represents a subset of the
information that is actually maintained in the database. In addition,
since Query commands provide a purely read-only access to the data in the Commerce
Payments database, the processing of these commands occurs under a different
JVM than the Payment Engine. Specifically, Query commands are processed within
the Payment Servlet. Because of this
separation of processing responsibilities across the two different JVMs,
and because of the fundamentally different requirements of the two command subsets
(administrative commands, which alter the Commerce Payments configuration, and query
commands which simply report the current state of the database), two different
class hierarchies are defined to implement the functions:
AdminObject
, which, as described above, represents the complete
Payment Engine view of the objects and
PSServerAdminObject
, which represents the external view of the objects
(that is, the view available to applications and users through the Query commands).
The purpose of this class is to not only encapsulate only the data items that are
to be exposed to external users, but also to provide methods that will build the
required constructs for exposing these data items through XML-based PSApiResult
documents. Specifically, there are two types of objects that must be built upon
request by the Framework:
CassetteExtensionObject
, which exposes the cassette extension
data items, each of which is represented as a CassetteProperty
object.
Once built, a CassetteExtensionObject
must be associated with its
respective Framework PSServerAdminObject
via the Framework object's
setCassetteExtensionObject
method.
CassetteConfigObject
, which exposes MerchantCassetteObjects and
SystemCassetteObjects. Again, each data item within such objects are represented
as a CassetteProperty
object.
Once built, a CassetteConfigObject
must be added to the associated
Framework PSServerAdminObject
via the Framework object's
addCassetteConfigObject
method.
CassetteConfigObject
,
CassetteExtensionObject
,
com.ibm.etill.framework.cassette.query.CassetteProperty
,
PSServerAdminObject
Field Summary | |
---|---|
protected boolean |
active
Contains this object's active status |
protected static String |
ADMINCREATEQUESTIONMARKS
Used in SQL commands to create this AdminObject. |
protected static String |
ADMINCREATESTRING
Used in SQL commands to manage this object's basic properties. |
protected static String |
ADMINUPDATESTRING
Used in SQL commands to update this AdminObject. |
protected boolean |
enabled
Contains this object's enabled status |
protected String |
invalidListKey
Used internally. |
protected boolean |
valid
Contains this object's active status. |
Fields inherited from interface com.ibm.etill.framework.xdm.PSServerAdminConstants |
---|
COL_ACTIVE, COL_ENABLED, COL_MESSAGESKEY, COL_PENDING, COL_VALID |
Constructor Summary | |
---|---|
protected |
AdminObject()
Constructs an AdminObject and sets the active property to false . |
protected |
AdminObject(Boolean enabled)
Constructs an AdminObject, setting the enabled property as specified and the active property to false
Since AdminObject is an abstract class, this constructor must be called from
a subclass's constructor. |
Method Summary | |
---|---|
void |
addCassetteMessage(String message)
Cassettes call this method to add message text which will be returned through query API commands and displayed by the Commerce Payments user interface. |
void |
addFrameworkMessage(String message)
Cassettes should not call this method. |
protected void |
deleteObject()
Subclasses can override this method so that it deletes this AdminObject. |
boolean |
getActive()
Returns the current setting of this object's active property. |
boolean |
getEnabled()
Returns the current setting of this object's enabled property. |
Hashtable |
getInvalidList()
Cassette should not call this method. |
boolean |
getPending()
Returns the current setting of this object's changesPending property. |
protected void |
initializeCommon(PSServerAdminObject queryObject)
Initializes this AdminObject using the enabled property from the input PSServerAdminObject , which is assumed to have been used to
read the object contents from the database. |
protected void |
initializeCommon(ResultSet rs)
Initializes this AdminObject using the enabled property directly from the input ResultSet , which is assumed to contain the object
contents read directly from the database. |
void |
processConfigurationChanges()
Called by the Framework to perform any actions required by a configuration change. |
static void |
processExtension(AdminRequest request)
Called by the Framework to process the cassette extension to the input AdminRequest object. |
void |
setActive(boolean value)
Updates this object's active property to the input value. |
protected int |
setCommonDatabaseFields(Connection conn,
PreparedStatement pstmt,
int index)
Modifies the input PreparedStatement in order to update this
object's database representation with the most current enabled, active,
valid and changesPending property values. |
void |
setEnabled(boolean value)
Updates this object's enabled property to the input value. |
void |
setEnabled(Boolean value)
Updates this object's enabled property to the input value. |
void |
setPending(boolean value)
Updates this object's changesPending property to the input value. |
abstract void |
startObject()
Implemented by subclasses to start this AdminObject. |
abstract void |
stopObject()
Implemented by subclasses to stop this AdminObject. |
abstract String |
toString()
Implemented by subclasses to format this AdminObject for tracing purposes. |
static void |
validateExtension(AdminRequest request)
Called by the Framework to validate the parameters for the cassette-specific extension to the input AdminRequest object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.etill.framework.archive.Archivable |
---|
createRecord, deleteRecord, updateRecord |
Field Detail |
protected static final String ADMINCREATESTRING
protected static final String ADMINCREATEQUESTIONMARKS
protected static final String ADMINUPDATESTRING
protected boolean enabled
protected boolean active
protected boolean valid
true
once the object has been successfully started so that
its is correctly reflected in the database.protected String invalidListKey
Constructor Detail |
protected AdminObject()
false
.
Since AdminObject is an abstract class, this constructor must be called from
a subclass's constructor.protected AdminObject(Boolean enabled)
false
Since AdminObject is an abstract class, this constructor must be called from
a subclass's constructor.enabled
- a Boolean object that contains the initial enabled property
value. If a null is passed, the property is set to
false
.Method Detail |
protected void initializeCommon(PSServerAdminObject queryObject)
PSServerAdminObject
, which is assumed to have been used to
read the object contents from the database.queryObject
- the PSServerAdminObject used to extract the contents
of the object from the database.protected void initializeCommon(ResultSet rs)
ResultSet
, which is assumed to contain the object
contents read directly from the database.rs
- a ResultSet containing the contents of the object
as it is currently stored in the database.protected void deleteObject()
protected int setCommonDatabaseFields(Connection conn, PreparedStatement pstmt, int index) throws SQLException, com.ibm.etill.framework.payapi.ETillAbortOperation
PreparedStatement
in order to update this
object's database representation with the most current enabled, active,
valid and changesPending property values.conn
- a java.sql.Connection
object representing
the database connection.pstmt
- a java.sql.PreparedStatement
that's been
initialized to update
this object's record in the appropriate database table.index
- an int that contains the index into the pstmt's parameter
set at which to set the property values.SQLException
- thrown if there are SQL or JDBC errorscom.ibm.etill.framework.payapi.ETillAbortOperation
- if there is a catastrophic error from ETillArchivepublic final void processConfigurationChanges() throws com.ibm.etill.framework.payapi.ETillAbortOperation
This method cannot be overridden by subclasses.
com.ibm.etill.framework.payapi.ETillAbortOperation
- thrown if the start, stop or commit
operation fails.public static void processExtension(AdminRequest request) throws com.ibm.etill.framework.payapi.ETillAbortOperation
request
- an AdminRequest object that has been processed for the
generic object and validated by the cassette.com.ibm.etill.framework.payapi.ETillAbortOperation
- thrown by the cassette if an error occurs
while processing the extension.public static void validateExtension(AdminRequest request) throws com.ibm.etill.framework.payapi.ETillAbortOperation
request
- an AdminRequest object to validate.com.ibm.etill.framework.payapi.ETillAbortOperation
- thrown if a validation error occurs.public abstract void startObject() throws com.ibm.etill.framework.payapi.ETillAbortOperation
com.ibm.etill.framework.payapi.ETillAbortOperation
- thrown if the object cannot be started.public abstract void stopObject() throws com.ibm.etill.framework.payapi.ETillAbortOperation
com.ibm.etill.framework.payapi.ETillAbortOperation
- thrown if the object cannot be stopped.public abstract String toString()
toString
in class Object
public boolean getActive()
active
property.true
if the object is currently active,
false
if not.public void setActive(boolean value)
active
property to the input value.value
- - a boolean containing the new setting.public boolean getEnabled()
enabled
property.true
if the object is currently enabled,
false
if not.public void setEnabled(boolean value)
enabled
property to the input value.value
- - a boolean containing the new setting.public void setEnabled(Boolean value)
enabled
property to the input value.
If the input value is null, the enabled
property is not
changedvalue
- - a Boolean containing the new setting, which may be
null.public boolean getPending()
changesPending
property.true
if the object currently has pending changes,
false
if not.public void setPending(boolean value)
changesPending
property to the input value.value
- - a boolean containing the new setting.public void addCassetteMessage(String message)
message
- a String containing the message text.XDMMessages
public void addFrameworkMessage(String message)
message
- a String containing the message text.public Hashtable getInvalidList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |