de.upb.swtpra05.group03.shuttle
Class CryptoMessagesHandler

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.CryptoMessagesHandler
All Implemented Interfaces:
CryptoMessagesHandlerInterface, Module

public class CryptoMessagesHandler
extends java.lang.Object
implements Module, CryptoMessagesHandlerInterface

Handler responsible for en- and decryption of messages

Version:
$Revision: 1.3 $

Field Summary
protected  ShuttleControlInterface agent
          reference to the ShuttleControl agent
protected  ShuttleCrypto crypto
          crypto class used by the shuttle
private static java.util.logging.Logger log
          logger
protected  StrategyControlInterface strategy
          reference to the StrategyControl
 
Constructor Summary
CryptoMessagesHandler()
          Constructor
 
Method Summary
protected  de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj handleIncoming(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj remObj)
          handle decrypted incoming messages
 de.upb.swtpra.kernel.message.Message handleIncoming(de.upb.swtpra.kernel.message.Message msg)
          handles all incoming messages and decrypt them if needed
 de.upb.swtpra.kernel.message.Message handleOutgoing(de.upb.swtpra.kernel.message.Message msg)
          handle all outgoing messages and encrypt them if needed
 void init(ModuleContainerInterface container)
          Initializes this module.
protected  void sendKeyToShuttle(de.upb.swtpra.kernel.id.ID id)
          sends the secret key to another shuttle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final java.util.logging.Logger log
logger


agent

protected ShuttleControlInterface agent
reference to the ShuttleControl agent


strategy

protected StrategyControlInterface strategy
reference to the StrategyControl


crypto

protected final ShuttleCrypto crypto
crypto class used by the shuttle

Constructor Detail

CryptoMessagesHandler

public CryptoMessagesHandler()
Constructor

Method Detail

init

public void init(ModuleContainerInterface container)
Description copied from interface: Module
Initializes this module. References to other modules should be set here to avoid circle dependencies.

Specified by:
init in interface Module
Parameters:
container - The module manager which contain all modules

handleIncoming

public de.upb.swtpra.kernel.message.Message handleIncoming(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: CryptoMessagesHandlerInterface
handles all incoming messages and decrypt them if needed

Specified by:
handleIncoming in interface CryptoMessagesHandlerInterface
Parameters:
msg - message
Returns:
possibly decrypted message

handleIncoming

protected de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj handleIncoming(de.upb.swtpra.kernel.companycontrol.CompanyControlRemoteObj remObj)
handle decrypted incoming messages

Parameters:
remObj -
Returns:
CompanyControlRemoteObj

handleOutgoing

public de.upb.swtpra.kernel.message.Message handleOutgoing(de.upb.swtpra.kernel.message.Message msg)
Description copied from interface: CryptoMessagesHandlerInterface
handle all outgoing messages and encrypt them if needed

Specified by:
handleOutgoing in interface CryptoMessagesHandlerInterface
Parameters:
msg - outgoing message
Returns:
possibly encrypted message

sendKeyToShuttle

protected void sendKeyToShuttle(de.upb.swtpra.kernel.id.ID id)
sends the secret key to another shuttle

Parameters:
id - the shuttle id