Package com.cxy.redisclient.integration.list

Source Code of com.cxy.redisclient.integration.list.UpdateList

package com.cxy.redisclient.integration.list;

import java.util.List;

import com.cxy.redisclient.integration.key.DeleteKey;
import com.cxy.redisclient.integration.key.Expire;
import com.cxy.redisclient.integration.key.TTLs;

public class UpdateList extends AddList {
  private int ttl;
  public UpdateList(int id, int db, String key, List<String> values,
      boolean headTail) {
    super(id, db, key, values, headTail, true);
  }

  @Override
  protected void beforeAdd() {
    TTLs command1 = new TTLs(id, db, key);
    command1.execute(jedis);
    ttl = (int) command1.getSecond();
   
    DeleteKey command = new DeleteKey(id, db, key);
    command.execute(jedis);
   
   
  }

  @Override
  protected void afterAdd() {
    Expire command2 = new Expire(id, db, key, ttl);
    command2.execute(jedis);
  }

}
TOP

Related Classes of com.cxy.redisclient.integration.list.UpdateList

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.