|
My Project
|
High-performance database wrapper for user residence lookups using Redis. More...
Public Member Functions | |
| UserResidenceDatabase () | |
| Constructor for UserResidenceDatabase. | |
| String | getUserResidence (String user) |
| Fetches a user's home country from the Redis database. | |
High-performance database wrapper for user residence lookups using Redis.
This class interacts with a Redis instance to store and retrieve the home country of bank users. It is a critical component of the fraud detection system, allowing the Banking API to quickly compare transaction locations against a user's verified residence.
| UserResidenceDatabase.UserResidenceDatabase | ( | ) |
Constructor for UserResidenceDatabase.
Initializes the Redis connection pool and triggers the automatic seeding of data from the local USER_RESIDENCE_FILE.
| String UserResidenceDatabase.getUserResidence | ( | String | user | ) |
Fetches a user's home country from the Redis database.
This method performs an O(1) lookup in Redis.
| user | The username or ID of the customer. |
| RuntimeException | if the user key does not exist in Redis. |