Direct Known Subclasses:
ActionResponse, QueryResponse

public class ControlResponseextends SOAPResponse
Represents a UPnP control response. Extends SOAPResponse to provide UPnP-specific error handling and fault response functionality.
  • Field Details

  • Constructor Details

    • ControlResponse

      public ControlResponse()
      /////////////////////////////////////////////
    • ControlResponse

      public ControlResponse(SOAPResponse soapRes)
      Constructs a ControlResponse from a SOAP response.
      Parameters:
      soapRes - the SOAP response to wrap
  • Method Details

    • setFaultResponse

      public void setFaultResponse(int errCode, String errDescr)
      Sets a fault response with the specified error code and description.
      Parameters:
      errCode - the UPnP error code
      errDescr - the error description
    • setFaultResponse

      public void setFaultResponse(int errCode)
      Sets a fault response with the specified error code. The error description is automatically generated from the error code.
      Parameters:
      errCode - the UPnP error code
    • createFaultResponseNode

      private Node createFaultResponseNode(int errCode, String errDescr)
      Builds the SOAP fault node for an error.
      Parameters:
      errCode - the UPnP error code
      errDescr - the description of the error
      Returns:
      the fault response node
    • createFaultResponseNode

      private Node createFaultResponseNode(int errCode)
      Builds a SOAP fault element with a default description.
      Parameters:
      errCode - the UPnP error number
      Returns:
      the fault node
    • getUPnPErrorNode

      private Node getUPnPErrorNode()
      Gets the UPnP error node from the fault detail.
      Returns:
      the UPnP error node, or null if not found
    • getUPnPErrorCodeNode

      private Node getUPnPErrorCodeNode()
      Gets the UPnP error code node.
      Returns:
      the error code node, or null if not found
    • getUPnPErrorDescriptionNode

      private Node getUPnPErrorDescriptionNode()
      Gets the UPnP error description node.
      Returns:
      the error description node, or null if not found
    • getUPnPErrorCode

      public int getUPnPErrorCode()
      Gets the UPnP error code from the response.
      Returns:
      the error code, or -1 if not found or invalid
    • getUPnPErrorDescription

      public String getUPnPErrorDescription()
      Gets the UPnP error description from the response.
      Returns:
      the error description, or empty string if not found
    • getUPnPError

      public UPnPStatus getUPnPError()
      Gets the complete UPnP error status from the response.
      Returns:
      a UPnPStatus object containing the error code and description