net.sf.beep4j
Interface Reply

All Known Implementing Classes:
SessionImpl.DefaultReply, SessionImpl.InitialReply

public interface Reply

A ResponseHandler is passed to the application whenever a message of type MSG is received. (see ChannelHandler#receiveRequest(Channel, Message, ResponseHandler)) It allows the application to reply to the received message. According to section 2.1.1 of the BEEP specification (RFC 3080) the allowed exchange styles are:

Author:
Simon Raess

Method Summary
 MessageBuilder createMessageBuilder()
          Creates a new MessageBuilder object that can be used to create one new message.
 void sendANS(Message message)
          Sends a reply of type ANS.
 void sendERR(Message message)
          Sends a negative reply of type ERR.
 void sendNUL()
          Sends a reply of type NUL.
 void sendRPY(Message message)
          Sends a positive reply of type RPY.
 

Method Detail

createMessageBuilder

MessageBuilder createMessageBuilder()
Creates a new MessageBuilder object that can be used to create one new message.

Returns:
a new MessageBuilder object

sendANS

void sendANS(Message message)
Sends a reply of type ANS. This method can be called zero or more times. To complete the response the method sendNUL() has to be invoked.

Parameters:
message - the response
Throws:
java.lang.IllegalArgumentException - if the message is null
java.lang.IllegalStateException - if a response has already been sent

sendNUL

void sendNUL()
Sends a reply of type NUL. This method must be called to complete a one-to-many exchange.

Throws:
java.lang.IllegalStateException - if a response has already been sent

sendERR

void sendERR(Message message)
Sends a negative reply of type ERR. This method can only be called exactly once.

Parameters:
message - the response
Throws:
java.lang.IllegalArgumentException - if the message is null
java.lang.IllegalStateException - if a response has already been sent

sendRPY

void sendRPY(Message message)
Sends a positive reply of type RPY. This method can only be called exactly once.

Parameters:
message - the response
Throws:
java.lang.IllegalArgumentException - if the message is null
java.lang.IllegalStateException - if a response has already been sent


Copyright © 2007 null. All Rights Reserved.