@Override protected boolean check(M message, final SynchronizedRemoteRegistry<String, M, ?> remoteRegistry) throws CouldNotPerformException { return !remoteRegistry.contains(message); } }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getBaseUnitConfigs() throws CouldNotPerformException { return baseUnitConfigRemoteRegistry.getMessages(); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public UnitConfig getLocationConfigById(final String locationId) throws CouldNotPerformException { unitRegistryRemote.validateData(); return locationUnitConfigRemoteRegistry.getMessage(locationId); }
@Override protected boolean check(final M message, final SynchronizedRemoteRegistry<String, M, ?> remoteRegistry) throws CouldNotPerformException { // if the updated message has been filtered out verify that is not contained anymore // and else verify that the update has been synchronized if (remoteRegistry.getFilter() != null && !remoteRegistry.getFilter().verify(message)) { return !remoteRegistry.contains(getId(message)); } else { return remoteRegistry.getMessage(getId(message)).equals(message); } }
public LocationRegistryController() throws InstantiationException, InterruptedException { super(JPLocationRegistryScope.class, LocationRegistryData.newBuilder()); try { unitRegistryRemote = CachedUnitRegistryRemote.getRegistry(); locationUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(unitRegistryRemote, UnitRegistryData.LOCATION_UNIT_CONFIG_FIELD_NUMBER); connectionUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(unitRegistryRemote, UnitRegistryData.CONNECTION_UNIT_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
@Override public void activate() throws InterruptedException, CouldNotPerformException { authorizationFilter.setAuthorizationGroups(authorizationGroupUnitConfigRemoteRegistry.getEntryMap()); authorizationFilter.setLocations(locationUnitConfigRemoteRegistry.getEntryMap()); super.activate(); }
public UserActivityRegistryRemote() throws InstantiationException, InterruptedException { super(JPUserActivityRegistryScope.class, UserActivityRegistryData.class); try { this.userActivityClassRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, UserActivityRegistryData.USER_ACTIVITY_CLASS_FIELD_NUMBER); this.userActivityConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, UserActivityRegistryData.USER_ACTIVITY_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
/** * {@inheritDoc } * * @throws InterruptedException {@inheritDoc } * @throws CouldNotPerformException {@inheritDoc } */ @Override public void activate() throws InterruptedException, CouldNotPerformException { if (!CachedLocationRegistryRemote.getRegistry().equals(this)) { logger.warn("You are using a " + getClass().getSimpleName() + " which is not maintained by the global registry singelton! This is extremely inefficient! Please use \"Registries.get" + getClass().getSimpleName().replace("Remote", "") + "()\" instead creating your own instances!"); } authorizationFilter.setAuthorizationGroups(unitRegistry.getAuthorizationGroupUnitConfigRemoteRegistry().getEntryMap()); authorizationFilter.setLocations(locationUnitConfigRemoteRegistry.getEntryMap()); super.activate(); }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getDalUnitConfigs() throws CouldNotPerformException { return dalUnitConfigRemoteRegistry.getMessages(); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public Boolean containsConnectionConfigById(String connectionId) throws CouldNotPerformException { unitRegistryRemote.validateData(); return connectionUnitConfigRemoteRegistry.contains(connectionId); }
@Override public UnitConfig getAppConfigById(String appUnitConfigId) throws CouldNotPerformException, NotAvailableException, InterruptedException { validateData(); return appUnitConfigRemoteRegistry.getMessage(appUnitConfigId); }
public DeviceRegistryRemote() throws InstantiationException { super(JPDeviceRegistryScope.class, DeviceRegistryData.class); try { authorizationFilter = new AuthorizationFilter(); deviceClassRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, DeviceRegistryData.DEVICE_CLASS_FIELD_NUMBER); deviceUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, authorizationFilter, DeviceRegistryData.DEVICE_UNIT_CONFIG_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
/** * {@inheritDoc } * * @throws InterruptedException {@inheritDoc } * @throws CouldNotPerformException {@inheritDoc } */ @Override public void activate() throws InterruptedException, CouldNotPerformException { if (!CachedAppRegistryRemote.getRegistry().equals(this)) { logger.warn("You are using a " + getClass().getSimpleName() + " which is not maintained by the global registry singelton! This is extremely inefficient! Please use \"Registries.get" + getClass().getSimpleName().replace("Remote", "") + "()\" instead creating your own instances!"); } authorizationFilter.setAuthorizationGroups(unitRegistry.getAuthorizationGroupUnitConfigRemoteRegistry().getEntryMap()); authorizationFilter.setLocations(unitRegistry.getLocationUnitConfigRemoteRegistry().getEntryMap()); super.activate(); }
@Override public List<ServiceTemplate> getServiceTemplates() throws CouldNotPerformException { validateData(); return serviceTemplateRemoteRegistry.getMessages(); }
/** * {@inheritDoc} * * @param deviceConfig {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public Boolean containsDeviceConfig(UnitConfig deviceConfig) throws CouldNotPerformException { unitRegistryRemote.validateData(); return deviceUnitConfigRemoteRegistry.contains(deviceConfig); }
@Override public UnitConfig getAuthorizationGroupConfigById(String groupConfigId) throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.getMessage(groupConfigId); }
public AppRegistryRemote() throws InstantiationException, InterruptedException { super(JPAppRegistryScope.class, AppRegistryData.class); try { authorizationFilter = new AuthorizationFilter(); appUnitConfigRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, authorizationFilter, AppRegistryData.APP_UNIT_CONFIG_FIELD_NUMBER); appClassRemoteRegistry = new SynchronizedRemoteRegistry<>(this.getIntenalPriorizedDataObservable(), this, AppRegistryData.APP_CLASS_FIELD_NUMBER); } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
/** * {@inheritDoc } * * @throws InterruptedException {@inheritDoc } * @throws CouldNotPerformException {@inheritDoc } */ @Override public void activate() throws InterruptedException, CouldNotPerformException { if (!CachedDeviceRegistryRemote.getRegistry().equals(this)) { logger.warn("You are using a " + getClass().getSimpleName() + " which is not maintained by the global registry singelton! This is extremely inefficient! Please use \"Registries.get" + getClass().getSimpleName().replace("Remote", "") + "()\" instead creating your own instances!"); } authorizationFilter.setAuthorizationGroups(unitRegistry.getAuthorizationGroupUnitConfigRemoteRegistry().getEntryMap()); authorizationFilter.setLocations(unitRegistry.getLocationUnitConfigRemoteRegistry().getEntryMap()); super.activate(); }
@Override public List<UnitConfig> getAppConfigs() throws CouldNotPerformException, NotAvailableException, InterruptedException { validateData(); List<UnitConfig> messages = appUnitConfigRemoteRegistry.getMessages(); return messages; }
@Override public Boolean containsSceneConfig(UnitConfig sceneUnitConfig) throws CouldNotPerformException { unitRegistryRemote.validateData(); return sceneUnitConfigRemoteRegistry.contains(sceneUnitConfig); }