Back to project page libgdx-chat-example.
The source code is released under:
Apache License
If you think the Android project libgdx-chat-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.stofkat.chat.server.actionhandlers; //from www . jav a2 s. c o m import javax.servlet.http.HttpSession; import org.apache.http.protocol.ExecutionContext; import org.stofkat.chat.common.actions.UpdateAction; import org.stofkat.chat.common.exceptions.DispatchException; import org.stofkat.chat.common.results.ChatResult; import org.stofkat.chat.server.ActionHandler; import org.stofkat.chat.server.ChatMessagesDatabase; public class UpdateActionHandler implements ActionHandler<UpdateAction, ChatResult> { @Override public Class<UpdateAction> getActionType() { return UpdateAction.class; } @Override public ChatResult execute(UpdateAction action, ExecutionContext context, HttpSession session) throws DispatchException { ChatMessagesDatabase db = ChatMessagesDatabase.getInstance(); return db.getLatestMessages(action.getLastReceivedChatMessageId()); } @Override public void rollback(UpdateAction action, ChatResult result, ExecutionContext context) throws DispatchException { // Not implemented. } }