|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.client.AbstractChannel anon.client.AbstractControlChannel anon.client.StreamedControlChannel anon.client.XmlControlChannel anon.pay.AIControlChannel
public class AIControlChannel
This control channel is used for communication with the AI (AccountingInstance or Abrechnungsinstanz in German) which lives in the first mix. The AI sends a request when it wants a cost confirmation from us. This thread waits for incoming requests and sends the requested confirmations to the AI.
Nested Class Summary | |
---|---|
private class |
AIControlChannel.EmptyAccountPacketObserver
|
Field Summary | |
---|---|
static long |
AI_LOGIN_TIMEOUT
|
private static int |
FIRST_MIX
|
private java.util.Vector |
m_aiListeners
|
private int |
m_aiLogin_timeout
|
private java.util.Vector |
m_aiLoginSyncObject
|
private boolean |
m_bEmptyMessageSent
|
private boolean |
m_bMultiplexerClosed
|
private boolean |
m_bPrepaidReceived
|
private MixCascade |
m_connectedCascade
|
private XMLEasyCC |
m_initialCC
|
private java.util.Observer |
m_packetCountEmptyObserver
|
private PacketCounter |
m_packetCounter
|
private boolean |
m_prepaidAmountInPayRequest
indicates that the prepaid Bytes are transmitted by a PayRequest instead of a challenge. |
private long |
m_prepaidBytes
|
private boolean |
m_synchronizedAILogin
indicates that the login to a mix cascade is synchronized. |
private static long |
m_totalBytes
|
static long |
MAX_PREPAID_INTERVAL
|
static long |
MIN_PREPAID_INTERVAL
|
private static java.lang.String |
PREPAID_AMOUNT_IN_PAY_REQ_MIXVERSION
|
static boolean |
REVERT_PRE_PREPAID
|
private static java.lang.String |
SYNCH_AI_LOGIN_MIXVERSION
|
Fields inherited from class anon.client.AbstractChannel |
---|
m_parentMultiplexer |
Constructor Summary | |
---|---|
AIControlChannel(Multiplexer a_multiplexer,
PacketCounter a_packetCounter,
IServiceContainer a_serviceContainer,
MixCascade a_connectedCascade)
|
Method Summary | |
---|---|
void |
addAIListener(IAIEventListener a_aiListener)
|
static long |
getBytes()
|
private void |
handlePrepaidBytesReceived(int prepaidBytes,
PayAccount activeAccount)
|
boolean |
isPrepaidAmountInPayRequest()
|
void |
multiplexerClosed()
This method is called on every channel in the channel-table after the multiplexer is closed. |
private void |
processCcToSign(XMLEasyCC cc)
processCcToSign: to be called by processPayRequest (only the initial, old CC is sent as a naked XMLEasyCC, new CCs to sign are sent inside a XMLPayRequest) |
private void |
processChallenge(XMLChallenge chal)
processChallenge |
private void |
processErrorMessage(XMLErrorMessage msg)
processErrorMessage |
private void |
processInitialCC(XMLEasyCC a_cc)
processInitialCC: last step of connecting to a pay cascade: take last CC as sent by AI as base value for future CCs Also, send a CC for (bytes in last CC + prepay interval of cascade) to avoid triggering the cascade's hardlimit by starting to transfer bytes without prepaying |
private void |
processPayRequest(XMLPayRequest request)
process a XMLPayRequest message, which might request a XMLAccountCertificate, request a XMLBalance, or contain a XMLEasyCC which the AI asks the JAP to sign |
void |
processXmlMessage(org.w3c.dom.Document docMsg)
proccessXMLMessage - this is called when a new request is coming in. |
int |
sendAccountCert()
|
void |
setAILoginTimeout(int aiLogin_timeout)
|
void |
setPrepaidAmountInPayRequest(boolean prepaidAmountInPayRequest)
|
private void |
updateBalance(PayAccount currentAccount,
boolean a_bSynchronous)
|
Methods inherited from class anon.client.XmlControlChannel |
---|
processMessage, sendXmlMessage |
Methods inherited from class anon.client.StreamedControlChannel |
---|
processPacketData, sendByteMessage |
Methods inherited from class anon.client.AbstractControlChannel |
---|
getServiceContainer, processReceivedPacket, sendRawMessage |
Methods inherited from class anon.client.AbstractChannel |
---|
createEmptyMixPacket, deleteChannel, isClosed, sendPacket |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long MAX_PREPAID_INTERVAL
public static final long MIN_PREPAID_INTERVAL
public static final long AI_LOGIN_TIMEOUT
private static final int FIRST_MIX
private static final java.lang.String SYNCH_AI_LOGIN_MIXVERSION
private static final java.lang.String PREPAID_AMOUNT_IN_PAY_REQ_MIXVERSION
public static final boolean REVERT_PRE_PREPAID
private int m_aiLogin_timeout
private static long m_totalBytes
private boolean m_bPrepaidReceived
private long m_prepaidBytes
private boolean m_bMultiplexerClosed
private java.util.Vector m_aiListeners
private PacketCounter m_packetCounter
private java.util.Observer m_packetCountEmptyObserver
private boolean m_bEmptyMessageSent
private MixCascade m_connectedCascade
private XMLEasyCC m_initialCC
private java.util.Vector m_aiLoginSyncObject
private volatile boolean m_synchronizedAILogin
private boolean m_prepaidAmountInPayRequest
Constructor Detail |
---|
public AIControlChannel(Multiplexer a_multiplexer, PacketCounter a_packetCounter, IServiceContainer a_serviceContainer, MixCascade a_connectedCascade)
Method Detail |
---|
public void addAIListener(IAIEventListener a_aiListener)
public void processXmlMessage(org.w3c.dom.Document docMsg)
processXmlMessage
in class XmlControlChannel
docMsg
- Documentprivate void handlePrepaidBytesReceived(int prepaidBytes, PayAccount activeAccount)
private void processChallenge(XMLChallenge chal) throws java.lang.Exception
xMLChallenge
- XMLChallenge
java.lang.Exception
private void processErrorMessage(XMLErrorMessage msg)
msg
- XMLErrorMessageprivate void processPayRequest(XMLPayRequest request)
request
- XMLPayRequestprivate void updateBalance(PayAccount currentAccount, boolean a_bSynchronous)
private void processCcToSign(XMLEasyCC cc) throws java.lang.Exception
java.lang.Exception
public int sendAccountCert()
public static long getBytes()
private void processInitialCC(XMLEasyCC a_cc)
a_cc
- XMLEasyCC: the last CC that the JAP sent to this Cascade, as returned from the AIpublic void multiplexerClosed()
AbstractChannel
multiplexerClosed
in class AbstractChannel
public void setAILoginTimeout(int aiLogin_timeout)
public boolean isPrepaidAmountInPayRequest()
public void setPrepaidAmountInPayRequest(boolean prepaidAmountInPayRequest)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |