Class MockAuthenticationService

  • All Implemented Interfaces:
    Serializable, org.alfresco.service.cmr.security.AuthenticationService, org.alfresco.service.cmr.security.MutableAuthenticationService

    public class MockAuthenticationService
    extends Object
    implements org.alfresco.service.cmr.security.MutableAuthenticationService, Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • MockAuthenticationService

        public MockAuthenticationService()
    • Method Detail

      • getAuthenticationEnabled

        public boolean getAuthenticationEnabled​(String userName)
                                         throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        getAuthenticationEnabled in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • authenticate

        public void authenticate​(String userName,
                                 char[] password)
                          throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        authenticate in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • authenticateAsGuest

        public void authenticateAsGuest()
                                 throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        authenticateAsGuest in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • guestUserAuthenticationAllowed

        public boolean guestUserAuthenticationAllowed()
        Specified by:
        guestUserAuthenticationAllowed in interface org.alfresco.service.cmr.security.AuthenticationService
      • authenticationExists

        public boolean authenticationExists​(String userName)
        Specified by:
        authenticationExists in interface org.alfresco.service.cmr.security.AuthenticationService
      • getCurrentUserName

        public String getCurrentUserName()
                                  throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        getCurrentUserName in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • invalidateUserSession

        public void invalidateUserSession​(String userName)
                                   throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        invalidateUserSession in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • invalidateTicket

        public void invalidateTicket​(String ticket)
                              throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        invalidateTicket in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • validate

        public void validate​(String ticket)
                      throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        validate in interface org.alfresco.service.cmr.security.AuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • getCurrentTicket

        public String getCurrentTicket()
        Specified by:
        getCurrentTicket in interface org.alfresco.service.cmr.security.AuthenticationService
      • getNewTicket

        public String getNewTicket()
        Specified by:
        getNewTicket in interface org.alfresco.service.cmr.security.AuthenticationService
      • clearCurrentSecurityContext

        public void clearCurrentSecurityContext()
        Specified by:
        clearCurrentSecurityContext in interface org.alfresco.service.cmr.security.AuthenticationService
      • isCurrentUserTheSystemUser

        public boolean isCurrentUserTheSystemUser()
        Specified by:
        isCurrentUserTheSystemUser in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDomains

        public Set<String> getDomains()
        Specified by:
        getDomains in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDomainsThatAllowUserCreation

        public Set<String> getDomainsThatAllowUserCreation()
        Specified by:
        getDomainsThatAllowUserCreation in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDomainsThatAllowUserDeletion

        public Set<String> getDomainsThatAllowUserDeletion()
        Specified by:
        getDomainsThatAllowUserDeletion in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDomiansThatAllowUserPasswordChanges

        public Set<String> getDomiansThatAllowUserPasswordChanges()
        Specified by:
        getDomiansThatAllowUserPasswordChanges in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDefaultAdministratorUserNames

        public Set<String> getDefaultAdministratorUserNames()
        Specified by:
        getDefaultAdministratorUserNames in interface org.alfresco.service.cmr.security.AuthenticationService
      • getDefaultGuestUserNames

        public Set<String> getDefaultGuestUserNames()
        Specified by:
        getDefaultGuestUserNames in interface org.alfresco.service.cmr.security.AuthenticationService
      • isAuthenticationMutable

        public boolean isAuthenticationMutable​(String userName)
        Specified by:
        isAuthenticationMutable in interface org.alfresco.service.cmr.security.MutableAuthenticationService
      • isAuthenticationCreationAllowed

        public boolean isAuthenticationCreationAllowed()
        Specified by:
        isAuthenticationCreationAllowed in interface org.alfresco.service.cmr.security.MutableAuthenticationService
      • createAuthentication

        public void createAuthentication​(String userName,
                                         char[] password)
                                  throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        createAuthentication in interface org.alfresco.service.cmr.security.MutableAuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • updateAuthentication

        public void updateAuthentication​(String userName,
                                         char[] oldPassword,
                                         char[] newPassword)
                                  throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        updateAuthentication in interface org.alfresco.service.cmr.security.MutableAuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • setAuthentication

        public void setAuthentication​(String userName,
                                      char[] newPassword)
                               throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        setAuthentication in interface org.alfresco.service.cmr.security.MutableAuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • deleteAuthentication

        public void deleteAuthentication​(String userName)
                                  throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        deleteAuthentication in interface org.alfresco.service.cmr.security.MutableAuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException
      • setAuthenticationEnabled

        public void setAuthenticationEnabled​(String userName,
                                             boolean enabled)
                                      throws org.alfresco.repo.security.authentication.AuthenticationException
        Specified by:
        setAuthenticationEnabled in interface org.alfresco.service.cmr.security.MutableAuthenticationService
        Throws:
        org.alfresco.repo.security.authentication.AuthenticationException