Package restapi.services
Class FirebaseService
java.lang.Object
restapi.services.FirebaseService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
getPhoneFromFireAuth
(String authUID) Retrieves phone number corresponding to auth UID from FirebasegetUsernameByFireAuth
(String authUID) Returns Username with phone number corresponding to the authUID on FirebasegetValidPhoneFromFireAuth
(String authUID) Returns phone number corresponding to the authUID on Firebase if the phone is not already used by a user
-
Field Details
-
userRepository
-
-
Constructor Details
-
FirebaseService
public FirebaseService()
-
-
Method Details
-
getPhoneFromFireAuth
Retrieves phone number corresponding to auth UID from Firebase- Parameters:
authUID
- Firebase authUID corresponding to a user logged with phone- Returns:
- Phone number in format String
- Throws:
CustomNotFoundException
- When Firebase rejects the authUID
-
getUsernameByFireAuth
Returns Username with phone number corresponding to the authUID on Firebase- Parameters:
authUID
- Firebase authUID corresponding to a user logged with phone- Returns:
- Username
- Throws:
CustomNotFoundException
- When Firebase rejects the authUID or Phone Number not found in database
-
getValidPhoneFromFireAuth
public String getValidPhoneFromFireAuth(String authUID) throws CustomNotFoundException, CustomConflictException Returns phone number corresponding to the authUID on Firebase if the phone is not already used by a user- Parameters:
authUID
- Firebase authUID corresponding to a user logged with phone- Returns:
- Phone Number in format String if it is not on the database
- Throws:
CustomNotFoundException
- When Firebase rejects the authUIDCustomConflictException
- When Phone Number already in database
-