public abstract class AbstractStaticReplyCommandHandler extends AbstractTrackingCommandHandler
replyCode
property. If only the
replyCode
property is set, then the default reply text corresponding to that
reply code is used in the response. You can optionally configure the reply text by setting
the replyMessageKey
or replyText
property.
Subclasses can optionally override the reply code and/or text for the reply by calling
setReplyCode(int)
, setReplyMessageKey(String)
and setReplyText(String)
.
Modifier and Type | Field and Description |
---|---|
protected int |
replyCode |
protected String |
replyMessageKey |
protected String |
replyText |
LOG
Constructor and Description |
---|
AbstractStaticReplyCommandHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
sendReply(Session session)
Send the reply using the replyCode and message key/text configured for this command handler.
|
protected void |
sendReply(Session session,
Object messageParameter)
Send the reply using the replyCode and message key/text configured for this command handler.
|
void |
setReplyCode(int replyCode)
Set the reply code.
|
void |
setReplyMessageKey(String replyMessageKey)
Set the message key for the reply text.
|
void |
setReplyText(String replyText)
Set the reply text.
|
clearInvocations, getInvocation, handleCommand, handleCommand, numberOfInvocations, sendReply
assertValidReplyCode, getReplyTextBundle, quotes, setReplyTextBundle
protected int replyCode
protected String replyText
protected String replyMessageKey
public void setReplyCode(int replyCode)
replyCode
- - the replyCodeAssertFailedException
- - if the replyCode is not validpublic void setReplyText(String replyText)
replyText
- - the replyTextpublic void setReplyMessageKey(String replyMessageKey)
replyMessageKey
- - the replyMessageKey to setprotected void sendReply(Session session)
session
- - the SessionAssertFailedException
- if the replyCode is not validprotected void sendReply(Session session, Object messageParameter)
session
- - the SessionmessageParameter
- - message parameter; may be nullAssertFailedException
- if the replyCode is not validCopyright © 2016. All rights reserved.