public class CloudCache extends Object
| Constructor and Description |
|---|
CloudCache(String cacheName)
Abstract class that wraps CloudBoost cache, with ability to create, delete, inspect,clear and add items to Cache
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(String key,
Object value,
ObjectCallback call)
Add data to the cache
|
void |
clear(ObjectCallback call)
clears the cache, after this operation, the cache size is 0.0kb
|
void |
create(CloudCacheCallback call)
creates a new cache using the parameters set on this CloudCache Object
|
void |
delete(ObjectCallback call)
delete this cache
|
static void |
deleteAll(ObjectCallback call)
delete all caches
|
void |
deleteItem(String key,
ObjectCallback call)
remove an item from the cache
|
void |
get(String key,
ObjectCallback call)
get item from this cache
|
static void |
getAllCache(ObjectCallback call)
returns all caches
|
static void |
getAllCaches(ObjectCallback call)
returns all caches
|
void |
getAllItems(ObjectCallback call)
returns all items in this cache
|
String |
getCacheName() |
JSONObject |
getDocument() |
void |
getInfo(ObjectCallback call)
returns info about this cache
|
void |
getItem(String key,
ObjectCallback call)
get item from cache
|
void |
getItemsCount(CloudIntegerCallback call)
it counts all items under unique keys in the cache, returns an integer in the callback
|
int |
getSize() |
void |
invalidateAttributes()
updates the data in this cache object
|
void |
set(String key,
Object value,
ObjectCallback call)
Set data to key in the cache
|
void |
setCacheName(String cacheName) |
void |
setDocument(JSONObject document) |
public CloudCache(String cacheName) throws CloudException
cacheName - CloudExceptionpublic void invalidateAttributes()
public void set(String key, Object value, ObjectCallback call) throws CloudException
key - -a key word to identify the data in the cachevalue - -the data to be cachedcall - CloudExceptionpublic void addItem(String key, Object value, ObjectCallback call) throws CloudException
key - -a key word to identify the data in the cachevalue - -the data to be cachedcall - CloudExceptionpublic void deleteItem(String key, ObjectCallback call) throws CloudException
key - -key under which the item was storedcall - -a listener to be fired when item is receivedCloudExceptionpublic void getItem(String key, ObjectCallback call) throws CloudException
key - -key under which the item was saved in cachecall - CloudExceptionpublic void create(CloudCacheCallback call) throws CloudException
call - CloudExceptionpublic JSONObject getDocument()
public void setDocument(JSONObject document)
public String getCacheName()
public void setCacheName(String cacheName)
public void getItemsCount(CloudIntegerCallback call) throws CloudException
call - CloudExceptionpublic int getSize()
public static void getAllCaches(ObjectCallback call) throws CloudException
call - CloudExceptionpublic void getAllItems(ObjectCallback call) throws CloudException
call - CloudExceptionpublic static void getAllCache(ObjectCallback call) throws CloudException
call - CloudExceptionpublic void clear(ObjectCallback call) throws CloudException
call - CloudExceptionpublic void delete(ObjectCallback call) throws CloudException
call - CloudExceptionpublic static void deleteAll(ObjectCallback call) throws CloudException
call - CloudExceptionpublic void get(String key, ObjectCallback call) throws CloudException
key - -key under which this data was saved in the cachecall - CloudExceptionpublic void getInfo(ObjectCallback call) throws CloudException
call - CloudExceptionCopyright © 2016. All rights reserved.