Class semper.payment.TokenCapsule
All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.TokenCapsule
java.lang.Object
|
+----semper.payment.TokenCapsule
- public class TokenCapsule
- extends Object
This class defines the capsule (containing a token) given as input to
and received as output from the various methods in the token-based
API for payment services. In addition to the token itself, the
capsule contains the following information which can be accessed
and interpreted by the invokers of token-based services:
- The status of the protocol (this is a high-level status,
independent of the specific protocol and is interpreted by the
calling application, unlike the low-level protocol-specific
status)
- the identities of the sender and the recepients,
- the external reference string, specific to the transaction
See the TPurseServices
interface for more information
on how the TokenCapsule
objects are to be used.
- Version:
- $Revision: 1.5 $ $Date: 1997/01/27 12:15:28 $
- Author:
- N. Asokan ([email protected])
- See Also:
- TPurseServices
-
E_DEFECTIVE_TOKEN
- Error flag
-
E_REPLAYED_TOKEN
- Error flag
-
E_UNEXPECTED_TOKEN
- Error flag
-
S_COMPLETE
- Status flag for a protocol run: protocol run is complete
-
S_CONTINUE_NEEDED
- Status flag for a protocol run: input of a token expected in the
next message of this protocol run.
-
S_NONE
- status flag for a protocol run: no status
-
TokenCapsule()
- Empty constructor for serialization
-
TokenCapsule(Object, PaymentEntity, Vector, String)
- Constructor
-
getExtRef()
- Retrieve the external reference string from the token capsule.
-
getOriginator()
- Get the originator of a token
-
getRecepients()
- Get a copy of the list of recipients
-
getToken()
- Retrieve the token from the token capsule.
-
getTokenStatus()
- Retrieve the status from a capsule.
-
setExtRef(String)
- Set the external reference string from the token capsule.
-
setOriginator(PaymentEntity)
- Set the originator identity
-
setRecepients(Vector)
- Set the list of recipients
-
setToken(Object)
- Set the token in the token capsule.
-
setTokenStatus(int)
- Set the status value in a capsule.
S_NONE
public final static int S_NONE
- status flag for a protocol run: no status
S_CONTINUE_NEEDED
public final static int S_CONTINUE_NEEDED
- Status flag for a protocol run: input of a token expected in the
next message of this protocol run.
S_COMPLETE
public final static int S_COMPLETE
- Status flag for a protocol run: protocol run is complete
E_DEFECTIVE_TOKEN
public final static int E_DEFECTIVE_TOKEN
- Error flag
E_REPLAYED_TOKEN
public final static int E_REPLAYED_TOKEN
- Error flag
E_UNEXPECTED_TOKEN
public final static int E_UNEXPECTED_TOKEN
- Error flag
TokenCapsule
public TokenCapsule()
- Empty constructor for serialization
TokenCapsule
public TokenCapsule(Object token,
PaymentEntity originator,
Vector recepients,
String extref)
- Constructor
- Parameters:
- token - Token object
- originator - Originator of the token
- recipients - Recepients of the token (Vector of
PaymentEntity objects)
- extref - External reference string of the transaction as
part of which the token was created
getTokenStatus
public int getTokenStatus()
- Retrieve the status from a capsule. Status can take either a
token status value (e.g. S_CONTINUE_NEEDED) or an error status value
(e.g. E_UNEXPECTED_TOKEN).
- Returns:
- status value
setTokenStatus
public synchronized void setTokenStatus(int status)
- Set the status value in a capsule. Status can take either a
token status value (e.g. S_CONTINUE_NEEDED) or an error status value
(e.g. E_UNEXPECTED_TOKEN).
- Parameters:
- status - status value
- Returns:
- nothing
getExtRef
public String getExtRef()
- Retrieve the external reference string from the token capsule.
- Returns:
- external reference string
setExtRef
public synchronized void setExtRef(String ext_ref)
- Set the external reference string from the token capsule.
- Parameters:
- ext_ref - external reference string
getToken
public Object getToken()
- Retrieve the token from the token capsule. For now, we'll allow
the token to be any Object.
- Returns:
- token object
setToken
public synchronized void setToken(Object token)
- Set the token in the token capsule.
- Parameters:
- token - the token object
getRecepients
public Vector getRecepients()
- Get a copy of the list of recipients
- Returns:
- a Vector of PaymentEntity objects
- See Also:
- PaymentEntity
setRecepients
public synchronized void setRecepients(Vector recepients)
- Set the list of recipients
- Parameters:
- recepients - Vector of PaymentEntity objects indicating the
list of recepients
getOriginator
public PaymentEntity getOriginator()
- Get the originator of a token
- Returns:
- PaymentEntity originator identity
setOriginator
public synchronized void setOriginator(PaymentEntity originator)
- Set the originator identity
- Parameters:
- originator - PaymentEntity object indicating the originator
All Packages Class Hierarchy This Package Previous Next Index