public class DefaultSecurityManager extends Object implements JackrabbitSecurityManager
Modifier and Type | Field and Description |
---|---|
protected String |
adminId
The user id of the administrator.
|
protected String |
anonymousId
The user id of the anonymous user.
|
Constructor and Description |
---|
DefaultSecurityManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInitialized()
Throws
IllegalStateException if this manager hasn't been
initialized. |
void |
close()
Disposes this security manager instance and cleans all internal caches.
|
protected PrincipalProvider |
createDefaultPrincipalProvider(Properties[] moduleConfig)
Creates the default principal provider used to create the
PrincipalProviderRegistry . |
protected WorkspaceAccessManager |
createDefaultWorkspaceAccessManager() |
protected PrincipalManager |
createPrincipalManager(SessionImpl session) |
protected UserManagerImpl |
createUserManager(SessionImpl session)
Creates a
UserManagerImpl for the given session. |
void |
dispose(String workspaceName)
Disposes those parts of this security manager that are related to the
workspace indicated by the given
workspaceName . |
AccessManager |
getAccessManager(javax.jcr.Session session,
AMContext amContext)
Retrieve the
AccessManager for the given session . |
AuthContext |
getAuthContext(javax.jcr.Credentials creds,
Subject subject,
String workspaceName)
Creates an AuthContext for the given
Credentials and
Subject . |
protected AuthContextProvider |
getAuthContextProvider() |
protected SecurityManagerConfig |
getConfig() |
protected MembershipCache |
getMembershipCache(SessionImpl session) |
PrincipalManager |
getPrincipalManager(javax.jcr.Session session)
Retrieve the principal manager for the given
session . |
protected PrincipalProviderRegistry |
getPrincipalProviderRegistry() |
protected javax.jcr.Repository |
getRepository() |
protected javax.jcr.Session |
getSystemSession() |
protected UserManager |
getSystemUserManager(String workspaceName) |
String |
getUserID(Subject subject,
String workspaceName)
Retrieve the id to be displayed upon
Session.getUserID() for
the specified subject. |
UserManager |
getUserManager(javax.jcr.Session session)
Returns the user manager for the specified
session . |
void |
init(javax.jcr.Repository repository,
javax.jcr.Session systemSession) |
protected String adminId
SecurityConstants.ADMIN_ID
).protected String anonymousId
SecurityConstants.ANONYMOUS_ID
).public void init(javax.jcr.Repository repository, javax.jcr.Session systemSession) throws javax.jcr.RepositoryException
init
in interface JackrabbitSecurityManager
javax.jcr.RepositoryException
JackrabbitSecurityManager.init(Repository, Session)
public void dispose(String workspaceName)
JackrabbitSecurityManager
workspaceName
.dispose
in interface JackrabbitSecurityManager
workspaceName
- Name of the workspace that is being disposed.JackrabbitSecurityManager.dispose(String)
public void close()
JackrabbitSecurityManager
close
in interface JackrabbitSecurityManager
JackrabbitSecurityManager.close()
public AccessManager getAccessManager(javax.jcr.Session session, AMContext amContext) throws javax.jcr.RepositoryException
JackrabbitSecurityManager
AccessManager
for the given session
.getAccessManager
in interface JackrabbitSecurityManager
AccessManager
for the specified session
.javax.jcr.RepositoryException
JackrabbitSecurityManager.getAccessManager(Session,AMContext)
public PrincipalManager getPrincipalManager(javax.jcr.Session session) throws javax.jcr.RepositoryException
JackrabbitSecurityManager
session
.getPrincipalManager
in interface JackrabbitSecurityManager
session
.javax.jcr.UnsupportedRepositoryOperationException
- If principal management
is not supported.javax.jcr.RepositoryException
- if an error occursJackrabbitSecurityManager.getPrincipalManager(Session)
public UserManager getUserManager(javax.jcr.Session session) throws javax.jcr.RepositoryException
JackrabbitSecurityManager
session
.getUserManager
in interface JackrabbitSecurityManager
session
.javax.jcr.UnsupportedRepositoryOperationException
- If user management is
not supported.javax.jcr.RepositoryException
JackrabbitSecurityManager.getUserManager(Session)
public String getUserID(Subject subject, String workspaceName) throws javax.jcr.RepositoryException
JackrabbitSecurityManager
Session.getUserID()
for
the specified subject.getUserID
in interface JackrabbitSecurityManager
Session.getUserID()
.javax.jcr.RepositoryException
JackrabbitSecurityManager.getUserID(javax.security.auth.Subject, String)
public AuthContext getAuthContext(javax.jcr.Credentials creds, Subject subject, String workspaceName) throws javax.jcr.RepositoryException
Credentials
and
Subject
. The workspace name is ignored and users are
stored and retrieved from a specific (separate) workspace.getAuthContext
in interface JackrabbitSecurityManager
workspaceName
- The name of the workspace to login.AuthContext
for the given Credentials, Subjectjavax.jcr.RepositoryException
- in other exceptional repository statesprotected SecurityManagerConfig getConfig()
SecurityManagerConfig
configured for the
repository this manager has been created for.protected UserManager getSystemUserManager(String workspaceName) throws javax.jcr.RepositoryException
workspaceName
- The name of the target workspace.javax.jcr.RepositoryException
- If an error occurs.protected MembershipCache getMembershipCache(SessionImpl session) throws javax.jcr.RepositoryException
session
- The session for which to retrieve the membership cache.javax.jcr.RepositoryException
- If an error occurs.protected UserManagerImpl createUserManager(SessionImpl session) throws javax.jcr.RepositoryException
UserManagerImpl
for the given session. May be overridden
to return a custom implementation.session
- sessionjavax.jcr.RepositoryException
- if an error occursprotected PrincipalManager createPrincipalManager(SessionImpl session) throws javax.jcr.RepositoryException
session
- The session used to create the principal manager.javax.jcr.RepositoryException
- If an error occurs.protected WorkspaceAccessManager createDefaultWorkspaceAccessManager()
protected PrincipalProvider createDefaultPrincipalProvider(Properties[] moduleConfig) throws javax.jcr.RepositoryException
PrincipalProviderRegistry
.DefaultPrincipalProvider
.javax.jcr.RepositoryException
- If an error occurs.protected PrincipalProviderRegistry getPrincipalProviderRegistry()
protected AuthContextProvider getAuthContextProvider()
protected void checkInitialized()
IllegalStateException
if this manager hasn't been
initialized.protected javax.jcr.Session getSystemSession()
protected javax.jcr.Repository getRepository()
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.