|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.pay.BIConnection
public class BIConnection
Field Summary | |
---|---|
private boolean |
m_bFirstCaptcha
|
private java.util.Vector |
m_biConnectionListeners
|
private boolean |
m_bSendNewCaptcha
|
private byte[] |
m_captchaSolution
|
private HttpClient |
m_httpClient
|
(package private) IMutableProxyInterface |
m_proxyInterface
|
private java.net.Socket |
m_socket
|
private BI |
m_theBI
|
private static int |
ms_connectionTimeout
|
static int |
TIMEOUT_DEFAULT
|
static java.lang.String |
XML_ATTR_CONNECTION_TIMEOUT
|
Constructor Summary | |
---|---|
BIConnection(BI theBI)
Constructor |
Method Summary | |
---|---|
void |
addConnectionListener(IBIConnectionListener a_listener)
Adds an IBIConnectionListener |
void |
authenticate(XMLAccountCertificate accountCert,
IMyPrivateKey a_privateKey)
performs challenge-response authentication |
XMLTransCert |
charge()
Fetches a transfer certificate from the BI. |
private void |
connect_internal(ImmutableProxyInterface a_proxy)
|
void |
connect(IMutableProxyInterface a_proxyInterface)
Connects to the Payment Instance via TCP and inits the HttpClient. |
void |
disconnect()
Closes the connection. |
XMLPaymentOptions |
fetchPaymentOptions()
Gets the payment options the PI provides. |
XMLTransactionOverview |
fetchTransactionOverview(XMLTransactionOverview a_overview)
Asks the PI to fill an XMLTransactionOverview |
private void |
fireGotCaptcha(IImageEncodedCaptcha a_captcha)
Signals a received captcha to all registered IBICOnnectionListeners. |
XMLAccountInfo |
getAccountInfo()
Fetches an account statement (balance cert. |
static int |
getConnectionTimeout()
|
void |
getNewCaptcha()
Notifies the CaptchaSender that it should send a new captcha |
XMLPaymentOptions |
getPaymentOptions()
Fetches payment options. |
XMLAccountCertificate |
register(XMLJapPublicKey pubKey,
IMyPrivateKey a_privateKey)
Registers a new account using the specified keypair. |
boolean |
sendPassivePayment(XMLPassivePayment a_passivePayment)
Sends data the user has entered for a passive payment to the payment instance. |
void |
setCaptchaSolution(byte[] a_solution)
Sets the solution of a captcha for registering an account. |
static void |
setConnectionTimeout(int a_timeout)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TIMEOUT_DEFAULT
public static final java.lang.String XML_ATTR_CONNECTION_TIMEOUT
private static int ms_connectionTimeout
private BI m_theBI
private java.net.Socket m_socket
private HttpClient m_httpClient
private java.util.Vector m_biConnectionListeners
private byte[] m_captchaSolution
private boolean m_bSendNewCaptcha
private boolean m_bFirstCaptcha
IMutableProxyInterface m_proxyInterface
Constructor Detail |
---|
public BIConnection(BI theBI)
BI
- the BI to which we connectMethod Detail |
---|
public static void setConnectionTimeout(int a_timeout)
public static int getConnectionTimeout()
public void connect(IMutableProxyInterface a_proxyInterface) throws java.io.IOException
java.io.IOException
- if an error occured while connection
HTTPClient.ForbiddenIOException
- if it is assumed that the local provider forbids the connectionprivate void connect_internal(ImmutableProxyInterface a_proxy) throws java.io.IOException
java.io.IOException
public void disconnect() throws java.lang.Exception
java.io.IOException
java.lang.Exception
public XMLTransCert charge() throws java.lang.Exception
java.lang.Exception
public XMLAccountInfo getAccountInfo() throws java.lang.Exception
java.io.IOException
java.lang.Exception
public XMLPaymentOptions getPaymentOptions() throws java.lang.Exception
java.lang.Exception
public void authenticate(XMLAccountCertificate accountCert, IMyPrivateKey a_privateKey) throws java.lang.Exception
java.lang.Exception
public XMLAccountCertificate register(XMLJapPublicKey pubKey, IMyPrivateKey a_privateKey) throws java.lang.Exception
pubKey
- public keyprivKey
- private key
java.lang.Exception
- if an error occurs or the signature or public key is wrongpublic XMLPaymentOptions fetchPaymentOptions() throws java.lang.Exception
java.lang.Exception
public XMLTransactionOverview fetchTransactionOverview(XMLTransactionOverview a_overview) throws java.lang.Exception
a_overview
- XMLTransactionOverview
java.lang.Exception
public boolean sendPassivePayment(XMLPassivePayment a_passivePayment)
a_passivePayment
- XMLPassivePayment
java.lang.Exception
public void addConnectionListener(IBIConnectionListener a_listener)
a_listener
- IBIConnectionListenerprivate void fireGotCaptcha(IImageEncodedCaptcha a_captcha)
a_captcha
- IImageEncodedCaptchapublic void setCaptchaSolution(byte[] a_solution)
setCaptchaSolution
in interface ICaptchaSender
a_solution
- byte[]public void getNewCaptcha()
ICaptchaSender
getNewCaptcha
in interface ICaptchaSender
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |