com.poscoict.glueframework.dao.redis
Class GlueRedisDao

java.lang.Object
  extended by com.poscoict.glueframework.dao.redis.GlueRedisDao
All Implemented Interfaces:
GlueGenericRedisDao, org.springframework.beans.factory.InitializingBean

public class GlueRedisDao
extends Object
implements GlueGenericRedisDao

Redis¿Í ¿¬µ¿Çϱâ À§ÇÑ Dao Class


Constructor Summary
GlueRedisDao()
           
 
Method Summary
 void afterPropertiesSet()
          Properties SetÈÄ ÃʱâÈ­ ÀÛ¾÷
 void delete(String key)
          ÇØ´ç µ¥ÀÌÅ͸¦ »èÁ¦ÇÑ´Ù.
 org.springframework.data.redis.connection.DataType getDataType(String key)
          ÇØ´ç µ¥ÀÌÅÍÀÇ Å¸ÀÔÀ» ¹ÝȯÇÑ´Ù.
 org.springframework.data.redis.core.HashOperations<String,String,Object> getOpsForHash()
          HashŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.
 org.springframework.data.redis.core.ListOperations<String,Object> getOpsForList()
          ListŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.
 org.springframework.data.redis.core.SetOperations<String,Object> getOpsForSet()
          SetŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.
 org.springframework.data.redis.core.ValueOperations<String,Object> getOpsForValue()
          String ŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.
 org.springframework.data.redis.core.ZSetOperations<String,Object> getOpsForZSet()
          Sotred SetŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.
 void opsHashAddMap(String key, Map<String,Object> value)
          RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç MapÀ» ÀúÀåÇÑ´Ù.
 void opsHashAddObject(String key, String hashkey, Object value)
          RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.
 Map<String,Object> opsHashGetMap(String key)
          Redis¿¡¼­ HashŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
 Object opsHashGetObject(String key, String hashkey)
          RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ ÇØ´ç Key¿¡ ÇØ´çÇÏ´Â µ¥ÀÌÅ͸¦ ¹ÝȯÇÑ´Ù.
 Set<String> opsHashKeys(String key)
          RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ Key°ªÀ» ¹ÝȯÇÑ´Ù.
 long opsListAddListAll(String key, List<Object> value)
          Redis¿¡ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.
 long opsListAddObject(String key, Object value)
          Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.
 List<Object> opsListGetList(String key)
          Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
 List<Object> opsListGetList(String key, long startIndex, long endIndex)
          Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤ÇÑ Row¸¸ °¡Á®¿Â´Ù.
 long opsSetAddObject(String key, Object value)
          Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.
 long opsSetAddSet(String key, Set<Object> value)
          Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.
 Set<Object> opsSetGetSet(String key)
          Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
 Object opsValueGetObject(String key)
          Redis¿¡¼­ StringŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
 void opsValueSetObject(String key, Object value)
          Redis¿¡ StringŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.
 boolean opsZSetAddObject(String key, Object value, double score)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.
 double opsZSetGetScore(String key, Object value)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍÀÇ Score¸¦ ¹ÝȯÇÑ´Ù.
 Set<Object> opsZSetGetSet(String key)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.
 Set<Object> opsZSetGetSet(String key, long startIndex, long endIndex)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤µÈ IndexÀÇ µ¥ÀÌÅ͸¸ °¡Á®¿Â´Ù.
 Set<Object> opsZSetGetSetByScore(String key, double startScore, double endScore)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤µÈ ScoreÀÇ µ¥ÀÌÅ͸¸ °¡Á®¿Â´Ù.
 long opsZSetRank(String key, Object value)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍÀÇ ¼øÀ§¸¦ ¹ÝȯÇÑ´Ù.
 long opsZSetRemoveByScore(String key, double startScore, double endScore)
          Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ ÇØ´ç ¹üÀ§ÀÇ Score¸¦ °¡Áø µ¥ÀÌÅ͸¦ »èÁ¦ÇÑ´Ù.
 void setConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
          setter method for DI.
 void setSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> serializer)
          setter method for DI.
 long size(String key)
          ÇØ´ç µ¥ÀÌÅ͸¦ Row ¼ö.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueRedisDao

public GlueRedisDao()
Method Detail

setConnectionFactory

public void setConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
setter method for DI.

Parameters:
RedisConnectionFactory -

setSerializer

public void setSerializer(org.springframework.data.redis.serializer.RedisSerializer<?> serializer)
setter method for DI.

Parameters:
RedisSerializer -

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Properties SetÈÄ ÃʱâÈ­ ÀÛ¾÷

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

getOpsForValue

public org.springframework.data.redis.core.ValueOperations<String,Object> getOpsForValue()
String ŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
getOpsForValue in interface GlueGenericRedisDao
Returns:
ValueOperations

