/** * {@inheritDoc} * * @throws org.openbase.jul.exception.NotAvailableException */ @Override public UnitTemplate getUnitTemplate() throws NotAvailableException { if (template == null) { throw new NotAvailableException("UnitTemplate"); } return template; }
/** * Method returns the latest triggered value. * * @return the latest value. * @throws NotAvailableException is thrown if a value was never triggered. */ public VALUE getLatestValue() throws NotAvailableException { if (latestValue == null) { throw new NotAvailableException("LatestValue"); } return latestValue; }
/** * Method returns the timestamp of the Stopwatch start. * * @return the timestamp in milliseconds. * @throws org.openbase.jul.exception.NotAvailableException is thrown in case the Stopwatch was never started. */ public long getStartTime() throws NotAvailableException { if (startTime == -1) { throw new NotAvailableException("StartTime"); } return startTime; }
private Package detectVersionConverterPackage() throws CouldNotPerformException { Package converterPackage; try { converterPackage = Class.forName((getClass().getPackage().getName() + "." + DB_CONVERTER_PACKAGE_NAME + ".ConverterPackageIdentifier")).getPackage(); } catch (ClassNotFoundException ex) { throw new NotAvailableException("ConverterPackage[" + getClass().getPackage().getName() + "." + DB_CONVERTER_PACKAGE_NAME + ".ConverterPackageIdentifier" + "]", ex); } return converterPackage; }
protected RSBSynchronizedRemoteServer(final Scope scope, final Double timeout) throws InstantiationException { super(scope, null); try { if (timeout == null) { throw new NotAvailableException("timeout"); } this.timeout = timeout; } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
private Scope detectScope(final CONFIG config) throws NotAvailableException { try { return (Scope) getConfigField(FIELD_SCOPE, config); } catch (CouldNotPerformException ex) { throw new NotAvailableException("scope"); } }
protected RSBSynchronizedParticipant(final Scope scope, final ParticipantConfig config) throws InstantiationException { try { if (scope == null) { throw new NotAvailableException("scope"); } this.scope = scope; this.config = config; } catch (CouldNotPerformException ex) { throw new InstantiationException(this, ex); } }
public boolean checkIfReachable() { try { return InetAddress.getByName(hostName).isReachable(REACHABLE_TIMEOUT); } catch (IOException ex) { ExceptionPrinter.printHistory(new NotAvailableException(hostName + " is not reachable!", ex), logger); return false; } }
@Override @Deprecated public BrightnessState getBrightnessState() throws NotAvailableException { try { return getData().getBrightnessState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("BrightnessState", ex); } }
@Override public TemperatureState getTemperatureState() throws NotAvailableException { try { return getData().getTemperatureState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("TemperatureState", ex); } }
@Override public StandbyState getStandbyState() throws NotAvailableException { try { return getData().getStandbyState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("StandbyState", ex); } }
@Override public TemperatureState getTemperatureState() throws NotAvailableException { try { return getData().getTemperatureState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("TemperatureState", ex); } }
@Override public TemperatureState getTargetTemperatureState() throws NotAvailableException { try { return getData().getTargetTemperatureState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("TargetTemperatureState", ex); } } }
@Override public UserPresenceState getUserPresenceState() throws NotAvailableException { try { return getData().getUserPresenceState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("user presence state", ex); } }
@Override public AlarmState getSmokeAlarmState() throws NotAvailableException { try { return getData().getSmokeAlarmState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("SmokeAlarmState", ex); } }
@Override public SmokeState getSmokeState() throws NotAvailableException { try { return getData().getSmokeState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("SmokeState", ex); } } }
@Override public ServiceFactory getServiceFactory() throws NotAvailableException { if (serviceFactory == null) { throw new NotAvailableException("ServiceFactory", new NotSupportedException("Unit hosting", this)); } return serviceFactory; }
@Override public BrightnessState getBrightnessState() throws NotAvailableException { try { return getData().getBrightnessState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("brightnessState", ex); } }
@Override public IlluminanceState getIlluminanceState() throws NotAvailableException { try { return getData().getIlluminanceState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("illuminanceState", ex); } }
@Override public TamperState getTamperState() throws NotAvailableException { try { return getData().getTamperState(); } catch (CouldNotPerformException ex) { throw new NotAvailableException("TamperState", ex); } }