Holger's
Java API

com.antelmann.net
Interface Handshake

All Known Implementing Classes:
SimpleHandshake

public interface Handshake

defines the process on how a party can determine whether the connection party is a valid counterpart. The same instance is to be used for both, client and server.

Author:
Holger Antelmann
See Also:
HandshakeException, NetConnection, NetConnectionHandler

Method Summary
 void clientHandshake(NetConnection con)
          performs a handshake for the given socket on behalf of a client
 Object getHandshakeAnswer(Object question)
          used to generate the appropriate response to a question (must not return null).
 Object getHandshakeQuestion()
          returns a question to be asked to validate the handshake (must not return null).
 String getIdentificationString()
          a String used to identify a specific handshake specification
 void serverHandshake(NetConnection con)
          performs a handshake for the given socket on behalf of a server
 

Method Detail

getIdentificationString

String getIdentificationString()
a String used to identify a specific handshake specification


getHandshakeAnswer

Object getHandshakeAnswer(Object question)
used to generate the appropriate response to a question (must not return null). This method must always produce the same output given the same input.


getHandshakeQuestion

Object getHandshakeQuestion()
returns a question to be asked to validate the handshake (must not return null). Successive calls may (and - for security reasons - should) return different values.


serverHandshake

void serverHandshake(NetConnection con)
                     throws IOException,
                            HandshakeException
performs a handshake for the given socket on behalf of a server

Throws:
IOException
HandshakeException

clientHandshake

void clientHandshake(NetConnection con)
                     throws IOException,
                            HandshakeException
performs a handshake for the given socket on behalf of a client

Throws:
IOException
HandshakeException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads