public static interface FredPluginFCPMessageHandler.ClientSideFCPMessageHandler extends FredPluginFCPMessageHandler
FredPluginFCPMessageHandler.ClientSideFCPMessageHandler, FredPluginFCPMessageHandler.PrioritizedMessageHandler, FredPluginFCPMessageHandler.ServerSideFCPMessageHandler
Modifier and Type | Method and Description |
---|---|
FCPPluginMessage |
handlePluginFCPMessage(FCPPluginConnection connection,
FCPPluginMessage message)
Is called to handle messages from the server after you sent a message to it using a
FCPPluginConnection .ATTENTION: The server is free to send messages to you on its own, that is not triggered by any message which you sent. This can happen for as long as you keep the connection open by having a hard reference to the original FCPPluginConnection in memory.The purpose of this mechanism is for example to allow the server to tell you about events which happened at its side. |
FCPPluginMessage handlePluginFCPMessage(FCPPluginConnection connection, FCPPluginMessage message)
FCPPluginConnection
.FCPPluginConnection
in memory.handlePluginFCPMessage
in interface FredPluginFCPMessageHandler
connection
- The connection which you had originally established to the server.FCPPluginConnection.sendSynchronous(
SendDirection, FCPPluginMessage, long)
: The function shall wait for the reply to the
original message, and return it to the caller. This only works if replies are
properly identified, otherwise it would have to throw an IOException
to
signal a timeout while waiting for the reply.message
- The actual message. See the JavaDoc of its member variables for an explanation of
their meaning.constructReplyMessage(FCPPluginMessage, SimpleFieldSet, Bucket, boolean, String,
String)
(or one of its shortcuts) to ensure that the
FCPPluginMessage.identifier
gets preserved.FCPPluginMessage.isReplyMessage()
.FCPPluginConnection
, as explained in the description of this function.FCPPluginConnection.sendSynchronous(SendDirection, FCPPluginMessage, long)
to fail fast instead of having to wait for timeout.