public static String generateStringRep(final Collection<String> components) throws CouldNotPerformException { try { String stringRep = Scope.COMPONENT_SEPARATOR; for (String component : components) { stringRep += component; stringRep += Scope.COMPONENT_SEPARATOR; } return stringRep; } catch (RuntimeException ex) { throw new CouldNotPerformException("Could not generate scope string representation!", ex); } }
public void publishData(T data) throws CouldNotPerformException, InterruptedException { LOGGER.trace("Publishing data via RSB."); try { informer.publish(data); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("RSB informer could not send the data.", ex); } }
@Override public Future<AuthenticatedValue> registerUnitConfigAuthenticated(AuthenticatedValue authenticatedValue) throws CouldNotPerformException { try { return RPCHelper.callRemoteMethod(authenticatedValue, this, AuthenticatedValue.class); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not register unit config!", ex); } }
@Override public Future<UnitConfig> removeUnitGroupConfig(final UnitConfig groupConfig) throws CouldNotPerformException { try { return RPCHelper.callRemoteMethod(groupConfig, this, UnitConfig.class); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not remove group unit config!", ex); } }
@Override public Future<ServiceTemplate> updateServiceTemplate(ServiceTemplate serviceTemplate) throws CouldNotPerformException { try { return RPCHelper.callRemoteMethod(serviceTemplate, this, ServiceTemplate.class); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not update service template!", ex); } }
public void waitForActivation() throws CouldNotPerformException, InterruptedException { try { serverWatchDog.waitForServiceActivation(); } catch (final CouldNotPerformException ex) { throw new CouldNotPerformException("Could not wait for activation!", ex); } }
@Override public void activate() throws CouldNotPerformException, InterruptedException { LOGGER.info("Activating " + getClass().getName() + "."); if (!initialized) { throw new CouldNotPerformException("Activate can only be called after init."); } if (!active) { active = true; rsbConnection.activate(); } }
private List<RdfTriple> rfidStateValue(final List<?> serviceDataCollList) throws CouldNotPerformException { //TODO aggregate string...?! final List<RdfTriple> triples = new ArrayList<>(); if (serviceDataCollList.get(0) instanceof OntStateChangeBuf) { List<OntStateChangeBuf> rfidValueList = dismissUnusedStateValues((List<OntStateChangeBuf>) serviceDataCollList); } else if (serviceDataCollList.get(0) instanceof OntAggregatedStateChange) { } else { throw new CouldNotPerformException("Could not identify parameter type. Dropped data..."); } return triples; }
@Override public <ReplyType, RequestType> ReplyType call(String name, RequestType data, double timeout) throws CouldNotPerformException { throw new CouldNotPerformException("Could not call Method["+name+"]!", new InvalidStateException("RemoteServer not initialized!")); } }
@Override public Future<UnitConfig> removeAppConfig(final UnitConfig appUnitConfig) throws CouldNotPerformException { try { return new RemovalFuture<>(RPCHelper.callRemoteMethod(appUnitConfig, this, UnitConfig.class), appUnitConfigRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not remove appUnitConfig!", ex); } }
@Override public Future<AgentClass> updateAgentClass(AgentClass agentClass) throws CouldNotPerformException { try { return new UpdateFuture<>(RPCHelper.callRemoteMethod(agentClass, this, AgentClass.class), agentClassRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not update agent class!", ex); } }
@Override public Future<UnitConfig> registerUserConfig(final UnitConfig userConfig) throws CouldNotPerformException { try { return new RegistrationFuture<>(RPCHelper.callRemoteMethod(userConfig, this, UnitConfig.class), userConfigRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not register user config!", ex); } }
@Override public Future<AppClass> removeAppClass(AppClass appClass) throws CouldNotPerformException { try { return new RemovalFuture<>(RPCHelper.callRemoteMethod(appClass, this, AppClass.class), appClassRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not remove app class!", ex); } }
@Override public Future<AgentClass> removeAgentClass(AgentClass agentClass) throws CouldNotPerformException { try { return new RemovalFuture<>(RPCHelper.callRemoteMethod(agentClass, this, AgentClass.class), agentClassRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not remove agent class!", ex); } }
@Override public Future<UnitConfig> removeAuthorizationGroupConfig(UnitConfig groupConfig) throws CouldNotPerformException { try { return new RemovalFuture<>(RPCHelper.callRemoteMethod(groupConfig, this, UnitConfig.class), authorizationGroupConfigRemoteRegistry, this); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not remove group config[" + groupConfig + "]!", ex); } }
protected <U extends AbstractUnitController<?, ?>> void registerUnit(final U unit) throws CouldNotPerformException { synchronized (unitMapLock) { try { if (unitMap.containsKey(unit.getId())) { throw new VerificationFailedException("Could not register " + unit + "! Unit with same name already registered!"); } unitMap.put(unit.getId(), unit); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not registerUnit!", ex); } } }
@Override public void update(final Observable<GeneratedMessage> source, GeneratedMessage data) { try { updateDynamicComponents(data); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not update unit remote view!", ex), logger); } }
@Override public Future<ActionFuture> setUserPresenceState(UserPresenceState userPresenceState) throws CouldNotPerformException { try (ClosableDataBuilder<Builder> dataBuilder = getDataBuilder(this)) { dataBuilder.getInternalBuilder().setUserPresenceState(userPresenceState); } catch (CouldNotPerformException | NullPointerException ex) { throw new CouldNotPerformException("Could not set user presence state to [" + userPresenceState + "] for " + this + "!", ex); } return CompletableFuture.completedFuture(null); } }
public synchronized static void reinitialize() throws InterruptedException, CouldNotPerformException { try { getRegistry().reinit(REMOTE_LOCK); getRegistry().requestData().get(10, TimeUnit.SECONDS); } catch (ExecutionException | TimeoutException | CouldNotPerformException | CancellationException ex) { throw new CouldNotPerformException("Could not reinitialize " + CachedAgentRegistryRemote.class.getSimpleName() + "!", ex); } }
public List<LocationRemote> getNeighborLocationList(final boolean waitForData) throws CouldNotPerformException { final List<LocationRemote> neighborList = new ArrayList<>(); try { for (UnitConfig locationUnitConfig : CachedLocationRegistryRemote.getRegistry().getNeighborLocations(getId())) { neighborList.add(Units.getUnit(locationUnitConfig, waitForData, LOCATION)); } } catch (InterruptedException ex) { throw new CouldNotPerformException("Could not get all neighbors!", ex); } return neighborList; }