Package com.pragprog.aebook.persistchat

Examples of com.pragprog.aebook.persistchat.ChatMessage


            query.setFilter("chat == desiredRoom");
            query.declareParameters("String desiredRoom");
            query.setOrdering("date");
            List<ChatMessage> messages =  (List<ChatMessage>)query.execute(chat);
            // Get the most recent message.
            ChatMessage lastMessage = messages.get(messages.size() - 1);//(1)
            ChatMessageList result = new ChatMessageList(chat, lastMessage.getDate());
            result.addMessages(messages);
            return result;
        } finally {
            persister.close();
        }
View Full Code Here


            query.declareParameters("String desiredRoom, Date earliest");//(6)
            query.setFilter("chat == desiredRoom && date > earliest"); //(7)
            query.setOrdering("date");
            List<ChatMessage> messages =  (List<ChatMessage>)query.execute(chat);
            // Get the most recent message.
            ChatMessage lastMessage = messages.get(messages.size() - 1);
            ChatMessageList result = new ChatMessageList(chat, lastMessage.getDate());
            result.addMessages(messages);
            return result;
        } finally {
            persister.close();
        }
View Full Code Here

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (20)
                ChatMessage chatmsg = new ChatMessage(getUser(), messageBox
                        .getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<List<ChatMessage>>() {
                            public void onFailure(Throwable caught) {
                                PersistChat.this.addNewMessage(new ChatMessage(
                                        "System", "Error sending message: "
                                                + caught.getMessage(),
                                        getCurrentChat()));
                            }

View Full Code Here

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (20)
                ChatMessage chatmsg = new ChatMessage(getUser(), messageBox
                        .getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<List<ChatMessage>>() {
                            public void onFailure(Throwable caught) {
                                PersistChat.this.addNewMessage(new ChatMessage(
                                        "System", "Error sending message: "
                                                + caught.getMessage(),
                                        getCurrentChat()));
                            }

View Full Code Here

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (19)
                ChatMessage chatmsg = new ChatMessage(user,
                        messageBox.getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        Chat.this.addNewMessage(new ChatMessage(
                                "System", "Error sending message: " +
                                caught.getMessage(),
                                getCurrentChat()));
                    }

View Full Code Here

                }
            }

            /** Send a chat message to the server. */
            private void sendMessageToServer() { // (19)
                ChatMessage chatmsg = new ChatMessage(user,
                        messageBox.getText(), getCurrentChat());
                messageBox.setText("");
                chatService.postMessage(chatmsg,
                        new AsyncCallback<Void>() {
                    public void onFailure(Throwable caught) {
                        Chat.this.addNewMessage(new ChatMessage(
                                "System", "Error sending message: " +
                                caught.getMessage(),
                                getCurrentChat()));
                    }

View Full Code Here

TOP

Related Classes of com.pragprog.aebook.persistchat.ChatMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.