FileDocCategorySizeDatePackage
SendMessageToRoomAction.javaAPI DocApache Struts 2.0.9 Apps2198Mon Jul 23 13:43:26 BST 2007org.apache.struts2.showcase.chat

SendMessageToRoomAction

public class SendMessageToRoomAction extends com.opensymphony.xwork2.ActionSupport implements org.apache.struts2.interceptor.SessionAware

Fields Summary
private static final long
serialVersionUID
private ChatService
chatService
private String
roomName
private String
message
private Map
session
Constructors Summary
public SendMessageToRoomAction(ChatService chatService)



       
        this.chatService = chatService;
    
Methods Summary
public java.lang.Stringexecute()

        User user = (User) session.get(ChatAuthenticationInterceptor.USER_SESSION_KEY);
        try {
            chatService.sendMessageToRoom(roomName, user, message);
        }catch(ChatException e) {
            addActionError(e.getMessage());
        }
        return SUCCESS;
    
public java.lang.StringgetMessage()

 return this.message; 
public java.lang.StringgetRoomName()

 return this.roomName; 
public voidsetMessage(java.lang.String message)

        this.message = message;
    
public voidsetRoomName(java.lang.String roomName)

        this.roomName = roomName;
    
public voidsetSession(java.util.Map session)

        this.session = session;