org.beepcore.beep.lib
Class Reply

java.lang.Object
  extended byorg.beepcore.beep.lib.Reply
All Implemented Interfaces:
ReplyListener

public class Reply
extends java.lang.Object
implements ReplyListener

Provides a synchronous abstraction for receiving BEEP reply messages. The caller may block using getNextReply when as it waits for incoming messages. Reply is produced by the Channel.sendMSG method. Please note that the other Channel send operations do NOT return this class as a result.

See Also:
Channel.sendMSG(org.beepcore.beep.core.OutputDataStream, org.beepcore.beep.core.ReplyListener)

Constructor Summary
Reply()
           
 
Method Summary
 Message getNextReply()
          Returns the reply corresponding to a Channel.sendMSG call as a Message.
 boolean hasNext()
          Indicates if there are more messages to retrive.
 void receiveANS(Message message)
          Called when the underlying BEEP framework receives a reply of type ANS.
 void receiveERR(Message message)
          Called when the underlying BEEP framework receives a reply of type ERR.
 void receiveNUL(Message message)
          Called when the underlying BEEP framework receives a reply of type NUL.
 void receiveRPY(Message message)
          Called when the underlying BEEP framework receives a reply of type RPY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reply

public Reply()
Method Detail

getNextReply

public Message getNextReply()
                     throws BEEPInterruptedException
Returns the reply corresponding to a Channel.sendMSG call as a Message. Always call hasNext previous to calling getNextReply to discover whether or not getNextReply should be called again. If all messages for this reply have been returned, a subsequent call will throw a NoSuchElementException.

Returns:
Message Contains the reply to the previous request.
Throws:
BEEPException
java.util.NoSuchElementException - If the reply is complete and no more Messages can be returned.
BEEPInterruptedException
See Also:
Message, hasNext()

hasNext

public boolean hasNext()
                throws BEEPInterruptedException
Indicates if there are more messages to retrive. While hasNext returns true the reply to the previous sendMSG is not complete. Call getNextReply to return unretrieved messages.

Throws:
BEEPInterruptedException
See Also:
getNextReply()

receiveRPY

public void receiveRPY(Message message)
Description copied from interface: ReplyListener
Called when the underlying BEEP framework receives a reply of type RPY.

Specified by:
receiveRPY in interface ReplyListener
Parameters:
message - BEEP message
See Also:
Message

receiveERR

public void receiveERR(Message message)
Description copied from interface: ReplyListener
Called when the underlying BEEP framework receives a reply of type ERR.

Specified by:
receiveERR in interface ReplyListener
Parameters:
message - BEEP message
See Also:
Message

receiveANS

public void receiveANS(Message message)
Description copied from interface: ReplyListener
Called when the underlying BEEP framework receives a reply of type ANS.

Specified by:
receiveANS in interface ReplyListener
Parameters:
message - BEEP message
See Also:
Message

receiveNUL

public void receiveNUL(Message message)
Description copied from interface: ReplyListener
Called when the underlying BEEP framework receives a reply of type NUL.

Specified by:
receiveNUL in interface ReplyListener
Parameters:
message - BEEP message
See Also:
Message


Copyright ? 2001 Invisible Worlds, Inc. All Rights Reserved.