Package org.serviceconnector.cache
Class SCCacheMetaEntry
java.lang.Object
org.serviceconnector.cache.SCCacheMetaEntry
- All Implemented Interfaces:
Serializable
The Class SCCacheMetaEntry. The cache meta entry instances are stored in META_DATA_CACHE. It represents either a single message or a group of part messages they belong to a
large response. Meta entries are identified by the cache id. SCMPMessages in DATA_CACHE are identified by cacheId/partnNr. The meta entry controls the state of the message.
Loading means storing the message in cache has started but is not completed yet. Meta entry count number of parts, saves loading session id and lots of other meta data. The
state Loading marks a message to be ready for delivery out of the cache.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSCCacheMetaEntry(String cacheId) Instantiates a new cache meta entry.SCCacheMetaEntry(SCCacheMetaEntry toCopyObject) Instantiates a new meta entry. -
Method Summary
Modifier and TypeMethodDescriptionGets the cache guardian name.Gets the cache id.Gets the creation time.Gets the expiration date time string.intGets the expected number of appendix.Gets the header.Gets the last modified time.Gets the loading session id.intGets the loading timeout milliseconds.intGets the number of appendix.intgetNrOfParts(String cacheId) Gets the number of parts.Gets the SC cache entry state.intIncrement number of appendix.intincrementNrOfPartsForDataMsg(String cacheId) Increment number of parts for cached data message.booleanisLoaded()Checks if is this composite is loaded and is accessible.booleanChecks if is loading.booleanChecks if is loading appendix.booleanisLoadingSessionId(String sessionId) Checks if is loading session id.booleanChecks if is managed.Number of parts by appendix as string.voidsetCacheEntryState(SC_CACHE_ENTRY_STATE cacheEntryState) Sets the cache entry state.voidsetCacheGuardianName(String cacheGuardianName) Sets the cache guardian name.voidsetCachingMethod(SC_CACHING_METHOD cachingMethod) Sets the caching method.voidsetExpDateTimeStr(String cacheExpirationDateTime) Sets the expiration date time string.voidsetExpectedAppendix(Integer expectedAppendix) Sets the expected number of appendix.voidClear the actual header and puts all header attributes from parameter instance.voidSets the last modified.voidsetLoadingSessionId(String loadingSessionId) Sets the loading session id.voidsetLoadingTimeoutMillis(int loadingTimeoutMillis) Sets the loading timeout milliseconds.
-
Constructor Details
-
SCCacheMetaEntry
Instantiates a new cache meta entry.- Parameters:
cacheId- the cache id
-
SCCacheMetaEntry
Instantiates a new meta entry. Copy constructor. Make a copy of given object.- Parameters:
toCopyObject- the object to be copied
-
-
Method Details
-
getCacheId
Gets the cache id.- Returns:
- the cache id
-
getLoadingSessionId
Gets the loading session id.- Returns:
- the loading session id
-
setLoadingSessionId
Sets the loading session id.- Parameters:
loadingSessionId- the new loading session id
-
isLoadingSessionId
Checks if is loading session id.- Parameters:
sessionId- the session id- Returns:
- true, if is loading session id
-
setCacheEntryState
Sets the cache entry state.- Parameters:
cacheEntryState- the new cache entry state
-
getSCCacheEntryState
Gets the SC cache entry state.- Returns:
- the SC cache entry state
-
setCachingMethod
Sets the caching method.- Parameters:
cachingMethod- the new caching method
-
isManaged
public boolean isManaged()Checks if is managed.- Returns:
- true, if is managed
-
isLoading
public boolean isLoading()Checks if is loading.- Returns:
- true, if is loading
-
isLoadingAppendix
public boolean isLoadingAppendix()Checks if is loading appendix.- Returns:
- true, if is loading appendix
-
isLoaded
public boolean isLoaded()Checks if is this composite is loaded and is accessible.SC_CACHE_ENTRY_STATE- Returns:
- true, if is loaded
-
getCreationTime
Gets the creation time.- Returns:
- the creation time
-
getLastModifiedTime
Gets the last modified time.- Returns:
- the last modified time
-
setLastModified
public void setLastModified()Sets the last modified. -
getLoadingTimeoutMillis
public int getLoadingTimeoutMillis()Gets the loading timeout milliseconds.- Returns:
- the loading timeout milliseconds
-
setLoadingTimeoutMillis
public void setLoadingTimeoutMillis(int loadingTimeoutMillis) Sets the loading timeout milliseconds.- Parameters:
loadingTimeoutMillis- the new loading timeout milliseconds
-
setHeader
Clear the actual header and puts all header attributes from parameter instance.- Parameters:
header- the header
-
getHeader
Gets the header.- Returns:
- the header
-
getNrOfAppendix
public int getNrOfAppendix()Gets the number of appendix.- Returns:
- the number of appendix
-
incrementNrOfAppendix
public int incrementNrOfAppendix()Increment number of appendix.- Returns:
- incremented number of appendix
-
getCacheGuardianName
Gets the cache guardian name.- Returns:
- the cache guardian name
-
setCacheGuardianName
Sets the cache guardian name.- Parameters:
cacheGuardianName- the new cache guardian name
-
setExpDateTimeStr
Sets the expiration date time string.- Parameters:
cacheExpirationDateTime- the new expiration date time string
-
getExpDateTimeStr
Gets the expiration date time string.- Returns:
- the expiration date time string
-
getNrOfParts
Gets the number of parts.- Parameters:
cacheId- the cache id- Returns:
- the number of parts
-
getExpectedAppendix
public int getExpectedAppendix()Gets the expected number of appendix.- Returns:
- the expected number of appendix
-
setExpectedAppendix
Sets the expected number of appendix.- Parameters:
expectedAppendix- the new expected number of appendix
-
incrementNrOfPartsForDataMsg
Increment number of parts for cached data message.- Parameters:
cacheId- the cache id- Returns:
- the number of parts
-
nrOfPartsByAppendixAsString
Number of parts by appendix as string.- Returns:
- the string
-