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 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 interface com.skava.core.EcommService<NotesRequest,NotesGetAllResponse>
      Parameters:
      request - Holds NotesRequest 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

      public List<com.skava.core.validation.ValidatorComponent> getValidator()
      This method is used to get the respective validator class for this get all user notes service.
      Specified by:
      getValidator in interface com.skava.core.EcommService<NotesRequest,NotesGetAllResponse>
      Returns:
      The list of ValidatorComponent object.
    • methodFallback

      public NotesGetAllResponse 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.
      Parameters:
      request - Holds NotesRequest object.
      Returns:
      The List of NotesResponse object.