org.apache.shiro.realm.text
Class IniRealm

java.lang.Object
  extended by org.apache.shiro.realm.CachingRealm
      extended by org.apache.shiro.realm.AuthenticatingRealm
          extended by org.apache.shiro.realm.AuthorizingRealm
              extended by org.apache.shiro.realm.SimpleAccountRealm
                  extended by org.apache.shiro.realm.text.TextConfigurationRealm
                      extended by org.apache.shiro.realm.text.IniRealm
All Implemented Interfaces:
LogoutAware, Authorizer, PermissionResolverAware, RolePermissionResolverAware, CacheManagerAware, Realm, Initializable, Nameable

public class IniRealm
extends TextConfigurationRealm

A Realm implementation that creates SimpleAccount instances based on Ini configuration.

This implementation looks for two sections in the Ini configuration:

 [users]
 # One or more user definitions
 ...
 [roles]
 # One or more role definitions

This class also supports setting the 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
static String ROLES_SECTION_NAME
           
static String USERS_SECTION_NAME
           
 
Fields inherited from class org.apache.shiro.realm.SimpleAccountRealm
roles, users
 
Constructor Summary
IniRealm()
           
IniRealm(Ini ini)
           
IniRealm(String resourcePath)
           
 
Method Summary
 String getResourcePath()
           
protected  void onInit()
           
 void setResourcePath(String resourcePath)
           
 
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, doGetAuthenticationInfo, doGetAuthorizationInfo, getRole, getUser, getUsername, getUsername, roleExists, toSet
 
Methods inherited from class org.apache.shiro.realm.AuthorizingRealm
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, clearCachedAuthorizationInfo, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getAvailablePrincipal, getPermissionResolver, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, init, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, onLogout, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver
 
Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm
getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, setAuthenticationTokenClass, setCredentialsMatcher, supports
 
Methods inherited from class org.apache.shiro.realm.CachingRealm
getCacheManager, getName, isCachingEnabled, setCacheManager, setCachingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USERS_SECTION_NAME

public static final String USERS_SECTION_NAME
See Also:
Constant Field Values

ROLES_SECTION_NAME

public static final String ROLES_SECTION_NAME
See Also:
Constant Field Values
Constructor Detail

IniRealm

public IniRealm()

IniRealm

public IniRealm(Ini ini)

IniRealm

public IniRealm(String resourcePath)
Method Detail

getResourcePath

public String getResourcePath()

setResourcePath

public void setResourcePath(String resourcePath)

onInit

protected void onInit()
Overrides:
onInit in class AuthorizingRealm


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.