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

com.github.sonus21.rqueue.dao.RqueueStringDao Maven / Gradle / Ivy

There is a newer version: 3.2.0-RELEASE
Show newest version
/*
 * Copyright (c) 2021-2023 Sonu Kumar
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * You may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and limitations under the License.
 *
 */

package com.github.sonus21.rqueue.dao;

import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.ZSetOperations.TypedTuple;

public interface RqueueStringDao {

  Map> readFromLists(List keys);

  List readFromList(String key);

  void appendToListWithListExpiry(String listName, String data, Duration duration);

  void appendToSet(String setName, String... data);

  List readFromSet(String setName);

  Boolean delete(String key);

  void set(String key, Object data);

  Object get(String key);

  Object delete(Collection keys);

  Object deleteAndSet(Collection keysToBeRemoved, Map objectsToBeStored);

  Boolean setIfAbsent(String key, String value, Duration duration);

  Long getListSize(String name);

  Long getSortedSetSize(String name);

  DataType type(String key);

  Boolean deleteIfSame(String key, String value);

  void addToOrderedSetWithScore(String key, String value, long score);

  List> readFromOrderedSetWithScoreBetween(String key, long start, long end);

  void deleteAll(String key, long min, long max);
}