org.jvoicexml.event.error
Class BadFetchProtocolResponsecodeError

java.lang.Object
  extended by java.lang.Throwable
      extended by org.jvoicexml.event.JVoiceXMLEvent
          extended by org.jvoicexml.event.ErrorEvent
              extended by org.jvoicexml.event.error.BadFetchError
                  extended by org.jvoicexml.event.error.BadFetchProtocolResponsecodeError
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BadFetchHttpResponsecodeError

public class BadFetchProtocolResponsecodeError
extends BadFetchError

In the case of a fetch failure, the interpreter context must use a detailed event type telling which specific HTTP or other protocol-specific response code was encountered. The value of the response code for HTTP is defined in [RFC2616]. This allows applications to differentially treat a missing document from a prohibited document, for instance. The value of the response code for other protocols (such as HTTPS, RTSP, and so on) is dependent upon the protocol.

Version:
$Revision: 197 $

Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jvoicexml.event.error.BadFetchError
EVENT_TYPE
 
Constructor Summary
BadFetchProtocolResponsecodeError(String usedProtocol, int detectedResponseCode)
          Constructs a new event with the event type as its detail message.
BadFetchProtocolResponsecodeError(String usedProtocol, int detectedResponseCode, String message)
          Constructs a new event with the specified detail message. the given detail message is expanded to the form <getEventType()>>: <message>.
BadFetchProtocolResponsecodeError(String usedProtocol, int detectedResponseCode, String message, Throwable cause)
          Constructs a new event with the specified detail message and cause.
BadFetchProtocolResponsecodeError(String usedProtocol, int detectedResponseCode, Throwable cause)
          Constructs a new event with the specified cause and a detail message of (cause==null ?
 
Method Summary
protected  void appendSpecificationDetails(StringBuilder str)
          Appends the protocol and response code to the type.
 String getProtocol()
          Retrieve the protocol.
 int getResponseCode()
          Retrieve the protocol-specific response code.
 
Methods inherited from class org.jvoicexml.event.error.BadFetchError
getEventType
 
Methods inherited from class org.jvoicexml.event.JVoiceXMLEvent
getMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BadFetchProtocolResponsecodeError

public BadFetchProtocolResponsecodeError(String usedProtocol,
                                         int detectedResponseCode)
Constructs a new event with the event type as its detail message. The cause is not initialized.

The usedProtocol and the detectedResponseCode are used to construct the event type.

Parameters:
usedProtocol - The used protocol.
detectedResponseCode - The protocol-specific response code.
See Also:
BadFetchError.getEventType()

BadFetchProtocolResponsecodeError

public BadFetchProtocolResponsecodeError(String usedProtocol,
                                         int detectedResponseCode,
                                         String message)
Constructs a new event with the specified detail message. the given detail message is expanded to the form <getEventType()>>: <message>. The cause is not initialized.

The usedProtocol and the detectedResponseCode are used to construct the event type.

Parameters:
usedProtocol - The used protocol.
detectedResponseCode - The protocol-specific response code.
message - The detail message.
See Also:
BadFetchError.getEventType()

BadFetchProtocolResponsecodeError

public BadFetchProtocolResponsecodeError(String usedProtocol,
                                         int detectedResponseCode,
                                         Throwable cause)
Constructs a new event with the specified cause and a detail message of (cause==null ? getEventType() : cause.toString()) (which typically contains the class and detail message of cause).

The usedProtocol and the detectedResponseCode are used to construct the event type.

Parameters:
usedProtocol - The used protocol.
detectedResponseCode - The protocol-specific response code.
cause - The cause.
See Also:
BadFetchError.getEventType()

BadFetchProtocolResponsecodeError

public BadFetchProtocolResponsecodeError(String usedProtocol,
                                         int detectedResponseCode,
                                         String message,
                                         Throwable cause)
Constructs a new event with the specified detail message and cause.

The usedProtocol and the detectedResponseCode are used to construct the event type.

Parameters:
usedProtocol - The used protocol.
detectedResponseCode - The protocol-specific response code.
message - The detail message.
cause - The cause.
See Also:
BadFetchError.getEventType()
Method Detail

getProtocol

public final String getProtocol()
Retrieve the protocol.

Returns:
The protocol.

getResponseCode

public final int getResponseCode()
Retrieve the protocol-specific response code.

Returns:
Protocol-specific response code.
See Also:
getProtocol()

appendSpecificationDetails

protected final void appendSpecificationDetails(StringBuilder str)
Appends the protocol and response code to the type. The event type has the following form

<BadFetchError.EVENT_TYPE>.<protocol>.<responseCode>

Appends detail information to the type information.

Overrides:
appendSpecificationDetails in class BadFetchError
Parameters:
str - type prefix.


Copyright © 2005-2007 JVoiceXML group.