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.
- Parameters:
message
— : the message to handle
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
- Parameters:
message
— {FBPMessage} the received message.
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
- Parameters:
message
— {FBPMessage} the received message.
private void edges(FBPMessage message)
Handle a “edges” message. It does nothing for now.
https://flowbased.github.io/fbp-protocol/#network-edges
- Parameters:
message
— {FBPMessage} the received message.
private void start(FBPMessage message)
Handle a “start” message by starting the execution of the graph.
https://flowbased.github.io/fbp-protocol/#network-start
- Parameters:
message
— {FBPMessage} the received message.
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
- Parameters:
message
— {FBPMessage} the received message.
private void debug (FBPMessage message)
Handle a “debug” message. Do nothing for now.
https://flowbased.github.io/fbp-protocol/#network-debug
- Parameters:
message
— {FBPMessage} the received message.
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
- Parameters:
message
— {FBPMessage} the received message.
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
- Parameters:
graph
— {String} id of the started graph
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
- Parameters:
graph
— {String} id of the started graph
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
- Parameters:
graph
— {String} id of the action targets
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
- Parameters:
message
— {String} contents of the output linetype
— {String} type of output, either message or preview urlurl
— {String} URL for an image generated by the runtime
private Status getGraphStatus (String graph)
Get the status of the given graph.
- Parameters:
graph
— {String} the id of the targeted graph. - Returns: {Status} the status instance of the given graph.