public class RedisProtobufDao extends Object implements IProtobufDao
| Modifier and Type | Method and Description |
|---|---|
void |
addToList(String listKey,
String objectKey)
Add an object to a list
|
void |
addToOrderedList(String listKey,
String objectKey,
long weight) |
void |
archive(String key)
Mark the given key as archived.
|
List<String> |
findAllList(String listKey) |
List<com.google.protobuf.Message> |
findAllListObjects(String listKey) |
List<String> |
findAllOrderedListAscending(String listKey) |
List<String> |
findAllOrderedListDescending(String listKey) |
List<com.google.protobuf.Message> |
findAllOrderedListObjectsAscending(String listKey) |
List<com.google.protobuf.Message> |
findAllOrderedListObjectsDescending(String listKey) |
com.google.protobuf.Message |
findByKey(String key)
Returns the object assigned to the given key
|
com.google.protobuf.Message |
findFieldsByKey(String key,
List<String> fields)
Returns partial object containing only the specified fields
|
List<String> |
findList(String key,
int start,
int count)
Returns list of objects starting from the given index; the list
will be maximum of size 'count'
|
List<com.google.protobuf.Message> |
findListObjects(String listKey,
int start,
int count) |
List<String> |
findOrderedListAscending(String listKey,
int start,
int conut) |
List<String> |
findOrderedListDescending(String listKey,
int start,
int conut) |
List<com.google.protobuf.Message> |
findOrderedListObjectsAscending(String listKey,
int start,
int count) |
List<com.google.protobuf.Message> |
findOrderedListObjectsDescending(String listKey,
int start,
int count) |
com.google.protobuf.Message |
getMessageDefaultInstance() |
static RedisProtobufDao |
newInstance(com.google.protobuf.Message messageDefaultInstance,
Protos.DataSource dataSource) |
void |
removeFromList(String listKey,
String objectKey)
Remove an object from a list
|
void |
store(String key,
com.google.protobuf.Message object)
Store the given object
|
void |
storeOrUpdate(String key,
com.google.protobuf.Message object)
Store or update the given object
|
public static RedisProtobufDao newInstance(com.google.protobuf.Message messageDefaultInstance, Protos.DataSource dataSource)
public com.google.protobuf.Message findByKey(String key)
IProtobufDaofindByKey in interface IProtobufDaokey - key assigned to the object to be fetchedpublic com.google.protobuf.Message findFieldsByKey(String key, List<String> fields)
IProtobufDaofindFieldsByKey in interface IProtobufDaokey - key assigned to the object to be fetchedfields - list of field names to be returnedpublic List<String> findList(String key, int start, int count)
IProtobufDaofindList in interface IProtobufDaokey - the list keystart - the starting indexcount - the maximum count of objects to returnpublic List<String> findAllList(String listKey)
findAllList in interface IProtobufDaopublic List<com.google.protobuf.Message> findListObjects(String listKey, int start, int count)
findListObjects in interface IProtobufDaopublic List<com.google.protobuf.Message> findAllListObjects(String listKey)
findAllListObjects in interface IProtobufDaopublic List<com.google.protobuf.Message> findOrderedListObjectsAscending(String listKey, int start, int count)
findOrderedListObjectsAscending in interface IProtobufDaopublic List<com.google.protobuf.Message> findAllOrderedListObjectsAscending(String listKey)
findAllOrderedListObjectsAscending in interface IProtobufDaopublic List<com.google.protobuf.Message> findOrderedListObjectsDescending(String listKey, int start, int count)
findOrderedListObjectsDescending in interface IProtobufDaopublic List<com.google.protobuf.Message> findAllOrderedListObjectsDescending(String listKey)
findAllOrderedListObjectsDescending in interface IProtobufDaopublic List<String> findOrderedListAscending(String listKey, int start, int conut)
findOrderedListAscending in interface IProtobufDaopublic List<String> findAllOrderedListAscending(String listKey)
findAllOrderedListAscending in interface IProtobufDaopublic List<String> findOrderedListDescending(String listKey, int start, int conut)
findOrderedListDescending in interface IProtobufDaopublic List<String> findAllOrderedListDescending(String listKey)
findAllOrderedListDescending in interface IProtobufDaopublic void store(String key, com.google.protobuf.Message object)
IProtobufDaostore in interface IProtobufDaokey - the key assigned to the objectobject - the protobuf object to be storedpublic void addToList(String listKey, String objectKey)
IProtobufDaoaddToList in interface IProtobufDaolistKey - key associated to the listobjectKey - object keypublic void removeFromList(String listKey, String objectKey)
IProtobufDaoremoveFromList in interface IProtobufDaolistKey - key associated to the listobjectKey - object keypublic void addToOrderedList(String listKey, String objectKey, long weight)
addToOrderedList in interface IProtobufDaopublic void storeOrUpdate(String key, com.google.protobuf.Message object)
IProtobufDaostoreOrUpdate in interface IProtobufDaokey - the key assigned to the objectobject - the protobuf object to be storedpublic void archive(String key)
IProtobufDaoarchive in interface IProtobufDaokey - the key referring to the object to be archived.public com.google.protobuf.Message getMessageDefaultInstance()
getMessageDefaultInstance in interface IProtobufDaoCopyright © 2015. All rights reserved.