All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.leancloud.command.LiveQueryLoginPacket Maven / Gradle / Ivy

There is a newer version: 8.2.28
Show newest version
package cn.leancloud.command;

import cn.leancloud.Messages;
import cn.leancloud.utils.StringUtil;

public class LiveQueryLoginPacket extends LoginPacket {
  public static final int SERVICE_LIVE_QUERY = 1;
  public static final int SERVICE_PUSH = 0;
  private String subscribeId;

  public void setSubscribeId(String subscribeId) {
    this.subscribeId = subscribeId;
  }

  @Override
  protected Messages.GenericCommand.Builder getGenericCommandBuilder() {
    Messages.GenericCommand.Builder builder = super.getGenericCommandBuilder();
    if (!StringUtil.isEmpty(subscribeId)) {
      builder.setInstallationId(subscribeId);
      builder.setService(SERVICE_LIVE_QUERY);
    }
    return builder;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy