Package com.avoka.fc.core.service.impl
Class AuthenticationServiceImpl
- java.lang.Object
-
- com.avoka.fc.core.service.impl.AuthenticationServiceImpl
-
- All Implemented Interfaces:
IAuthenticationService
public class AuthenticationServiceImpl extends Object implements IAuthenticationService
Provides an authentication service implementation.
-
-
Field Summary
-
Fields inherited from interface com.avoka.fc.core.service.IAuthenticationService
SPRING_BEAN_NAME
-
-
Constructor Summary
Constructors Constructor Description AuthenticationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
associateRequestUser(HttpServletRequest request, RequestLog requestLog)
Associate the user with the request log.void
associateSubmissionUser(HttpServletRequest request, Submission submission)
Associate the user with the submission.List<Group>
getUserFormGroups(HttpServletRequest request)
Gets the user form groups.Set<String>
getUserGroups(HttpServletRequest request)
Gets the user groups.String
getUserId(HttpServletRequest request)
Return user identifier for the given request.List<Group>
getUserJobGroups(HttpServletRequest request)
Gets the user job groups.boolean
isAuthenticated(HttpServletRequest request)
Return true if the user request has been authenticated by an external system.boolean
isUserInFormGroups(HttpServletRequest request)
Return true if the user is in one or more form group.boolean
isUserInGroups(HttpServletRequest request, Set<String> groups)
Return true if the user for the given request belongs to one of the specified groups.boolean
isUserInJobGroups(HttpServletRequest request, Set<String> groups)
Return true if the user for the given request belongs to one of the specified job groups.
-
-
-
Method Detail
-
getUserId
public String getUserId(HttpServletRequest request)
Return user identifier for the given request.- Specified by:
getUserId
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet request- Returns:
- user identifier for the given request
- See Also:
IAuthenticationService.getUserId(HttpServletRequest)
-
isAuthenticated
public boolean isAuthenticated(HttpServletRequest request)
Return true if the user request has been authenticated by an external system.- Specified by:
isAuthenticated
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet request- Returns:
- true if the user request has been authenticated by an external system.
- See Also:
IAuthenticationService.isAuthenticated(HttpServletRequest)
-
isUserInGroups
public boolean isUserInGroups(HttpServletRequest request, Set<String> groups) throws ApplicationException
Return true if the user for the given request belongs to one of the specified groups. If the providing group is empty, then it will return false- Specified by:
isUserInGroups
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet requestgroups
- the set of group names- Returns:
- true if the user is in one of the specified groups
- Throws:
ApplicationException
- if the user request is not identified- See Also:
IAuthenticationService.isUserInGroups(HttpServletRequest, Set)
-
isUserInJobGroups
public boolean isUserInJobGroups(HttpServletRequest request, Set<String> groups) throws ApplicationException
Return true if the user for the given request belongs to one of the specified job groups. If the providing group is empty, then it will return false- Specified by:
isUserInJobGroups
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet requestgroups
- the set of group names- Returns:
- true if the user is in one of the specified groups
- Throws:
ApplicationException
- if the user request is not identified- Since:
- 17.10.0
- See Also:
IAuthenticationService.isUserInJobGroups(HttpServletRequest, Set)
-
isUserInFormGroups
public boolean isUserInFormGroups(HttpServletRequest request) throws ApplicationException
Return true if the user is in one or more form group.- Specified by:
isUserInFormGroups
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet request- Returns:
- true if the user is in one or more form group
- Throws:
ApplicationException
- if the user request is not identified- Since:
- 3.6.0
- See Also:
IAuthenticationService.isUserInFormGroups(HttpServletRequest)
-
associateRequestUser
public void associateRequestUser(HttpServletRequest request, RequestLog requestLog)
Associate the user with the request log.- Specified by:
associateRequestUser
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet requestrequestLog
- the request log record to update- See Also:
IAuthenticationService.associateRequestUser(HttpServletRequest, com.avoka.fc.core.entity.RequestLog)
-
associateSubmissionUser
public void associateSubmissionUser(HttpServletRequest request, Submission submission)
Associate the user with the submission.- Specified by:
associateSubmissionUser
in interfaceIAuthenticationService
- Parameters:
request
- the user servlet requestsubmission
- the submission record to update- See Also:
IAuthenticationService.associateSubmissionUser(HttpServletRequest, Submission)
-
getUserGroups
public Set<String> getUserGroups(HttpServletRequest request)
Gets the user groups.- Specified by:
getUserGroups
in interfaceIAuthenticationService
- Parameters:
request
- the request- Returns:
- the user groups
- See Also:
IAuthenticationService.getUserGroups(HttpServletRequest)
-
getUserFormGroups
public List<Group> getUserFormGroups(HttpServletRequest request)
Gets the user form groups.- Specified by:
getUserFormGroups
in interfaceIAuthenticationService
- Parameters:
request
- the request- Returns:
- the user groups
- Since:
- 4.3.4
- See Also:
IAuthenticationService#getFormUserGroups(HttpServletRequest)
-
getUserJobGroups
public List<Group> getUserJobGroups(HttpServletRequest request)
Gets the user job groups.- Specified by:
getUserJobGroups
in interfaceIAuthenticationService
- Parameters:
request
- the request- Returns:
- the user job groups
- Since:
- 17.10.0
- See Also:
IAuthenticationService#getFormUserGroups(HttpServletRequest)
-
-