Package model.tools.flowmanager

Examples of model.tools.flowmanager.Flow


   
    if (!obj.isNull(dpid)) {
      json = obj.getJSONArray(dpid);
      for (int i = 0; i < json.length(); i++) {
        obj = (JSONObject) json.get(i);
        Flow flow = new Flow(dpid);
        flow.setActions(ActionJSON.getActions(obj
            .getJSONArray("actions")));
        flow.setMatch(MatchJSON.getMatch(obj.getJSONObject("match")));
        flow.setPriority(String.valueOf(obj.getInt("priority")));
        if (obj.getInt("idleTimeout") != 0)
          flow.setIdleTimeOut(String.valueOf(obj
              .getInt("idleTimeout")));
        if (obj.getInt("hardTimeout") != 0)
          flow.setHardTimeOut(String.valueOf(obj
              .getInt("hardTimeout")));
        flow.setDurationSeconds(String.valueOf(obj
            .getInt("durationSeconds")));
        flow.setPacketCount(String.valueOf(obj.getInt("packetCount")));
        flow.setByteCount(FormatLong.formatBytes(obj.getLong("byteCount"),false,false));
        flows.add(flow);
      }
    }
    return flows;
  }
View Full Code Here


        try {
          String key = (String) myIter.next();
          if(jsonobj.has(key)){
          if (jsonobj.get(key) instanceof JSONObject) {
            obj = (JSONObject) jsonobj.get(key);
            Flow flow = new Flow();
            flow.setSwitch(sw);
            flow.setName(key);
            // Get the actions
            flow.setActions(ActionManagerJSON.getActions(sw, key));
            // Get the match
            flow.setMatch(MatchManagerJSON.getMatch(sw, key));
            flow.setPriority(String.valueOf(obj
                  .getInt("priority")));
            flows.add(flow);
            System.out.println(flow.serialize());
            }
          }
        } catch (Exception e) {
          e.printStackTrace();
        }
View Full Code Here

   * Generates a new flow, and updates the view accordingly
   */
  public void setupNewFlow() {

      if(currSwitch != null){
        flow = new Flow(currSwitch.getDpid());
        txtFlowName.setText("");
          txtFlowPriority.setText("");
          newFlow = true;
         
          populateActionTree();
View Full Code Here

TOP

Related Classes of model.tools.flowmanager.Flow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.