Define the Tax Implementation Class

In this task, you define the implementation class and method stubs.

Procedure

  1. Go to to the projects/thinAirTax/rsgwextension/src/main/java/com/matrixx/rsgateway/configuration directory.
  2. Create a file named TaxationService.java.
  3. Define the class and method stubs.
    package com.matrixx.rsgateway.configuration;
     
            import com.matrixx.datacontainer.mdc.TaxComputeRequest;
            import com.matrixx.datacontainer.mdc.TaxComputeResponse;
            import com.matrixx.platform.MatrixxLogging;
            import com.matrixx.rsgateway.admin.Services;
    
            import org.slf4j.Logger;
            import org.slf4j.LoggerFactory;
     
            import static com.matrixx.platform.LogUtils.ENTER;
            import static com.matrixx.platform.LogUtils.LEAVE;
    
            import org.springframework.stereotype.Service;
     
            @Service(value = "TaxationService")
            public class TaxationService extends Services {
                /**
                 * logger
                 */
                private final Logger m_logger = MatrixxLogging.setupLogging(getClass());
     
                /**
                 * hide constructor
                 */
                public TaxationService()
                {
                }
                /**
                 * Compute the tax for the request and respond with the information in response.
                 * @param request  TaxComputeRequest
                 * @param response TaxComputeResponse
                 * @return int
                 */
                public int computeTax(TaxComputeRequest request, TaxComputeResponse response)
                {
                    ENTER(m_logger, "multiQuery"); 
                    response.setResult(0L);
                    response.setResultText("OK");
                    return LEAVE(0, m_logger, "multiQuery");
                }
            }
  4. Save the file.