Class CreateCollectionServiceImpl
java.lang.Object
com.skava.oms.service.EcommCoreServices
com.skava.oms.service.collection.CollectionHelperServices
com.skava.oms.service.collection.impl.CreateCollectionServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<CreateCollectionRequest,
,OmsServiceEntityResponse<CollectionDTO>> CreateCollectionService
,CustomEcommService<CreateCollectionRequest,
OmsServiceEntityResponse<CollectionDTO>>
@Service
public class CreateCollectionServiceImpl
extends CollectionHelperServices
implements CreateCollectionService
The class CreateCollectionServiceImpl is the implementation class for the create collection API
-
Field Summary
Fields inherited from class com.skava.oms.service.collection.CollectionHelperServices
authHelper, bpmService, collectionAssembler, collectionAttributeAssembler, collectionAttributeRepository, collectionPropertiesAssembler, collectionRepository
Fields inherited from class com.skava.oms.service.EcommCoreServices
context, messageSource, orderService, redissonClient, validator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.core.io.Resource
getResource
(String path) getResource.List<com.skava.core.validation.ValidatorComponent>
void
init()
Initialize validators Load validator classes from configuration using microservices property By default load built-in validatormethodFallback
(CreateCollectionRequest request) Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly.process
(CreateCollectionRequest request) This method is used to create Collection based on given Collection.Methods inherited from class com.skava.oms.service.collection.CollectionHelperServices
checkForDuplicateName
Methods inherited from class com.skava.oms.service.EcommCoreServices
createOrderNotes, getItemIds, getItemIdsStr, updateOrderNotification
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.skava.oms.service.CustomEcommService
getValidateException
Methods inherited from interface com.skava.core.EcommService
getValidator
-
Constructor Details
-
CreateCollectionServiceImpl
public CreateCollectionServiceImpl()
-
-
Method Details
-
init
@EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void init()Initialize validators Load validator classes from configuration using microservices property By default load built-in validator -
getValidator
- Specified by:
getValidator
in interfacecom.skava.core.EcommService<CreateCollectionRequest,
OmsServiceEntityResponse<CollectionDTO>>
-
process
@Audit @SendEvent(eventType="omsservices/collections/create", identifier="response_id") @HystrixCommand(commandKey="oms-key", fallbackMethod="methodFallback", ignoreExceptions={com.skava.core.validation.ValidateException.class,OmsServiceException.class,OmsValidateException.class}) public OmsServiceEntityResponse<CollectionDTO> process(@AuditField(field="CreateCollectionRequest") CreateCollectionRequest request) This method is used to create Collection based on given Collection.- Specified by:
process
in interfacecom.skava.core.EcommService<CreateCollectionRequest,
OmsServiceEntityResponse<CollectionDTO>> - Parameters:
request
- It contains the attributes required for the creation of Collection.- Returns:
- It returns the
CollectionResponse
. It will throw Ecommerce exception if it process get failed.
-
getResource
getResource.
This method used to get the json data file as classpath resource using path of the json file.- Parameters:
path
- aString
object.- Returns:
- a
Resource
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.- Parameters:
request
- Instance ofCreateCollectionRequest
- Returns:
- Instance of
OmsServiceEntityResponse
-