Package redis.clients.jedis

Examples of redis.clients.jedis.Jedis.multi()


        long expireAtTime = currentTime + (maxInactiveInterval * 1000);
        long expireAtTimeWithReserve = currentTime + (maxInactiveInterval * 1000 * 2);

        Jedis jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            transaction.set(creationTimeKey, Long.toString(currentTime));
            transaction.set(lastAccessTimeKey, Long.toString(currentTime));
            transaction.set(expiresAtKey, Long.toString(expireAtTimeWithReserve));
            transaction.set(timeoutKey, Integer.toString(maxInactiveInterval));
View Full Code Here


        long lastAccessTime = getLastAccessedTime();

        Jedis jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            transaction.rename(oldCreationTimeKey, newCreationTimeKey);
            transaction.rename(oldLastAccessTimeKey, newLastAccessTimeKey);
            transaction.rename(oldExpiresAtKey, newExpiresAtKey);
            transaction.rename(oldTimeoutKey, newTimeoutKey);
View Full Code Here

            attributeNames = getAttributesNames();
        }

        Jedis jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            if (currentExpireAtTime < expireAtTime) {
                transaction.set(expiresAtKey, Long.toString(expireAtTimeWithReserve));
                transaction.expireAt(expiresAtKey, getUnixTime(expireAtTimeWithReserve));
View Full Code Here

        Set<String> attributeNames = getAttributesNames();

        Jedis jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            transaction.del(creationTimeKey, lastAccessTimeKey, expiresAtKey, timeoutKey, attrsKey);

            if (!attributeNames.isEmpty()) {
                Set<String> keys = new HashSet<String>();
View Full Code Here

            }
        }

        jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            byte[] object = RedisSerializationUtil.encode((Serializable) value);
            transaction.set(attributeKey.getBytes(RedisSessionKeys.getEncoding()), object);
            transaction.expireAt(attributeKey.getBytes(RedisSessionKeys.getEncoding()), getUnixTime(currentExpireAtTimeWithReserve));
View Full Code Here

            message = new String(Base64Util.encode(bytes));
        }

        jedis = pool.getResource();
        try {
            Transaction transaction = jedis.multi();

            transaction.del(attributeKey.getBytes(RedisSessionKeys.getEncoding()));

            transaction.srem(attrsListKey, name);
View Full Code Here

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.