Package chemaxon.jchem.db
Class CacheRegistrationUtil
java.lang.Object
chemaxon.jchem.db.CacheRegistrationUtil
Utility class for cache registration.
- Since:
- JChem 5.3.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTimestamp(String timestamp, Connection c) static StringGenerates a random UUID without hyphens (32 characters long)static StringFor internal use only!protected StringbooleanisCacheIDRegistered(String cacheID) Checks whether a cache identifier is currently registered or not.static booleanstatic booleanFor internal use only.voidRegisters the cache.voidregisterPermanentCache(String cacheID) Registers a permanent cache identifier.static voidstatic voidsetPermanentCacheID(String cacheIdentifier) Sets the ID used for identifying the permanent cache.static voidsetRowIdNeeded(boolean needed) For internal use only.protected booleanvoidUnregisters the cache.voidunRegisterCache(String cacheID) Unregisters the given cache identifier.protected voidupdateTimestamp(String timestamp, Connection c)
-
Field Details
-
PROP_CACHE_REGISTRATION_SENSITIVITY
Property name that shows cache registration error sensitivity.- See Also:
-
CACHE_REGISTRATION_SENSITIVITY_EXCEPTION
Error sensitivity - exception.- See Also:
-
CACHE_REGISTRATION_SENSITIVITY_LOG
Error sensitivity - log- See Also:
-
CACHE_REGISTRATION_SENSITIVITY_NONE
Error sensitivity - none.- See Also:
-
-
Constructor Details
-
CacheRegistrationUtil
- Throws:
SQLException
-
-
Method Details
-
registerCache
Registers the cache. The registration will be permanent ifsetPermanentCacheID(String)was called before, otherwise temporary.- Throws:
SQLException- if encounter an sql exception
-
registerPermanentCache
Registers a permanent cache identifier.- Parameters:
cacheID- cache identifier to be registered- Throws:
SQLException- if encounter an sql exception
-
unRegisterCache
Unregisters the cache.- Throws:
SQLException- if encounter an sql exception
-
unRegisterCache
Unregisters the given cache identifier.- Parameters:
cacheID- cache identifier to unregister- Throws:
SQLException- if encounter an sql exception
-
timestampExists
- Throws:
SQLException
-
getRegisteredCacheIDs
For internal use only!- Returns:
- ArrayList of registered cache ids
- Throws:
SQLException- if encounter an sql exception
-
isCacheIDRegistered
Checks whether a cache identifier is currently registered or not.- Parameters:
cacheID- ID to check.- Returns:
trueif the cache identifier is registered.- Throws:
SQLException- if encounter an sql exception
-
getTimestamp
- Throws:
SQLException
-
addTimestamp
- Throws:
SQLException
-
updateTimestamp
- Throws:
SQLException
-
generateRandomID
Generates a random UUID without hyphens (32 characters long)- Returns:
- random UUID
-
setPermanentCacheID
Sets the ID used for identifying the permanent cache.- Parameters:
cacheIdentifier- the cache ID to set. Should not benull, and it's length must be between 1 and 32, inclusive.- Throws:
IllegalArgumentException- if the cacheIdentifier is not valid
-
getCacheID
-
isPermanent
public static boolean isPermanent() -
resetCacheID
public static void resetCacheID() -
setRowIdNeeded
public static void setRowIdNeeded(boolean needed) For internal use only.- Parameters:
needed- true if needed
-
isRowIdNeeded
public static boolean isRowIdNeeded()For internal use only.- Returns:
- true if needed
-