Class NamingResponse


  • public class NamingResponse
    extends Object
    This NamingResponse class represents a NamingResponse XML document. The NamingResponse DTD is defined as the following:

         <?xml version="1.0">
         < !DOCTYPE NamingResponse [
         < !ELEMENT NamingResponse (GetNamingProfile)>
         < !ATTLIST NamingResponse
           vers   CDATA #REQUIRED
           reqid  CDATA #REQUIRED>
         < !ELEMENT GetNamingProfile (Attribute*|Exception)>
         < !ELEMENT Attribute EMPTY>
         < !ATTLIST Attribute
           name   CDATA #REQUIRED
           value  CDATA #REQUIRED>
         < !ELEMENT Exception (#PCDATA)>
         ]>
     

    • Constructor Detail

      • NamingResponse

        public NamingResponse​(String reqid)
        This constructor shall only be used at the server side to construct a NamingResponse object.
        Parameters:
        reqid - The original request ID.
    • Method Detail

      • parseXML

        public static NamingResponse parseXML​(String xml)
        This method is used primarily at the client side to reconstruct a NamingResponse object based on the XML document received from server. The DTD of this XML document is described above.
        Parameters:
        xml - The NamingResponse XML document String.
      • getResponseVersion

        public String getResponseVersion()
        Gets the response version.
        Returns:
        The response version.
      • getRequestID

        public String getRequestID()
        Gets the request ID.
        Returns:
        The request ID.
      • setAttribute

        public void setAttribute​(String name,
                                 String value)
        Sets the naming attribute.
        Parameters:
        name - attribute name.
        value - attribute value.
      • getAttribute

        public String getAttribute​(String name)
        Gets the attribute.
        Parameters:
        name - attribute name.
        Returns:
        the attribute value.
      • getNamingTable

        public Hashtable getNamingTable()
        Gets the naming table.
      • setNamingTable

        public void setNamingTable​(Hashtable table)
        Sets the naming table.
      • setException

        public void setException​(String ex)
        Sets the exception.
        Parameters:
        ex - A string representing the exception.
      • getException

        public String getException()
        Gets the exception.
        Returns:
        The exception.
      • replaceURI

        public void replaceURI​(String uri)
        Replaces "%uri" with the acutal URI
      • toXMLString

        public String toXMLString()
        This method translates the response to an XML document String based on the NamingResponse DTD described above.
        Returns:
        An XML String representing the response.