Backend API

@SuppressWarnings(“unchecked”) public class FBPMessage

A very simple class to create and handle FBP Network Protocol compliant messages. The structure of a message is described here : https://flowbased.github.io/fbp-protocol/#message-structure

Created by antoine on 26/05/2017.

public String getProtocol ()

Returns the protocol field of the message as a String. The protocols are : runtime - graph - component - network - trace

public String getCommand ()

Returns the command field of the message. The command is the name of the action to do. For example removeedge

public JSONObject getPayload()

Returns the payload of the message, as a JSONObject. The payload contains all the interesting information to handle the message. It must be compliant with the documentation. Each command has a different payload.

public void setProtocol(String protocol)

Set the protocol field of the message.

public void setCommand (String command)

Set the command field of the message.

public void setPayload (String payload)

Set the payload of the message, from a String.

public String toJSONString ()

Serialize the message to a JSON compliant String. Commonly used to send the message through a socket.