/** {@inheritDoc} */ @Override public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); // primitive parsing String[] confparts = bindingConfig.trim().split(";"); int id = -1; try { id = Integer.parseInt(confparts[0]); } catch (NumberFormatException e) { logger.debug( "Could not parse the id value from the items-file in processBindingConfiguration()!"); e.printStackTrace(); } String type = confparts[1]; String ip = confparts[2]; HexaBusBindingConfig config = null; try { config = new HexaBusBindingConfig(id, type, InetAddress.getByName(ip)); } catch (UnknownHostException e) { logger.debug( "Could not parse the device ip from the items-file in processBindingConfiguration()!"); e.printStackTrace(); return; } addBindingConfig(item, config); items.put(item.getName(), item); if (config.getPlugType().equals("plug+")) { logger.debug("BindProv ip string: " + config.getIP()); pullList.add(config.getIP()); } }
@Override public int getID(String itemName) { HexaBusBindingConfig config = (HexaBusBindingConfig) bindingConfigs.get(itemName); return config.getID(); }
@Override public InetAddress getIP(String itemName) { HexaBusBindingConfig config = (HexaBusBindingConfig) bindingConfigs.get(itemName); return config.getIP(); }
@Override public String getPlugType(String itemName) { HexaBusBindingConfig config = (HexaBusBindingConfig) bindingConfigs.get(itemName); return config.getPlugType(); }