Class CacheRegistrationUtil


  • @PublicAPI
    public class CacheRegistrationUtil
    extends chemaxon.jchem.db.cache.CacheRegistrationBase
    Utility class for cache registration.
    Since:
    JChem 5.3.2
    • Field Detail

      • PROP_CACHE_REGISTRATION_SENSITIVITY

        public static final String PROP_CACHE_REGISTRATION_SENSITIVITY
        Property name that shows cache registration error sensitivity.
        See Also:
        Constant Field Values
      • CACHE_REGISTRATION_SENSITIVITY_EXCEPTION

        public static final String CACHE_REGISTRATION_SENSITIVITY_EXCEPTION
        Error sensitivity - exception.
        See Also:
        Constant Field Values
      • CACHE_REGISTRATION_SENSITIVITY_LOG

        public static final String CACHE_REGISTRATION_SENSITIVITY_LOG
        Error sensitivity - log
        See Also:
        Constant Field Values
      • CACHE_REGISTRATION_SENSITIVITY_NONE

        public static final String CACHE_REGISTRATION_SENSITIVITY_NONE
        Error sensitivity - none.
        See Also:
        Constant Field Values
    • Method Detail

      • registerPermanentCache

        public void registerPermanentCache​(String cacheID)
                                    throws SQLException
        Registers a permanent cache identifier.
        Parameters:
        cacheID - cache identifier to be registered
        Throws:
        SQLException - if encounter an sql exception
      • unRegisterCache

        public void unRegisterCache()
                             throws SQLException
        Unregisters the cache.
        Throws:
        SQLException - if encounter an sql exception
      • unRegisterCache

        public void unRegisterCache​(String cacheID)
                             throws SQLException
        Unregisters the given cache identifier.
        Parameters:
        cacheID - cache identifier to unregister
        Throws:
        SQLException - if encounter an sql exception
      • getRegisteredCacheIDs

        public List<String> getRegisteredCacheIDs()
                                           throws SQLException
        For internal use only!
        Returns:
        ArrayList of registered cache ids
        Throws:
        SQLException - if encounter an sql exception
      • isCacheIDRegistered

        public boolean isCacheIDRegistered​(String cacheID)
                                    throws SQLException
        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
      • generateRandomID

        public static String generateRandomID()
        Generates a random UUID without hyphens (32 characters long)
        Returns:
        random UUID
      • setPermanentCacheID

        public static void setPermanentCacheID​(String cacheIdentifier)
                                        throws IllegalArgumentException
        Sets the ID used for identifying the permanent cache.
        Parameters:
        cacheIdentifier - the cache ID to set. Should not be null, and it's length must be between 1 and 32, inclusive.
        Throws:
        IllegalArgumentException - if the cacheIdentifier is not valid
      • getCacheID

        public static String 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