de.knipp.rritoolkit.response
Class QueueReadResponse

java.lang.Object
  extended by de.knipp.rritoolkit.response.Response
      extended by de.knipp.rritoolkit.response.QueueReadResponse

public class QueueReadResponse
extends Response

response of a queue read request

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Nested Class Summary
 
Nested classes/interfaces inherited from class de.knipp.rritoolkit.response.Response
Response.Result
 
Field Summary
private  Message message
          the read message, if any
private  int messageCount
          the number of elements in the queue
 
Constructor Summary
QueueReadResponse()
           
 
Method Summary
 void accept(ResponseVisitor visitor)
          calls the suitable method of the given visitor
protected  void dataFromList(KVMultiList list)
          subclasses that need to read additional data from the key-value pair response should override this method.
protected  void dataFromXml(org.w3c.dom.Element data)
          subclasses that need to read additional data from the XML response should override this method.
 Message getMessage()
          return the retrieved message
 int getMessageCount()
          return the number of messages in the queue
 java.lang.String toString()
          returns a string representation for debugging purposes
 
Methods inherited from class de.knipp.rritoolkit.response.Response
fromList, fromXml, getClientTxnID, getResult, getResultMessages, getServerTxnID, isSuccess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

messageCount

private int messageCount
the number of elements in the queue


message

private Message message
the read message, if any

Constructor Detail

QueueReadResponse

public QueueReadResponse()
Method Detail

dataFromList

protected void dataFromList(KVMultiList list)
                     throws ResponseParseException
subclasses that need to read additional data from the key-value pair response should override this method. The default implementation is empty and need not to be called.

Overrides:
dataFromList in class Response
Parameters:
list - the list
Throws:
ResponseParseException - if the document does not contain the expected content

dataFromXml

protected void dataFromXml(org.w3c.dom.Element data)
                    throws org.w3c.dom.DOMException,
                           ResponseParseException
subclasses that need to read additional data from the XML response should override this method. The default implementation is empty and need not to be called.

Overrides:
dataFromXml in class Response
Parameters:
data - the data element or null if the data contains no additional data
Throws:
org.w3c.dom.DOMException - on DOM exceptions
ResponseParseException - if the document does not contain the expected content

accept

public void accept(ResponseVisitor visitor)
calls the suitable method of the given visitor

Overrides:
accept in class Response
Parameters:
visitor - the visitor

toString

public java.lang.String toString()
returns a string representation for debugging purposes

Overrides:
toString in class Response
Returns:
the string representation

getMessageCount

public int getMessageCount()
return the number of messages in the queue

Returns:
the number of messages

getMessage

public Message getMessage()
return the retrieved message

Returns:
the message or null if no message is in the queue


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH