/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getBaseUnitConfigs() throws CouldNotPerformException { return baseUnitConfigRemoteRegistry.getMessages(); }
@Override public List<AppClass> getAppClasses() throws CouldNotPerformException, InterruptedException { validateData(); return appClassRemoteRegistry.getMessages(); }
@Override public List<UnitConfig> getUserConfigs() throws CouldNotPerformException, NotAvailableException { validateData(); List<UnitConfig> messages = userConfigRemoteRegistry.getMessages(); return messages; }
@Override public List<UnitConfig> getAppConfigs() throws CouldNotPerformException { unitRegistryRemote.validateData(); return appUnitConfigRemoteRegistry.getMessages(); }
@Override public List<UnitTemplate> getUnitTemplates() throws CouldNotPerformException { validateData(); return unitTemplateRemoteRegistry.getMessages(); }
@Override public List<UnitConfig> getUnitGroupConfigs() throws CouldNotPerformException { validateData(); return new ArrayList<>(unitGroupUnitConfigRemoteRegistry.getMessages()); }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} * @throws NotAvailableException {@inheritDoc} */ @Override public List<DeviceClass> getDeviceClasses() throws CouldNotPerformException, NotAvailableException { validateData(); return deviceClassRemoteRegistry.getMessages(); }
@Override public List<UnitConfig> getSceneConfigs() throws CouldNotPerformException { unitRegistryRemote.validateData(); return sceneUnitConfigRemoteRegistry.getMessages(); } }
@Override public List<ServiceTemplate> getServiceTemplates() throws CouldNotPerformException { validateData(); return serviceTemplateRemoteRegistry.getMessages(); }
@Override public List<UnitConfig> getAppConfigs() throws CouldNotPerformException, NotAvailableException, InterruptedException { validateData(); List<UnitConfig> messages = appUnitConfigRemoteRegistry.getMessages(); return messages; }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} * @throws org.openbase.jul.exception.NotAvailableException {@inheritDoc} */ @Override public List<UnitConfig> getLocationConfigs() throws CouldNotPerformException, NotAvailableException { validateData(); return locationUnitConfigRemoteRegistry.getMessages(); }
@Override public List<AgentClass> getAgentClasses() throws CouldNotPerformException { validateData(); return agentClassRemoteRegistry.getMessages(); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getLocationConfigsByLabel(final String locationLabel) throws CouldNotPerformException { validateData(); return locationUnitConfigRemoteRegistry.getMessages().stream() .filter(m -> m.getLabel().equalsIgnoreCase(locationLabel)) .collect(Collectors.toCollection(ArrayList::new)); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getConnectionConfigsByLabel(String connectionLabel) throws CouldNotPerformException { unitRegistryRemote.validateData(); return connectionUnitConfigRemoteRegistry.getMessages().stream() .filter(m -> m.getLabel().equals(connectionLabel)) .collect(Collectors.toCollection(ArrayList::new)); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getConnectionConfigsByLabel(String connectionLabel) throws CouldNotPerformException { validateData(); return connectionUnitConfigRemoteRegistry.getMessages().stream() .filter(m -> m.getLabel().equals(connectionLabel)) .collect(Collectors.toCollection(ArrayList::new)); }
@Override public List<UnitConfig> getUnitGroupConfigsByUnitType(final UnitTemplate.UnitType type) throws CouldNotPerformException { validateData(); List<UnitConfig> unitConfigList = new ArrayList<>(); for (UnitConfig unitGroupUnitConfig : unitGroupUnitConfigRemoteRegistry.getMessages()) { if (unitGroupUnitConfig.getType() == type || getSubUnitTypesOfUnitType(type).contains(unitGroupUnitConfig.getType())) { unitConfigList.add(unitGroupUnitConfig); } } return unitConfigList; }
@Override public List<UnitTemplate.UnitType> getSubUnitTypes(UnitTemplate.UnitType type) throws CouldNotPerformException { validateData(); List<UnitTemplate.UnitType> unitTypes = new ArrayList<>(); for (UnitTemplate template : unitTemplateRemoteRegistry.getMessages()) { if (template.getIncludedTypeList().contains(type)) { unitTypes.add(template.getType()); unitTypes.addAll(getSubUnitTypes(template.getType())); } } return unitTypes; }
@Override public List<UnitConfig> getUnitGroupConfigsByUnitConfig(final UnitConfig unitConfig) throws CouldNotPerformException { validateData(); List<UnitConfig> unitConfigList = new ArrayList<>(); for (UnitConfig unitGroupUnitConfig : unitGroupUnitConfigRemoteRegistry.getMessages()) { if (unitGroupUnitConfig.getUnitGroupConfig().getMemberIdList().contains(unitConfig.getId())) { unitConfigList.add(unitGroupUnitConfig); } } return unitConfigList; }
@Override public ServiceTemplate getServiceTemplateByType(ServiceType type) throws CouldNotPerformException { validateData(); for (final ServiceTemplate serviceTemplates : serviceTemplateRemoteRegistry.getMessages()) { if (serviceTemplates.getType() == type) { return serviceTemplates; } } throw new NotAvailableException("ServiceTemplate", type.name(), "No ServiceTemplate with given Type[" + type + "] registered!"); }
@Override public UnitTemplate getUnitTemplateByType(final UnitTemplate.UnitType type) throws CouldNotPerformException { validateData(); for (final UnitTemplate unitTemplate : unitTemplateRemoteRegistry.getMessages()) { if (unitTemplate.getType() == type) { return unitTemplate; } } throw new NotAvailableException("UnitTemplate", type.name(), "No UnitTemplate with given Type[" + type + "] registered!"); }