getOpsForList

public org.springframework.data.redis.core.ListOperations<String,Object> getOpsForList()
ListŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
getOpsForList in interface GlueGenericRedisDao
Returns:
ListOperations

getOpsForSet

public org.springframework.data.redis.core.SetOperations<String,Object> getOpsForSet()
SetŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
getOpsForSet in interface GlueGenericRedisDao
Returns:
SetOperations

getOpsForZSet

public org.springframework.data.redis.core.ZSetOperations<String,Object> getOpsForZSet()
Sotred SetŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
getOpsForZSet in interface GlueGenericRedisDao
Returns:
ZSetOperations

getOpsForHash

public org.springframework.data.redis.core.HashOperations<String,String,Object> getOpsForHash()
HashŸÀÔ µ¥ÀÌÅÍÀÇ Operation Ŭ·¡½º¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
getOpsForHash in interface GlueGenericRedisDao
Returns:
HashOperations

getDataType

public org.springframework.data.redis.connection.DataType getDataType(String key)
ÇØ´ç µ¥ÀÌÅÍÀÇ Å¸ÀÔÀ» ¹ÝȯÇÑ´Ù.

Specified by:
getDataType in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ È®ÀÎÇÒ µ¥ÀÌÅÍÀÇ Key
Returns:
DataType

delete

public void delete(String key)
ÇØ´ç µ¥ÀÌÅ͸¦ »èÁ¦ÇÑ´Ù.

Specified by:
delete in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ »èÁ¦ÇÒ µ¥ÀÌÅÍÀÇ Key

size

public long size(String key)
ÇØ´ç µ¥ÀÌÅ͸¦ Row ¼ö.

Specified by:
size in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
long µ¥ÀÌÅÍ Row ¼ö

opsValueGetObject

public Object opsValueGetObject(String key)
Redis¿¡¼­ StringŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.

Specified by:
opsValueGetObject in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
Object Redisµ¥ÀÌŸ

opsValueSetObject

public void opsValueSetObject(String key,
                              Object value)
Redis¿¡ StringŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.

Specified by:
opsValueSetObject in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡ ÀúÀåÇÒ µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸ

opsListGetList

public List<Object> opsListGetList(String key)
Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.

Specified by:
opsListGetList in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
List< Object > Redisµ¥ÀÌŸ

opsListGetList

public List<Object> opsListGetList(String key,
                                   long startIndex,
                                   long endIndex)
Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤ÇÑ Row¸¸ °¡Á®¿Â´Ù.

Specified by:
opsListGetList in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
long - startIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ½ÃÀÛ Index
long - endIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ¸¶Áö¸· Index
Returns:
List< Object > Redisµ¥ÀÌŸ

opsListAddObject

public long opsListAddObject(String key,
                             Object value)
Redis¿¡¼­ ListŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.

Specified by:
opsListAddObject in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡ Add µ¥ÀÌŸ
Returns:
long ÀúÀåµÈ µ¥ÀÌŸÀÇ List Index°ª

opsListAddListAll

public long opsListAddListAll(String key,
                              List<Object> value)
Redis¿¡ ListŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.

Specified by:
opsListAddListAll in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
List< - Object > value Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸ
Returns:
long ÀúÀåµÈ µ¥ÀÌŸÀÇ List Index°ª

opsSetGetSet

public Set<Object> opsSetGetSet(String key)
Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.

Specified by:
opsSetGetSet in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
Set< Object > Redisµ¥ÀÌŸ

opsSetAddObject

public long opsSetAddObject(String key,
                            Object value)
Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.

Specified by:
opsSetAddObject in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸ
Returns:
long ÀúÀåµÈ µ¥ÀÌŸÀÇ Row¼ö(ÀÌ¹Ì Á¸ÀçÇÏ´Â µ¥ÀÌÅÍ´Â Á¦¿Ü)

opsSetAddSet

public long opsSetAddSet(String key,
                         Set<Object> value)
Redis¿¡¼­ SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.

Specified by:
opsSetAddSet in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸ
Returns:
long ÀúÀåµÈ µ¥ÀÌŸÀÇ Row¼ö(ÀÌ¹Ì Á¸ÀçÇÏ´Â µ¥ÀÌÅÍ´Â Á¦¿Ü)

opsZSetGetSet

public Set<Object> opsZSetGetSet(String key)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.

Specified by:
opsZSetGetSet in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
Set< Object > Redisµ¥ÀÌŸ

opsZSetGetSet

public Set<Object> opsZSetGetSet(String key,
                                 long startIndex,
                                 long endIndex)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤µÈ IndexÀÇ µ¥ÀÌÅ͸¸ °¡Á®¿Â´Ù.

