Package chemaxon.jchem.db
Class CacheRegistrationUtil
java.lang.Object
chemaxon.jchem.db.cache.CacheRegistrationBase
chemaxon.jchem.db.CacheRegistrationUtil
Utility class for cache registration.
- Since:
- JChem 5.3.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Error sensitivity - exception.static final String
Error sensitivity - logstatic final String
Error sensitivity - none.static final String
Property name that shows cache registration error sensitivity.Fields inherited from class chemaxon.jchem.db.cache.CacheRegistrationBase
CACHE_ID_FIELD_NAME, CACHE_ID_LENGTH, CACHE_PROTECTED_FIELD_NAME, CACHE_TIME_FIELD_NAME, CACHE_UPDATE_ID_FIELD_NAME, CACHE_UPDATE_INFO_FIELD_NAME, cacheTable, con, PROP_CACHE_REGISTRATION_TABLE_NAME, PROP_CACHE_VALIDITY_TIMESTAMP, propertyTable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addTimestamp
(String timestamp, Connection c) static String
Generates a random UUID without hyphens (32 characters long)static String
For internal use only!protected String
boolean
isCacheIDRegistered
(String cacheID) Checks whether a cache identifier is currently registered or not.static boolean
static boolean
For internal use only.void
Registers the cache.void
registerPermanentCache
(String cacheID) Registers a permanent cache identifier.static void
static void
setPermanentCacheID
(String cacheIdentifier) Sets the ID used for identifying the permanent cache.static void
setRowIdNeeded
(boolean needed) For internal use only.protected boolean
void
Unregisters the cache.void
unRegisterCache
(String cacheID) Unregisters the given cache identifier.protected void
updateTimestamp
(String timestamp, Connection c) Methods inherited from class chemaxon.jchem.db.cache.CacheRegistrationBase
getCacheRegistrationInfos
-
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:
true
if 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
-