com.hazelcast.cache.impl.nearcache
Interface NearCache<K,V>

Type Parameters:
K - the type of the key
V - the type of the value
All Known Implementing Classes:
DefaultNearCache

public interface NearCache<K,V>

NearCache is the contract point to store keys and values in underlying NearCacheRecordStore.


Field Summary
static int DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS
          Default expiration task delay time as seconds
static int DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS
          Default expiration task initial delay time as seconds
static Object NULL_OBJECT
          NULL Object
 
Method Summary
 void clear()
          Removes all stored values.
 void destroy()
          Clears the record store and destroys it.
 V get(K key)
          Gets the value associated with the given key.
 InMemoryFormat getInMemoryFormat()
          Gets the InMemoryFormat of the storage for internal records.
 String getName()
          Gets the name of the this NearCache instance.
 NearCacheStats getNearCacheStats()
          Get the NearCacheStats instance to monitor this store.
 void invalidate(K key)
          Invalidates the value associated with the given key.
 boolean isInvalidateOnChange()
           
 void put(K key, V value)
          Puts (associates) a value with the given key.
 boolean remove(K key)
          Removes the value associated with the given key.
 Object selectToSave(Object... candidates)
          Selects the best candidate object to store from the given candidates.
 int size()
          Gets the count of stored records.
 

Field Detail

DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS

static final int DEFAULT_EXPIRATION_TASK_INITIAL_DELAY_IN_SECONDS
Default expiration task initial delay time as seconds

See Also:
Constant Field Values

DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS

static final int DEFAULT_EXPIRATION_TASK_DELAY_IN_SECONDS
Default expiration task delay time as seconds

See Also:
Constant Field Values

NULL_OBJECT

static final Object NULL_OBJECT
NULL Object

Method Detail

getName

String getName()
Gets the name of the this NearCache instance.

Returns:
the name of the this NearCache instance

get

V get(K key)
Gets the value associated with the given key.

Parameters:
key - the key of the requested value
Returns:
the value associated with the given key

put

void put(K key,
         V value)
Puts (associates) a value with the given key.

Parameters:
key - the key of the value will be stored
value - the value will be stored

remove

boolean remove(K key)
Removes the value associated with the given key.

Parameters:
key - the key of the value will be removed

invalidate

void invalidate(K key)
Invalidates the value associated with the given key.

Parameters:
key - the key of the value will be removed

isInvalidateOnChange

boolean isInvalidateOnChange()
Returns:

clear

void clear()
Removes all stored values.


destroy

void destroy()
Clears the record store and destroys it.


getInMemoryFormat

InMemoryFormat getInMemoryFormat()
Gets the InMemoryFormat of the storage for internal records.

Returns:
the InMemoryFormat of the storage for internal records

getNearCacheStats

NearCacheStats getNearCacheStats()
Get the NearCacheStats instance to monitor this store.

Returns:
the NearCacheStats instance to monitor this store

selectToSave

Object selectToSave(Object... candidates)
Selects the best candidate object to store from the given candidates.

Parameters:
candidates - the candidates from which the best candidate object will be selected.
Returns:
the best candidate object to store, selected from the given candidates.

size

int size()
Gets the count of stored records.

Returns:
the count of stored records


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.