Package org.auto.comet.support

Source Code of org.auto.comet.support.JsonProtocolUtils

package org.auto.comet.support;

import java.io.Serializable;

import org.auto.comet.Protocol;
import org.auto.json.JsonObject;

/**
*
* @author XiaohangHu
*/
public class JsonProtocolUtils {

  public static String getCloseCommend() {
    JsonObject commend = new JsonObject();
    commend.put(Protocol.SYNCHRONIZE_KEY, Protocol.DISCONNECT_VALUE);
    return commend.toString();
  }

  public static String getConnectionCommend(Serializable socketId) {
    JsonObject commend = new JsonObject();
    commend.put(Protocol.CONNECTIONID_KEY, socketId);
    return commend.toString();
  }

  // suppress default constructor for noninstantiability
  private JsonProtocolUtils() {
    throw new AssertionError();
  }

}
TOP

Related Classes of org.auto.comet.support.JsonProtocolUtils

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.