Codota Logo
CmsFlexCache.isEnabled
Code IndexAdd Codota to your IDE (free)

How to use
isEnabled
method
in
org.opencms.flex.CmsFlexCache

Best Java code snippets using org.opencms.flex.CmsFlexCache.isEnabled (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.opencms/opencms-core

/**
 * Checks if the cache is empty or if at last one element is contained.<p>
 *
 * @return true if the cache is empty, false otherwise
 */
boolean isEmpty() {
  if (!isEnabled()) {
    return true;
  }
  return m_keyCache.isEmpty();
}
origin: org.opencms/opencms-solr

/**
 * Returns the total number of cached resource keys.
 *
 * @return the number of resource keys in the cache
 */
public int keySize() {
  if (!isEnabled()) {
    return 0;
  }
  return m_keyCache.size();
}
origin: org.opencms/opencms-solr

/**
 * Checks if the cache is empty or if at last one element is contained.<p>
 *
 * @return true if the cache is empty, false otherwise
 */
boolean isEmpty() {
  if (!isEnabled()) {
    return true;
  }
  return m_keyCache.isEmpty();
}
origin: org.opencms/opencms-core

/**
 * Returns the total number of cached resource keys.
 *
 * @return the number of resource keys in the cache
 */
public int keySize() {
  if (!isEnabled()) {
    return 0;
  }
  return m_keyCache.size();
}
origin: org.opencms/opencms-core

/**
 * Returns a set of all cached resource names.<p>
 *
 * Useful if you want to show a list of all cached resources,
 * like on the FlexCache administration page.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 *
 * @param cms the CmsObject used for user authorization
 * @return a Set of cached resource names (which are of type String)
 */
public Set<String> getCachedResources(CmsObject cms) {
  if (!isEnabled() || !OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER)) {
    return null;
  }
  return m_keyCache.keySet();
}
origin: org.opencms/opencms-solr

/**
 * Returns a set of all cached resource names.
 * Usefull if you want to show a list of all cached resources,
 * like on the FlexCache administration page.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 *
 * @param cms the CmsObject used for user authorization
 * @return a Set of cached resource names (which are of type String)
 */
public Set getCachedResources(CmsObject cms) {
  if (!isEnabled() || !OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER)) {
    return null;
  }
  return m_keyCache.keySet();
}
origin: org.opencms/opencms-core

/**
 * Empties the cache completely.<p>
 */
private synchronized void clear() {
  if (!isEnabled()) {
    return;
  }
  m_keyCache.clear();
  m_size = 0;
  m_variationCache.clear();
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_0));
  }
}
origin: org.opencms/opencms-solr

/**
 * Emptys the cache completely.<p>
 */
private synchronized void clear() {
  if (!isEnabled()) {
    return;
  }
  m_keyCache.clear();
  m_size = 0;
  m_variationCache.clear();
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_0));
  }
}
origin: org.opencms/opencms-core

/**
 * Clears all entries from offline projects in the cache.<p>
 *
 * The keys from the offline projects are not cleared.
 * Cached resources from the online project are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOfflineEntries() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_OFFLINE_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_OFFLINESUFFIX, true);
}
origin: org.opencms/opencms-core

/**
 * Clears all entries from the online project in the cache.<p>
 *
 * The keys from the online project are not cleared.
 * Cached resources from the offline projects are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOnlineEntries() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_ONLINE_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_ONLINESUFFIX, true);
}
origin: org.opencms/opencms-core

/**
 * Removes an entry from the cache.<p>
 *
 * @param key the key which describes the entry to remove from the cache
 */
void remove(CmsFlexCacheKey key) {
  if (!isEnabled()) {
    return;
  }
  CmsFlexCacheVariation o = m_keyCache.get(key.getResource());
  if (o != null) {
    I_CmsLruCacheObject old = o.m_map.get(key.getVariation());
    if (old != null) {
      getEntryLruCache().remove(old);
    }
  }
}
origin: org.opencms/opencms-core

/**
 * Clears all entries and all keys from the online project in the cache.<p>
 *
 * Cached resources from the offline projects are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOnline() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_ONLINE_KEYS_AND_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_ONLINESUFFIX, false);
}
origin: org.opencms/opencms-solr

/**
 * Clears all entries and all keys from offline projects in the cache.<p>
 * 
 * Cached resources from the online project are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOffline() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_KEYS_AND_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_OFFLINESUFFIX, false);
}
origin: org.opencms/opencms-solr

/**
 * Clears all entries and all keys from the online project in the cache.<p>
 * 
 * Cached resources from the offline projects are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOnline() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_ONLINE_KEYS_AND_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_ONLINESUFFIX, false);
}
origin: org.opencms/opencms-core

/**
 * Clears all entries and all keys from offline projects in the cache.<p>
 *
 * Cached resources from the online project are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOffline() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_KEYS_AND_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_OFFLINESUFFIX, false);
}
origin: org.opencms/opencms-solr

/**
 * Removes an entry from the cache.<p>
 *
 * @param key the key which describes the entry to remove from the cache
 */
