Examples of DeviceSummary


Examples of model.overview.DeviceSummary

      Future<Object> devices = Deserializer.readJsonArrayFromURL("http://" + IP
          + ":" + PORT + "/wm/device/");
      JSONArray json = (JSONArray) devices.get(5, TimeUnit.SECONDS);
      for (int i = 0; i < json.length(); i++) {
        obj = json.getJSONObject(i);
        DeviceSummary temp = new DeviceSummary(obj.getJSONArray("mac")
            .getString(0));
        if (!obj.getJSONArray("ipv4").isNull(0))
          temp.setIpv4(obj.getJSONArray("ipv4").getString(0));
        if (!obj.getJSONArray("attachmentPoint").isNull(0)) {
          temp.setAttachedSwitch(obj.getJSONArray("attachmentPoint")
              .getJSONObject(0).getString("switchDPID"));
          temp.setSwitchPort(obj.getJSONArray("attachmentPoint")
              .getJSONObject(0).getInt("port"));
        }
        Date d = new Date(obj.getLong("lastSeen"));
        temp.setLastSeen(d);
        deviceSummaries.add(temp);
      }
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.