@Override public Boolean isReady() throws InterruptedException { return isDataAvailable() && super.isReady(); }
@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(); }
@Override public UnitConfig getAppConfigById(String appUnitConfigId) throws CouldNotPerformException, NotAvailableException, InterruptedException { validateData(); return appUnitConfigRemoteRegistry.getMessage(appUnitConfigId); }
@Override public void activate() throws InterruptedException, CouldNotPerformException { authorizationFilter.setAuthorizationGroups(authorizationGroupUnitConfigRemoteRegistry.getEntryMap()); authorizationFilter.setLocations(locationUnitConfigRemoteRegistry.getEntryMap()); super.activate(); }
@Override protected void postInit() throws InitializationException, InterruptedException { super.postInit(); registryRemotes.clear(); registerRegistryRemotes(); bindRegistryRemoteToRemoteRegistries(); }
@Override public void waitForData() throws CouldNotPerformException, InterruptedException { for (RegistryRemote registryRemote : registryRemotes) { registryRemote.waitForData(); } super.waitForData(); waitForVirtualRegistrySync(); }
@Override public boolean isDataAvailable() { for (RegistryRemote registryRemote : registryRemotes) { if (!registryRemote.isDataAvailable()) { return false; } } // TODO release: // workaround, should be removed in release scrab virtualRegistryInitiallySynchronized = virtualRegistryInitiallySynchronized || isVirtualRegistrySynchronized(); return super.isDataAvailable() && virtualRegistryInitiallySynchronized; }
@Override public void deactivate() throws InterruptedException, CouldNotPerformException { getRemoteRegistries().forEach((remoteRegistry) -> { remoteRegistry.removeObserver(synchronisationObserver); }); super.deactivate(); }
@Override protected void deactivateRemoteRegistries() throws CouldNotPerformException, InterruptedException { getRegistryRemotes().forEach((registryRemote) -> { registryRemote.removeDataObserver(virtualRegistrySynchronizer); }); super.deactivateRemoteRegistries(); }
@Override protected void postInit() throws InitializationException, InterruptedException { super.postInit(); //To change body of generated methods, choose Tools | Templates. try { try { registerRegistryRemotes(); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not register all registry remotes!", ex); } } catch (CouldNotPerformException ex) { throw new InitializationException(this, ex); } }
/** * * @param observable The observable to get informed about data updates. * @param remoteService The remote service to get informed about data updates. * @param fieldDescriptors The field descriptors which are used for the internal registry synchronization. * @throws InstantiationException is thrown in case the instantiation fails. */ public SynchronizedRemoteRegistry(final Observable observable, final RSBRemoteService<M> remoteService, final Descriptors.FieldDescriptor... fieldDescriptors) throws InstantiationException { this.observable = observable; this.fieldDescriptors = fieldDescriptors; this.remoteService = remoteService; this.remoteRegistrySynchronizer = new RemoteRegistrySynchronizer(this, fieldDescriptors); }
protected void activateRemoteRegistries() throws CouldNotPerformException, InterruptedException { for (RemoteRegistry remoteRegistry : remoteRegistryList) { if (remoteRegistry instanceof SynchronizedRemoteRegistry) { ((SynchronizedRemoteRegistry) remoteRegistry).activate(); } } }
protected void deactivateRemoteRegistries() throws CouldNotPerformException, InterruptedException { for (final RemoteRegistry remoteRegistry : remoteRegistryList) { if (remoteRegistry instanceof SynchronizedRemoteRegistry) { ((SynchronizedRemoteRegistry) remoteRegistry).deactivate(); } } }
@Override public Boolean containsUnitTemplate(final UnitTemplate unitTemplate) throws CouldNotPerformException { validateData(); return unitTemplateRemoteRegistry.contains(unitTemplate); }
/** * {@inheritDoc} * * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} */ @Override public List<UnitConfig> getDalUnitConfigs() throws CouldNotPerformException { return dalUnitConfigRemoteRegistry.getMessages(); }
@Override public UnitConfig getAuthorizationGroupConfigById(String groupConfigId) throws CouldNotPerformException { validateData(); return authorizationGroupConfigRemoteRegistry.getMessage(groupConfigId); }
/** * * @param observable The observable to get informed about data updates. * @param remoteService The remote service to get informed about data updates. * @param internalMap the internal map instance of this registry. * @param fieldDescriptors The field descriptors which are used for the internal registry synchronization. * @throws InstantiationException is thrown in case the instantiation fails. */ public SynchronizedRemoteRegistry(final Observable observable, final RSBRemoteService<M> remoteService, final Map<KEY, IdentifiableMessage<KEY, M, MB>> internalMap, final Descriptors.FieldDescriptor... fieldDescriptors) throws InstantiationException { super(internalMap); this.observable = observable; this.fieldDescriptors = fieldDescriptors; this.remoteService = remoteService; this.remoteRegistrySynchronizer = new RemoteRegistrySynchronizer(this, fieldDescriptors); }
@Override public Boolean containsUnitTemplateById(final String unitTemplateId) throws CouldNotPerformException { validateData(); return unitTemplateRemoteRegistry.contains(unitTemplateId); }
/** * {@inheritDoc} * * @throws org.openbase.jul.exception.CouldNotPerformException {@inheritDoc} */ @Override public Boolean containsConnectionConfig(UnitConfig connectionConfig) throws CouldNotPerformException { validateData(); return connectionUnitConfigRemoteRegistry.contains(connectionConfig); }