예제 #1
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();
    }
예제 #2
0
 public void handle(ActionResult event) {
   String tz = event.getParameter("Time zone", ValueType.STRING).getString();
   // String tz = conn.timezones.get(tzKey);
   BitPoolServerModelBitPoolEntity pool = null;
   try {
     conn.poolsApi.poolsSetPoolTimezone(node.getAttribute("Pool key").getString(), tz);
     pool = conn.poolsApi.poolsGetPool(node.getAttribute("Pool key").getString());
   } catch (ApiException e) {
     // TODO Auto-generated catch block
     return;
   }
   if (pool != null) {
     node.setAttribute("Pool key", new Value(pool.getPoolKey()));
     node.setAttribute(
         "Registration date", new Value(conn.link.safeToString(pool.getRegistrationDate())));
     node.setAttribute("Public", new Value(pool.getPublic()));
     node.setAttribute("Virtual", new Value(pool.getVirtual()));
     node.setAttribute("Owner", new Value(pool.getOwner()));
     node.setAttribute("Access mode", new Value(pool.getAccessMode().toString()));
     node.setAttribute("Utc offset", new Value(pool.getUtcOffset()));
     node.setAttribute("Time zone", new Value(pool.getTimeZone()));
     init();
   }
 }