All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.intelie.liverig.witsml.query.AbstractMessageQuery131 Maven / Gradle / Ivy

The newest version!
package net.intelie.liverig.witsml.query;

import com.google.common.base.Strings;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

abstract class AbstractMessageQuery131 extends AbstractQuery131 {
    private final String uidWell;
    private final String uidWellbore;
    private final String uid;
    private final boolean header;

    protected AbstractMessageQuery131(String uidWell, String uidWellbore, String uid, boolean header) {
        this.uidWell = uidWell;
        this.uidWellbore = uidWellbore;
        this.uid = uid;
        this.header = header;
    }

    @Override
    public String type() {
        return "message";
    }

    @Override
    void query(XMLStreamWriter writer) throws XMLStreamException {
        writeRootElement(writer, "messages");
        writer.writeStartElement(WITSML_NS, "message");
        writer.writeAttribute("uidWell", uidWell);
        writer.writeAttribute("uidWellbore", uidWellbore);
        writer.writeAttribute("uid", Strings.nullToEmpty(uid));
        writer.writeEmptyElement(WITSML_NS, "nameWell");
        writer.writeEmptyElement(WITSML_NS, "nameWellbore");
        writer.writeEmptyElement(WITSML_NS, "name");
        if (header) {
            writer.writeEmptyElement(WITSML_NS, "objectReference");
            writer.writeAttribute("object", "");
            writer.writeAttribute("uidRef", "");
            writer.writeEmptyElement(WITSML_NS, "subObjectReference");
            writer.writeAttribute("object", "");
            writer.writeAttribute("uidRef", "");
            writer.writeEmptyElement(WITSML_NS, "dTim");
            writer.writeEmptyElement(WITSML_NS, "activityCode");
            writer.writeEmptyElement(WITSML_NS, "detailActivity");
            writer.writeEmptyElement(WITSML_NS, "md");
            writer.writeAttribute("uom", "");
            writer.writeAttribute("datum", "");
            writer.writeEmptyElement(WITSML_NS, "mdBit");
            writer.writeAttribute("uom", "");
            writer.writeAttribute("datum", "");
            writer.writeEmptyElement(WITSML_NS, "typeMessage");
            writer.writeEmptyElement(WITSML_NS, "messageText");
            writer.writeEmptyElement(WITSML_NS, "param");
            writer.writeAttribute("index", "");
            writer.writeAttribute("name", "");
            writer.writeAttribute("uom", "");
            writer.writeAttribute("description", "");
            writer.writeEmptyElement(WITSML_NS, "severity");
            writer.writeEmptyElement(WITSML_NS, "warnProbability");

            writeCommonData(writer);
            writer.writeEmptyElement(WITSML_NS, "customData");
        }
        writer.writeEndElement();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy