public class IniRealm extends TextConfigurationRealm
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.Modifier and Type | Field and Description |
---|---|
static String |
ROLES_SECTION_NAME |
static String |
USERS_SECTION_NAME |
roles, ROLES_LOCK, users, USERS_LOCK
Constructor and Description |
---|
IniRealm() |
IniRealm(Ini ini)
This constructor will immediately process the definitions in the
Ini argument. |
IniRealm(String resourcePath)
This constructor will immediately process the definitions in the
Ini resolved from the specified
resourcePath . |
Modifier and Type | Method and Description |
---|---|
Ini |
getIni()
Returns the Ini instance used to configure this realm.
|
String |
getResourcePath() |
protected void |
onInit()
Will call 'processDefinitions' on startup.
|
void |
setIni(Ini ini)
Sets the Ini instance used to configure this realm.
|
void |
setResourcePath(String resourcePath) |
getRoleDefinitions, getUserDefinitions, processDefinitions, processRoleDefinitions, processRoleDefinitions, processUserDefinitions, processUserDefinitions, setRoleDefinitions, setUserDefinitions, toLines, toMap
accountExists, add, add, addAccount, addAccount, addRole, doGetAuthenticationInfo, doGetAuthorizationInfo, getRole, getUser, getUsername, getUsername, roleExists, toSet
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, setRolePermissionResolver
assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports
clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public static final String USERS_SECTION_NAME
public static final String ROLES_SECTION_NAME
public IniRealm()
public IniRealm(Ini ini)
Ini
argument. If you need to perform
additional configuration before processing (e.g. setting a permissionResolver, etc), do not call this
constructor. Instead, do the following:
#setIni
AuthenticatingRealm.init()
ini
- the Ini instance which will be inspected to create accounts, groups and permissions for this realm.public IniRealm(String resourcePath)
Ini
resolved from the specified
resourcePath
. If you need to perform additional configuration before processing (e.g. setting a
permissionResolver, etc), do not call this constructor. Instead, do the following:
#setIni
AuthenticatingRealm.init()
resourcePath
- the resource path of the Ini config which will be inspected to create accounts, groups and
permissions for this realm.public String getResourcePath()
public void setResourcePath(String resourcePath)
public Ini getIni()
public void setIni(Ini ini)
ini
- the Ini instance which will be inspected to create accounts, groups and permissions for this realm.protected void onInit()
TextConfigurationRealm
onInit
in class TextConfigurationRealm
Copyright © 2004-2016 The Apache Software Foundation. All Rights Reserved.