org.n52.oxf.sml.util
Class SmlHelper

java.lang.Object
  extended by org.n52.oxf.sml.util.SmlHelper

public class SmlHelper
extends Object

A helper class to conveniently read SensorML documents.

An instance is read into an internal cache for performance reasons. That means that once read, the helper can be reused on the same instance. One could decide to hold the helper instance on caller side instead of the sensorML document. If needed the cache can be cleared by clearCachedSml().


Field Summary
 net.opengis.sensorML.x101.SensorMLDocument cachedDocument
           
static String LONG_NAME_NAME
           
static String OGC_LONG_NAME_URN
           
static String OGC_SHORT_NAME_URN
           
static String OGC_UNIQUE_ID_URN
           
static String SHORT_NAME_NAME
           
static String UNIQUE_ID_NAME
           
 
Constructor Summary
SmlHelper()
           
 
Method Summary
 net.opengis.sensorML.x101.ComponentType asComponent(net.opengis.sensorML.x101.AbstractProcessType process)
           
 net.opengis.sensorML.x101.SystemType asSystem(net.opengis.sensorML.x101.AbstractProcessType process)
           
 void clearCachedSml()
          Clears the cachedDocument SensorML description.
 String findUniqueIdFrom(net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)
           
 net.opengis.sensorML.x101.SensorMLDocument getCachedSmlFrom(org.apache.xmlbeans.XmlObject smlContainer)
          Parses the passed procedure description into SensorML and caches the result for later use.
 net.opengis.swe.x101.DataComponentPropertyType getField(String name, net.opengis.swe.x101.DataRecordType dataRecord)
           
 net.opengis.sensorML.x101.IdentificationDocument.Identification getIdentification(net.opengis.sensorML.x101.SensorMLDocument smlDoc)
          Gets the first Identification entry of the first SensorML member.
 String getIdValueFrom(String name, net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)
          Finds the value from a given sml:identification that matches either name.
 String getIdValueFrom(String name, String definition, net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)
          Finds the value from a given sml:identification that matches either name or definition.
 net.opengis.sensorML.x101.InterfaceDocument.Interface getServiceInterface(String name, net.opengis.sensorML.x101.InterfacesDocument.Interfaces interfaces)
           
 net.opengis.sensorML.x101.SensorMLDocument getSmlFrom(org.apache.xmlbeans.XmlObject smlContainer)
           
 String getStringValue(net.opengis.swe.x101.DataComponentPropertyType field)
           
 boolean isComponent(net.opengis.sensorML.x101.AbstractProcessType process)
           
 boolean isScalar(net.opengis.swe.x101.DataComponentPropertyType field)
           
 boolean isSystem(net.opengis.sensorML.x101.AbstractProcessType process)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedDocument

public net.opengis.sensorML.x101.SensorMLDocument cachedDocument

UNIQUE_ID_NAME

public static final String UNIQUE_ID_NAME
See Also:
Constant Field Values

LONG_NAME_NAME

public static final String LONG_NAME_NAME
See Also:
Constant Field Values

SHORT_NAME_NAME

public static final String SHORT_NAME_NAME
See Also:
Constant Field Values

OGC_UNIQUE_ID_URN

public static final String OGC_UNIQUE_ID_URN
See Also:
Constant Field Values

OGC_LONG_NAME_URN

public static final String OGC_LONG_NAME_URN
See Also:
Constant Field Values

OGC_SHORT_NAME_URN

public static final String OGC_SHORT_NAME_URN
See Also:
Constant Field Values
Constructor Detail

SmlHelper

public SmlHelper()
Method Detail

getSmlFrom

public net.opengis.sensorML.x101.SensorMLDocument getSmlFrom(org.apache.xmlbeans.XmlObject smlContainer)
                                                      throws org.apache.xmlbeans.XmlException
Parameters:
smlContainer - the xml container containing the SensorML description
Returns:
the procedure description parsed as SensorML
Throws:
org.apache.xmlbeans.XmlException - if parsing to SensorML fails.

getCachedSmlFrom

public net.opengis.sensorML.x101.SensorMLDocument getCachedSmlFrom(org.apache.xmlbeans.XmlObject smlContainer)
                                                            throws org.apache.xmlbeans.XmlException
Parses the passed procedure description into SensorML and caches the result for later use. If a new SensorML description shall be cachedDocument the cachedDocument instance can be cleared by clearCachedSml().

Parameters:
smlContainer - the xml container containing the SensorML description
Returns:
the procedure description parsed as SensorML
Throws:
org.apache.xmlbeans.XmlException - if parsing to SensorML fails.
See Also:
#getSmlFrom(ProcedureDescription), clearCachedSml()

clearCachedSml

public void clearCachedSml()
Clears the cachedDocument SensorML description.


asSystem

public net.opengis.sensorML.x101.SystemType asSystem(net.opengis.sensorML.x101.AbstractProcessType process)

asComponent

public net.opengis.sensorML.x101.ComponentType asComponent(net.opengis.sensorML.x101.AbstractProcessType process)

findUniqueIdFrom

public String findUniqueIdFrom(net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)

getIdentification

public net.opengis.sensorML.x101.IdentificationDocument.Identification getIdentification(net.opengis.sensorML.x101.SensorMLDocument smlDoc)
Gets the first Identification entry of the first SensorML member.

Parameters:
smlDoc - the sensor description document.
Returns:
the first Identification of the first member found in the sensor description, or null if not found.

getIdValueFrom

public String getIdValueFrom(String name,
                             net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)
Finds the value from a given sml:identification that matches either name.

Parameters:
name - the name to search for (mandatory)
identifier - the sml:identifier to search
Returns:
true if name or definition could be found in the sml:identifier

getIdValueFrom

public String getIdValueFrom(String name,
                             String definition,
                             net.opengis.sensorML.x101.IdentificationDocument.Identification smlIdentification)
Finds the value from a given sml:identification that matches either name or definition.

Parameters:
name - the name to search for (mandatory)
definition - the definition to search for (optional)
identifier - the sml:identifier to search
Returns:
true if name or definition could be found in the sml:identifier

isComponent

public boolean isComponent(net.opengis.sensorML.x101.AbstractProcessType process)

isSystem

public boolean isSystem(net.opengis.sensorML.x101.AbstractProcessType process)

getServiceInterface

public net.opengis.sensorML.x101.InterfaceDocument.Interface getServiceInterface(String name,
                                                                                 net.opengis.sensorML.x101.InterfacesDocument.Interfaces interfaces)

getStringValue

public String getStringValue(net.opengis.swe.x101.DataComponentPropertyType field)

getField

public net.opengis.swe.x101.DataComponentPropertyType getField(String name,
                                                               net.opengis.swe.x101.DataRecordType dataRecord)

isScalar

public boolean isScalar(net.opengis.swe.x101.DataComponentPropertyType field)


Copyright © 2012-2013 52north.org. All Rights Reserved.