/*
 * Copyright (C), 2002-2015, 365
 * FileName: //文件名
 * Author:   Administrator
 * Date:     2015年11月4日 下午1:55:28
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.house365.ws.cached;

import java.util.concurrent.TimeUnit;

/**
 * 〈一句话功能简述〉
 * 〈功能详细描述〉
 * @author     hqc
 */
public interface RedisUtilsInterface {
    public void addKeyVal(final String key, final String value) ;
    public void deleteKey(final String key) ;
    public void addKeyValExpire(final String key, final String value, long second) ;

    public void addKeyObjectExpire(final String key, final Object value, long second);

    public Object getObjectByKey(final String key);

    public String getValByKey(final String key);

    String getValByKeyNew(String key);

    public Integer getIntegerByKey(final String key);
    public Long increaseByKey(final String key);
    public Long decreaseByKey(final String key);
    public void pushIntegerIntoRedisList(final String key, final Integer value);
    public Integer popIntegerFromRedisList(final String key);
    public void removeRedisList(final String key);
    public long getListSize(String key);

    /**
     * Atomically sets key to value and returns the old value stored at key.
     * Returns an error when key exists but does not hold a string value.
     * @param key key
     * @param value value
     * @return old value
     */
    String getSet(String key, String value);

    boolean setNotExists(String key, String value);

    boolean hasKey(String key);

    void setValueNew(String key, String value);

    void setValueExpireNew(String key, String value, long expire, TimeUnit timeUnit);

    void deleteByKeyNew(String key);

    boolean setNX(String key, String value, long seconds);
}
