/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getUnitConfigsByLocation(final String locationId) throws CouldNotPerformException { return getUnitConfigsByLocation(locationId, true); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} * @throws org.openbase.jul.exception.NotAvailableException {@inheritDoc} */ @Override public List<ServiceConfig> getServiceConfigsByLocation(final String locationId) throws CouldNotPerformException, NotAvailableException { List<ServiceConfig> serviceConfigList = new ArrayList<>(); for (UnitConfig unitConfig : getUnitConfigsByLocation(locationId)) { serviceConfigList.addAll(unitConfig.getServiceConfigList()); } return serviceConfigList; }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getUnitConfigsByLocationLabel(final String locationLabel) throws CouldNotPerformException { final HashMap<String, UnitConfig> unitConfigMap = new HashMap<>(); for (UnitConfig location : getLocationConfigsByLabel(locationLabel)) { for (UnitConfig unitConfig : getUnitConfigsByLocation(location.getId())) { unitConfigMap.put(unitConfig.getId(), unitConfig); } } return new ArrayList<>(unitConfigMap.values()); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} * @throws org.openbase.jul.exception.NotAvailableException {@inheritDoc} */ @Override public List<UnitConfig> getUnitConfigsByLocationLabel(final UnitType unitType, final String locationLabel) throws CouldNotPerformException { HashMap<String, UnitConfig> unitConfigMap = new HashMap<>(); for (UnitConfig location : getLocationConfigsByLabel(locationLabel)) { for (UnitConfig unitConfig : getUnitConfigsByLocation(unitType, location.getId())) { unitConfigMap.put(unitConfig.getId(), unitConfig); } } return new ArrayList<>(unitConfigMap.values()); }
if (!Registries.getLocationRegistry().getUnitConfigsByLocation(UnitTemplateType.UnitTemplate.UnitType.COLORABLE_LIGHT, locationRemote.getId()).isEmpty()) { try { if (locationRemote.isConnected() && locationRemote.isDataAvailable()) {
MultiException.ExceptionStack exceptionStack = null; Registries.waitForData(); for (final UnitConfig unitConfig : Registries.getLocationRegistry().getUnitConfigsByLocation(unitType, getId())) { try { if (recursive || unitConfig.getPlacementConfig().getLocationId().equals(getId())) {
if (selectedUnitType == UnitType.UNKNOWN) { if (selectedLocationConfigHolder != null && !selectedLocationConfigHolder.isNotSpecified()) { for (final UnitConfig config : Registries.getLocationRegistry().getUnitConfigsByLocation(selectedLocationConfigHolder.getConfig().getId())) { try { unitConfigHolderList.add(new UnitConfigHolder(config, Registries.getLocationRegistry().getLocationConfigById(config.getPlacementConfig().getLocationId()))); for (UnitConfig config : Registries.getLocationRegistry().getUnitConfigsByLocation(selectedUnitType, selectedLocationConfigHolder.getConfig().getId())) { try { unitConfigHolderList.add(new UnitConfigHolder(config, Registries.getLocationRegistry().getLocationConfigById(config.getPlacementConfig().getLocationId())));