org.eu.mayrhofer.channel
Interface SecureChannel

All Known Subinterfaces:
IPSecConnection
All Known Implementing Classes:
IPSecConnection_Windows

public interface SecureChannel

This interface represents a secure channel to another (usually remote) device. Specific implementations take care of constructing, terminating, and querying the secure channel. All implementations should take care to clean up connections if they have not been set to be persistent.

Version:
1.0
Author:
Rene Mayrhofer

Method Summary
 boolean init(java.lang.String remoteHost, boolean useAsDefault)
          Initializes an instance of a secure channel.
 boolean isEstablished()
          Returns true if the channel has been established.
 boolean start(byte[] sharedSecret, boolean persistent)
          Establishes and starts a new secure channel to another host.
 boolean stop()
          Stop a previously established secure channel.
 

Method Detail

init

boolean init(java.lang.String remoteHost,
             boolean useAsDefault)
Initializes an instance of a secure channel. The minimal initialization is to remember the remote host description for future calls to start() and stop(), but the implementation might do additional tasks when necessary. This method must be called before any of the others.

Parameters:
remoteHost - The remote host to establish the channel to. This string is dependent on the implementation of the secure channel.
useAsDefault - If set to true, this channel will be used as default for all further communication. It might not be supported by all implementations, set to false if in doubt.
Returns:
true if the channel could be initialized, false otherwise. It will return false if the channel has already been initialized previously.

start

boolean start(byte[] sharedSecret,
              boolean persistent)
Establishes and starts a new secure channel to another host. init() needs to be called once before this method.

Parameters:
sharedSecret - The shared secret to use when establishing the channel.
persistent - If set to true, the secure channel will persist accross application restarts (and might persist across reboots). This is dependent on the implementation, only some might support persistance.
Returns:
true if the channel could be started, false otherwise.
See Also:
init(java.lang.String, boolean)

stop

boolean stop()
Stop a previously established secure channel. If that channel was made persistant, then it will be deleted completely. init() needs to be called once before this method.

Returns:
true if the channel could be stopped, false otherwise.
See Also:
init(java.lang.String, boolean)

isEstablished

boolean isEstablished()
Returns true if the channel has been established. init() needs to be called once before this method.

See Also:
init(java.lang.String, boolean)


2005-2006, Rene Mayrhofer.