Class 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
  • 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

      public List<com.skava.core.validation.ValidatorComponent> getValidator()
      Specified by:
      getValidator in interface com.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 interface com.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

      public static org.springframework.core.io.Resource getResource(String path)

      getResource.

      This method used to get the json data file as classpath resource using path of the json file.
      Parameters:
      path - a String 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 of CreateCollectionRequest
      Returns:
      Instance of OmsServiceEntityResponse