List of usage examples for org.springframework.data.redis.core BoundListOperations range
@Nullable List<V> range(long start, long end);
From source file:org.shareok.data.redis.job.JobQueueDaoImpl.java
@Override public boolean isJobQueueEmpty(String queueName) { try {/* ww w . j a va 2s . c om*/ BoundListOperations<String, String> jobQueueOps = (BoundListOperations<String, String>) redisTemplate .boundListOps(queueName); return jobQueueOps.range(0, ShareokdataManager.getRedisJobQueueMaxJobs()).isEmpty(); } catch (Exception ex) { logger.error("Cannot determine if the job queue " + queueName + " is empty!", ex); } return false; }
From source file:org.shareok.data.redis.job.JobQueueDaoImpl.java
@Override public List getJobQueueByName(String queueName) { List jobs = new ArrayList(); try {// w w w . j a v a 2 s . co m BoundListOperations<String, String> jobQueueOps = (BoundListOperations<String, String>) redisTemplate .boundListOps(queueName); jobs = jobQueueOps.range(0, ShareokdataManager.getRedisJobQueueMaxJobs()); } catch (Exception ex) { logger.error("Cannot get the list of the jobs stored in " + queueName, ex); } return jobs; }