Class JDFJMF

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, IStreamWriter, org.w3c.dom.Element, org.w3c.dom.ElementTraversal, org.w3c.dom.events.EventTarget, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.TypeInfo

    public class JDFJMF
    extends JDFAutoJMF
    The wrapper for JMF messages, i.e. the root of a JMF document
    See Also:
    Serialized Form
    • Constructor Detail

      • JDFJMF

        public JDFJMF​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                      java.lang.String qualifiedName)
        Constructor for JDFJMF
        Parameters:
        myOwnerDocument -
        qualifiedName -
      • JDFJMF

        public JDFJMF​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                      java.lang.String myNamespaceURI,
                      java.lang.String qualifiedName)
        Constructor for JDFJMF
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
      • JDFJMF

        public JDFJMF​(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
                      java.lang.String myNamespaceURI,
                      java.lang.String qualifiedName,
                      java.lang.String myLocalName)
        Constructor for JDFJMF
        Parameters:
        myOwnerDocument -
        myNamespaceURI -
        qualifiedName -
        myLocalName -
    • Method Detail

      • parseFile

        public static JDFJMF parseFile​(java.io.File file)
        parse a JMF file
        Parameters:
        file -
        Returns:
        the parsed JDFNode
      • parseFile

        public static JDFJMF parseFile​(java.lang.String fileName)
        parse a JMF file
        Parameters:
        fileName -
        Returns:
        the parsed JDFNode
      • toString

        public java.lang.String toString()
        toString
        Overrides:
        toString in class KElement
        Returns:
        String
        See Also:
        Object.toString()
      • getMaxVersion

        public JDFElement.EnumVersion getMaxVersion()
        get attribute MaxVersion, defaults to version if not set
        Overrides:
        getMaxVersion in class JDFAutoJMF
        Returns:
        EnumVersion - attribute value default - getMaxVersion(false)
      • getMessage

        public JDFMessage getMessage​(int i)
        GetMessage - get the ith message, regardless of type
        Parameters:
        i - message index
        Returns:
        JDFMessage - the ith message
      • getCommand

        @Deprecated
        public JDFCommand getCommand​(int i,
                                     boolean bCreate)
        Deprecated.
        use getMessageElement or getCreateMessageElement
        Parameters:
        i -
        bCreate -
        Returns:
      • getQuery

        @Deprecated
        public JDFQuery getQuery​(int i,
                                 boolean bCreate)
        Deprecated.
        use getMessageElement or getCreateMessageElement
        Parameters:
        i -
        bCreate -
        Returns:
      • getResponse

        @Deprecated
        public JDFResponse getResponse​(int i,
                                       boolean bCreate)
        Deprecated.
        use getMessageElement or getCreateMessageElement
        getResponse()
        Parameters:
        i -
        bCreate -
        Returns:
      • getSignal

        @Deprecated
        public JDFSignal getSignal​(int i,
                                   boolean bCreate)
        Deprecated.
        use getMessageElement
        Parameters:
        i -
        bCreate -
        Returns:
      • getCreateMessageElement

        public JDFMessage getCreateMessageElement​(JDFMessage.EnumFamily family,
                                                  JDFMessage.EnumType typ,
                                                  int i)
        get an existing message element, create it if it doesn't exist
        Parameters:
        family - the Message family - Query, Acknowledge, Command, Response, Registration or Signal
        typ - the message type
        i - get the ith element
        Returns:
        the newly created message
      • getCreateMessageElement

        @Deprecated
        public JDFMessage getCreateMessageElement​(JDFMessage.EnumFamily family,
                                                  int i)
        Deprecated.
        use getCreateMessageElement(family, null, i);
        get an existing message element, create it if it doesn't exist
        Parameters:
        family - the Message family - Query, Acknowledge, Command, Response, Registration or Signal
        i - get the ith element
        Returns:
        the newly created message
      • appendMessageElement

        @Deprecated
        public JDFMessage appendMessageElement​(JDFMessage.EnumFamily family)
        Deprecated.
        use appendMessageElement (family, null);
        append a message element to this
        Parameters:
        family -
        Returns:
      • createJMF

        public static JDFJMF createJMF​(JDFMessage.EnumFamily family,
                                       JDFMessage.EnumType typ)
        create a new JMF with one Message Element of family family and type typ
        Parameters:
        family - the Message family - Query, Acknowledge, Command, Response, Registration or Signal
        typ - the messages @Type value, null if unknown
        Returns:
        the newly created message
      • appendMessageElement

        public JDFMessage appendMessageElement​(JDFMessage.EnumFamily family,
                                               JDFMessage.EnumType typ)
        append a message element to this
        Parameters:
        family - the Message family - Query, Acknowledge, Command, Response, Registration or Signal
        typ - the messages @Type value, null if unknown
        Returns:
        the newly created message
      • getMessageElement

        @Deprecated
        public JDFMessage getMessageElement​(JDFMessage.EnumFamily family,
                                            int i)
        Deprecated.
        since 060619, use getMessageElement (JDFMessage.EnumFamily family, JDFMessage.EnumType typ, int i)
        get the ith message element of family type family
        Parameters:
        family -
        i -
        Returns:
      • getMessageElement

        public JDFMessage getMessageElement​(JDFMessage.EnumFamily family,
                                            JDFMessage.EnumType typ,
                                            int i)
        get the ith message element of family type family
        Parameters:
        family - the Message family - Query, Acknowledge, Command, Response, Registration or Signal
        typ - the messages @Type value, null if unknown
        i - the i'th message element to get, if i<0, get from back
        Returns:
        the matching message, null if none are found
      • getMessageVector

        @Deprecated
        public VElement getMessageVector()
        Deprecated.
        use getMessageVector (null, null)
        get a vector of all messages in this JMF
        Returns:
        VElement all message elements
      • getMessageVector

        @Deprecated
        public VElement getMessageVector​(JDFMessage.EnumFamily family)
        Deprecated.
        use getMessageVector (family, null)
        get a vector of all messages in this JMF
        Parameters:
        family - requested message family
        Returns:
        VElement all message elements
      • getMessageVector

        public static VElement getMessageVector​(JDFDoc doc,
                                                JDFMessage.EnumFamily family,
                                                JDFMessage.EnumType typ)
        get a vector of all messages in a JMF from a JDFDoc
        Parameters:
        doc - the JDFDoc to search - only valid for root JMF
        family - requested message family
        typ - requested message type
        Returns:
        VElement all message elements, null if no match found
      • getMessageVector

        public VElement getMessageVector​(JDFMessage.EnumFamily family,
                                         JDFMessage.EnumType typ)
        get a vector of all messages in this JMF
        Parameters:
        family - requested message family
        typ - requested message type
        Returns:
        VElement all message elements
      • getAcknowledge

        @Deprecated
        public JDFAcknowledge getAcknowledge​(int i,
                                             boolean bCreate)
        Deprecated.
        use getMessageElement or appendMessageElement
        Parameters:
        i -
        bCreate -
        Returns:
      • appendCommand

        public JDFCommand appendCommand​(JDFMessage.EnumType typ)
        Append a Command
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFQuery the newly created message element
      • appendRegistration

        public JDFRegistration appendRegistration​(JDFMessage.EnumType typ)
        Append a Command
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFQuery the newly created message element
      • appendQuery

        public JDFQuery appendQuery​(JDFMessage.EnumType typ)
        Append a query
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFQuery: the newly created message element
      • appendSignal

        public JDFSignal appendSignal​(JDFMessage.EnumType typ)
        Append a Signal
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFSignal: the newly created message element
      • appendResponse

        public JDFResponse appendResponse​(JDFMessage.EnumType typ)
        Append a Response
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFResponse the newly created message element
      • appendAcknowledge

        public JDFAcknowledge appendAcknowledge​(JDFMessage.EnumType typ)
        Append an Acknowledge
        Parameters:
        typ - the type attribute of the appended message
        Returns:
        JDFAcknowledge the newly created message element
      • getTheSenderID

        public static java.lang.String getTheSenderID()
        Returns:
        the theSenderID which is used as default when initializing new messages
      • setTheSenderID

        public static void setTheSenderID​(java.lang.String _theSenderID)
        set the default senderID that is used to generate jmf messages
        Parameters:
        _theSenderID - the theSenderID to set
      • createResponse

        public JDFJMF createResponse()
        create a new response for all messages of this if the message is any message except response correctly fills refId, type etc.
        Returns:
        the newly created JMF with multiple responses
      • collectICSVersions

        public VString collectICSVersions()
        collect ICSVersions from all message children also removes duplicate entries from this and remove ""
        Returns:
        VString of all ICS versions
      • convertResponses

        public void convertResponses​(JDFQuery q)
        convert all responses that match the query q to signals
        Parameters:
        q - the query to convert
      • getSubmissionURL

        public java.lang.String getSubmissionURL()
        get the @URL of this message if it is either a submitQueueEntry, a returnQueuentry or a resubmitqueueentry
        Returns:
        the String
      • getAcknowledge

        public JDFAcknowledge getAcknowledge​(java.lang.String refID)
        get element Acknowledge
        Parameters:
        refID - refID of the response
        Returns:
        JDFResponse the element
      • getResponse

        public JDFResponse getResponse​(java.lang.String refID)
        (27) get element Response
        Parameters:
        refID - refID of the response
        Returns:
        JDFResponse the element