Backend API

@SuppressWarnings(“unchecked”) public class NetworkMessageHandler extends SendMessageOverFBP implements FBPProtocolHandler

Class managing the Network messages for the Flow-Based Programming Network Protocol To know more about this protocol, take a look at the doc on J.Paul Morisson’s website : https://flowbased.github.io/fbp-protocol/#sub-protocols

Created by antoine on 26/05/2017.

public void handleMessage (FBPMessage message)

Handle a message. It call the corresponding method for each supported type of message.

private void persist(FBPMessage message)

Tells the runtime to persist the current state of graphs and components so that they are available between restarts. It saves the flow.json file.

https://flowbased.github.io/fbp-protocol/#network-persist

private void getstatus(FBPMessage message)

Handle a “getstatus” message by sending the current status of the runtime.

https://flowbased.github.io/fbp-protocol/#network-getstatus

private void edges(FBPMessage message)

Handle a “edges” message. It does nothing for now.

https://flowbased.github.io/fbp-protocol/#network-edges

private void start(FBPMessage message)

Handle a “start” message by starting the execution of the graph.

https://flowbased.github.io/fbp-protocol/#network-start

private void stop(FBPMessage message)

Handle a “stop” message by stopping the execution of the graph or group.

https://flowbased.github.io/fbp-protocol/#network-stop

private void debug (FBPMessage message)

Handle a “debug” message. Do nothing for now.

https://flowbased.github.io/fbp-protocol/#network-debug

private void sendPersistMessage (FBPMessage message)

Send a persist message. It is the exact same message than the one received from the UI.

https://flowbased.github.io/fbp-protocol/#network-persist

private void sendStartedMessage (String graph)

Send a “started” message. Inform that a given network has started. Must be call when the graph start.

https://flowbased.github.io/fbp-protocol/#network-started

private void sendStoppedMessage (String graph)

Send a “stopped” message. Inform that a given network has stopped. Must be call when the graph stop.

https://flowbased.github.io/fbp-protocol/#network-stopped

private void sendStatusMessage (String graph)

Send a “status” message. It’s a response to a “getstatus” message.

https://flowbased.github.io/fbp-protocol/#network-status

private void sendOutputMessage (String message, String type, String url)

Send an “output” message. It is an output message from a running network, roughly similar to STDOUT output of a Unix process, or a line of console.log in JavaScript. Output can also be used for passing images from the runtime to the UI.’

https://flowbased.github.io/fbp-protocol/#network-output

private Status getGraphStatus (String graph)

Get the status of the given graph.