Backend API

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

Class managing the Graph Message 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 clear ()

Clear the content of the graph. https://flowbased.github.io/fbp-protocol/#graph-clear

private void addnode (JSONObject payload)

Handle a “addnode” message by adding a new Node object into the list of nodes in the Flow object.

https://flowbased.github.io/fbp-protocol/#graph-addnode

private void removenode (JSONObject payload)

Handle a “removenode” message by removing the Node object with the given id, from the Flow object.

https://flowbased.github.io/fbp-protocol/#graph-removenode

private void renamenode (JSONObject payload)

Handle a “renamenode” message by changing its id.

https://flowbased.github.io/fbp-protocol/#graph-renamenode

private void changenode (JSONObject payload)

Handle a “changenode” message by updating the metadata field of the Node object with the given id, from the Flow object.

https://flowbased.github.io/fbp-protocol/#graph-changenode

private void addedge (JSONObject payload)

Handle a “addedge” message by adding a new Edge object into the Flow. The edge is created from the data we retrieve in the given payload object, in accordance to the FBPNP documentation.

https://flowbased.github.io/fbp-protocol/#graph-addedge

private void removeedge (JSONObject payload)

Handle a “removeedge” message by removing the Edge object with the given id, from the Flow object.

https://flowbased.github.io/fbp-protocol/#graph-removeedge

private void changeedge (JSONObject payload)

Handle a “changeedge” message by updating the metadata field of the Edge object with the given id, from the Flow object.

https://flowbased.github.io/fbp-protocol/#graph-changeedge

private void addinitial (JSONObject payload)

Handle a “addinitial” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-addinitial

private void removeinitial (JSONObject payload)

Handle a “removeinitial” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-removeinitial

private void addinport (JSONObject payload)

Handle a “addinport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-addinport

private void removeinport (JSONObject payload)

Handle a “removeinport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-removeinport

private void renameinport (JSONObject payload)

Handle a “renameinport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-renameinport

private void addoutport (JSONObject payload)

Handle a “addoutport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-addoutport

private void removeoutport (JSONObject payload)

Handle a “removeoutport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-removeoutport

private void renameoutport (JSONObject payload)

Handle a “renameoutport” message. Don’t do anything for now.

https://flowbased.github.io/fbp-protocol/#graph-renameoutport

private void addgroup (JSONObject payload)

Handle a “addgroup” message by adding a group to the graph.

https://flowbased.github.io/fbp-protocol/#graph-addgroup

private void removegroup (JSONObject payload)

Handle a “removegroup” message by removing a group from the graph.

https://flowbased.github.io/fbp-protocol/#graph-removegroup

private void renamegroup (JSONObject payload)

Handle a “renamegroup” message by renaming an existing group from the graph.

https://flowbased.github.io/fbp-protocol/#graph-renamegroup

private void changegroup (JSONObject payload)

Handle a “changegroup” message by updating its metadata.

https://flowbased.github.io/fbp-protocol/#graph-changegroup

private void sendClearMessage ()

Send a “clear” message on the graph protocol

https://flowbased.github.io/fbp-protocol/#graph-clear

private void sendAddNodeMessage (String id, String graph)

Send a “addnode” message for the Node with the given id in the given graph.

https://flowbased.github.io/fbp-protocol/#graph-addnode

private void sendRemoveNodeMessage (String id, String graph)

Send a “removenode” message in order to remove the node with the given id from the graph.

https://flowbased.github.io/fbp-protocol/#graph-removenode

private void sendRenameNodeMessage (String from, String to, String graph)

Send a “renamenode” message in order to replace the node with the new given id.

https://flowbased.github.io/fbp-protocol/#graph-renamenode

private void sendChangeNodeMessage (String id, String graph)

Send a “changenode” message in order to update its metadata.

https://flowbased.github.io/fbp-protocol/#graph-changenode

private void sendAddEdgeMessage (JSONObject src, JSONObject tgt, String graph)

Send a “addedge” message in order to create a new edge that connects two existing nodes.

https://flowbased.github.io/fbp-protocol/#graph-addedge

private void sendRemoveEdgeMessage (String id, String graph, JSONObject src, JSONObject tgt)

Send a “removeedge” message in order to remove the edge from the graph.

https://flowbased.github.io/fbp-protocol/#graph-removeedge

private void sendChangeEdgeMessage (String graph, JSONObject src, JSONObject tgt)

Send a “changeedge” message in order to connect an edge update its metadata.

https://flowbased.github.io/fbp-protocol/#graph-changeedge

private void sendAddInitialMessage (JSONObject msg)

Send a “addinitial” message. Behavior and interest to find …

https://flowbased.github.io/fbp-protocol/#graph-addinitial

private void sendRemoveInitialMessage (JSONObject msg)

Send a “removeinitial” message. Behavior and interest to find …

https://flowbased.github.io/fbp-protocol/#graph-removeinitial

private void sendAddInportMessage (Port port, String node, String graph)

Send a “addinport” message.

https://flowbased.github.io/fbp-protocol/#graph-addinport

private void sendRemoveInportMessage (String name, String graph)

Send a “removeinport” message.

https://flowbased.github.io/fbp-protocol/#graph-removeinport

private void sendRenameInportMessage (String from, String to, String graph)

Send a “renameinport” message.

https://flowbased.github.io/fbp-protocol/#graph-renameinport

private void sendAddOutportMessage (Port port, String node, String graph)

Send a “addoutport” message.

https://flowbased.github.io/fbp-protocol/#graph-addoutport

private void sendRemoveOutportMessage (String name, String graph)

Send a “removeoutport” message. Remove an exported port in the graph.

https://flowbased.github.io/fbp-protocol/#graph-removeoutport

private void sendRenameOutportMessage (String from, String to, String graph)

Send a “renameoutport” message. Rename an exported port in the graph.

https://flowbased.github.io/fbp-protocol/#graph-renameoutport

private void sendAddGroupMessage (String name, String graph)

Send a “addgroup” message. Add a group to the graph

https://flowbased.github.io/fbp-protocol/#graph-addgroup

private void sendRemoveGroupMessage (String name, String graph)

Send a “removegroup” message. Remove a group from the graph

https://flowbased.github.io/fbp-protocol/#graph-removegroup

private void sendRenameGroupMessage (String from, String to, String graph)

Send a “removegroup” message. Rename a group in the graph

https://flowbased.github.io/fbp-protocol/#graph-renamegroup

private void sendChangeGroupMessage (String name, String graph)

Send a “changegroup” message. Change a group’s metadata.

https://flowbased.github.io/fbp-protocol/#graph-changegroup

private void sendAddInportAndOutportForNode (Node node, String graph)

Send addinport and addoutport message for the given node.