Package com.skava.service.impl
Class CreateNotesServiceImpl
java.lang.Object
com.skava.service.impl.CreateNotesServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<NotesRequest,
,NotesResponse> CreateNotesService
@Service
@Transactional
public class CreateNotesServiceImpl
extends Object
implements CreateNotesService
This service class implements CreateNotesService and handles the create notes service request, process it
and save the details in DB. It also implements business logic required to create notes for a business or
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 create user notes service.methodFallback
(NotesRequest input) 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 create a new 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
-
CreateNotesServiceImpl
public CreateNotesServiceImpl()Default Constructor
-
-
Method Details
-
process
@SendEvent(eventType="userservice/notes/create", identifier="response_notes.id") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions=com.skava.core.validation.ValidateException.class) public NotesResponse process(NotesRequest request) This method is used to create a new 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, the notes will be saved in database.- Specified by:
process
in interfacecom.skava.core.EcommService<NotesRequest,
NotesResponse> - 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 creation and if any validations fails, throws an validate exception.
-
getValidator
This method is used to get the respective validator class for this create user notes service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<NotesRequest,
NotesResponse> - 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:
input
- HoldsNotesRequest
object.- Returns:
- The
NotesResponse
object.
-