Class EdgeSessionStatus

java.lang.Object
casa.lepton.hub.EdgeSessionStatus

public class EdgeSessionStatus extends Object
A class used to combine the sometimes contradictory visions of lepton and the hub concerning the status of edges. Lepton add an edge between two nodes as soon as they are both online and within mutual radio range, and removes it when those conditions are no longer fulfilled. If an edge exists between two nodes, they can open a TCP session via the hub. In that case, the hub informs lepton that the edge status is 'connected'. If, while moving, the nodes move away from each other and become out of range, the edge is removed by lepton. However the hub still considers that they are connected, as long as the TCP session is not used, and the hub is not notified that the edge doesn't exist anymore. If the nodes move close again and an edge is added by lepton, the TCP session is still valid, and this edge should be initialized with the 'connected' status. But lepton cannot change the status of an edge from its defalt value unless it is notified to do so.
  • Constructor Details

    • EdgeSessionStatus

      public EdgeSessionStatus(OppNet oppNet)
  • Method Details

    • setEdgeStatus

      public boolean setEdgeStatus(String nodeId1, String nodeId2, String connectivityType, String status)
      Change the status of the edge in the graph if it exists and/or store this status in some cases to restaure it when the edge is created
      Parameters:
      nodeId1 - a node at one extremity of the edge
      nodeId2 - the node at the other extremity of the edge
      connectivityType - the connectivity type of the edge
      status - the new status (CONNECTED,DISCONNECTED)
      Returns:
      true if
    • edgeAdded

      public void edgeAdded(OppEdge edge)