messageProcessor
Class MessageProcessorController

java.lang.Object
  extended by messageProcessor.MessageProcessorController

public class MessageProcessorController
extends java.lang.Object

Controller class of component MessageProcessor.

Takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to component OutputStrategy.

Can handle Requests and Replies in parallel.

The functions mentioned above can be performed in parallel as well, except for detecting replays (for security reasons).

Author:
Karl-Peter Fuchs

Nested Class Summary
private  class MessageProcessorController.ReplyMixThread
          Thread, which coordinates the mixing process of replies.
private  class MessageProcessorController.RequestMixThread
          Thread, which coordinates the mixing process of request.
 
Field Summary
private  AccessControlController accessControl
          Reference on component AccessControl (used to check if messages have integrity).
private  InputOutputHandlerController inputOutputHandler
          Reference on component InputOutputHandler (used to get unprocessed messages from).
private static InternalInformationPortController internalInformationPort
          Reference on component InternalInformationPort.
private  OutputStrategyController outputStrategy
          Reference on component OutputStrategy (used to hand over processed messages).
private  Recoder recoder
          Reference on Recoder, used to decrypt data.
 
Constructor Summary
MessageProcessorController()
          Generates a new MessageProcessor component, which takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to the OutputStrategy component.
 
Method Summary
 byte[] decrypt(byte[] data, java.lang.String transformation)
          Decrypts the bypassed data using the internal asymmetric cipher (and private key) and the specified transformation.
private  int getNumberOfThreads()
          Returns the number of message that shall be processed in parallel (as specified in property file).
 void initialize(java.security.KeyPair keyPair)
          Initialization method for this component.
 void initialize(java.security.KeyPair keyPair, InputOutputHandlerController inputOutputHandler, AccessControlController accessControl, OutputStrategyController outputStrategy)
          Initialization method for this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

internalInformationPort

private static InternalInformationPortController internalInformationPort
Reference on component InternalInformationPort. Used to display and/or log data and read general settings.


inputOutputHandler

private InputOutputHandlerController inputOutputHandler
Reference on component InputOutputHandler (used to get unprocessed messages from).


accessControl

private AccessControlController accessControl
Reference on component AccessControl (used to check if messages have integrity).


outputStrategy

private OutputStrategyController outputStrategy
Reference on component OutputStrategy (used to hand over processed messages).


recoder

private Recoder recoder
Reference on Recoder, used to decrypt data.

See Also:
decrypt(byte[], String), initialize(KeyPair)
Constructor Detail

MessageProcessorController

public MessageProcessorController()
Generates a new MessageProcessor component, which takes messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypasses them to the OutputStrategy component.

Can handle Requests and Replies in parallel.

The functions mentioned above can be performed in parallel as well, except for detecting replays (for security reasons).

Component can't be used before calling initialize().

See Also:
initialize(KeyPair), initialize( KeyPair, InputOutputHandlerController, AccessControlController, OutputStrategyController )
Method Detail

initialize

public void initialize(java.security.KeyPair keyPair,
                       InputOutputHandlerController inputOutputHandler,
                       AccessControlController accessControl,
                       OutputStrategyController outputStrategy)
Initialization method for this component. Makes this component process messages (= take messages from component InputOutputHandler, processes them (recoding, checking for replays, removing/adding padding, initiating message authentication) and bypass them to the OutputStrategy component.

Parameters:
keyPair - Reference on this mix' KeyPair. Used for asymmetric cryptography.
inputOutputHandler - Reference on component InputOutputHandler (used to get unprocessed messages from).
accessControl - Reference on component AccessControl (used to check if messages have integrity).
outputStrategy - Reference on component OutputStrategy (used to hand over processed messages).
See Also:
initialize(KeyPair)

initialize

public void initialize(java.security.KeyPair keyPair)
Initialization method for this component. Should be called, when component shall solely be used to decrypt data and not process messages (see initialize(KeyPair, InternalInformationPortController, InputOutputHandlerController, AccessControlController, OutputStrategyController) for an initializer causing this component to process messages, too).

Parameters:
keyPair - Reference on this mix' KeyPair. Used to decrypt data.
See Also:
initialize( KeyPair, InputOutputHandlerController, AccessControlController, OutputStrategyController)

getNumberOfThreads

private int getNumberOfThreads()
Returns the number of message that shall be processed in parallel (as specified in property file).

Returns:
Number of message that shall be processed in parallel.

decrypt

public byte[] decrypt(byte[] data,
                      java.lang.String transformation)
               throws java.lang.Exception
Decrypts the bypassed data using the internal asymmetric cipher (and private key) and the specified transformation.

Parameters:
data - Data to be decrypted.
transformation - Transformation that shall be used for decryption.
Returns:
Decrypted data.
Throws:
java.lang.Exception - Any type of error preventing the data from being decrypted.