Class XMLRequest

    • Constructor Detail

      • XMLRequest

        public XMLRequest()
    • Method Detail

      • getSrc

        protected abstract java.lang.String getSrc()
        Returns the request source. This method is used internally.
        Returns:
        Source
      • createRequest

        protected abstract void createRequest​(com.uc4.util.XMLDocument doc,
                                              org.w3c.dom.Element request,
                                              ConnectionAttributes sessionInfo)
        Creates the XML Document for the request. This method is used internally.
        Parameters:
        doc - Document, used to create new Elements
        request - Request Element - classes append information to this request element
        sessionInfo - Information about the session
      • createNATRequest

        protected com.automic.protocol.Message createNATRequest​(ConnectionAttributes sessionInfo)
        Sub classes may override this method send messages in NAT protocol to the AE.
        Parameters:
        sessionInfo - Session infos
        Returns:
        Message or null if not used
      • handleResponse

        public final void handleResponse​(com.uc4.util.XMLDocument doc,
                                         ConnectionAttributes session)
        Handles the response from the server. This method should be called from IResponseHandler#handleResponse.
        Parameters:
        doc - Document returned from the server
        session - Information about the session
      • handleContent

        protected void handleContent​(com.uc4.util.XMLDocument doc,
                                     ConnectionAttributes session)
        Sub classes extract the values from the XML document and provide public getter methods.
        Parameters:
        doc - XML Document
        session - Info about the user session
      • showQuarantineNotification

        public boolean showQuarantineNotification()
        Returns true if a new quarantine message has been found. This information can be used to show an alert message to users. The request GetQuarantineMessage can be used to get more details about the crash.
        Returns:
        true if an alert should be shown, false if the alert notification can be removed.
      • getMessageBox

        public final MessageBox getMessageBox()
        Returns a MessageBox object if the server returns a message for this request. The message can indicate an error.
        Returns:
        MessageBox or null if there is no message
      • getAllMessageBoxes

        public final java.util.List<MessageBox> getAllMessageBoxes()
        Returns a List of all MessageBoxes object if the server returns messages for this request. The messages can indicate an error, warning or information.
        Returns:
        List of MessageBox received in the request.
      • setMessageBox

        protected void setMessageBox​(MessageBox box)
        Used in XMLRequestSet to move the Message Box from a child request to the XMLRequestSet object.
        Parameters:
        box - Message Box
      • isAllowedInClientZero

        protected boolean isAllowedInClientZero()
        This method is used internally. Tests if this XMLRequest is allowed in client 0. The default implementation returns false, subclasses may override.
        Returns:
        true if this request is allowed in client 0, false otherwise
      • ignoreMessageBox

        protected boolean ignoreMessageBox()
      • emptyAttributes

        protected boolean emptyAttributes​(org.w3c.dom.NamedNodeMap attributeMap,
                                          com.uc4.translate.Message translator)
        Returns true if the attribute map is not empty. Also an error message is set. Used by internal tests only.
        Parameters:
        attributeMap - attribute map
        translator - message translator
        Returns:
        true if the attribute map is empty
      • checkClient

        protected static final void checkClient​(int client)
      • checkID

        protected static final void checkID​(int id)
      • checkNull

        protected static final void checkNull​(java.lang.Object object,
                                              java.lang.String msg)
      • checkLnr

        protected static final void checkLnr​(int lnr)
      • checkUC4ObjectName

        protected static final void checkUC4ObjectName​(UC4ObjectName name)
      • checkUC4ObjectEmptyName

        protected static final void checkUC4ObjectEmptyName​(UC4ObjectName name)
      • assertClientZero

        protected static final void assertClientZero​(ConnectionAttributes sessioninfo)
      • assertServerVersion

        protected static final void assertServerVersion​(ConnectionAttributes sessioninfo,
                                                        int minExpected)
      • send

        public void send​(org.w3c.dom.Document doc,
                         ConnectionAttributes sessioninfo,
                         java.lang.String nr)
        Prepares the request for sending.
        Parameters:
        doc - DOM
        sessioninfo - Information about the UC4 session
        nr - Request number
      • getRequestID

        public java.lang.String getRequestID​(java.lang.String defaultValue)
        Sub classes may override to send a UUID instead. This is used for a file transfer from the Agent to the client
        Parameters:
        defaultValue - Unique number which is not used so far
        Returns:
        ID to use to send this request
      • checkSystemOverviewPrivilege

        protected static final void checkSystemOverviewPrivilege​(ConnectionAttributes sessionInfo)
      • checkSelStatisticsPrivilege

        protected static final void checkSelStatisticsPrivilege​(ConnectionAttributes sessionInfo)