private String addSensorMLWrapperForXmlDescription(final AbstractProcessType xbProcessType) {
   final SensorMLDocument xbSensorMLDoc =
       SensorMLDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   final net.opengis.sensorML.x101.SensorMLDocument.SensorML xbSensorML =
       xbSensorMLDoc.addNewSensorML();
   xbSensorML.setVersion(SensorMLConstants.VERSION_V101);
   final Member member = xbSensorML.addNewMember();
   final AbstractProcessType xbAbstractProcessType =
       (AbstractProcessType)
           member
               .addNewProcess()
               .substitute(
                   getQnameForType(xbProcessType.schemaType()), xbProcessType.schemaType());
   xbAbstractProcessType.set(xbProcessType);
   return xbSensorMLDoc.xmlText(XmlOptionsHelper.getInstance().getXmlOptions());
 }
 private String toString(SosProcedureDescription desc, String format) throws OwsExceptionReport {
   if (desc instanceof SosProcedureDescriptionUnknowType
       && desc.isSetSensorDescriptionXmlString()) {
     return desc.getSensorDescriptionXmlString();
   }
   XmlOptions options = XmlOptionsHelper.getInstance().getXmlOptions();
   return CodingHelper.encodeObjectToXml(format, desc).xmlText(options);
 }
 private SensorML parseSensorML(final SensorMLDocument xbSensorML) throws OwsExceptionReport {
   final SensorML sensorML = new SensorML();
   // get member process
   for (final Member xbMember : xbSensorML.getSensorML().getMemberArray()) {
     if (xbMember.getProcess() != null) {
       if (xbMember.getProcess() instanceof AbstractProcessType) {
         final AbstractProcessType xbAbstractProcess = xbMember.getProcess();
         AbstractProcess abstractProcess = null;
         if (xbAbstractProcess.schemaType() == SystemType.type) {
           abstractProcess = parseSystem((SystemType) xbAbstractProcess);
         } else if (xbAbstractProcess.schemaType() == ProcessModelType.type) {
           abstractProcess = parseProcessModel((ProcessModelType) xbAbstractProcess);
         } else if (xbAbstractProcess.schemaType() == ComponentType.type) {
           abstractProcess = parseComponent((ComponentType) xbAbstractProcess);
         } else {
           throw new InvalidParameterValueException()
               .at(XmlHelper.getLocalName(xbMember))
               .withMessage(
                   "The process of a member of the SensorML Document (%s) is not supported!",
                   xbMember.getProcess().getDomNode().getNodeName());
         }
         sensorML.addMember(abstractProcess);
       } else {
         throw new InvalidParameterValueException()
             .at(XmlHelper.getLocalName(xbMember))
             .withMessage(
                 "The process of a member of the SensorML Document (%s) is not supported!",
                 xbMember.getProcess().getDomNode().getNodeName());
       }
     } else {
       throw new InvalidParameterValueException()
           .at(XmlHelper.getLocalName(xbMember))
           .withMessage(
               "The process of a member of the SensorML Document is null (%s)!",
               xbMember.getProcess());
     }
   }
   sensorML.setSensorDescriptionXmlString(
       xbSensorML.xmlText(XmlOptionsHelper.getInstance().getXmlOptions()));
   return sensorML;
 }
Beispiel #4
0
 private XmlObject encodeToHeader(WsaToHeader wsaHeader) {
   ToDocument toDoc =
       ToDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   toDoc.addNewTo().setStringValue(wsaHeader.getValue());
   return toDoc;
 }
Beispiel #5
0
 private XmlObject encodeActionHeader(WsaActionHeader wsaHeader) {
   ActionDocument actionDoc =
       ActionDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   actionDoc.addNewAction().setStringValue(wsaHeader.getValue());
   return actionDoc;
 }
Beispiel #6
0
 private XmlObject encodeMessageIDHeader(WsaMessageIDHeader wsaHeader) {
   MessageIDDocument messageIDDoc =
       MessageIDDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   messageIDDoc.addNewMessageID().setStringValue(wsaHeader.getValue());
   return null;
 }
Beispiel #7
0
 private XmlObject encodeRelatesToHeader(WsaRelatesToHeader wsaHeader) {
   RelatesToDocument relatesToDoc =
       RelatesToDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   relatesToDoc.addNewRelatesTo().setStringValue(wsaHeader.getValue());
   return relatesToDoc;
 }