/** * 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; }
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; }
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); } } } }
/** {@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); } } }
@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); } } } }
/** {@inheritDoc} */ @Override public void allBindingsChanged(BindingProvider provider) { for (String itemName : provider.getItemNames()) { bindingChanged(provider, itemName); } }