Codota Logo
CachingRealm
Code IndexAdd Codota to your IDE (free)

How to use
CachingRealm
in
org.apache.shiro.realm

Best Java code snippets using org.apache.shiro.realm.CachingRealm (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: apache/shiro

/**
 * Sets the <tt>CacheManager</tt> to be used for data caching to reduce EIS round trips.
 * <p/>
 * This property is <tt>null</tt> by default, indicating that caching is turned off.
 *
 * @param cacheManager the <tt>CacheManager</tt> to use for data caching, or <tt>null</tt> to disable caching.
 */
public void setCacheManager(CacheManager cacheManager) {
  this.cacheManager = cacheManager;
  afterCacheManagerSet();
}
origin: apache/shiro

/**
 * If caching is enabled, this will clear any cached data associated with the specified account identity.
 * Subclasses are free to override for additional behavior, but be sure to call {@code super.onLogout} first.
 * <p/>
 * This default implementation merely calls {@link #clearCache(org.apache.shiro.subject.PrincipalCollection)}.
 *
 * @param principals the application-specific Subject/user identifier that is logging out.
 * @see #clearCache(org.apache.shiro.subject.PrincipalCollection)
 * @see #getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)
 * @since 1.2
 */
public void onLogout(PrincipalCollection principals) {
  clearCache(principals);
}
origin: apache/shiro

/**
 * Clears out any cached data associated with the specified account identity/identities.
 * <p/>
 * This implementation will return quietly if the principals argument is null or empty.  Otherwise it delegates
 * to {@link #doClearCache(org.apache.shiro.subject.PrincipalCollection)}.
 *
 * @param principals the principals of the account for which to clear any cached data.
 * @since 1.2
 */
protected void clearCache(PrincipalCollection principals) {
  if (!isEmpty(principals)) {
    doClearCache(principals);
    log.trace("Cleared cache entries for account with principals [{}]", principals);
  }
}
origin: apache/shiro

if (!isEmpty(principals)) {
  Collection thisPrincipals = principals.fromRealm(getName());
  if (!CollectionUtils.isEmpty(thisPrincipals)) {
    primary = thisPrincipals.iterator().next();
origin: apache/shiro

public void setName(String name) {
  super.setName(name);
  String authcCacheName = this.authenticationCacheName;
  if (authcCacheName != null && authcCacheName.startsWith(getClass().getName())) {
    //get rid of the default heuristically-created cache name.  Create a more meaningful one
    //based on the application-unique Realm name:
    this.authenticationCacheName = name + DEFAULT_AUTHORIZATION_CACHE_SUFFIX;
  }
}
origin: apache/shiro

/**
 * This implementation clears out any cached authentication data by calling
 * {@link #clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)}.
 * If overriding in a subclass, be sure to call {@code super.doClearCache} to ensure this behavior is maintained.
 *
 * @param principals principals the principals of the account for which to clear any cached data.
 * @since 1.2
 */
@Override
protected void doClearCache(PrincipalCollection principals) {
  super.doClearCache(principals);
  clearCachedAuthenticationInfo(principals);
}
origin: org.neo4j/neo4j-security-enterprise

@Override
public void shutdown() throws Throwable
{
  for ( Realm realm : realms )
  {
    if ( realm instanceof CachingRealm )
    {
      ((CachingRealm) realm).setCacheManager( null );
    }
    if ( realm instanceof RealmLifecycle )
    {
      ((RealmLifecycle) realm).shutdown();
    }
  }
}
origin: com.github.fartherp/shiro-redisson

  public void onExpiration(Session session) {
    LOGGER.debug("session onExpiration ID: " + session.getId());
    this.sessionDAO.delete(session);
    this.cachingRealms.forEach(o -> o.onLogout(SecurityUtils.getSubject().getPrincipals()));
  }
}
origin: org.apache.shiro/shiro-core

if (!isEmpty(principals)) {
  Collection thisPrincipals = principals.fromRealm(getName());
  if (!CollectionUtils.isEmpty(thisPrincipals)) {
    primary = thisPrincipals.iterator().next();
origin: org.apache.shiro/shiro-core

public void setName(String name) {
  super.setName(name);
  String authcCacheName = this.authenticationCacheName;
  if (authcCacheName != null && authcCacheName.startsWith(getClass().getName())) {
    //get rid of the default heuristically-created cache name.  Create a more meaningful one
    //based on the application-unique Realm name:
    this.authenticationCacheName = name + DEFAULT_AUTHORIZATION_CACHE_SUFFIX;
  }
}
origin: org.apache.shiro/shiro-core

/**
 * This implementation clears out any cached authentication data by calling
 * {@link #clearCachedAuthenticationInfo(org.apache.shiro.subject.PrincipalCollection)}.
 * If overriding in a subclass, be sure to call {@code super.doClearCache} to ensure this behavior is maintained.
 *
 * @param principals principals the principals of the account for which to clear any cached data.
 * @since 1.2
 */
@Override
protected void doClearCache(PrincipalCollection principals) {
  super.doClearCache(principals);
  clearCachedAuthenticationInfo(principals);
}
origin: org.neo4j/neo4j-security-enterprise

@Override
public void init() throws Throwable
{
  for ( Realm realm : realms )
  {
    if ( realm instanceof Initializable )
    {
      ((Initializable) realm).init();
    }
    if ( realm instanceof CachingRealm )
    {
      ((CachingRealm) realm).setCacheManager( cacheManager );
    }
    if ( realm instanceof RealmLifecycle )
    {
      ((RealmLifecycle) realm).initialize();
    }
  }
}
origin: org.apache.shiro/shiro-core

/**
 * Sets the <tt>CacheManager</tt> to be used for data caching to reduce EIS round trips.
 * <p/>
 * This property is <tt>null</tt> by default, indicating that caching is turned off.
 *
 * @param cacheManager the <tt>CacheManager</tt> to use for data caching, or <tt>null</tt> to disable caching.
 */
public void setCacheManager(CacheManager cacheManager) {
  this.cacheManager = cacheManager;
  afterCacheManagerSet();
}
origin: org.apache.shiro/shiro-core

/**
 * Clears out any cached data associated with the specified account identity/identities.
 * <p/>
 * This implementation will return quietly if the principals argument is null or empty.  Otherwise it delegates
 * to {@link #doClearCache(org.apache.shiro.subject.PrincipalCollection)}.
 *
 * @param principals the principals of the account for which to clear any cached data.
 * @since 1.2
 */
protected void clearCache(PrincipalCollection principals) {
  if (!isEmpty(principals)) {
    doClearCache(principals);
    log.trace("Cleared cache entries for account with principals [{}]", principals);
  }
}
origin: org.apache.shiro/shiro-core

/**
 * If caching is enabled, this will clear any cached data associated with the specified account identity.
 * Subclasses are free to override for additional behavior, but be sure to call {@code super.onLogout} first.
 * <p/>
 * This default implementation merely calls {@link #clearCache(org.apache.shiro.subject.PrincipalCollection)}.
 *
 * @param principals the application-specific Subject/user identifier that is logging out.
 * @see #clearCache(org.apache.shiro.subject.PrincipalCollection)
 * @see #getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)
 * @since 1.2
 */
public void onLogout(PrincipalCollection principals) {
  clearCache(principals);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

/**
 * Sets the <tt>CacheManager</tt> to be used for data caching to reduce EIS round trips.
 * <p/>
 * <p>This property is <tt>null</tt> by default, indicating that caching is turned off.
 *
 * @param cacheManager the <tt>CacheManager</tt> to use for data caching, or <tt>null</tt> to disable caching.
 */
public void setCacheManager(CacheManager cacheManager) {
  this.cacheManager = cacheManager;
  afterCacheManagerSet();
}
org.apache.shiro.realmCachingRealm

Javadoc

A very basic abstract extension point for the Realm interface that provides caching support for subclasses.

It also provides a convenience method, #getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection), which is useful across all realm subclasses for obtaining a realm-specific principal/identity.

All actual Realm method implementations are left to subclasses.

Most used methods

  • afterCacheManagerSet
    Template method that may be implemented by subclasses should they wish to react to a CacheManager in
  • clearCache
    Clears out any cached data associated with the specified account identity/identities. This implement
  • doClearCache
    This implementation does nothing - it is a template to be overridden by subclasses if necessary.
  • getName
  • isEmpty
  • onLogout
    If caching is enabled, this will clear any cached data associated with the specified account identit
  • setCacheManager
    Sets the CacheManager to be used for data caching to reduce EIS round trips. This property is null
  • setName

Popular in Java

  • Reactive rest calls using spring rest template
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
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