Class IniRealm
- All Implemented Interfaces:
LogoutAware,Authorizer,PermissionResolverAware,RolePermissionResolverAware,org.apache.shiro.cache.CacheManagerAware,org.apache.shiro.lang.util.Initializable,org.apache.shiro.lang.util.Nameable,Realm
A
Realm implementation that creates
SimpleAccount instances based on
Ini configuration.
This implementation looks for two sections in the Ini configuration:
[users] # One or moreThis class also supports setting theuser definitions... [roles] # One or morerole definitions
resourcePath property to create account
data from an .ini resource. This will only be used if there isn't already account data in the Realm.- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringroles section namestatic final Stringusers section nameFields inherited from class org.apache.shiro.realm.SimpleAccountRealm
roles, rolesLock, users, usersLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.shiro.config.InigetIni()Returns the Ini instance used to configure this realm.protected voidonInit()Will call 'processDefinitions' on startup.voidsetIni(org.apache.shiro.config.Ini ini) Sets the Ini instance used to configure this realm.voidsetResourcePath(String resourcePath) Methods inherited from class org.apache.shiro.realm.text.TextConfigurationRealm
getRoleDefinitions, getUserDefinitions, processDefinitions, processRoleDefinitions, processRoleDefinitions, processUserDefinitions, processUserDefinitions, setRoleDefinitions, setUserDefinitions, toLines, toMapMethods inherited from class org.apache.shiro.realm.SimpleAccountRealm
accountExists, add, add, addAccount, addAccount, addRole, doGetAuthenticationInfo, doGetAuthorizationInfo, getRole, getUser, getUsername, getUsername, roleExists, toSetMethods inherited from class org.apache.shiro.realm.AuthorizingRealm
afterCacheManagerSet, 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, setRolePermissionResolverMethods 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, supportsMethods inherited from class org.apache.shiro.realm.CachingRealm
clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.shiro.lang.util.Initializable
init
-
Field Details
-
USERS_SECTION_NAME
-
ROLES_SECTION_NAME
-
-
Constructor Details
-
IniRealm
public IniRealm() -
IniRealm
This constructor will immediately process the definitions in theIniargument. If you need to perform additional configuration before processing (e.g. setting a permissionResolver, etc.), do not call this constructor. Instead, do the following:- Call the default no-arg constructor
- Set the Ini instance you wish to use via
#setIni - Set any other configuration properties
- Call
AuthenticatingRealm.init()
- Parameters:
ini- the Ini instance which will be inspected to create accounts, groups and permissions for this realm.
-
IniRealm
This constructor will immediately process the definitions in theIniresolved from the specifiedresourcePath. If you need to perform additional configuration before processing (e.g. setting a permissionResolver, etc.), do not call this constructor. Instead, do the following:- Call the default no-arg constructor
- Set the Ini instance you wish to use via
#setIni - Set any other configuration properties
- Call
AuthenticatingRealm.init()
- Parameters:
resourcePath- the resource path of the Ini config which will be inspected to create accounts, groups and permissions for this realm.
-
-
Method Details
-
getResourcePath
-
setResourcePath
-
getIni
Returns the Ini instance used to configure this realm. Provided for JavaBeans-style configuration of this realm, particularly useful in Dependency Injection environments.- Returns:
- the Ini instance which will be inspected to create accounts, groups and permissions for this realm.
-
setIni
Sets the Ini instance used to configure this realm. Provided for JavaBeans-style configuration of this realm, particularly useful in Dependency Injection environments.- Parameters:
ini- the Ini instance which will be inspected to create accounts, groups and permissions for this realm.
-
onInit
Description copied from class:TextConfigurationRealmWill call 'processDefinitions' on startup.- Overrides:
onInitin classTextConfigurationRealm- See Also:
-