public class DefaultSecurityManager extends Object implements JackrabbitSecurityManager
PrincipalProvider
s
AccessControlProvider
s
WorkspaceAccessManager
UserManager
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 org.apache.jackrabbit.api.security.principal.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(Session session,
AMContext amContext)
Retrieve the
AccessManager for the given session . |
AuthContext |
getAuthContext(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) |
org.apache.jackrabbit.api.security.principal.PrincipalManager |
getPrincipalManager(Session session)
Retrieve the principal manager for the given
session . |
protected PrincipalProviderRegistry |
getPrincipalProviderRegistry() |
protected Repository |
getRepository() |
protected Session |
getSystemSession() |
protected org.apache.jackrabbit.api.security.user.UserManager |
getSystemUserManager(String workspaceName) |
String |
getUserID(Subject subject,
String workspaceName)
Retrieve the id to be displayed upon
Session.getUserID() for
the specified subject. |
org.apache.jackrabbit.api.security.user.UserManager |
getUserManager(Session session)
Returns the user manager for the specified
session . |
void |
init(Repository repository,
Session systemSession) |
protected String adminId
SecurityConstants.ADMIN_ID
).protected String anonymousId
SecurityConstants.ANONYMOUS_ID
).public void init(Repository repository, Session systemSession) throws RepositoryException
init
in interface JackrabbitSecurityManager
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(Session session, AMContext amContext) throws RepositoryException
JackrabbitSecurityManager
AccessManager
for the given session
.getAccessManager
in interface JackrabbitSecurityManager
AccessManager
for the specified session
.RepositoryException
JackrabbitSecurityManager.getAccessManager(Session,AMContext)
public org.apache.jackrabbit.api.security.principal.PrincipalManager getPrincipalManager(Session session) throws RepositoryException
JackrabbitSecurityManager
session
.getPrincipalManager
in interface JackrabbitSecurityManager
session
.UnsupportedRepositoryOperationException
- If principal management
is not supported.RepositoryException
- if an error occursJackrabbitSecurityManager.getPrincipalManager(Session)
public org.apache.jackrabbit.api.security.user.UserManager getUserManager(Session session) throws RepositoryException
JackrabbitSecurityManager
session
.getUserManager
in interface JackrabbitSecurityManager
session
.UnsupportedRepositoryOperationException
- If user management is
not supported.RepositoryException
JackrabbitSecurityManager.getUserManager(Session)
public String getUserID(Subject subject, String workspaceName) throws RepositoryException
JackrabbitSecurityManager
Session.getUserID()
for
the specified subject.getUserID
in interface JackrabbitSecurityManager
Session.getUserID()
.RepositoryException
JackrabbitSecurityManager.getUserID(javax.security.auth.Subject, String)
public AuthContext getAuthContext(Credentials creds, Subject subject, String workspaceName) throws 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, SubjectRepositoryException
- in other exceptional repository statesprotected SecurityManagerConfig getConfig()
SecurityManagerConfig
configured for the
repository this manager has been created for.protected org.apache.jackrabbit.api.security.user.UserManager getSystemUserManager(String workspaceName) throws RepositoryException
workspaceName
- The name of the target workspace.RepositoryException
- If an error occurs.protected MembershipCache getMembershipCache(SessionImpl session) throws RepositoryException
session
- The session for which to retrieve the membership cache.RepositoryException
- If an error occurs.protected UserManagerImpl createUserManager(SessionImpl session) throws RepositoryException
UserManagerImpl
for the given session. May be overridden
to return a custom implementation.session
- sessionRepositoryException
- if an error occursprotected org.apache.jackrabbit.api.security.principal.PrincipalManager createPrincipalManager(SessionImpl session) throws RepositoryException
session
- The session used to create the principal manager.RepositoryException
- If an error occurs.protected WorkspaceAccessManager createDefaultWorkspaceAccessManager()
protected PrincipalProvider createDefaultPrincipalProvider(Properties[] moduleConfig) throws RepositoryException
PrincipalProviderRegistry
.DefaultPrincipalProvider
.RepositoryException
- If an error occurs.protected PrincipalProviderRegistry getPrincipalProviderRegistry()
protected AuthContextProvider getAuthContextProvider()
protected void checkInitialized()
IllegalStateException
if this manager hasn't been
initialized.protected Session getSystemSession()
protected Repository getRepository()
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.