/** * Write XML formatted PV configuration * * @param writer PrintWriter */ @Override public void write(final PrintWriter writer) { XMLWriter.start(writer, 2, Model.TAG_PV); writer.println(); writeCommonConfig(writer); XMLWriter.XML(writer, 3, Model.TAG_SCAN_PERIOD, getScanPeriod()); XMLWriter.XML(writer, 3, Model.TAG_LIVE_SAMPLE_BUFFER_SIZE, getLiveCapacity()); XMLWriter.XML(writer, 3, Model.TAG_REQUEST, getRequestType().name()); for (ArchiveDataSource archive : archives) { XMLWriter.start(writer, 3, Model.TAG_ARCHIVE); writer.println(); XMLWriter.XML(writer, 4, Model.TAG_NAME, archive.getName()); XMLWriter.XML(writer, 4, Model.TAG_URL, archive.getUrl()); XMLWriter.XML(writer, 4, Model.TAG_KEY, archive.getKey()); XMLWriter.end(writer, 3, Model.TAG_ARCHIVE); writer.println(); } XMLWriter.end(writer, 2, Model.TAG_PV); writer.println(); }
/** * @param archive Archive data source * @return <code>true</code> if PV uses given data source */ public boolean hasArchiveDataSource(final ArchiveDataSource archive) { for (ArchiveDataSource arch : archives) if (arch.equals(archive)) return true; return false; }