public class StreamCompressionHandshake extends AbstractHandshake
Constructor and Description |
---|
StreamCompressionHandshake(Integer maxStreamCompressionLevel) |
Modifier and Type | Method and Description |
---|---|
void |
apply(HandshakeContext handshakeContext,
Map<String,String> acceptedProperties)
Activate the results from the previous handshake run.
|
void |
handshake(HandshakeContext handshakeContext,
Map<String,String> helloProperties,
Map<String,String> acceptedProperties)
Called by the server and actually performing the handshake based on the
helloProperties from the client
|
protected Integer |
performHandshake(Map<String,String> helloProperties,
Map<String,String> acceptedProperties) |
void |
postApply(HandshakeContext context,
Map<String,String> acceptedProperties)
A second apply run performed directly after the run to
Handshake.apply(HandshakeContext, Map) |
void |
request(HandshakeContext handshakeContext,
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.
|
getBoolean, getInteger
public StreamCompressionHandshake(Integer maxStreamCompressionLevel)
public void request(HandshakeContext handshakeContext, Map<String,String> helloProperties)
Handshake
HelloMessage
handshakeContext
- the handshake contexthelloProperties
- the properties to fillpublic void handshake(HandshakeContext handshakeContext, Map<String,String> helloProperties, Map<String,String> acceptedProperties) throws Exception
Handshake
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.
handshakeContext
- the handshake contexthelloProperties
- the properties from the clientacceptedProperties
- the properties to fill with the result of the handshakeException
- if anything goes wrongprotected Integer performHandshake(Map<String,String> helloProperties, Map<String,String> acceptedProperties)
public void apply(HandshakeContext handshakeContext, Map<String,String> acceptedProperties) throws Exception
Handshake
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.
handshakeContext
- the handshake contextacceptedProperties
- the accepted properties from the servers handshake runException
- if anything goes wrongpublic void postApply(HandshakeContext context, Map<String,String> acceptedProperties) throws Exception
Handshake
Handshake.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 wrongpublic void sessionStarted(HandshakeContext context, Map<String,String> acceptedProperties) throws Exception
Handshake
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.