externalInformationPort
Class InformationGrabber

java.lang.Object
  extended by externalInformationPort.InformationGrabber

final class InformationGrabber
extends java.lang.Object

Can be used to retrieve Information from "external" communication partners (e. g. other mixes or clients) vie network (UDP).

Author:
Karl-Peter Fuchs
See Also:
Client, Information

Field Summary
protected static int MAX_PACKET_SIZE
          Maximum size a packet received by getInformation() may have.
private static int TIMEOUT
          Timeout for reply on a request.
 
Constructor Summary
protected InformationGrabber()
          Creates a new InformationGrabber that can be used to retrieve Information from "external" communication partners (e. g. other mixes or clients) vie network (UDP).
 
Method Summary
protected static byte[] getInformation(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest, byte[] data)
          Generic method to receive some Information from a specified InformationProvider-component.
protected static byte[][] getInformationFromAll(java.net.InetAddress informationProviderAddress, int informationProviderPort, Information informationOfInterest, byte[] data)
          Generic method to receive some Information from several ExternalInformationPort components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_PACKET_SIZE

protected static final int MAX_PACKET_SIZE
Maximum size a packet received by getInformation() may have.

See Also:
getInformation(InetAddress, int, Information, byte[]), Constant Field Values

TIMEOUT

private static final int TIMEOUT
Timeout for reply on a request.

See Also:
Constant Field Values
Constructor Detail

InformationGrabber

protected InformationGrabber()
Creates a new InformationGrabber that can be used to retrieve Information from "external" communication partners (e. g. other mixes or clients) vie network (UDP). Empty Constructor, since all methods are static.

Method Detail

getInformation

protected static byte[] getInformation(java.net.InetAddress informationProviderAddress,
                                       int informationProviderPort,
                                       Information informationOfInterest,
                                       byte[] data)
                                throws InformationRetrieveException
Generic method to receive some Information from a specified InformationProvider-component.

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Parameters:
informationProviderAddress - Address of the InformationProvider -component to receive data from.
informationProviderPort - Port the InformationProvider -component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
Returns:
The requested Information .
Throws:
InformationRetrieveException - Thrown, when requested Information not available.

getInformationFromAll

protected static byte[][] getInformationFromAll(java.net.InetAddress informationProviderAddress,
                                                int informationProviderPort,
                                                Information informationOfInterest,
                                                byte[] data)
                                         throws InformationRetrieveException
Generic method to receive some Information from several ExternalInformationPort components. The first component's address and port number must be specified. The other components' addresses are received by their predecessor (= telescope implementation).

If communication channel isn't safe, but transmitted data is sensitive, cryptographic measures (like authentication and encryption) should be applied.

Parameters:
informationProviderAddress - Address of the first InformationProvider component to receive data from.
informationProviderPort - Port the first InformationProvider component to receive data from runs on.
informationOfInterest - Type of Information, that shall be received.
data - Data to be transmitted.
Returns:
The requested Information s.
Throws:
InformationRetrieveException - Thrown, when requested Information not available.