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

redis.clients.jedis.AbstractTransaction Maven / Gradle / Ivy

The newest version!
package redis.clients.jedis;

import java.io.Closeable;
import java.util.List;

public abstract class AbstractTransaction extends PipeliningBase implements Closeable {

  protected AbstractTransaction() {
    super(new CommandObjects());
  }

  public abstract void multi();

  /**
   * Must be called before {@link AbstractTransaction#multi() MULTI}.
   */
  public abstract String watch(final String... keys);

  /**
   * Must be called before {@link AbstractTransaction#multi() MULTI}.
   */
  public abstract String watch(final byte[]... keys);

  public abstract String unwatch();

  @Override public abstract void close();

  public abstract List exec();

  public abstract String discard();

  public Response waitReplicas(int replicas, long timeout) {
    return appendCommand(commandObjects.waitReplicas(replicas, timeout));
  }
}