Class semper.payment.Purse
All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.Purse
java.lang.Object
|
+----semper.payment.Purse
- public class Purse
- extends Object
- implements Streamable
Generic abstraction of a payment system instance
- Version:
- $Revision: 1.18 $ $Date: 1996/08/20 12:04:09 $
- Author:
- N. Asokan ([email protected])
- See Also:
- PurseServices, GroupedPurseServices
-
_acl
- Access control structure used by this purse
-
_address
- Address of this purse.
-
_bank
- The bank with which this purse is associated
-
_brandName
- Name of the brand.
-
_handle
- The handle to this purse
-
_purseName
- The name of this purse
-
_purseRef
- A handle to the purse reference object
-
_type
- Purse type: one of pay-only, receive-only, pay-and-receive
-
TYPE_PAY_AND_RECEIVE
- purse type flag indicating the purse can be used to pay and receive
-
TYPE_PAY_ONLY
- purse type flag indicating the purse can be used to pay only
-
TYPE_RECEIVE_ONLY
- purse type flag indicating the purse can be used to receive only
(aka till)
-
Purse()
-
-
getAmount()
- Get the current amount in the purse.
-
getBank()
- Get the identity of the bank.
-
getBrandName()
- Get the brand name
-
getPaymentSystemName()
- Get the name of the payment system.
-
getPurseAddress()
- Get the address to which payment protocol messages should be sent in
order to interact with this purse.
-
getPurseName()
- Gets the name of the purse
Access to the attribute _purseName.
-
getPurseType()
- Get the purse type
-
getUnlockedAmount()
- Get the unlocked amount.
-
getUserName()
- Return the user name associated with this purse (This information is
part of the purse address).
-
init()
- Initialise the purse.
-
isCurrencySupported(Currency)
- Check if a given currency is supported.
-
isSecurityServiceOffered(SecurityOption)
- Check if a specific security service is offered.
-
myStreamSize()
- Implementing the Streamable interface
-
offeredSecurityServices()
- Get the list of security services offered.
-
readObject(StreamInputInterface)
- Implementing the Streamable interface
-
registerWithBank()
- Register or re-register a purse _with_ _the_ _bank_.
-
setBank(PaymentEntity)
- Set the identity of the bank.
-
setBrandName(String)
- Set the brand name
-
setPurseAddress(PaymentEntity)
- Set the address of this purse
-
setPurseHandle(AccessName)
- Set the archive handle for this purse.
-
setPurseName(String)
- Set the name of a purse
Access to the attribute _purseName.
-
setPurseType(int)
- Set the purse type
-
setUnlockedAmount(Amount)
- Set the unlocked amount.
-
setup(TinguinDisplay)
- Setup the purse.
-
startTransaction()
- Start a transaction on this purse.
-
store()
- Commit this purse to the archive.
-
supportedCurrency()
- Return the list of supported currencies.
-
writeObject(StreamOutputInterface)
- Implementing the Streamable interface
_brandName
protected String _brandName
- Name of the brand. The same payment system may support different
brands of purses (e.g. SET/EuroCard)
_address
protected PaymentEntity _address
- Address of this purse.
From this object, it must be possible to extract the address to
which subsequent messages in the payment system protocol should be sent.
_purseName
protected String _purseName
- The name of this purse
_purseRef
protected transient PurseReference _purseRef
- A handle to the purse reference object
_bank
protected PaymentEntity _bank
- The bank with which this purse is associated
_acl
protected PaymentAccessControlStructure _acl
- Access control structure used by this purse
TYPE_PAY_AND_RECEIVE
public final int TYPE_PAY_AND_RECEIVE
- purse type flag indicating the purse can be used to pay and receive
TYPE_PAY_ONLY
public final int TYPE_PAY_ONLY
- purse type flag indicating the purse can be used to pay only
TYPE_RECEIVE_ONLY
public final int TYPE_RECEIVE_ONLY
- purse type flag indicating the purse can be used to receive only
(aka till)
_type
protected int _type
- Purse type: one of pay-only, receive-only, pay-and-receive
_handle
protected AccessName _handle
- The handle to this purse
Purse
public Purse()
registerWithBank
public abstract void registerWithBank() throws PaymentServiceException
- Register or re-register a purse _with_ _the_ _bank_. Purse
subclasses must provide an implementation of this method that
does whatever is necessary to make the purse active/usable.
- Throws: PaymentServiceException
- if registration failed
- See Also:
- getBank
supportedCurrency
public abstract Vector supportedCurrency()
- Return the list of supported currencies.
- Returns:
- list of supported currencies (Vector of Currency objects)
- See Also:
- Currency, Vector
isCurrencySupported
public abstract boolean isCurrencySupported(Currency currency)
- Check if a given currency is supported.
- Parameters:
- currency - currency
- Returns:
- true/false
- See Also:
- Currency
offeredSecurityServices
public abstract Vector offeredSecurityServices()
- Get the list of security services offered.
- Returns:
- list of supported security services
- See Also:
- SecurityOption
isSecurityServiceOffered
public abstract boolean isSecurityServiceOffered(SecurityOption service)
- Check if a specific security service is offered.
- Parameters:
- service - security service
- Returns:
- true/false
- See Also:
- SecurityOption
getAmount
public abstract Amount getAmount() throws AmountNotApplicable
- Get the current amount in the purse.
- Returns:
- amount being held in the purse
- Throws: AmountNotApplicable
- on a purse where the current amount
does not make sense (e.g. in certain credit card systems)
- See Also:
- Amount
getUnlockedAmount
public abstract Amount getUnlockedAmount()
- Get the unlocked amount.
- Returns:
- currently unlocked amount
- See Also:
- Amount
setUnlockedAmount
public synchronized abstract void setUnlockedAmount(Amount amount)
- Set the unlocked amount.
- Parameters:
- amount - new unlocked amount
- Returns:
- none
- See Also:
- Amount
startTransaction
public abstract PaymentTransaction startTransaction() throws PaymentServiceException
- Start a transaction on this purse.
- Returns:
- a PaymentTransaction object
- Throws: PaymentServiceException
- when a transaction cannot be started.
- See Also:
- PaymentTransaction
getPaymentSystemName
public abstract String getPaymentSystemName()
- Get the name of the payment system. It must be possible to conduct a
transaction between purses having the same payment system name. In
some cases (e.g. credit cards), this name may contain the basic
payment system name (e.g. iKP/SET) and the brand name
(e.g. EuroCard). It is up to the adapter designer to decide what
string is to be returned by this method.
There isn't a corresponding setPaymentSystemName(); It is assumed
that purses will initialise the payment system name attribute when
they are created.
- Returns:
- unique name for the payment system
getPurseAddress
public PaymentEntity getPurseAddress()
- Get the address to which payment protocol messages should be sent in
order to interact with this purse. Since the return value is a
PaymentEntity object, it also contains the "name" of the user to
be associated with this purse.
- Returns:
- PaymentEntity object indicating the address
setPurseAddress
public synchronized void setPurseAddress(PaymentEntity address)
- Set the address of this purse
- Parameters:
- address - PaymentEntity
- Returns:
- nothing
getUserName
public String getUserName() throws PaymentServiceException
- Return the user name associated with this purse (This information is
part of the purse address).
- Returns:
- string representing the user name associated with this purse,
if it had been set using the
setPurseAddress
method.
- Throws: PaymentServiceException
- if user name is not set
- See Also:
- setPurseAddress
setBrandName
public synchronized void setBrandName(String brand_name)
- Set the brand name
- Parameters:
- String - brand name
- Returns:
- nothing
getBrandName
public String getBrandName()
- Get the brand name
- Returns:
- string representing the brand name
setPurseType
public synchronized void setPurseType(int type) throws IllegalArgumentException
- Set the purse type
- Parameters:
- type - integer flag indicating type
getPurseType
public int getPurseType()
- Get the purse type
- Returns:
- flag representing purse type
getPurseName
public String getPurseName()
- Gets the name of the purse
Access to the attribute _purseName.
method defined in Purse.java
- See Also:
- getPurseName
setPurseName
public synchronized void setPurseName(String purse_name) throws PaymentServiceException
- Set the name of a purse
Access to the attribute _purseName.
method defined in Purse.java
- Throws: PaymentServiceException
- if the new status cannot be sync'd
- See Also:
- setPurseName
getBank
public PaymentEntity getBank()
- Get the identity of the bank.
- Returns:
- unique name for the bank
setBank
public synchronized void setBank(PaymentEntity address)
- Set the identity of the bank.
- Parameters:
- address - PaymentEntity object with contact information for
the bank
store
public synchronized void store() throws ArchiveManException
- Commit this purse to the archive.
- Throws: ArchiveManException
- if commit fails
init
public void init() throws PaymentServiceException
- Initialise the purse. Purse subclasses that require any sort of
initialisation should override this method to do whatever is
necessary to initialise this purse on startup. These may
include the reading of preferences, starting of any daemons etc.
- Throws: PaymentServiceException
- on failure
setup
public void setup(TinguinDisplay dis) throws PaymentServiceException
- Setup the purse. Purse subclasses that require any sort of user-driven
setup (e.g. port numbers, addresses of banks etc.) should do whatever
is necessary by overriding this method. Any user interaction must
be via the Tinguin session passed as parameter. This will be used
by the PurseMangement class.
The implementation here is mostly intended as an example. Each
adapter should really re-implement it.
- Parameters:
- dis - an active Tinguin session
- Returns:
- nothing
- Throws: PaymentServiceException
- on misc. errors
- See Also:
- createPurses
setPurseHandle
public synchronized void setPurseHandle(AccessName handle)
- Set the archive handle for this purse. This should be called only by
the PurseReference object.
- Parameters:
- handle - AccessName object
writeObject
public void writeObject(StreamOutputInterface s) throws StreamIOException
- Implementing the Streamable interface
- Throws: StreamIOException
- as usual
readObject
public void readObject(StreamInputInterface s) throws StreamIOException
- Implementing the Streamable interface
- Throws: StreamIOException
- as usual
myStreamSize
public int myStreamSize() throws StreamIOException
- Implementing the Streamable interface
All Packages Class Hierarchy This Package Previous Next Index