Package com.calclab.emite.core.conn

Examples of com.calclab.emite.core.conn.StreamSettings


   * @return true if the session is paused (if the session was ready), false
   *         otherwise
   */
  private final boolean pauseSession() {
    logger.info("Pausing connection...");
    final StreamSettings stream = session.pause();
    if (stream == null)
      return false;

    final String user = session.getCurrentUserURI().toString();
    final Map<String, String> map = Maps.newHashMap();
    map.put("rid", "" + stream.rid);
    map.put("sid", stream.sid);
    map.put("wait", stream.wait);
    map.put("inactivity", stream.getInactivityString());
    map.put("maxPause", stream.getMaxPauseString());
    map.put("user", user);

    final String serialized = cookieJoiner.join(map);
    Cookies.setCookie(PAUSE_COOKIE, serialized);
    logger.finer("Pausing session: " + serialized);
View Full Code Here


      return false;

    logger.finer("Resume session: " + pause);
    Cookies.removeCookie(PAUSE_COOKIE);
    final Map<String, String> map = cookieSplitter.split(pause);
    final StreamSettings stream = new StreamSettings();
    stream.rid = Integer.parseInt(map.get("rid"));
    stream.sid = map.get("sid");
    stream.wait = map.get("wait");
    stream.setInactivity(map.get("inactivity"));
    stream.setMaxPause(map.get("maxPause"));
    final XmppURI user = uri(map.get("user"));
    session.resume(user, stream);
    return true;
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.core.conn.StreamSettings

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.