void remove(CmsFlexCacheKey key) {
  if (!isEnabled()) {
    return;
  }
  Object o = m_keyCache.get(key.getResource());
  if (o != null) {
    //Object old = ((HashMap)o).remove(key.Variation);
    Object old = ((HashMap)o).get(key.getVariation());
    if (old != null) {
      getEntryLruCache().remove((I_CmsLruCacheObject)old);
    }
  }
}
origin: org.opencms/opencms-solr

/**
 * Clears all entries from the online project in the cache.<p>
 * 
 * The keys from the online project are not cleared.
 * Cached resources from the offline projects are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOnlineEntries() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_ONLINE_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_ONLINESUFFIX, true);
}
origin: org.opencms/opencms-solr

/**
 * Clears all entries from offline projects in the cache.<p>
 * 
 * The keys from the offline projects are not cleared.
 * Cached resources from the online project are not touched.<p>
 *
 * Only users with administrator permissions are allowed
 * to perform this operation.<p>
 */
private void clearOfflineEntries() {
  if (!isEnabled()) {
    return;
  }
  if (LOG.isInfoEnabled()) {
    LOG.info(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_CLEAR_OFFLINE_ENTRIES_0));
  }
  clearAccordingToSuffix(CACHE_OFFLINESUFFIX, true);
}
origin: org.opencms/opencms-core

/**
 * Adds a key with a new, empty variation map to the cache.<p>
 *
 * @param key the key to add to the cache.
 */
void putKey(CmsFlexCacheKey key) {
  if (!isEnabled()) {
    return;
  }
  Object o = m_keyCache.get(key.getResource());
  if (o == null) {
    // No variation map for this resource yet, so create one
    CmsFlexCacheVariation variationMap = new CmsFlexCacheVariation(key);
    m_keyCache.put(key.getResource(), variationMap);
    if (LOG.isDebugEnabled()) {
      LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_ADD_KEY_1, key.getResource()));
    }
  }
  // If != null the key is already in the cache, so we just do nothing
}
origin: org.opencms/opencms-solr

/**
 * Adds a key with a new, empty variation map to the cache.<p>
 *
 * @param key the key to add to the cache.
 */
void putKey(CmsFlexCacheKey key) {
  if (!isEnabled()) {
    return;
  }
  Object o = m_keyCache.get(key.getResource());
  if (o == null) {
    // No variation map for this resource yet, so create one
    CmsFlexCacheVariation variationMap = new CmsFlexCacheVariation(key);
    m_keyCache.put(key.getResource(), variationMap);
    if (LOG.isDebugEnabled()) {
      LOG.debug(Messages.get().getBundle().key(Messages.LOG_FLEXCACHE_ADD_KEY_1, key.getResource()));
    }
  }
  // If != null the key is already in the cache, so we just do nothing
}
org.opencms.flexCmsFlexCacheisEnabled

Javadoc

Indicates if the cache is enabled (i.e. actually caching entries) or not.

Popular methods of CmsFlexCache

  • cacheOffline
    Indicates if offline project resources are cached.
  • getEntryLruCache
    Returns the LRU cache where the CacheEntries are cached.
  • <init>
    Constructor for class CmsFlexCache. The parameter "enabled" is used to control if the cache is actua
  • clear
    Empties the cache completely.
  • clearAccordingToSuffix
    Internal method to perform cache clearance. It clears "one half" of the cache, i.e. either the onlin
  • clearEntries
    Clears all entries in the cache, online or offline. The keys are not cleared. Only users with admi
  • clearOffline
    Clears all entries and all keys from offline projects in the cache. Cached resources from the online
  • clearOfflineEntries
    Clears all entries from offline projects in the cache. The keys from the offline projects are not cl
  • clearOnline
    Clears all entries and all keys from the online project in the cache. Cached resources from the offl
  • clearOnlineEntries
    Clears all entries from the online project in the cache. The keys from the online project are not cl
  • get
    Looks up a specific entry in the cache. In case a found entry has a timeout set, it will be checked
  • getKey
    Returns the CmsFlexCacheKey data structure for a given resource name.
  • get,
  • getKey,
  • purgeJspRepository,
  • put,
  • putKey,
  • getCachedKey,
  • getCachedResources,
  • getCachedVariations,
  • keySize

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • IsNull (org.hamcrest.core)
    Is the value null?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now