/** * A convenience method for disabling logging. * @param resource * @throws IllegalArgumentException * if <code>resource</code> is a {@link StringResource} */ public static void deactivateLogging(SingleValueResource resource) throws IllegalArgumentException { RecordedData rd = getHistoricalData(resource); rd.setConfiguration(null); }
/** * Check whether logging is enabled for the resource. This is a convenience method, * the same check can be performed using only basic API methods, such as * {@link FloatResource#getHistoricalData()}, and the methods provided by {@link RecordedData} * and {@link RecordedDataConfiguration}. * @param resource * @return */ public static boolean isLoggingEnabled(SingleValueResource resource) { try { RecordedData rd = getHistoricalData(resource); if (rd == null || rd.getConfiguration() == null) return false; else return true; } catch (IllegalArgumentException e) { return false; } }
RecordedData rd = getHistoricalData(resource); RecordedDataConfiguration rcd = new RecordedDataConfiguration(); switch ((int) updateInterval) {
if (config.isCopyLoggingState() && source instanceof SingleValueResource) { if (LoggingUtils.isLoggingEnabled((SingleValueResource) source)) { final RecordedData rd = LoggingUtils.getHistoricalData((SingleValueResource) source); if (rd != null) { final RecordedDataConfiguration cfg = rd.getConfiguration();