Package com.skava.auth.util
Class UtilBase
java.lang.Object
com.skava.auth.util.JavaCollectionUtil
com.skava.auth.util.UtilBase
- Direct Known Subclasses:
AuthGrandManipluationUtil
This class holds the frequently used utility methods.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static com.skava.core.auth.AuthenticationToken
THis method returns the authentication from security context.protected static com.skava.core.auth.AuthenticationToken
getAuthenticationToken
(Long userId, Long actingUserId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) This method returns the authentication based on userid, aciting userid and grant of the user.protected static <T> T
This method returns the bean reference based on the given class type.protected static com.skava.core.auth.AuthenticationToken
getClientAuthenticationToken
(String clientId, String actingClientId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) This method returns the authentication based on clientId, aciting clientId and grant of the client.static com.skava.core.auth.AuthenticationToken
getClientAuthenticationTokenBase
(String clientId, String actingClientId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) getClientAuthenticationToken.protected static long
THis method return the current TImeStamp.protected static com.skava.core.errorhandler.ResourceNotFoundException
resourceNotFoundException
(String resourceName, String fieldName, String fieldValue) This method returns the resource not found exception.static void
validateClientId
(String clientId, org.springframework.context.MessageSource messageSource) THis method validates the user identifier.static void
validateCollectionId
(Long collectionId, org.springframework.context.MessageSource messageSource) THis method validates the collection identifier.static void
validateUserId
(Long userId, org.springframework.context.MessageSource messageSource) THis method validates the user identifier.protected static com.skava.core.validation.ValidateException
validationException
(org.springframework.context.MessageSource messageSource, AuthResponseCodes responseCode) This method returns the validation exception based on the response code.Methods inherited from class com.skava.auth.util.JavaCollectionUtil
convertToList, getNewList, getNewSet, hasSingleKey
-
Constructor Details
-
UtilBase
protected UtilBase()default constructor.
-
-
Method Details
-
getAuthentication
protected static com.skava.core.auth.AuthenticationToken getAuthentication()THis method returns the authentication from security context.- Returns:
- a
AuthenticationToken
object.
-
getAuthenticationToken
protected static com.skava.core.auth.AuthenticationToken getAuthenticationToken(Long userId, Long actingUserId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) This method returns the authentication based on userid, aciting userid and grant of the user. -
resourceNotFoundException
protected static com.skava.core.errorhandler.ResourceNotFoundException resourceNotFoundException(String resourceName, String fieldName, String fieldValue) This method returns the resource not found exception. -
validationException
protected static com.skava.core.validation.ValidateException validationException(org.springframework.context.MessageSource messageSource, AuthResponseCodes responseCode) This method returns the validation exception based on the response code.- Parameters:
messageSource
- aMessageSource
object.responseCode
- aAuthResponseCodes
object.- Returns:
- a
ValidateException
object.
-
getCurrentTimeInMillis
protected static long getCurrentTimeInMillis()THis method return the current TImeStamp.- Returns:
- a
Long
object.
-
validateCollectionId
public static void validateCollectionId(Long collectionId, org.springframework.context.MessageSource messageSource) THis method validates the collection identifier.- Parameters:
collectionId
- aLong
object.messageSource
- aMessageSource
object.
-
validateUserId
public static void validateUserId(Long userId, org.springframework.context.MessageSource messageSource) THis method validates the user identifier.- Parameters:
userId
- aLong
object.messageSource
- aMessageSource
object.
-
getBean
protected static <T> T getBean(org.springframework.context.ApplicationContext context, String className, Class<T> type) This method returns the bean reference based on the given class type. -
getClientAuthenticationToken
protected static com.skava.core.auth.AuthenticationToken getClientAuthenticationToken(String clientId, String actingClientId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) This method returns the authentication based on clientId, aciting clientId and grant of the client. -
getClientAuthenticationTokenBase
public static com.skava.core.auth.AuthenticationToken getClientAuthenticationTokenBase(String clientId, String actingClientId, com.skava.core.auth.AuthGrantedAuthority authGrantedAuthority) getClientAuthenticationToken.
-
validateClientId
public static void validateClientId(String clientId, org.springframework.context.MessageSource messageSource) THis method validates the user identifier.- Parameters:
clientId
- aString
object.messageSource
- aMessageSource
object.
-