Examples of ChatException


Examples of net.zschech.gwt.chat.client.ChatException

   
    // setup the mapping of user names to CometSessions
    if (users.putIfAbsent(username, cometSession) != null) {
      // some one else has already logged in with this user name
      httpSession.invalidate();
      throw new ChatException("User: " + username + " already logged in");
    }
  }
View Full Code Here

Examples of net.zschech.gwt.chat.client.ChatException

  @Override
  public void logout(String username) throws ChatException {
    // check if there is a HTTP session setup.
    HttpSession httpSession = getThreadLocalRequest().getSession(false);
    if (httpSession == null) {
      throw new ChatException("User: " + username + " is not logged in: no http session");
    }
   
    // check if there is a Comet session setup. In a larger application the HTTP session may have been
    // setup via other means.
    CometSession cometSession = CometServlet.getCometSession(httpSession, false);
    if (cometSession == null) {
      throw new ChatException("User: " + username + " is not logged in: no comet session");
    }
   
    // check the user name parameter matches the HTTP sessions user name
    if (!username.equals(httpSession.getAttribute("username"))) {
      throw new ChatException("User: " + username + " is not logged in on this session");
    }
   
    // remove the mapping of user name to CometSession
    users.remove(username, cometSession);
    httpSession.invalidate();
View Full Code Here

Examples of net.zschech.gwt.chat.client.ChatException

  @Override
  public void send(String message) throws ChatException {
    // check if there is a HTTP session setup.
    HttpSession httpSession = getThreadLocalRequest().getSession(false);
    if (httpSession == null) {
      throw new ChatException("not logged in: no http session");
    }
   
    // get the user name for the HTTP session.
    String username = (String) httpSession.getAttribute("username");
    if (username == null) {
      throw new ChatException("not logged in: no http session username");
    }
   
    // create the chat message
    ChatMessage chatMessage = new ChatMessage();
    chatMessage.setUsername(username);
View Full Code Here

Examples of net.zschech.gwt.chat.client.ChatException

  @Override
  public void setStatus(Status status) throws ChatException {
    // check if there is a HTTP session setup.
    HttpSession httpSession = getThreadLocalRequest().getSession(false);
    if (httpSession == null) {
      throw new ChatException("not logged in: no http session");
    }
   
    // get the user name for the HTTP session.
    String username = (String) httpSession.getAttribute("username");
    if (username == null) {
      throw new ChatException("not logged in: no http session username");
    }
   
    // create the chat message
    StatusUpdate statusUpdate = new StatusUpdate();
    statusUpdate.setUsername(username);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.