public interface Handshake
Modifier and Type | Method and Description |
---|---|
void |
apply(HandshakeContext context,
Map<String,String> acceptedProperties)
Activate the results from the previous handshake run.
|
void |
handshake(HandshakeContext context,
Map<String,String> helloProperties,
Map<String,String> acceptedProperties)
Called by the server and actually performing the handshake based on the
helloProperties from the client
|
void |
postApply(HandshakeContext context,
Map<String,String> acceptedProperties)
A second apply run performed directly after the run to
apply(HandshakeContext, Map) |
void |
request(HandshakeContext context,
Map<String,String> helloProperties)
Called by the client, putting together all properties for the
HelloMessage |
void |
sessionStarted(HandshakeContext context,
Map<String,String> acceptedProperties)
Called on the server and client when the session got started.
|
void request(HandshakeContext context, Map<String,String> helloProperties)
HelloMessage
context
- the handshake contexthelloProperties
- the properties to fillvoid handshake(HandshakeContext context, Map<String,String> helloProperties, Map<String,String> acceptedProperties) throws Exception
The server needs to evaluate what the client requested and puts the result into the acceptedProperties. No action will be done right now. The result in the acceptedProperties will also be sent to the client.
context
- the handshake contexthelloProperties
- the properties from the clientacceptedProperties
- the properties to fill with the result of the handshakeException
- if anything goes wrongvoid apply(HandshakeContext context, Map<String,String> acceptedProperties) throws Exception
AcceptMessage
was
received.
In this phase all handshake modules should apply the changes needed. They may also change the sessions filter chain to change the way it communicates.
This method will be called before the ACCEPT/START packet is sent. This means that on the server side filters that change the encoding must be deactivated for the first packet. On the client side the first packet must already be encoded.
context
- the handshake contextacceptedProperties
- the accepted properties from the servers handshake runException
- if anything goes wrongvoid postApply(HandshakeContext context, Map<String,String> acceptedProperties) throws Exception
apply(HandshakeContext, Map)
This second apply run has the possibility to perform stuff which needs to be done after all changes to the filter change have been performed. So messages sent in this phase will already be encoded correctly.
context
- the handshake contextacceptedProperties
- the accepted properties from the servers handshake runException
- if anything goes wrongvoid sessionStarted(HandshakeContext context, Map<String,String> acceptedProperties) throws Exception
For the server this may either be directly after the handshake run or
later when the StartMessage
has been received. This depends on
the fact weather the client supports the session start command.
For the client this is after the session has been accepted
context
- the handshake contextacceptedProperties
- the accepted properties from the servers handshake runException
- if anything goes wrongCopyright © 2016 Eclipse NeoSCADA Project. All rights reserved.