Interface UploadService
-
- All Known Implementing Classes:
UploadServiceImpl
public interface UploadService
This interface abstracts out the Business Logic services available for this micro-service.- Author:
- swaroop_nath
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Memory
convertToMemoryObject(Map<String,Object> payload)
A service that can be used to convert a valid JSON string representation to Memory objectUser
fetchUser(String currentUserID)
This service is used to fetch the currently logged in userboolean
updateUserMemories(List<Memory> uploadedMemories, String userID)
Updates the list of memories for the uservoid
updateUserObject(User currentUser, Memory memory)
A service that can be used to update the current user's portfolio with the newly uploaded memory.
-
-
-
Method Detail
-
updateUserObject
void updateUserObject(User currentUser, Memory memory)
A service that can be used to update the current user's portfolio with the newly uploaded memory.- Parameters:
currentUser
- The current user.memory
- The memory object signifying the uploaded memory.
-
convertToMemoryObject
Memory convertToMemoryObject(Map<String,Object> payload)
A service that can be used to convert a valid JSON string representation to Memory object- Parameters:
payload
- The map object that contains the fields of the Memory- Returns:
- Returns the well-formed Java object. string doesn't correctly represent the Java bean.
-
updateUserMemories
boolean updateUserMemories(List<Memory> uploadedMemories, String userID) throws UploadNotCompleteException
Updates the list of memories for the user- Parameters:
uploadedMemories
- The list of memories that the user has uploaded, including the recently uploaded memoryuserID
- The user id of the user who has uploaded the image- Returns:
- Returns true if the memory could be uploaded on the database
- Throws:
UploadNotCompleteException
- Thrown incase the upload action couldn't be completed
-
fetchUser
User fetchUser(String currentUserID) throws InternalServerException
This service is used to fetch the currently logged in user- Parameters:
currentUserID
- The user id that identifies the currently logged in user- Returns:
- A User object representing the currently logged in user
- Throws:
InternalServerException
- Thrown in case there is some error while loading the User
-
-