public class OMUtils extends Object
Provides Helper methods to read and write O&M observations in a version agnostic manner.
Modifier and Type | Field and Description |
---|---|
protected static String |
defaultVersion |
static String |
OBSERVATION |
static String |
OM |
static String |
V2_0 |
protected static Pattern |
versionRegex |
Modifier and Type | Method and Description |
---|---|
String |
getVersion(DOMHelper dom,
Element omElt)
Logic to guess O&M version from namespace
|
static void |
loadRegistry() |
IObservation |
readObservation(DOMHelper dom,
Element obsElt)
Read an O&M observation object from a DOM element
|
IObservation |
readObservation(InputStream inputStream)
Reads an O&M observation object from an InputStream
|
IObservation |
readObservationSeries(InputStream inputStream) |
Element |
writeObservation(DOMHelper dom,
IObservation obs,
String version)
Builds a DOM Element from the content of the IObservation object
|
void |
writeObservation(OutputStream outputStream,
IObservation obs,
String version)
Writes XML for an Observation of selected version in the specified OutputStream
|
public static final String OM
public static final String V2_0
public static final String OBSERVATION
protected static final Pattern versionRegex
protected static final String defaultVersion
public OMUtils(String version)
public static void loadRegistry()
public IObservation readObservation(DOMHelper dom, Element obsElt) throws XMLReaderException
dom
- DOMHelper to use to read the element contentobsElt
- DOM element corresponding to the ObservationXMLReaderException
public IObservation readObservation(InputStream inputStream) throws XMLReaderException
inputStream
- input stream to read fromXMLReaderException
public IObservation readObservationSeries(InputStream inputStream) throws XMLReaderException
XMLReaderException
public Element writeObservation(DOMHelper dom, IObservation obs, String version) throws XMLWriterException
dom
- DOMHelper used to generate the elementobs
- Observation instance whose content will be serializedversion
- Version of O&M schema to useXMLWriterException
public void writeObservation(OutputStream outputStream, IObservation obs, String version) throws XMLWriterException, IOException
outputStream
- Outputstream to write the XML intoobs
- Observation instance whose content will be serializedversion
- Version of O&M schema to useXMLWriterException
IOException
Copyright © 2016 Sensia Software LLC. All rights reserved.