Package overit.geocall.cache
Interface Entry<V,C>
- Type Parameters:
V- the type of the value of the entryC- the type of the composed value of the entry
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ApiKeyEntryCache,ConfigChapterCacheEntry,LastSecretVersionsCacheEntry,LayerChapterCacheEntry,MaintenanceCacheEntry,OmissionCacheEntry,RawExtractor,SecretEntry,StaticView.SVCache,WebResourceChapterCacheEntry
Interface used to identify, load and serialize an entry within the
Cache.-
Method Summary
Modifier and TypeMethodDescriptionThe method for obtaining the composed instance of the object.default VfromRaw(byte[] bb) Create the instance of the real entry value by deserializing the passed bytes arraydefault CharsetThe charset to be used during the serialization/deserialization of this entitydefault longDefines the ttl in milliseconds for the entry to remain in the cloud cache.getKey()Defines the name of a cacheable objectdefault longDefines the ttl in milliseconds that the entry remains in the local cache. this interval should be reset against any reading of the entry.default longDefines the ttl in milliseconds for the entry to remain in the local cache.default StringgetView()Defines the name of a view for the cacheable objectload()The method for obtaining the real value of the entrydefault byte[]Serialize the real value of the entry into a bytes array.
-
Method Details
-
getKey
String getKey()Defines the name of a cacheable object- Returns:
- the name of a cacheable object
-
getView
Defines the name of a view for the cacheable object- Returns:
- the name of the view for the cacheable object. Typically, the empty string indicates that the entry consists of only one view
-
load
V load()The method for obtaining the real value of the entry- Returns:
- the real value of the entry. This method must be used when the cache doesn't contains a version for
this
Entry
-
compose
The method for obtaining the composed instance of the object. This method allows the real instance of the object to be aggregated with other information, such as the composition of a system configuration with the default one- Parameters:
v- the real instance of the object- Returns:
- the composed instance of the object. This method must be used after the invocation of the
load()method when the cache doesn't contain a version for this entry.
-
getStoreTtl
default long getStoreTtl()Defines the ttl in milliseconds for the entry to remain in the local cache. After this interval, the entry should be removed.- Returns:
- the ttl or -1 if the entry will never expire
-
getReadTtl
default long getReadTtl()Defines the ttl in milliseconds that the entry remains in the local cache. this interval should be reset against any reading of the entry. After this interval, the entry should be removed.- Returns:
- the ttl or -1 if the entry will never expire
-
getClusterTtl
default long getClusterTtl()Defines the ttl in milliseconds for the entry to remain in the cloud cache. After this interval, the entry should be removed.- Returns:
- the ttl or -1 if the entry will never expire
-
toRaw
Serialize the real value of the entry into a bytes array.- Parameters:
obj- the real value of the entry- Returns:
- the serialized bytes array
- Throws:
IOException- if the serialization phase goes wrong
-
fromRaw
Create the instance of the real entry value by deserializing the passed bytes array- Parameters:
bb- the bytes array containing the serialized object- Returns:
- the real entry value instance
- Throws:
IOException- if the deserialization phase goes wrong
-
getCharset
The charset to be used during the serialization/deserialization of this entity- Returns:
- The charset to be used during the serialization/deserialization of this entity. Return value must not be null.
-