Exemplo n.º 1
0
 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);
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 private XmlObject encodeToHeader(WsaToHeader wsaHeader) {
   ToDocument toDoc =
       ToDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   toDoc.addNewTo().setStringValue(wsaHeader.getValue());
   return toDoc;
 }
Exemplo n.º 5
0
 private XmlObject encodeActionHeader(WsaActionHeader wsaHeader) {
   ActionDocument actionDoc =
       ActionDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   actionDoc.addNewAction().setStringValue(wsaHeader.getValue());
   return actionDoc;
 }
Exemplo n.º 6
0
 private XmlObject encodeMessageIDHeader(WsaMessageIDHeader wsaHeader) {
   MessageIDDocument messageIDDoc =
       MessageIDDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   messageIDDoc.addNewMessageID().setStringValue(wsaHeader.getValue());
   return null;
 }
Exemplo n.º 7
0
 private XmlObject encodeRelatesToHeader(WsaRelatesToHeader wsaHeader) {
   RelatesToDocument relatesToDoc =
       RelatesToDocument.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions());
   relatesToDoc.addNewRelatesTo().setStringValue(wsaHeader.getValue());
   return relatesToDoc;
 }