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

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

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

import cn.leancloud.Messages;

import java.util.ArrayList;
import java.util.List;

public class SessionAckPacket extends PeerBasedCommandPacket {

  List ids;

  public SessionAckPacket() {
    this.setCmd("ack");
  }

  public void setMessageId(String id) {
    ids = new ArrayList(1);
    ids.add(id);
  }

  @Override
  protected Messages.GenericCommand.Builder getGenericCommandBuilder() {
    Messages.GenericCommand.Builder builder = super.getGenericCommandBuilder();
    builder.setAckMessage(getAckCommand());
    return builder;
  }

  protected Messages.AckCommand getAckCommand() {
    Messages.AckCommand.Builder builder = Messages.AckCommand.newBuilder();
    if (null != ids && ids.size() > 0) {
      builder.addAllIds(ids);
    }
    return builder.build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy