com.ibm.commerce.context.content.resources.dynacache

Class PatternBasedCacheInvalidationIDGeneratorImpl

  • java.lang.Object
    • com.ibm.commerce.context.content.resources.dynacache.PatternBasedCacheInvalidationIDGeneratorImpl
  • All Implemented Interfaces:
    CacheInvalidationIDGenerator


    public class PatternBasedCacheInvalidationIDGeneratorImpl
    extends java.lang.Object
    implements CacheInvalidationIDGenerator
    PatternBasedCacheInvalidationIDGeneratorImpl implements the CacheInvalidationIDGenerator interface. It uses InvalidationIDPattern to generate cache invalidation IDs.
    • Constructor Detail

      • PatternBasedCacheInvalidationIDGeneratorImpl

        public PatternBasedCacheInvalidationIDGeneratorImpl()
        the default constructor.
    • Method Detail

      • generateInvalidationIDs

        public java.util.List generateInvalidationIDs(java.lang.String resource,
                                                      java.lang.String[] resourceKeys,
                                                      java.util.HashMap oneRecord,
                                                      java.lang.String action,
                                                      java.sql.Connection connection,
                                                      java.lang.String schema)
        generates WebSphere Dynamic Cache invalidation IDs.
        Specified by:
        generateInvalidationIDs in interface CacheInvalidationIDGenerator
        Parameters:
        resource - the resource.
        resourceKeys - the resource keys.
        oneRecord - a HashMap object contains the values in the resource object.
        action - the action performed against the resource object.
        connection - the database connection.
        schema - the database schema name.
        Returns:
        a list of cache invalidation IDs.
      • getResourcePatterns

        public InvalidationIDPattern[] getResourcePatterns(java.lang.String resource)
        returns the CacheInvalidationIDPattern objects used for a resource.
        Parameters:
        resource - the resource.
        Returns:
        the CacheInvalidationIDPattern objects used for the resource.
      • setResourcePatterns

        public void setResourcePatterns(java.lang.String resource,
                                        InvalidationIDPattern[] patterns)
        sets the CacheInvalidationIDPattern objects used for a resource.
        Parameters:
        resource - the resource.
        patterns - the CacheInvalidationIDPattern objects used for the resource.
      • isInvalidationTrigger

        public boolean isInvalidationTrigger(java.lang.String resource,
                                             java.lang.String action)
        returns whether performing the action against the resource would trigger cache invalidation.
        Specified by:
        isInvalidationTrigger in interface CacheInvalidationIDGenerator
        Parameters:
        resource - the resource.
        action - the action performed against the resource object.
        Returns:
        true if performing the action against the resource would trigger cache invalidation.