com.wilko.jaim
Class ErrorTocResponse

java.lang.Object
  |
  +--com.wilko.jaim.TocResponse
        |
        +--com.wilko.jaim.ErrorTocResponse
All Implemented Interfaces:
TocResponseHandler

public class ErrorTocResponse
extends TocResponse
implements TocResponseHandler

This TOC response is sent to a JaimEventListener when an error message is received from the TOC server

Version:
$Revision: 1.7 $
Author:
paulw

Field Summary
static java.lang.String RESPONSE_TYPE
           
 
Fields inherited from class com.wilko.jaim.TocResponse
cmd
 
Constructor Summary
ErrorTocResponse()
          Creates new ErrorTocResponse
 
Method Summary
 boolean canHandle(java.lang.String Response)
          Returns true if this response handler can handle the specified response.
 int getErrorCode()
          Obtain the error code for this response
 java.lang.String getErrorDescription()
          Obtain the error message that corresponds to this error.
static java.lang.String getErrorDescription(int code)
          Obtain the error message that corresponds to the specified error code
 java.lang.String getErrorText()
          Get the error text (if any) associated with this error response
 java.lang.String getResponseType()
           
 TocResponse parseString(java.lang.String str)
          Parse the error response string sent by the TOC server
 
Methods inherited from class com.wilko.jaim.TocResponse
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESPONSE_TYPE

public static final java.lang.String RESPONSE_TYPE
See Also:
Constant Field Values
Constructor Detail

ErrorTocResponse

public ErrorTocResponse()
Creates new ErrorTocResponse

Method Detail

parseString

public TocResponse parseString(java.lang.String str)
Parse the error response string sent by the TOC server

Specified by:
parseString in interface TocResponseHandler
Parameters:
str - The error response string
Returns:
- A TocResponse object that represents this response

getErrorCode

public int getErrorCode()
Obtain the error code for this response

Returns:
The error code

getErrorText

public java.lang.String getErrorText()
Get the error text (if any) associated with this error response

Returns:
The error text

getErrorDescription

public java.lang.String getErrorDescription()
Obtain the error message that corresponds to this error.

Returns:
The error text with any applicable error argument text inserted

getErrorDescription

public static java.lang.String getErrorDescription(int code)
Obtain the error message that corresponds to the specified error code

Parameters:
code - The error code
Returns:
The error text

getResponseType

public java.lang.String getResponseType()
Specified by:
getResponseType in class TocResponse

canHandle

public boolean canHandle(java.lang.String Response)
Returns true if this response handler can handle the specified response.

Specified by:
canHandle in interface TocResponseHandler
Parameters:
Response - - the response string from TOC. This is the part of the response before the first ':'
Returns:
true if the response can be handled

jaimlib.sourceforge.net