Ejemplo n.º 1
0
 public T get(String uuid, String id) {
   if (!containsKey(uuid)) {
     put(uuid, new HashMap<String, T>());
   }
   HashMap<String, T> m = get(uuid);
   if (!m.containsKey(id)) {
     try {
       T newitem = TClass.newInstance();
       newitem.uuid = uuid;
       m.put(id, newitem);
     } catch (Exception e) {
       LOGGER.debug("Error instantiating item " + uuid + "[" + id + "]: " + e);
     }
   }
   return m.get(id);
 }
Ejemplo n.º 2
0
 public void alert() {
   if (isUpnpDevice(uuid)
       && (monitor == null || !monitor.isAlive())
       && !"STOPPED".equals(data.get("TransportState"))) {
     monitor();
   }
   for (ActionListener l : listeners) {
     l.actionPerformed(event);
   }
 }
Ejemplo n.º 3
0
 public Renderer() {
   controls = 0;
   active = false;
   data = new HashMap<>();
   details = null;
   listeners = new LinkedHashSet<>();
   event = new ActionEvent(this, 0, null);
   monitor = null;
   renew = false;
   data.put("TransportState", "STOPPED");
 }
Ejemplo n.º 4
0
 public void mark(String uuid, int property, Object value) {
   HashMap<String, T> m = get(uuid);
   if (m != null) {
     for (T i : m.values()) {
       switch (property) {
         case ACTIVE:
           i.setActive((boolean) value);
           break;
         case RENEW:
           i.renew = (boolean) value;
           break;
         case CONTROLS:
           i.controls = (int) value;
           break;
         default:
           break;
       }
     }
   }
 }