de.upb.swtpra05.group03.companycontrol
Class CryptoMessagesHandler

java.lang.Object
  extended byde.upb.swtpra05.group03.companycontrol.CryptoMessagesHandler

public class CryptoMessagesHandler
extends java.lang.Object

Handler responsible for en- and decryption of messages

Version:
$Revision: 1.3 $

Field Summary
protected  CompanyControlClient client
          reference to the CompanyControlClient
protected  CompanyCrypto crypto
          crypto class used by the company control
protected  java.util.Collection queuedMessages
          collection of queued messages. collected until crypto is ready
 
Constructor Summary
CryptoMessagesHandler(CompanyControlClient cCC)
          Constructor
 
Method Summary
 de.upb.swtpra.kernel.visualisation.RemoteObj handleIncoming(de.upb.swtpra.kernel.visualisation.RemoteObj ro)
          handles all incoming messages and decrypt them if needed
 de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj handleOutgoing(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj ccro)
          handle decrypted incoming messages
 void initHandShake()
          called to initiate the handshake with the shuttles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crypto

protected final CompanyCrypto crypto
crypto class used by the company control


client

protected final CompanyControlClient client
reference to the CompanyControlClient


queuedMessages

protected final java.util.Collection queuedMessages
collection of queued messages. collected until crypto is ready

Constructor Detail

CryptoMessagesHandler

public CryptoMessagesHandler(CompanyControlClient cCC)
Constructor

Parameters:
cCC - reference to the CompanyControlClient
Method Detail

initHandShake

public void initHandShake()
called to initiate the handshake with the shuttles


handleIncoming

public de.upb.swtpra.kernel.visualisation.RemoteObj handleIncoming(de.upb.swtpra.kernel.visualisation.RemoteObj ro)
handles all incoming messages and decrypt them if needed

Parameters:
ro - message
Returns:
possibly decrypted message

handleOutgoing

public de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj handleOutgoing(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj ccro)
handle decrypted incoming messages

Parameters:
ccro - message
Returns:
possibly encrypted message