Package com.skava.service.impl
Class GetAllNotesServiceImpl
java.lang.Object
com.skava.service.impl.GetAllNotesServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<NotesRequest,
,NotesGetAllResponse> GetAllNotesService
@Service
@Transactional(propagation=REQUIRED,
readOnly=true)
public class GetAllNotesServiceImpl
extends Object
implements GetAllNotesService
This service class implements GetAllNotesService and handles loading the notes details from DB.
It also implements business logic required for loading notes for a particular user within a collection.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.skava.core.validation.ValidatorComponent>
This method is used to get the respective validator class for this get all user notes service.methodFallback
(NotesRequest request) Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly - Method fallback.process
(NotesRequest request) This method is used to load all notes for a particular user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.skava.core.EcommService
getValidateException, getValidator
-
Constructor Details
-
GetAllNotesServiceImpl
public GetAllNotesServiceImpl()Default Constructor
-
-
Method Details
-
process
@HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public NotesGetAllResponse process(NotesRequest request) This method is used to load all notes for a particular user. Notes which contains the title and description. The validation occurs for collection id and user id. If any validation fails, it throws ValidateException and on successful validation, then all notes will be loaded from database within a user id and collection id.- Specified by:
process
in interfacecom.skava.core.EcommService<NotesRequest,
NotesGetAllResponse> - Parameters:
request
- HoldsNotesRequest
object which holds the notes request for creating a new notes.- Returns:
- The
NotesResponse
object which returns the success response code and response message on successful fetching and if any validations fails, throws an validate exception.
-
getValidator
This method is used to get the respective validator class for this get all user notes service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<NotesRequest,
NotesGetAllResponse> - Returns:
- The list of
ValidatorComponent
object.
-
methodFallback
Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly - Method fallback.- Parameters:
request
- HoldsNotesRequest
object.- Returns:
- The
List
ofNotesResponse
object.
-