예제 #1
0
  private BitpoolStation makeStationObj(BitPoolServerModelBitStationEntity station, Node child) {
    child.setAttribute("Pool key", new Value(station.getPoolKey()));
    child.setAttribute("Station id", new Value(station.getStationID()));
    child.setAttribute(
        "Registration date", new Value(conn.link.safeToString(station.getRegistrationDate())));

    return new BitpoolStation(getMe(), child);
  }
예제 #2
0
    public void handle(ActionResult event) {
      String name = event.getParameter("Station name", ValueType.STRING).getString();
      BitPoolServerModelBitStationEntity station;
      try {
        station =
            conn.poolsApi.poolsRegisterStation(node.getAttribute("Pool key").getString(), name);
      } catch (ApiException e) {
        // TODO Auto-generated catch block
        return;
      }
      if (station == null) return;

      Node child = node.createChild(station.getStationName()).build();

      BitpoolStation bs = makeStationObj(station, child);
      bs.init();
    }
예제 #3
0
 private void loadStations() {
   try {
     List<BitPoolServerModelBitStationEntity> stations =
         conn.poolsApi.poolsGetStations(node.getAttribute("Pool key").getString());
     for (BitPoolServerModelBitStationEntity station : stations) {
       if (node.getChild(station.getStationName()) == null) {
         Node child = node.createChild(station.getStationName()).build();
         final BitpoolStation bs = makeStationObj(station, child);
         bs.init();
         //				child.getListener().setOnListHandler(new Handler<Node>() {
         //					private boolean loaded = false;
         //					public void handle(Node event) {
         //						if (!loaded) bs.init();
         //						loaded = true;
         //					}
         //				});
       }
     }
   } catch (ApiException e) {
     // TODO Auto-generated catch block
   }
 }