Class ExtendedPropertiesRealm

java.lang.Object
org.apache.shiro.realm.CachingRealm
org.apache.shiro.realm.AuthenticatingRealm
org.apache.shiro.realm.AuthorizingRealm
org.apache.shiro.realm.SimpleAccountRealm
org.apache.shiro.realm.text.TextConfigurationRealm
org.apache.shiro.realm.text.PropertiesRealm
org.tynamo.shiro.extension.realm.text.ExtendedPropertiesRealm
All Implemented Interfaces:
Runnable, org.apache.shiro.authc.LogoutAware, org.apache.shiro.authz.Authorizer, org.apache.shiro.authz.permission.PermissionResolverAware, org.apache.shiro.authz.permission.RolePermissionResolverAware, org.apache.shiro.cache.CacheManagerAware, org.apache.shiro.lang.util.Destroyable, org.apache.shiro.lang.util.Initializable, org.apache.shiro.lang.util.Nameable, org.apache.shiro.realm.Realm

public class ExtendedPropertiesRealm extends org.apache.shiro.realm.text.PropertiesRealm
Fixes some bugs with PropertiesRealm
  • Field Summary

    Fields inherited from class org.apache.shiro.realm.text.PropertiesRealm

    fileLastModified, reloadIntervalSeconds, resourcePath, scheduler, useXmlFormat

    Fields inherited from class org.apache.shiro.realm.SimpleAccountRealm

    roles, rolesLock, users, usersLock
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Remove initialization after installing cacheManager.
    protected org.apache.shiro.authc.AuthenticationInfo
    doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
    Eliminates the error generating NullPointerException, when trying to register for non-existent account.
    void
    setCacheManager(org.apache.shiro.cache.CacheManager authzInfoCacheManager)
     

    Methods inherited from class org.apache.shiro.realm.text.PropertiesRealm

    afterRoleCacheSet, destroy, getName, getRolename, getUsername, isRolename, isUsername, onInit, run, setReloadIntervalSeconds, setResourcePath, setUseXmlFormat, startReloadThread

    Methods inherited from class org.apache.shiro.realm.text.TextConfigurationRealm

    getRoleDefinitions, getUserDefinitions, processDefinitions, processRoleDefinitions, processRoleDefinitions, processUserDefinitions, processUserDefinitions, setRoleDefinitions, setUserDefinitions, toLines, toMap

    Methods inherited from class org.apache.shiro.realm.SimpleAccountRealm

    accountExists, add, add, addAccount, addAccount, addRole, doGetAuthorizationInfo, getRole, getUser, getUsername, getUsername, roleExists, toSet

    Methods inherited from class org.apache.shiro.realm.AuthorizingRealm

    checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getPermissions, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver

    Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm

    assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports

    Methods inherited from class org.apache.shiro.realm.CachingRealm

    clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCachingEnabled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.shiro.lang.util.Initializable

    init
  • Constructor Details

    • ExtendedPropertiesRealm

      public ExtendedPropertiesRealm(String resourcePath)
  • Method Details

    • doGetAuthenticationInfo

      protected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token) throws org.apache.shiro.authc.AuthenticationException
      Eliminates the error generating NullPointerException, when trying to register for non-existent account.
      Overrides:
      doGetAuthenticationInfo in class org.apache.shiro.realm.SimpleAccountRealm
      Throws:
      org.apache.shiro.authc.AuthenticationException
      See Also:
      • SimpleAccountRealm.doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)
    • setCacheManager

      public void setCacheManager(org.apache.shiro.cache.CacheManager authzInfoCacheManager)
      Specified by:
      setCacheManager in interface org.apache.shiro.cache.CacheManagerAware
      Overrides:
      setCacheManager in class org.apache.shiro.realm.CachingRealm
    • afterCacheManagerSet

      protected void afterCacheManagerSet()
      Remove initialization after installing cacheManager. This created problems of premature initialization, when not specified the name of realm, respectively, are generated nekkorektnye account with the name of the default realm, which then changed to the name specified in the config.
      Overrides:
      afterCacheManagerSet in class org.apache.shiro.realm.AuthorizingRealm
      See Also:
      • AuthorizingRealm.afterCacheManagerSet()