org.alfresco.repo.security.authentication
Class AuthenticationContextImpl

java.lang.Object
  extended by org.alfresco.repo.security.authentication.AuthenticationContextImpl
All Implemented Interfaces:
AuthenticationContext

public class AuthenticationContextImpl
extends java.lang.Object
implements AuthenticationContext


Constructor Summary
AuthenticationContextImpl()
           
 
Method Summary
 void clearCurrentSecurityContext()
          Remove the current security information
 net.sf.acegisecurity.Authentication getCurrentAuthentication()
           
 java.lang.String getCurrentUserName()
          Get the current user name.
 java.lang.String getGuestUserName()
          Get the name of the Guest User.
 java.lang.String getGuestUserName(java.lang.String tenantDomain)
          Get the name of the guest user
 java.lang.String getSystemUserName()
          Get the name of the system user.
 java.lang.String getSystemUserName(java.lang.String tenantDomain)
          Get the name of the system user
 java.lang.String getUserDomain(java.lang.String userName)
          Extracts the tenant domain name from a user name
 boolean isCurrentUserTheSystemUser()
          Is the current user the system user?
 boolean isGuestUserName(java.lang.String userName)
          True if this is a guest user ?
 boolean isSystemUserName(java.lang.String userName)
          True if this is the System user ?
 net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
          Explicitly set the current suthentication.
 net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser()
          Set the system user as the current user.
 net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(java.lang.String tenantDomain)
          Set the system user as the current user.
 void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
           
 net.sf.acegisecurity.Authentication setUserDetails(net.sf.acegisecurity.UserDetails ud)
          Explicitly set the given validated user details to be authenticated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationContextImpl

public AuthenticationContextImpl()
Method Detail

setTenantService

public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)

setUserDetails

public net.sf.acegisecurity.Authentication setUserDetails(net.sf.acegisecurity.UserDetails ud)
Explicitly set the given validated user details to be authenticated.

Specified by:
setUserDetails in interface AuthenticationContext
Parameters:
ud - the User Details
Returns:
Authentication

setSystemUserAsCurrentUser

public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser()
Description copied from interface: AuthenticationContext
Set the system user as the current user.

Specified by:
setSystemUserAsCurrentUser in interface AuthenticationContext

setSystemUserAsCurrentUser

public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(java.lang.String tenantDomain)
Description copied from interface: AuthenticationContext
Set the system user as the current user.

Specified by:
setSystemUserAsCurrentUser in interface AuthenticationContext

getSystemUserName

public java.lang.String getSystemUserName()
Description copied from interface: AuthenticationContext
Get the name of the system user. Note: for MT, will get system for default domain only

Specified by:
getSystemUserName in interface AuthenticationContext

getSystemUserName

public java.lang.String getSystemUserName(java.lang.String tenantDomain)
Description copied from interface: AuthenticationContext
Get the name of the system user

Specified by:
getSystemUserName in interface AuthenticationContext

isSystemUserName

public boolean isSystemUserName(java.lang.String userName)
Description copied from interface: AuthenticationContext
True if this is the System user ?

Specified by:
isSystemUserName in interface AuthenticationContext

isCurrentUserTheSystemUser

public boolean isCurrentUserTheSystemUser()
Description copied from interface: AuthenticationContext
Is the current user the system user?

Specified by:
isCurrentUserTheSystemUser in interface AuthenticationContext

getGuestUserName

public java.lang.String getGuestUserName(java.lang.String tenantDomain)
Description copied from interface: AuthenticationContext
Get the name of the guest user

Specified by:
getGuestUserName in interface AuthenticationContext

getGuestUserName

public java.lang.String getGuestUserName()
Description copied from interface: AuthenticationContext
Get the name of the Guest User. Note: for MT, will get guest for default domain only

Specified by:
getGuestUserName in interface AuthenticationContext

isGuestUserName

public boolean isGuestUserName(java.lang.String userName)
Description copied from interface: AuthenticationContext
True if this is a guest user ?

Specified by:
isGuestUserName in interface AuthenticationContext

setCurrentAuthentication

public net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
Description copied from interface: AuthenticationContext
Explicitly set the current suthentication. If the authentication is null the the current authentication is cleared.

Specified by:
setCurrentAuthentication in interface AuthenticationContext
Parameters:
authentication - the current authentication (may be null).
Returns:
Returns the modified authentication instance or null if it was cleared.

getCurrentAuthentication

public net.sf.acegisecurity.Authentication getCurrentAuthentication()
                                                             throws org.alfresco.repo.security.authentication.AuthenticationException
Specified by:
getCurrentAuthentication in interface AuthenticationContext
Throws:
AuthenticationException

getCurrentUserName

public java.lang.String getCurrentUserName()
                                    throws org.alfresco.repo.security.authentication.AuthenticationException
Description copied from interface: AuthenticationContext
Get the current user name.

Specified by:
getCurrentUserName in interface AuthenticationContext
Throws:
AuthenticationException

clearCurrentSecurityContext

public void clearCurrentSecurityContext()
Description copied from interface: AuthenticationContext
Remove the current security information

Specified by:
clearCurrentSecurityContext in interface AuthenticationContext

getUserDomain

public java.lang.String getUserDomain(java.lang.String userName)
Description copied from interface: AuthenticationContext
Extracts the tenant domain name from a user name

Specified by:
getUserDomain in interface AuthenticationContext
Parameters:
userName - a user name
Returns:
a tenant domain name


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.