Class UserUtils
java.lang.Object
es.kukenan.smartfi.microservice.transfer.utils.UserUtils
class for handler some util methods.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractCompanyId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication) Extract user company value.static StringextractSessionId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication) Extract Session ID from kukenan authentication.static StringextractUserId(es.kukenan.smartfi.common.security.WalletAuthentication kukenanWalletAuthentication) Extract user ID from kukenan authentication.Returns User from database.static List<UserBackoffice>map(User user, List<es.kukenan.smartfi.microservice.clients.events.common.UserBackoffice> userBackofficeEntities) Map the givenUserBackofficelist to aUserBackofficelist.
-
Field Details
-
userRepository
User repository.
-
-
Constructor Details
-
UserUtils
public UserUtils()
-
-
Method Details
-
map
public static List<UserBackoffice> map(User user, List<es.kukenan.smartfi.microservice.clients.events.common.UserBackoffice> userBackofficeEntities) Map the givenUserBackofficelist to aUserBackofficelist.- Parameters:
user- event.userBackofficeEntities- a user backoffice entity list.- Returns:
- the mapped user backoffice dto list.
-
extractUserId
public static String extractUserId(es.kukenan.smartfi.common.security.WalletAuthentication kukenanWalletAuthentication) Extract user ID from kukenan authentication.- Parameters:
kukenanWalletAuthentication- received authentication.- Returns:
- the user identifier.
-
extractCompanyId
public static String extractCompanyId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication) Extract user company value.- Parameters:
walletAuthentication- received authentication.- Returns:
- the company value identifier.
-
extractSessionId
public static String extractSessionId(es.kukenan.smartfi.common.security.WalletAuthentication walletAuthentication) Extract Session ID from kukenan authentication.- Parameters:
walletAuthentication- received authentication.- Returns:
- the Session identifier.
-
getUser
Returns User from database.- Parameters:
userId- userId- Returns:
- User
-