Exemplo n.º 1
0
 /**
  * Returns names of all the items, registered with this binding
  *
  * @return list of item names
  */
 public Collection<String> getItemNames() {
   Collection<String> items = null;
   for (BindingProvider provider : providers) {
     if (items == null) {
       items = provider.getItemNames();
     } else {
       items.addAll(provider.getItemNames());
     }
   }
   return items;
 }
Exemplo n.º 2
0
  private String getMiosUnitName(String itemName) {
    logger.trace("getMiosUnitName: start itemName '{}'", itemName);

    for (BindingProvider provider : providers) {
      if (provider instanceof MiosBindingProvider) {
        if (provider.getItemNames().contains(itemName)) {
          return ((MiosBindingProvider) provider).getMiosUnitName(itemName);
        }
      }
    }
    return null;
  }
Exemplo n.º 3
0
  private void registerAllWatches() {
    logger.debug("registerAllWatches: start");

    for (BindingProvider provider : providers) {
      logger.debug("registerAllWatches: provider '{}'", provider.getClass());

      if (provider instanceof MiosBindingProvider) {
        MiosBindingProvider miosProvider = (MiosBindingProvider) provider;

        for (String itemName : provider.getItemNames()) {
          registerWatch(miosProvider, itemName);
        }
      }
    }
  }
Exemplo n.º 4
0
  /** {@inheritDoc} */
  @Override
  public void allBindingsChanged(BindingProvider provider) {
    logger.debug("allBindingsChanged: start provider '{}'", provider);

    if (provider instanceof MiosBindingProvider) {
      MiosBindingProvider miosProvider = (MiosBindingProvider) provider;

      for (String itemName : provider.getItemNames()) {
        registerWatch(miosProvider, itemName);
      }
    }
  }
Exemplo n.º 5
0
 @Override
 public void bindingChanged(BindingProvider prov, String itemName) {
   if (prov.getItemNames().contains(itemName)) {
     try {
       createInternalItem(itemName, prov);
     } catch (Ipx800UnknownDeviceException e) {
       logger.error("Item {} will be ignored", itemName);
     }
   } else {
     logger.debug("Removing item {}", itemName);
     for (String deviceName : devices.keySet()) {
       for (Ipx800Port slot : devices.get(deviceName).getAllPorts()) {
         slot.destroyItem(itemName);
       }
     }
   }
 }
Exemplo n.º 6
0
 /** {@inheritDoc} */
 @Override
 public void allBindingsChanged(BindingProvider provider) {
   for (String itemName : provider.getItemNames()) {
     bindingChanged(provider, itemName);
   }
 }