Specified by:
opsZSetGetSet in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
long - startIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ½ÃÀÛ Index
long - endIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ¸¶Áö¸· Index
Returns:
Set< Object > Redisµ¥ÀÌŸ

opsZSetGetSetByScore

public Set<Object> opsZSetGetSetByScore(String key,
                                        double startScore,
                                        double endScore)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅ͸¦ ÁöÁ¤µÈ ScoreÀÇ µ¥ÀÌÅ͸¸ °¡Á®¿Â´Ù.

Specified by:
opsZSetGetSetByScore in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
long - startIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ½ÃÀÛ Score
long - endIndex Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ ¸¶Áö¸· Score
Returns:
Set< Object > Redisµ¥ÀÌŸ

opsZSetAddObject

public boolean opsZSetAddObject(String key,
                                Object value,
                                double score)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç °ªÀ» AddÇÑ´Ù.

Specified by:
opsZSetAddObject in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸ
double - score Redis¿¡ ÀúÀåÇÒ µ¥ÀÌŸÀÇ Score
Returns:
boolean ÀúÀå ¿©ºÎ

opsZSetGetScore

public double opsZSetGetScore(String key,
                              Object value)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍÀÇ Score¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
opsZSetGetScore in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌŸ

opsZSetRank

public long opsZSetRank(String key,
                        Object value)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍÀÇ ¼øÀ§¸¦ ¹ÝȯÇÑ´Ù.

Specified by:
opsZSetRank in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
Object - value Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌŸ
Returns:
double µ¥ÀÌŸÀÇ ¼øÀ§

opsZSetRemoveByScore

public long opsZSetRemoveByScore(String key,
                                 double startScore,
                                 double endScore)
Redis¿¡¼­ Sorted SetŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ ÇØ´ç ¹üÀ§ÀÇ Score¸¦ °¡Áø µ¥ÀÌÅ͸¦ »èÁ¦ÇÑ´Ù.

Specified by:
opsZSetRemoveByScore in interface GlueGenericRedisDao
Parameters:
String - key Redis µ¥ÀÌÅÍÀÇ Key
double - startScore Redis¿¡¼­ »èÁ¦ÇÒ µ¥ÀÌŸ ¹üÀ§ÀÇ ½ÃÀÛ Score
double - endScore Redis¿¡¼­ »èÁ¦ÇÒ µ¥ÀÌŸ ¹üÀ§ÀÇ ¸¶Áö¸· Score
Returns:
long »èÁ¦ µ¥ÀÌÅÍ ¼ö

opsHashGetMap

public Map<String,Object> opsHashGetMap(String key)
Redis¿¡¼­ HashŸÀÔÀÇ µ¥ÀÌÅ͸¦ °¡Á®¿Â´Ù.

Specified by:
opsHashGetMap in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
Map Redisµ¥ÀÌŸ

opsHashGetObject

public Object opsHashGetObject(String key,
                               String hashkey)
RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ ÇØ´ç Key¿¡ ÇØ´çÇÏ´Â µ¥ÀÌÅ͸¦ ¹ÝȯÇÑ´Ù.

Specified by:
opsHashGetObject in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
String - hashkey Hashµ¥ÀÌÅÍÀÇ Key
Returns:
Object Redisµ¥ÀÌŸ

opsHashAddObject

public void opsHashAddObject(String key,
                             String hashkey,
                             Object value)
RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç µ¥ÀÌÅ͸¦ ÀúÀåÇÑ´Ù.

Specified by:
opsHashAddObject in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
String - hashkey Hashµ¥ÀÌÅÍÀÇ Key
Object - value Hashµ¥ÀÌÅÍ¿¡ ÀúÀåÇÒ °ª

opsHashAddMap

public void opsHashAddMap(String key,
                          Map<String,Object> value)
RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡ ÇØ´ç MapÀ» ÀúÀåÇÑ´Ù.

Specified by:
opsHashAddMap in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ ÀúÀåÇÒ µ¥ÀÌÅÍÀÇ Key
Map - value ÀúÀåÇÒ mapµ¥ÀÌÅÍ

opsHashKeys

public Set<String> opsHashKeys(String key)
RedisÀÇ HashŸÀÔÀÇ µ¥ÀÌÅÍ¿¡¼­ Key°ªÀ» ¹ÝȯÇÑ´Ù.

Specified by:
opsHashKeys in interface GlueGenericRedisDao
Parameters:
String - key Redis¿¡¼­ °¡Á®¿Ã µ¥ÀÌÅÍÀÇ Key
Returns:
Set< String > HashŸÀÔÀÇ µ¥ÀÌÅÍÀÇ Key°ªµé


Copyright © 2013–2015 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.