├── src ├── main │ └── java │ │ └── com │ │ ├── method │ │ └── invoke │ │ │ ├── base │ │ │ ├── BaseRequest.java │ │ │ └── BaseResponse.java │ │ │ ├── ExceptionReInvokeProcessor.java │ │ │ ├── SystemInvoke.java │ │ │ ├── DefaultExceptionReInvokeProcessor.java │ │ │ ├── callback │ │ │ └── InvokeCallBack.java │ │ │ ├── NextInvokeProcessor.java │ │ │ ├── DefaultNextInvokeProcessor.java │ │ │ ├── DefaultAttachment.java │ │ │ └── exec │ │ │ └── InvokeThreadFactory.java │ │ ├── amazon │ │ ├── commom │ │ │ ├── ProcessingStatus.java │ │ │ ├── MarketPlaceId.java │ │ │ └── ReportType.java │ │ ├── invoke │ │ │ ├── AmazonBaseRequest.java │ │ │ ├── AmazonBaseResponse.java │ │ │ ├── AmazonExceptionReInvokeProcessor.java │ │ │ └── AmazonNextInvokeProcessor.java │ │ ├── domain │ │ │ └── report │ │ │ │ ├── ResolveReportResult.java │ │ │ │ ├── ReportResult_GET_SELLER_FEEDBACK_DATA_.java │ │ │ │ ├── ReportResult_GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_.java │ │ │ │ ├── ReportResult_GET_MERCHANT_LISTINGS_DATA_LITER_.java │ │ │ │ ├── ReportResult_GET_FLAT_FILE_OPEN_LISTINGS_DATA_.java │ │ │ │ └── ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_.java │ │ ├── config │ │ │ └── AmazonAccountConfig.java │ │ ├── report │ │ │ └── DisposableRequestReportResponse.java │ │ └── util │ │ │ └── IPUtil.java │ │ ├── amazonaws │ │ └── mws │ │ │ ├── model │ │ │ ├── package-info.java │ │ │ ├── ContentTypeParameter.java │ │ │ ├── ContentType.java │ │ │ ├── ResponseHeaderMetadata.java │ │ │ └── FeedProcessingStatus.java │ │ │ └── mock │ │ │ ├── GetReportResponse.xml │ │ │ ├── GetFeedSubmissionResultResponse.xml │ │ │ ├── GetReportCountResponse.xml │ │ │ ├── GetReportRequestCountResponse.xml │ │ │ ├── GetFeedSubmissionCountResponse.xml │ │ │ ├── GetReportScheduleCountResponse.xml │ │ │ ├── ErrorResponse.xml │ │ │ ├── ManageReportScheduleResponse.xml │ │ │ ├── GetReportScheduleListResponse.xml │ │ │ ├── GetReportScheduleListByNextTokenResponse.xml │ │ │ ├── SubmitFeedResponse.xml │ │ │ ├── GetReportListResponse.xml │ │ │ ├── UpdateReportAcknowledgementsResponse.xml │ │ │ ├── GetReportListByNextTokenResponse.xml │ │ │ ├── CancelFeedSubmissionsResponse.xml │ │ │ ├── GetFeedSubmissionListResponse.xml │ │ │ ├── RequestReportResponse.xml │ │ │ ├── GetFeedSubmissionListByNextTokenResponse.xml │ │ │ ├── CancelReportRequestsResponse.xml │ │ │ ├── GetReportRequestListResponse.xml │ │ │ └── GetReportRequestListByNextTokenResponse.xml │ │ └── amazonservices │ │ └── mws │ │ ├── FulfillmentOutboundShipment │ │ └── _2010_10_01 │ │ │ ├── mock │ │ │ ├── CancelFulfillmentOrderResponse.xml │ │ │ ├── CreateFulfillmentOrderResponse.xml │ │ │ ├── UpdateFulfillmentOrderResponse.xml │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── ErrorResponse.xml │ │ │ ├── GetPackageTrackingDetailsResponse.xml │ │ │ ├── ListAllFulfillmentOrdersResponse.xml │ │ │ ├── ListAllFulfillmentOrdersByNextTokenResponse.xml │ │ │ └── GetFulfillmentPreviewResponse.xml │ │ │ ├── MWSEndpoint.java │ │ │ ├── model │ │ │ ├── MWSResponse.java │ │ │ └── ResponseHeaderMetadata.java │ │ │ ├── FBAOutboundServiceMWSException.java │ │ │ └── samples │ │ │ └── FBAOutboundServiceMWSSampleConfig.java │ │ ├── products │ │ ├── mock │ │ │ ├── ErrorResponse.xml │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── GetProductCategoriesForSKUResponse.xml │ │ │ ├── GetProductCategoriesForASINResponse.xml │ │ │ └── GetMyFeesEstimateResponse.xml │ │ ├── MWSEndpoint.java │ │ ├── model │ │ │ ├── ProductsUtil.java │ │ │ ├── MWSResponse.java │ │ │ ├── ResponseHeaderMetadata.java │ │ │ └── ServiceStatusEnum.java │ │ ├── MarketplaceWebServiceProductsException.java │ │ └── samples │ │ │ ├── MarketplaceWebServiceProductsSampleConfig.java │ │ │ └── GetServiceStatusSample.java │ │ ├── sellers │ │ ├── mock │ │ │ ├── ErrorResponse.xml │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── ListMarketplaceParticipationsResponse.xml │ │ │ └── ListMarketplaceParticipationsByNextTokenResponse.xml │ │ ├── MWSEndpoint.java │ │ ├── model │ │ │ ├── ServiceStatusEnum.java │ │ │ ├── MWSResponse.java │ │ │ ├── HasSellerSuspendedListingsEnum.java │ │ │ └── ResponseHeaderMetadata.java │ │ ├── MarketplaceWebServiceSellersException.java │ │ ├── MarketplaceWebServiceSellersAsync.java │ │ ├── samples │ │ │ ├── MarketplaceWebServiceSellersSampleConfig.java │ │ │ └── GetServiceStatusSample.java │ │ ├── MarketplaceWebServiceSellers.java │ │ └── MarketplaceWebServiceSellersAsyncClient.java │ │ ├── orders │ │ └── _2013_09_01 │ │ │ ├── mock │ │ │ ├── ErrorResponse.xml │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── GetOrderResponse.xml │ │ │ ├── ListOrdersResponse.xml │ │ │ └── ListOrdersByNextTokenResponse.xml │ │ │ ├── MWSEndpoint.java │ │ │ ├── model │ │ │ ├── MWSResponse.java │ │ │ └── ResponseHeaderMetadata.java │ │ │ ├── MarketplaceWebServiceOrdersException.java │ │ │ └── samples │ │ │ ├── MarketplaceWebServiceOrdersSampleConfig.java │ │ │ └── GetServiceStatusSample.java │ │ ├── FulfillmentInventory │ │ └── _2010_10_01 │ │ │ ├── mock │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── ErrorResponse.xml │ │ │ ├── ListInventorySupplyResponse.xml │ │ │ └── ListInventorySupplyByNextTokenResponse.xml │ │ │ ├── MWSEndpoint.java │ │ │ ├── model │ │ │ ├── MWSResponse.java │ │ │ └── ResponseHeaderMetadata.java │ │ │ ├── FBAInventoryServiceMWSException.java │ │ │ ├── samples │ │ │ └── FBAInventoryServiceMWSSampleConfig.java │ │ │ └── FBAInventoryServiceMWSAsyncClient.java │ │ ├── merchantfulfillment │ │ └── _2015_06_01 │ │ │ ├── mock │ │ │ ├── GetServiceStatusResponse.xml │ │ │ ├── ErrorResponse.xml │ │ │ └── GetEligibleShippingServicesResponse.xml │ │ │ ├── MWSEndpoint.java │ │ │ ├── model │ │ │ ├── MWSResponse.java │ │ │ └── ResponseHeaderMetadata.java │ │ │ ├── MWSMerchantFulfillmentServiceException.java │ │ │ └── samples │ │ │ └── MWSMerchantFulfillmentServiceSampleConfig.java │ │ └── client │ │ ├── MwsCall.java │ │ ├── MwsResponseMetadata.java │ │ ├── MwsRequestType.java │ │ ├── MwsXmlBuilder.java │ │ ├── MwsJsonBuilder.java │ │ ├── AbstractMwsObject.java │ │ ├── MwsEndpoints.java │ │ ├── MwsResponse.java │ │ └── MwsObject.java └── test │ └── java │ └── com │ └── method │ └── test │ └── amazon │ └── apimocktest │ ├── AmazonProductRequest.java │ ├── AmazonOrderResponse.java │ ├── AmazonProductResponse.java │ └── AmazonTestClient.java ├── README.md ├── .gitignore └── pom.xml /src/main/java/com/method/invoke/base/BaseRequest.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke.base; 2 | 3 | /** 4 | * 基本请求类 5 | * 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public interface BaseRequest { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/base/BaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke.base; 2 | 3 | /** 4 | * 基本响应类 5 | * 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public interface BaseResponse { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/commom/ProcessingStatus.java: -------------------------------------------------------------------------------- 1 | package com.amazon.commom; 2 | 3 | public enum ProcessingStatus { 4 | 5 | _SUBMITTED_, 6 | _IN_PROGRESS_, 7 | _CANCELLED_, 8 | _DONE_, 9 | _DONE_NO_DATA_ 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/model/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.xml.bind.annotation.XmlSchema(namespace = "http://mws.amazonaws.com/doc/2009-01-01/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) 2 | package com.amazonaws.mws.model; 3 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonBaseRequest.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.method.invoke.base.BaseRequest; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/22 8 | */ 9 | public interface AmazonBaseRequest extends BaseRequest { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonBaseResponse.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.method.invoke.base.BaseResponse; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/22 8 | */ 9 | public interface AmazonBaseResponse extends BaseResponse { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/ExceptionReInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | /** 4 | * 异常重试处理器 5 | * 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public interface ExceptionReInvokeProcessor { 10 | boolean needReInvoke(Exception e); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | string 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ResolveReportResult.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/26 8 | */ 9 | public interface ResolveReportResult { 10 | List resolveResult(List resultList); 11 | } 12 | -------------------------------------------------------------------------------- /src/test/java/com/method/test/amazon/apimocktest/AmazonProductRequest.java: -------------------------------------------------------------------------------- 1 | package com.method.test.amazon.apimocktest; 2 | 3 | import com.method.invoke.base.BaseRequest; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public class AmazonProductRequest implements BaseRequest { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/SystemInvoke.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | import com.method.invoke.base.BaseResponse; 4 | 5 | /** 6 | * 系统后台线程工作池 7 | * 8 | * @author zhuzhenke 9 | * @date 2018/03/20 10 | */ 11 | public interface SystemInvoke { 12 | BaseResponse execute(RequestCommand request) throws Exception; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetFeedSubmissionResultResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | string 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportCountResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/CancelFulfillmentOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/CreateFulfillmentOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/UpdateFulfillmentOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportRequestCountResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetFeedSubmissionCountResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportScheduleCountResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/DefaultExceptionReInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | /** 4 | * 默认的异常重试处理器:不重试,直接返回 5 | * 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public class DefaultExceptionReInvokeProcessor implements ExceptionReInvokeProcessor { 10 | 11 | @Override 12 | public boolean needReInvoke(Exception e) { 13 | return false; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/model/ContentTypeParameter.java: -------------------------------------------------------------------------------- 1 | package com.amazonaws.mws.model; 2 | 3 | /* 4 | * Interface for Content-Type parameters that are appended to the Content-Type; 5 | * e.g. "charset=utf-8". 6 | * 7 | * The toString method should be overriden to output the correct value in 8 | * key/value pair format separated by an equals sign. 9 | */ 10 | public interface ContentTypeParameter { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/callback/InvokeCallBack.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke.callback; 2 | 3 | import com.method.invoke.DefaultAttachment; 4 | import com.method.invoke.base.BaseResponse; 5 | 6 | /** 7 | * 回调 8 | * 9 | * @author zhuzhenke 10 | * @date 2018/03/20 11 | */ 12 | public interface InvokeCallBack { 13 | void invokeResult(BaseResponse response, DefaultAttachment defaultAttachment, Exception e); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_SELLER_FEEDBACK_DATA_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/26 8 | */ 9 | public class ReportResult_GET_SELLER_FEEDBACK_DATA_ implements ResolveReportResult { 10 | @Override 11 | public List resolveResult(List resultList) { 12 | return null; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/NextInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | import com.method.invoke.base.BaseRequest; 4 | 5 | /** 6 | * 下次执行时间处理器 7 | * 8 | * @author zhuzhenke 9 | * @date 2018/03/20 10 | */ 11 | public interface NextInvokeProcessor { 12 | 13 | /** 14 | * 下一次执行时间 15 | * 这里的参数需要根据业务来定,一般这里放影响下次执行时间的参数 16 | */ 17 | Long getNextInvokeTimeMillis(BaseRequest baseRequest, String sellerId); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/26 8 | */ 9 | public class ReportResult_GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_ implements ResolveReportResult { 10 | 11 | @Override 12 | public List resolveResult(List resultList) { 13 | return null; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/test/java/com/method/test/amazon/apimocktest/AmazonOrderResponse.java: -------------------------------------------------------------------------------- 1 | package com.method.test.amazon.apimocktest; 2 | 3 | import com.method.invoke.base.BaseResponse; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public class AmazonOrderResponse implements BaseResponse { 10 | private String result; 11 | 12 | public void setResult(String result) { 13 | this.result = result; 14 | } 15 | 16 | public String getResult() { 17 | return result; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 7 | 8 | String 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 7 | 8 | String 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/test/java/com/method/test/amazon/apimocktest/AmazonProductResponse.java: -------------------------------------------------------------------------------- 1 | package com.method.test.amazon.apimocktest; 2 | 3 | import com.method.invoke.base.BaseResponse; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/20 8 | */ 9 | public class AmazonProductResponse implements BaseResponse { 10 | private String result; 11 | 12 | public void setResult(String result) { 13 | this.result = result; 14 | } 15 | 16 | public String getResult() { 17 | return result; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 7 | 8 | String 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ErrorResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sender 6 | string 7 | string 8 | 9 | 10 | 11 | 12 | 13 | string 14 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/ManageReportScheduleResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | string 9 | 2008-09-28T18:49:45 10 | 11 | 12 | 13 | string 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportScheduleListResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 2007-10-25T23:36:28 11 | 12 | 13 | 14 | string 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | String 7 | 8 | 9 | String 10 | String 11 | 12 | 13 | 14 | 15 | String 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | String 7 | 8 | 9 | String 10 | String 11 | 12 | 13 | 14 | 15 | String 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetServiceStatusResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 1969-07-21T02:56:03Z 7 | String 8 | 9 | 10 | String 11 | String 12 | 13 | 14 | 15 | 16 | String 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonExceptionReInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.method.invoke.ExceptionReInvokeProcessor; 4 | 5 | /** 6 | * @author zhuzhenke 7 | * @date 2018/03/22 8 | */ 9 | public class AmazonExceptionReInvokeProcessor implements ExceptionReInvokeProcessor { 10 | @Override 11 | public boolean needReInvoke(Exception e) { 12 | if (e.getMessage() != null && 13 | (e.getMessage().contains("You exceeded your quota") || e.getMessage().contains("Request is throttled"))) { 14 | System.out.println("亚马逊异常了 。。。需要继续执行"); 15 | e.printStackTrace(); 16 | return true; 17 | } 18 | return false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/DefaultNextInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | import com.method.invoke.base.BaseRequest; 4 | 5 | /** 6 | * 默认的下次执行时间处理器 7 | * 8 | * @author zhuzhenke 9 | * @date 2018/03/20 10 | */ 11 | public class DefaultNextInvokeProcessor implements NextInvokeProcessor { 12 | 13 | 14 | @Override 15 | public final Long getNextInvokeTimeMillis(BaseRequest baseRequest, String sellerId) { 16 | long nextInvokeTimeMillis = System.currentTimeMillis() + 2000; 17 | long curTime = System.currentTimeMillis(); 18 | if (nextInvokeTimeMillis < curTime) { 19 | return curTime + 100; 20 | } 21 | return nextInvokeTimeMillis; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportScheduleListByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 2007-10-25T23:36:28 11 | 12 | 13 | 14 | string 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/SubmitFeedResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | string 6 | string 7 | string 8 | string 9 | 10 | 2008-09-28T18:49:45 11 | 12 | 2014-09-18T16:18:33 13 | 14 | 15 | 16 | string 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetProductCategoriesForSKUResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | String 6 | String 7 | 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | 15 | String 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetProductCategoriesForASINResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | String 6 | String 7 | 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | 15 | String 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportListResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 11 | string 12 | 2007-10-25T23:36:28 13 | true 14 | 2014-06-09T08:15:04-07:00 15 | 16 | 17 | 18 | string 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/UpdateReportAcknowledgementsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | string 9 | 10 | string 11 | 2008-09-28T18:49:45 12 | true 13 | 2004-02-14T10:44:14 14 | 15 | 16 | 17 | string 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/commom/MarketPlaceId.java: -------------------------------------------------------------------------------- 1 | package com.amazon.commom; 2 | public enum MarketPlaceId { 3 | 4 | /** 5 | * CA 6 | */ 7 | A2EUQ1WTGCTBG2, 8 | 9 | /** 10 | * US 11 | */ 12 | ATVPDKIKX0DER, 13 | 14 | /** 15 | * DE 16 | */ 17 | A1PA6795UKMFR9, 18 | 19 | /** 20 | * ES 21 | */ 22 | A1RKKUPIHCS9HS, 23 | 24 | /** 25 | * FR 26 | */ 27 | A13V1IB3VIYZZH, 28 | 29 | /** 30 | * IN 31 | */ 32 | A21TJRUUN4KGV, 33 | 34 | /** 35 | * IT 36 | */ 37 | APJ6JRA9NG5V4, 38 | 39 | /** 40 | * UK 41 | */ 42 | A1F83G8C2ARO7P, 43 | 44 | /** 45 | * JP 46 | */ 47 | A1VC38T7YXB528, 48 | 49 | /** 50 | * CN 51 | */ 52 | AAHKV2X7AFYLW, 53 | 54 | /** 55 | * MX 56 | */ 57 | A1AM78C64UM0Y8, 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportListByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 11 | string 12 | 2007-10-25T23:36:28 13 | true 14 | 2014-06-09T08:15:04-07:00 15 | 16 | 17 | 18 | string 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/CancelFeedSubmissionsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | string 9 | string 10 | string 11 | 12 | 2008-09-28T18:49:45 13 | 14 | 2014-09-18T16:18:33 15 | 16 | 17 | 18 | string 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetFeedSubmissionListResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | string 11 | string 12 | 13 | 2007-10-25T23:36:28 14 | 15 | 2004-02-14T10:44:14 16 | 17 | 18 | 19 | string 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/RequestReportResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | string 6 | string 7 | 2008-09-28T18:49:45 8 | 2014-09-18T16:18:33 9 | false 10 | 2006-08-19T10:27:14-07:00 11 | string 12 | string 13 | 2008-04-22T10:44:23 14 | 2012-01-12T03:16:16 15 | 16 | 17 | 18 | string 19 | 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 解决亚马逊调用频率限制问题的sdk框架 2 | 3 | 技术交流欢迎联系作者Wechat:839127406 4 | 5 | 针对亚马逊API调用频率限制的问题,使用CountDownLatch和线程池,结合频率统一控制中心,来封装一套亚马逊调用的sdk框架。 6 | 7 | 8 | 9 | 10 | 主要的优化点 11 | 12 | 1、调用方调用亚马逊API不会出现超频率的错误 13 | 14 | 2、对于拉取亚马逊报告的3个步骤,sdk封装成一个调用就能拿到报告结果 15 | 16 | 3、sdk提供了同步和异步两种调用方式 17 | 18 | 19 | 20 | 21 | 注意: 22 | 23 | 对应的亚马逊java封装的客户端库,见以下链接及其相关页面 https://developer.amazonservices.com.cn/doc/products/products/v20111001/java.html 24 | 25 | 26 | 27 | 使用方式参考 28 | 第一步: 29 | 30 | 填写授权信息配置com.amazon.config.AmazonAccountConfig 31 | 32 | 第二步: 33 | 34 | (1)简单接口调用使用AmazonTest中的案例 35 | 正常模式调用,即只需要一次调用接口就可以完成的调用 36 | 37 | 提供同步和异步两种方式,异步方式有回调方法 38 | 39 | (2)复杂接口的调用使用AmazonDisposableTest中的案例 40 | 41 | 组合模式的接口调用,如获取商品列表这种数据 42 | 43 | 通常分为3个步骤完成所有调用 44 | 45 | (1)提交获取商品请求,拿到请求ID 46 | 47 | (2)通过请求ID,去获取这个请求ID的报告是否完成,如已经完成,拿到报告ID 48 | 49 | (3)通过报告ID获取商品数据 50 | 51 | 但是如果分为3次调用就会比较麻烦,所以提供了AmazonDisposableClient只需要一次调用,就可以获取最后的商品数据了 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/DefaultAttachment.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke; 2 | 3 | import java.util.HashMap; 4 | 5 | /** 6 | * 回调附件类 7 | * 8 | * @author zhuzhenke 9 | * @date 2018/03/20 10 | */ 11 | public class DefaultAttachment { 12 | protected HashMap attachmentMap; 13 | 14 | public HashMap getAttachmentMap() { 15 | return attachmentMap; 16 | } 17 | 18 | public void setAttachmentMap(HashMap attachmentMap) { 19 | this.attachmentMap = attachmentMap; 20 | } 21 | 22 | public void put(Object key, Object value) { 23 | if (attachmentMap == null) { 24 | attachmentMap = new HashMap(); 25 | } 26 | attachmentMap.put(key, value); 27 | } 28 | 29 | public Object get(Object key) { 30 | if (attachmentMap == null) { 31 | return null; 32 | } 33 | return attachmentMap.get(key); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetFeedSubmissionListByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | string 11 | string 12 | 13 | 2007-10-25T23:36:28 14 | 15 | 2004-02-14T10:44:14 16 | 17 | 18 | 19 | string 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/CancelReportRequestsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 100 5 | 6 | 7 | string 8 | string 9 | 2008-09-28T18:49:45 10 | 2014-09-18T16:18:33 11 | false 12 | 2006-08-19T10:27:14-07:00 13 | string 14 | string 15 | 2008-04-22T10:44:23 16 | 2012-01-12T03:16:16 17 | 18 | 19 | 20 | string 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportRequestListResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 2007-10-25T23:36:28 11 | 2004-02-14T10:44:14 12 | false 13 | 2018-10-31T22:36:46-07:00 14 | string 15 | string 16 | 2008-04-22T10:44:23 17 | 2012-01-12T03:16:16 18 | 19 | 20 | 21 | string 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/model/ContentType.java: -------------------------------------------------------------------------------- 1 | package com.amazonaws.mws.model; 2 | 3 | import java.util.Collection; 4 | import java.util.HashSet; 5 | 6 | /* 7 | * Enumeration of valid content types for a feed submission. 8 | */ 9 | public enum ContentType { 10 | /* 11 | * Feed is sent as a stream of bytes ("application/octet-stream"). 12 | * Currently this is the only content type supported by MWS. 13 | */ 14 | OctetStream("application/octet-stream"); 15 | 16 | private String value; 17 | private Collection parameters = new HashSet(); 18 | 19 | private ContentType(String s) { 20 | this.value = s; 21 | } 22 | 23 | @SuppressWarnings("unused") 24 | private void addParameter(ContentTypeParameter parameter) { 25 | parameters.add(parameter); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | StringBuilder sb = new StringBuilder(); 31 | 32 | sb.append(this.value); 33 | 34 | for(ContentTypeParameter p : parameters) { 35 | sb.append(";").append(p); 36 | } 37 | 38 | return sb.toString(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-06-01 12 | * Generated: Mon Jun 13 10:07:47 PDT 2016 13 | */ 14 | package com.amazonservices.mws.products; 15 | 16 | import com.amazonservices.mws.client.MwsEndpoints; 17 | 18 | public class MWSEndpoint extends MwsEndpoints { 19 | 20 | /** Never instantiated. */ 21 | private MWSEndpoint() { 22 | // 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Sep 15 19:38:38 GMT 2014 13 | */ 14 | package com.amazonservices.mws.sellers; 15 | 16 | import com.amazonservices.mws.client.MwsEndpoints; 17 | 18 | public class MWSEndpoint extends MwsEndpoints { 19 | 20 | /** Never instantiated. */ 21 | private MWSEndpoint() { 22 | // 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2015-09-24 12 | * Generated: Fri Sep 25 20:06:20 GMT 2015 13 | */ 14 | package com.amazonservices.mws.orders._2013_09_01; 15 | 16 | import com.amazonservices.mws.client.MwsEndpoints; 17 | 18 | public class MWSEndpoint extends MwsEndpoints { 19 | 20 | /** Never instantiated. */ 21 | private MWSEndpoint() { 22 | // 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/ServiceStatusEnum.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.sellers.model; 2 | 3 | import javax.xml.bind.annotation.XmlEnum; 4 | import javax.xml.bind.annotation.XmlType; 5 | 6 | /** 7 | * Java class for ServiceStatusEnum. 8 | * 9 | * The following schema fragment specifies the expected content contained within this class. 10 | * 11 | * 12 | * <simpleType name="ServiceStatusEnum"> 13 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 14 | * <enumeration value="GREEN"/> 15 | * <enumeration value="GREEN_I"/> 16 | * <enumeration value="YELLOW"/> 17 | * <enumeration value="RED"/> 18 | * </restriction> 19 | * </simpleType> 20 | * 21 | * 22 | */ 23 | @XmlType(name = "ServiceStatusEnum") 24 | @XmlEnum 25 | public enum ServiceStatusEnum { 26 | 27 | GREEN, 28 | GREEN_I, 29 | YELLOW, 30 | RED; 31 | 32 | public String value() { 33 | return name(); 34 | } 35 | 36 | public static ServiceStatusEnum fromValue(String v) { 37 | return valueOf(v); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/mock/GetReportRequestListByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | string 5 | false 6 | 7 | 8 | string 9 | string 10 | 2007-10-25T23:36:28 11 | 2004-02-14T10:44:14 12 | false 13 | 2018-10-31T22:36:46-07:00 14 | string 15 | string 16 | 2008-04-22T10:44:23 17 | 2012-01-12T03:16:16 18 | 19 | 20 | 21 | string 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-03-30 12 | * Generated: Tue Mar 29 18:59:55 UTC 2016 13 | */ 14 | package com.amazonservices.mws.merchantfulfillment._2015_06_01; 15 | 16 | import com.amazonservices.mws.client.MwsEndpoints; 17 | 18 | public class MWSEndpoint extends MwsEndpoints { 19 | 20 | /** Never instantiated. */ 21 | private MWSEndpoint() { 22 | // 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsCall.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Interface for call instances. 5 | * 6 | * Call instances are created by {@link MwsConnection#newCall(String, String)}. 7 | * 8 | * @author mayerj 9 | * 10 | */ 11 | public interface MwsCall extends MwsWriter { 12 | 13 | /** 14 | * Invoke the request synchronously with error handling and backoff/retry logic. 15 | * 16 | * Call after writing request body. 17 | * 18 | * @return A reader to read the response body. 19 | * 20 | * @throws MwsException 21 | */ 22 | MwsReader invoke() throws MwsException; 23 | 24 | /** 25 | * Execute the request synchronously without error handling or backoff/retry logic. 26 | * 27 | * @return The unparsed response contents (caller must check status for error). 28 | */ 29 | MwsResponse execute(); 30 | 31 | /** 32 | * Gets metadata from response header. 33 | * 34 | * Available after invoke() returns successfully. 35 | * 36 | * @return Response header metadata. 37 | */ 38 | MwsResponseHeaderMetadata getResponseHeaderMetadata(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/exec/InvokeThreadFactory.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke.exec; 2 | 3 | import java.util.concurrent.ThreadFactory; 4 | import java.util.concurrent.atomic.AtomicInteger; 5 | 6 | /** 7 | * 线程工厂 8 | * 9 | * @author zhuzhenke 10 | * @date 2018/03/20 11 | */ 12 | public class InvokeThreadFactory implements ThreadFactory { 13 | 14 | private final ThreadGroup group; 15 | private final AtomicInteger threadNumber = new AtomicInteger(1); 16 | private final String namePrefix; 17 | 18 | public InvokeThreadFactory() { 19 | SecurityManager s = System.getSecurityManager(); 20 | group = (s != null) ? s.getThreadGroup() : 21 | Thread.currentThread().getThreadGroup(); 22 | namePrefix = "invoke-limit-method-pool-thread-"; 23 | } 24 | 25 | @Override 26 | public Thread newThread(Runnable r) { 27 | Thread t = new Thread(group, r, 28 | namePrefix + threadNumber.getAndIncrement(), 29 | 0); 30 | if (t.isDaemon()) { 31 | t.setDaemon(false); 32 | } 33 | if (t.getPriority() != Thread.NORM_PRIORITY) { 34 | t.setPriority(Thread.NORM_PRIORITY); 35 | } 36 | return t; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsResponseMetadata.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Response metadata. 5 | * 6 | * @author mayerj 7 | */ 8 | public class MwsResponseMetadata extends AbstractMwsObject { 9 | 10 | /** The request id. */ 11 | private String requestId; 12 | 13 | /** 14 | * Gets the request id. 15 | * 16 | * @return The request id. 17 | */ 18 | public String getRequestId() { 19 | return requestId; 20 | } 21 | /** 22 | * Set the request id. 23 | * 24 | * @param value 25 | * The request id. 26 | * 27 | */ 28 | public void setRequestId(String value) { 29 | this.requestId = value; 30 | } 31 | 32 | @Override 33 | public void writeFragmentTo(MwsWriter w) { 34 | w.write("RequestId", requestId); 35 | } 36 | 37 | @Override 38 | public void readFragmentFrom(MwsReader r) { 39 | requestId = r.read("RequestId", String.class); 40 | } 41 | 42 | @Override 43 | public void writeTo(MwsWriter w) { 44 | String name = "ResponseMetadata"; 45 | w.beginObject(name); 46 | writeFragmentTo(w); 47 | w.endObject(name); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/commom/ReportType.java: -------------------------------------------------------------------------------- 1 | package com.amazon.commom; 2 | 3 | public enum ReportType { 4 | 5 | /** 6 | * 在售商品报告 7 | * "在售"、"禁止显示"、"在售(商品信息质量警告)"、"不可售(缺货)"会被找出来,"不可售(停售)"的不会被找出来 8 | */ 9 | _GET_MERCHANT_LISTINGS_DATA_, 10 | 11 | /** 12 | * 可售商品报告 13 | * "在售"、"在售(商品信息质量警告)"、"禁止显示"会被找出来,"不可售(停售)"、"不可售(缺货)"的不会被找出来 14 | */ 15 | _GET_MERCHANT_LISTINGS_DATA_BACK_COMPAT_, 16 | 17 | 18 | /** 19 | * 商品信息质量报告 (“商品信息质量和阻止上传的商品信息报告”) 20 | * "禁止显示"、"在售(商品信息质量警告)"会被找出来,但是商品"不可售(停售)"、"不可售(缺货)"、"在售"的不会找出来 21 | */ 22 | _GET_MERCHANT_LISTINGS_DEFECT_DATA_, 23 | 24 | /** 25 | * 可售商品报告 (“库存报告”) 26 | */ 27 | _GET_FLAT_FILE_OPEN_LISTINGS_DATA_, 28 | 29 | /** 30 | * 可售商品报告精简版 31 | */ 32 | _GET_MERCHANT_LISTINGS_DATA_LITE_, 33 | 34 | /** 35 | * 可售商品报告精简升级版 36 | */ 37 | _GET_MERCHANT_LISTINGS_DATA_LITER_, 38 | 39 | /** 40 | * 已售商品报告 41 | */ 42 | _GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_, 43 | 44 | /** 45 | * 可售商品报告精简版[只有sku asin price quantity,包含库存为0的商品] 46 | * _GET_MERCHANT_LISTINGS_DATA_LITE_ 47 | * 暂时不优化 48 | */ 49 | 50 | /** 51 | * 返回买家对您的业绩的负面和中性反馈(1 到 3 星) 52 | */ 53 | _GET_SELLER_FEEDBACK_DATA_, 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/ListMarketplaceParticipationsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | String 15 | String 16 | String 17 | String 18 | String 19 | String 20 | 21 | 22 | 23 | 24 | String 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/ListMarketplaceParticipationsByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | String 15 | String 16 | String 17 | String 18 | String 19 | String 20 | 21 | 22 | 23 | 24 | String 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/ProductsUtil.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.products.model; 2 | 3 | import java.io.StringWriter; 4 | 5 | import javax.xml.transform.OutputKeys; 6 | import javax.xml.transform.Transformer; 7 | import javax.xml.transform.TransformerException; 8 | import javax.xml.transform.dom.DOMSource; 9 | import javax.xml.transform.stream.StreamResult; 10 | 11 | import com.amazonservices.mws.client.MwsUtl; 12 | 13 | import org.w3c.dom.Node; 14 | 15 | public class ProductsUtil { 16 | 17 | public static String formatXml(Node node) { 18 | try { 19 | Transformer transformer = MwsUtl.getTF().newTransformer(); 20 | transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); 21 | transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 22 | transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 23 | transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); 24 | StringWriter sw = new StringWriter(); 25 | StreamResult result = new StreamResult(sw); 26 | DOMSource source = new DOMSource(node); 27 | transformer.transform(source, result); 28 | return sw.toString(); 29 | } catch (TransformerException e) { 30 | throw new RuntimeException(e); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### JetBrains template 2 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 3 | 4 | *.iml 5 | 6 | ## Directory-based project format: 7 | .idea/ 8 | # if you remove the above rule, at least ignore the following: 9 | 10 | # User-specific stuff: 11 | # .idea/workspace.xml 12 | # .idea/tasks.xml 13 | # .idea/dictionaries 14 | 15 | # Sensitive or high-churn files: 16 | # .idea/dataSources.ids 17 | # .idea/dataSources.xml 18 | # .idea/sqlDataSources.xml 19 | # .idea/dynamic.xml 20 | # .idea/uiDesigner.xml 21 | 22 | # Gradle: 23 | # .idea/gradle.xml 24 | # .idea/libraries 25 | 26 | # Mongo Explorer plugin: 27 | # .idea/mongoSettings.xml 28 | 29 | ## File-based project format: 30 | *.ipr 31 | *.iws 32 | 33 | ## Plugin-specific files: 34 | 35 | # IntelliJ 36 | /out/ 37 | 38 | # mpeltonen/sbt-idea plugin 39 | .idea_modules/ 40 | 41 | # JIRA plugin 42 | atlassian-ide-plugin.xml 43 | 44 | # Crashlytics plugin (for Android Studio and IntelliJ) 45 | com_crashlytics_export_strings.xml 46 | crashlytics.properties 47 | crashlytics-build.properties 48 | ### Java template 49 | *.class 50 | 51 | # Mobile Tools for Java (J2ME) 52 | .mtj.tmp/ 53 | 54 | # Package Files # 55 | *.jar 56 | *.war 57 | *.ear 58 | *.log 59 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 60 | hs_err_pid* 61 | 62 | # Created by .ignore support plugin (hsz.mobi) 63 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsRequestType.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Defines metadata for an operation. 5 | * 6 | * This includes the service, version, operation name, response object class, 7 | * and call parameters. 8 | * 9 | * @author mayerj 10 | */ 11 | public interface MwsRequestType { 12 | 13 | /** 14 | * Get the class that will be thrown for an exception response. 15 | * 16 | * @return The exception class. 17 | */ 18 | MwsException wrapException(Throwable e); 19 | 20 | /** 21 | * Get the operation name that identifies the operation within the service 22 | * version. 23 | * 24 | * @return The operation name. 25 | */ 26 | String getOperationName(); 27 | 28 | /** 29 | * Get the class that will hold a successful response. 30 | * 31 | * @return The response class. 32 | */ 33 | Class extends MwsObject> getResponseClass(); 34 | 35 | /** 36 | * Wrap response header metadata and set into response object. 37 | * 38 | * @param response 39 | * @param rhmd 40 | */ 41 | void setRHMD(MwsObject response, MwsResponseHeaderMetadata rhmd); 42 | 43 | /** 44 | * Get the service path string that identifies the service and version to 45 | * call on the server. 46 | * 47 | * @return The service path. 48 | */ 49 | String getServicePath(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/config/AmazonAccountConfig.java: -------------------------------------------------------------------------------- 1 | package com.amazon.config; 2 | 3 | /** 4 | * @author zhuzhenke 5 | * @date 2018/04/22 6 | */ 7 | public class AmazonAccountConfig { 8 | 9 | private static String applicationName; 10 | private static String applicationVersion; 11 | private static String awsAccessKeyId; 12 | private static String awsSecretAccessKey; 13 | 14 | public static String getApplicationName() { 15 | return applicationName; 16 | } 17 | 18 | public static void setApplicationName(String applicationName) { 19 | AmazonAccountConfig.applicationName = applicationName; 20 | } 21 | 22 | public static String getApplicationVersion() { 23 | return applicationVersion; 24 | } 25 | 26 | public static void setApplicationVersion(String applicationVersion) { 27 | AmazonAccountConfig.applicationVersion = applicationVersion; 28 | } 29 | 30 | public static String getAwsAccessKeyId() { 31 | return awsAccessKeyId; 32 | } 33 | 34 | public static void setAwsAccessKeyId(String awsAccessKeyId) { 35 | AmazonAccountConfig.awsAccessKeyId = awsAccessKeyId; 36 | } 37 | 38 | public static String getAwsSecretAccessKey() { 39 | return awsSecretAccessKey; 40 | } 41 | 42 | public static void setAwsSecretAccessKey(String awsSecretAccessKey) { 43 | AmazonAccountConfig.awsSecretAccessKey = awsSecretAccessKey; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Sep 15 19:38:38 GMT 2014 13 | */ 14 | package com.amazonservices.mws.sellers.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-06-01 12 | * Generated: Mon Jun 13 10:07:47 PDT 2016 13 | */ 14 | package com.amazonservices.mws.products.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2015-09-24 12 | * Generated: Fri Sep 25 20:06:20 GMT 2015 13 | */ 14 | package com.amazonservices.mws.orders._2013_09_01.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/HasSellerSuspendedListingsEnum.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.sellers.model; 2 | 3 | import javax.xml.bind.annotation.XmlEnum; 4 | import javax.xml.bind.annotation.XmlEnumValue; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | /** 8 | * Java class for HasSellerSuspendedListingsEnum. 9 | * 10 | * The following schema fragment specifies the expected content contained within this class. 11 | * 12 | * 13 | * <simpleType name="HasSellerSuspendedListingsEnum"> 14 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 15 | * <enumeration value="Yes"/> 16 | * <enumeration value="No"/> 17 | * </restriction> 18 | * </simpleType> 19 | * 20 | * 21 | */ 22 | @XmlType(name = "HasSellerSuspendedListingsEnum") 23 | @XmlEnum 24 | public enum HasSellerSuspendedListingsEnum { 25 | 26 | @XmlEnumValue("Yes") 27 | YES("Yes"), 28 | @XmlEnumValue("No") 29 | NO("No"); 30 | private final String value; 31 | 32 | HasSellerSuspendedListingsEnum(String v) { 33 | value = v; 34 | } 35 | 36 | public String value() { 37 | return value; 38 | } 39 | 40 | public static HasSellerSuspendedListingsEnum fromValue(String v) { 41 | for (HasSellerSuspendedListingsEnum c: HasSellerSuspendedListingsEnum.values()) { 42 | if (c.value.equals(v)) { 43 | return c; 44 | } 45 | } 46 | throw new IllegalArgumentException(v); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Mar 21 09:01:27 PDT 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 15 | 16 | public enum MWSEndpoint { 17 | 18 | US("mws.amazonservices.com"), 19 | UK("mws.amazonservices.co.uk"), 20 | DE("mws.amazonservices.de"), 21 | FR("mws.amazonservices.fr"), 22 | JP("mws.amazonservices.jp"), 23 | CN("mws.amazonservices.com.cn"), 24 | IT("mws.amazonservices.it"); 25 | 26 | private final String url; 27 | 28 | private MWSEndpoint(String domain) { 29 | this.url = "https://" + domain + "/" + FBAInventoryServiceMWSConfig.DEFAULT_SERVICE_PATH; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return url; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Mar 21 09:01:27 PDT 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-03-30 12 | * Generated: Tue Mar 29 18:59:55 UTC 2016 13 | */ 14 | package com.amazonservices.mws.merchantfulfillment._2015_06_01.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/MWSEndpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-02-01 12 | * Generated: Fri Jan 08 13:26:39 PST 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01; 15 | 16 | public enum MWSEndpoint { 17 | 18 | US("mws.amazonservices.com"), 19 | UK("mws.amazonservices.co.uk"), 20 | DE("mws.amazonservices.de"), 21 | FR("mws.amazonservices.fr"), 22 | JP("mws.amazonservices.jp"), 23 | CN("mws.amazonservices.com.cn"), 24 | IT("mws.amazonservices.it"); 25 | 26 | private final String url; 27 | 28 | private MWSEndpoint(String domain) { 29 | this.url = "https://" + domain + "/" + FBAOutboundServiceMWSConfig.DEFAULT_SERVICE_PATH; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return url; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-02-01 12 | * Generated: Fri Jan 08 13:26:39 PST 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/report/DisposableRequestReportResponse.java: -------------------------------------------------------------------------------- 1 | package com.amazon.report; 2 | 3 | import com.amazon.invoke.AmazonBaseResponse; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * @author zhuzhenke 9 | * @date 2018/03/23 10 | */ 11 | public class DisposableRequestReportResponse implements AmazonBaseResponse { 12 | 13 | /** 14 | * 亚马逊请求ID 15 | */ 16 | private String reportRequestId; 17 | 18 | /** 19 | * 是否有结果集 20 | */ 21 | private Boolean hasResult; 22 | 23 | /** 24 | * 报告ID 25 | */ 26 | private String generatedReportId; 27 | 28 | /** 29 | * 报文响应结果集 30 | */ 31 | private List reportResultList; 32 | 33 | public String getGeneratedReportId() { 34 | return generatedReportId; 35 | } 36 | 37 | public void setGeneratedReportId(String generatedReportId) { 38 | this.generatedReportId = generatedReportId; 39 | } 40 | 41 | public Boolean getHasResult() { 42 | return hasResult; 43 | } 44 | 45 | public void setHasResult(Boolean hasResult) { 46 | this.hasResult = hasResult; 47 | } 48 | 49 | public String getReportRequestId() { 50 | return reportRequestId; 51 | } 52 | 53 | public void setReportRequestId(String reportRequestId) { 54 | this.reportRequestId = reportRequestId; 55 | } 56 | 57 | public List getReportResultList() { 58 | return reportResultList; 59 | } 60 | 61 | public void setReportResultList(List reportResultList) { 62 | this.reportResultList = reportResultList; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsXmlBuilder.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2012 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Runtime Client Library 12 | */ 13 | package com.amazonservices.mws.client; 14 | 15 | /** 16 | * A MwsWriter that builds a XML string. 17 | * 18 | * @author mayerj 19 | */ 20 | public class MwsXmlBuilder extends MwsXmlWriter { 21 | 22 | /** The buffer to build into. */ 23 | private StringBuilder buf; 24 | 25 | @Override 26 | protected void append(String v) { 27 | buf.append(v); 28 | } 29 | 30 | @Override 31 | protected void append(String v, int start, int end) { 32 | buf.append(v, start, end); 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return buf.toString(); 38 | } 39 | 40 | /** 41 | * Create a new builder. 42 | */ 43 | MwsXmlBuilder() { 44 | super(null); 45 | buf = new StringBuilder(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/GetPackageTrackingDetailsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | String 6 | String 7 | String 8 | String 9 | 1969-07-21T02:56:03Z 10 | 1969-07-21T02:56:03Z 11 | 12 | String 13 | String 14 | String 15 | 16 | String 17 | String 18 | String 19 | 20 | 21 | 1969-07-21T02:56:03Z 22 | 23 | String 24 | String 25 | String 26 | 27 | String 28 | 29 | 30 | 31 | 32 | String 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsJsonBuilder.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2012 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Runtime Client Library 12 | */ 13 | package com.amazonservices.mws.client; 14 | 15 | /** 16 | * A MwsWriter that builds a JSON string. 17 | * 18 | * @author mayerj 19 | */ 20 | public class MwsJsonBuilder extends MwsJsonWriter { 21 | 22 | /** The buffer to build into. */ 23 | private final StringBuilder buf; 24 | 25 | @Override 26 | protected void append(String v) { 27 | buf.append(v); 28 | } 29 | 30 | @Override 31 | protected void append(String v, int start, int end) { 32 | buf.append(v, start, end); 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return buf.toString(); 38 | } 39 | 40 | /** 41 | * Create a new builder. 42 | */ 43 | MwsJsonBuilder() { 44 | super(null); 45 | buf = new StringBuilder(); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_MERCHANT_LISTINGS_DATA_LITER_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * _GET_MERCHANT_LISTINGS_DATA_LITER_ 8 | * 对应报文头的先后顺序 9 | * seller-sku quantity 10 | * 11 | * @author zhuzhenke 12 | * @date 2018/03/26 13 | */ 14 | public class ReportResult_GET_MERCHANT_LISTINGS_DATA_LITER_ implements ResolveReportResult { 15 | 16 | private String sellerSku; 17 | private String quantity; 18 | 19 | public String getQuantity() { 20 | return quantity; 21 | } 22 | 23 | public void setQuantity(String quantity) { 24 | this.quantity = quantity; 25 | } 26 | 27 | public String getSellerSku() { 28 | return sellerSku; 29 | } 30 | 31 | public void setSellerSku(String sellerSku) { 32 | this.sellerSku = sellerSku; 33 | } 34 | 35 | @Override 36 | public List resolveResult(List resultList) { 37 | List reportResultList = new ArrayList(); 38 | if (resultList == null || resultList.size() <= 1) { 39 | return reportResultList; 40 | } 41 | for (int i = 1; i < resultList.size(); i++) { 42 | String[] strings = resultList.get(i).split("\t"); 43 | ReportResult_GET_MERCHANT_LISTINGS_DATA_LITER_ object = new ReportResult_GET_MERCHANT_LISTINGS_DATA_LITER_(); 44 | 45 | object.setSellerSku(strings[0]); 46 | object.setQuantity(strings[1]); 47 | 48 | reportResultList.add(object); 49 | } 50 | 51 | return reportResultList; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/test/java/com/method/test/amazon/apimocktest/AmazonTestClient.java: -------------------------------------------------------------------------------- 1 | package com.method.test.amazon.apimocktest; 2 | 3 | import com.amazon.commom.MarketPlace; 4 | import com.method.invoke.base.BaseClient; 5 | import com.method.invoke.base.BaseRequest; 6 | import com.method.invoke.base.BaseResponse; 7 | 8 | /** 9 | * @author zhuzhenke 10 | * @date 2018/03/20 11 | */ 12 | public class AmazonTestClient extends BaseClient { 13 | int i = 0; 14 | 15 | /** 16 | * 复用同一个client 17 | */ 18 | @Override 19 | public BaseResponse executeInternal(BaseRequest baseRequest, MarketPlace marketPlace) throws Exception { 20 | if (baseRequest instanceof AmazonOrderRequest) { 21 | System.out.println("invoke AmazonOrderRequest..." + i); 22 | AmazonOrderResponse amazonOrderResponse = new AmazonOrderResponse(); 23 | amazonOrderResponse.setResult("AmazonOrderRequest finish"); 24 | i++; 25 | if (i == 10) { 26 | return amazonOrderResponse; 27 | } else { 28 | throw new Exception("授权异常了"); 29 | } 30 | } else if (baseRequest instanceof AmazonProductRequest) { 31 | System.out.println("invoke AmazonProductRequest..." + i); 32 | AmazonProductResponse amazonProductResponse = new AmazonProductResponse(); 33 | amazonProductResponse.setResult("AmazonProductRequest finish"); 34 | i++; 35 | if (i == 15) { 36 | return amazonProductResponse; 37 | } else { 38 | throw new Exception("授权异常了"); 39 | } 40 | } else { 41 | throw new Exception("授权异常了"); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Sep 15 19:38:38 GMT 2014 13 | */ 14 | package com.amazonservices.mws.sellers.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-06-01 12 | * Generated: Mon Jun 13 10:07:47 PDT 2016 13 | */ 14 | package com.amazonservices.mws.products.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2015-09-24 12 | * Generated: Fri Sep 25 20:06:20 GMT 2015 13 | */ 14 | package com.amazonservices.mws.orders._2013_09_01.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/ServiceStatusEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Service Status Enum 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.model; 17 | 18 | /** 19 | * Java class for ServiceStatusEnum. 20 | * 21 | * The following schema fragment specifies the expected content contained within this class. 22 | * 23 | * 24 | * <simpleType name="ServiceStatusEnum"> 25 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 26 | * <enumeration value="GREEN"/> 27 | * <enumeration value="GREEN_I"/> 28 | * <enumeration value="YELLOW"/> 29 | * <enumeration value="RED"/> 30 | * </restriction> 31 | * </simpleType> 32 | * 33 | * 34 | */ 35 | public enum ServiceStatusEnum { 36 | 37 | GREEN, 38 | GREEN_I, 39 | YELLOW, 40 | RED; 41 | 42 | public String value() { 43 | return name(); 44 | } 45 | 46 | public static ServiceStatusEnum fromValue(String v) { 47 | return valueOf(v); 48 | } 49 | 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/AbstractMwsObject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2012 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Runtime Client Library 12 | */ 13 | package com.amazonservices.mws.client; 14 | 15 | 16 | /** 17 | * Abstract class that provides default implementations for some of the 18 | * MwsObject interface methods. 19 | * 20 | * @author mayerj 21 | */ 22 | public abstract class AbstractMwsObject implements MwsObject { 23 | 24 | @Override 25 | public String toJSON() { 26 | MwsWriter w = new MwsJsonBuilder(); 27 | this.writeTo(w); 28 | return w.toString(); 29 | } 30 | 31 | @Override 32 | public String toJSONFragment() { 33 | MwsWriter w = new MwsJsonBuilder(); 34 | this.writeFragmentTo(w); 35 | return w.toString(); 36 | } 37 | 38 | @Override 39 | public String toXML() { 40 | MwsWriter w = new MwsXmlBuilder(); 41 | this.writeTo(w); 42 | return w.toString(); 43 | } 44 | 45 | @Override 46 | public String toXMLFragment() { 47 | MwsWriter w = new MwsXmlBuilder(); 48 | this.writeFragmentTo(w); 49 | return w.toString(); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Mar 21 09:01:27 PDT 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-03-30 12 | * Generated: Tue Mar 29 18:59:55 UTC 2016 13 | */ 14 | package com.amazonservices.mws.merchantfulfillment._2015_06_01.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.method.invoke 8 | invoke-limit-api 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 13 | org.apache.httpcomponents 14 | httpclient 15 | 4.3 16 | 17 | 18 | org.slf4j 19 | slf4j-api 20 | 1.7.5 21 | 22 | 23 | 24 | commons-io 25 | commons-io 26 | 2.4 27 | 28 | 29 | junit 30 | junit 31 | 4.12 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.apache.maven.plugins 40 | maven-compiler-plugin 41 | 42 | 43 | 1.6 44 | 1.6 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-02-01 12 | * Generated: Fri Jan 08 13:26:39 PST 2016 13 | */ 14 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.model; 15 | 16 | import java.util.List; 17 | import java.util.Date; 18 | 19 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 20 | 21 | /** 22 | * ResponseHeaderMetadata 23 | */ 24 | public class ResponseHeaderMetadata extends MwsResponseHeaderMetadata { 25 | 26 | /** Value constructor. */ 27 | public ResponseHeaderMetadata(String requestId, List responseContext, String timestamp, 28 | Double quotaMax, Double quotaRemaining, Date quotaResetsAt) { 29 | super(requestId, responseContext, timestamp, quotaMax, quotaRemaining, quotaResetsAt); 30 | } 31 | 32 | /** Empty constructor. */ 33 | public ResponseHeaderMetadata() { 34 | super(null, null, null, null, null, null); 35 | } 36 | 37 | /** Copy constructor. */ 38 | public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd) { 39 | super(rhmd); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/mock/ListInventorySupplyResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | String 11 | 1 12 | 1 13 | 14 | String 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | 19 | 1 20 | String 21 | 22 | String 23 | 1969-07-21T02:56:03Z 24 | 25 | 26 | String 27 | 1969-07-21T02:56:03Z 28 | 29 | 30 | 31 | 32 | 33 | String 34 | 35 | 36 | String 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/model/ResponseHeaderMetadata.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2008-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | * ***************************************************************************** 11 | * 12 | * Marketplace Web Service Java Library 13 | * API Version: 2009-01-01 14 | * 15 | */ 16 | 17 | 18 | 19 | package com.amazonaws.mws.model; 20 | 21 | import java.util.List; 22 | 23 | public class ResponseHeaderMetadata { 24 | private String requestId; 25 | private String responseContext; 26 | private String timestamp; 27 | 28 | public ResponseHeaderMetadata() {} 29 | 30 | public ResponseHeaderMetadata(String requestId, String responseContext, String timestamp) { 31 | this.requestId = requestId; 32 | this.responseContext = responseContext; 33 | this.timestamp = timestamp; 34 | } 35 | 36 | public String getRequestId() { 37 | return requestId; 38 | } 39 | 40 | public String getResponseContext() { 41 | return responseContext; 42 | } 43 | 44 | public String getTimestamp() { 45 | return timestamp; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | StringBuilder sb = new StringBuilder(); 51 | sb.append("requestId : " + requestId + "\n"); 52 | sb.append("responseContext : " + responseContext + "\n"); 53 | sb.append("timestamp : " + timestamp); 54 | return sb.toString(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/mock/ListInventorySupplyByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | String 11 | 1 12 | 1 13 | 14 | String 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | 19 | 1 20 | String 21 | 22 | String 23 | 1969-07-21T02:56:03Z 24 | 25 | 26 | String 27 | 1969-07-21T02:56:03Z 28 | 29 | 30 | 31 | 32 | 33 | String 34 | 35 | 36 | String 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsEndpoints.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | import java.net.URI; 4 | 5 | /** 6 | * Published URI's for MWS services. 7 | * 8 | * @author mayerj 9 | * 10 | */ 11 | public class MwsEndpoints { 12 | 13 | /** URI for CN production. */ 14 | public static final URI CN_PROD; 15 | 16 | /** URI for DE production. */ 17 | public static final URI DE_PROD; 18 | 19 | /** URI for ES production. */ 20 | public static final URI ES_PROD; 21 | 22 | /** URI for EU production. */ 23 | public static final URI EU_PROD; 24 | 25 | /** URI for FR production. */ 26 | public static final URI FR_PROD; 27 | 28 | /** URI for IN production. */ 29 | public static final URI IN_PROD; 30 | 31 | /** URI for IT production. */ 32 | public static final URI IT_PROD; 33 | 34 | /** URI for JP production. */ 35 | public static final URI JP_PROD; 36 | 37 | /** URI for NA production. */ 38 | public static final URI NA_PROD; 39 | 40 | /** URI for UK production. */ 41 | public static final URI UK_PROD; 42 | 43 | static { 44 | try { 45 | CN_PROD = new URI("https://mws.amazonservices.com.cn"); 46 | DE_PROD = new URI("https://mws.amazonservices.de"); 47 | ES_PROD = new URI("https://mws.amazonservices.es"); 48 | EU_PROD = new URI("https://mws-eu.amazonservices.com"); 49 | FR_PROD = new URI("https://mws.amazonservices.fr"); 50 | IN_PROD = new URI("https://mws.amazonservices.in"); 51 | IT_PROD = new URI("https://mws.amazonservices.it"); 52 | JP_PROD = new URI("https://mws.amazonservices.jp"); 53 | NA_PROD = new URI("https://mws.amazonservices.com"); 54 | UK_PROD = new URI("https://mws.amazonservices.co.uk"); 55 | } catch (Exception e) { 56 | throw MwsUtl.wrap(e); 57 | } 58 | } 59 | 60 | /** Never instantiated, but is extended. */ 61 | protected MwsEndpoints() { 62 | // 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_FLAT_FILE_OPEN_LISTINGS_DATA_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * _GET_FLAT_FILE_OPEN_LISTINGS_DATA_ 8 | * 对应报文头的先后顺序 9 | * sku asin price quantity 10 | * 11 | * @author zhuzhenke 12 | * @date 2018/03/26 13 | */ 14 | public class ReportResult_GET_FLAT_FILE_OPEN_LISTINGS_DATA_ implements ResolveReportResult { 15 | private String sku; 16 | private String asin; 17 | private String price; 18 | private String quantity; 19 | 20 | public String getAsin() { 21 | return asin; 22 | } 23 | 24 | public void setAsin(String asin) { 25 | this.asin = asin; 26 | } 27 | 28 | public String getPrice() { 29 | return price; 30 | } 31 | 32 | public void setPrice(String price) { 33 | this.price = price; 34 | } 35 | 36 | public String getQuantity() { 37 | return quantity; 38 | } 39 | 40 | public void setQuantity(String quantity) { 41 | this.quantity = quantity; 42 | } 43 | 44 | public String getSku() { 45 | return sku; 46 | } 47 | 48 | public void setSku(String sku) { 49 | this.sku = sku; 50 | } 51 | 52 | @Override 53 | public List resolveResult(List resultList) { 54 | List reportResultList = new ArrayList(); 55 | if (resultList == null || resultList.size() <= 1) { 56 | return reportResultList; 57 | } 58 | for (int i = 1; i < resultList.size(); i++) { 59 | String[] strings = resultList.get(i).split("\t"); 60 | ReportResult_GET_FLAT_FILE_OPEN_LISTINGS_DATA_ object = new ReportResult_GET_FLAT_FILE_OPEN_LISTINGS_DATA_(); 61 | 62 | object.setSku(strings[0]); 63 | object.setAsin(strings[1]); 64 | object.setPrice(strings[2]); 65 | object.setQuantity(strings[3]); 66 | 67 | reportResultList.add(object); 68 | } 69 | 70 | return reportResultList; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/amazonaws/mws/model/FeedProcessingStatus.java: -------------------------------------------------------------------------------- 1 | 2 | package com.amazonaws.mws.model; 3 | 4 | import javax.xml.bind.annotation.XmlEnum; 5 | import javax.xml.bind.annotation.XmlEnumValue; 6 | import javax.xml.bind.annotation.XmlType; 7 | 8 | 9 | /** 10 | * Java class for FeedProcessingStatus. 11 | * 12 | * The following schema fragment specifies the expected content contained within this class. 13 | * 14 | * 15 | * <simpleType name="FeedProcessingStatus"> 16 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 17 | * <enumeration value="_UNKNOWN_"/> 18 | * <enumeration value="_UNCONFIRMED_"/> 19 | * <enumeration value="_SUBMITTED_"/> 20 | * <enumeration value="_IN_PROGRESS_"/> 21 | * <enumeration value="_CANCELLED_"/> 22 | * <enumeration value="_DONE_"/> 23 | * <enumeration value="_IN_SAFETY_NET_"/> 24 | * </restriction> 25 | * </simpleType> 26 | * 27 | * 28 | */ 29 | @XmlType(name = "FeedProcessingStatus") 30 | @XmlEnum 31 | public enum FeedProcessingStatus { 32 | 33 | @XmlEnumValue("_UNKNOWN_") 34 | UNKNOWN("_UNKNOWN_"), 35 | @XmlEnumValue("_UNCONFIRMED_") 36 | UNCONFIRMED("_UNCONFIRMED_"), 37 | @XmlEnumValue("_SUBMITTED_") 38 | SUBMITTED("_SUBMITTED_"), 39 | @XmlEnumValue("_IN_PROGRESS_") 40 | IN_PROGRESS("_IN_PROGRESS_"), 41 | @XmlEnumValue("_CANCELLED_") 42 | CANCELLED("_CANCELLED_"), 43 | @XmlEnumValue("_DONE_") 44 | DONE("_DONE_"), 45 | @XmlEnumValue("_IN_SAFETY_NET_") 46 | IN_SAFETY_NET("_IN_SAFETY_NET_"); 47 | private final String value; 48 | 49 | FeedProcessingStatus(String v) { 50 | value = v; 51 | } 52 | 53 | public String value() { 54 | return value; 55 | } 56 | 57 | public static FeedProcessingStatus fromValue(String v) { 58 | for (FeedProcessingStatus c: FeedProcessingStatus.values()) { 59 | if (c.value.equals(v)) { 60 | return c; 61 | } 62 | } 63 | throw new IllegalArgumentException(v); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsResponse.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Response from MwsCall.call method. 5 | * 6 | * Immutable object providing access to MwsCall response elements. 7 | * 8 | * @author mayerj 9 | */ 10 | public class MwsResponse { 11 | 12 | /** The http status of the response, ie 200,400,500,503,... */ 13 | private final int status; 14 | 15 | /** The message from the http status line. */ 16 | private final String message; 17 | 18 | /** The response header metadata constructed from the response headers. */ 19 | private final MwsResponseHeaderMetadata rhmd; 20 | 21 | /** The body content of the response. */ 22 | private final String content; 23 | 24 | /** 25 | * Get the HTTP status code from the response. 26 | * 27 | * @return The HTTP status code from the response. 28 | */ 29 | public int getHttpStatus() { 30 | return status; 31 | } 32 | 33 | /** 34 | * Get the HTTP status message from the response. 35 | * 36 | * @return The HTTP status message from the response. 37 | */ 38 | public String getHttpMessage() { 39 | return message; 40 | } 41 | 42 | /** 43 | * Get the response header metadata from the response http headers. 44 | * 45 | * @return The Response Header metadata. 46 | */ 47 | public MwsResponseHeaderMetadata getResponseHeaderMetadata() { 48 | return rhmd; 49 | } 50 | 51 | /** 52 | * Get the response body contents. 53 | * 54 | * @return The response body content as a String. 55 | */ 56 | public String getBodyContent() { 57 | return content; 58 | } 59 | 60 | /** 61 | * Construct immutable response. 62 | * 63 | * @param status 64 | * @param message 65 | * @param rhmd 66 | * @param content 67 | */ 68 | MwsResponse(int status, String message, MwsResponseHeaderMetadata rhmd, String content) { 69 | this.status = status; 70 | this.message = message; 71 | this.rhmd = rhmd; 72 | this.content=content; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * _GET_MERCHANT_LISTINGS_DATA_LITE_ 8 | * 对应报文头的先后顺序 9 | * seller-sku quantity price product-id 10 | * 11 | * @author zhuzhenke 12 | * @date 2018/03/26 13 | */ 14 | public class ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_ implements ResolveReportResult { 15 | 16 | private String sellerSku; 17 | private String quantity; 18 | private String price; 19 | private String productId; 20 | 21 | public String getPrice() { 22 | return price; 23 | } 24 | 25 | public void setPrice(String price) { 26 | this.price = price; 27 | } 28 | 29 | public String getProductId() { 30 | return productId; 31 | } 32 | 33 | public void setProductId(String productId) { 34 | this.productId = productId; 35 | } 36 | 37 | public String getQuantity() { 38 | return quantity; 39 | } 40 | 41 | public void setQuantity(String quantity) { 42 | this.quantity = quantity; 43 | } 44 | 45 | public String getSellerSku() { 46 | return sellerSku; 47 | } 48 | 49 | public void setSellerSku(String sellerSku) { 50 | this.sellerSku = sellerSku; 51 | } 52 | 53 | @Override 54 | public List resolveResult(List resultList) { 55 | List reportResultList = new ArrayList(); 56 | if (resultList == null || resultList.size() <= 1) { 57 | return reportResultList; 58 | } 59 | for (int i = 1; i < resultList.size(); i++) { 60 | String[] strings = resultList.get(i).split("\t"); 61 | ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_ object = new ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_(); 62 | 63 | object.setSellerSku(strings[0]); 64 | object.setQuantity(strings[1]); 65 | object.setPrice(strings[2]); 66 | object.setProductId(strings[3]); 67 | 68 | reportResultList.add(object); 69 | } 70 | 71 | return reportResultList; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/mock/GetEligibleShippingServicesResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | 14 | String 15 | 100 16 | 17 | 18 | String 19 | 20 | String 21 | 100 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | String 30 | 31 | 32 | 33 | 34 | String 35 | 36 | 37 | 38 | 39 | String 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import com.amazonservices.mws.sellers.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceSellers operations. 24 | */ 25 | public class MarketplaceWebServiceSellersException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceSellersException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceSellersException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceSellersException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceSellersException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceSellersException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceSellersException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/MarketplaceWebServiceProductsException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products; 17 | 18 | import com.amazonservices.mws.products.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceProducts operations. 24 | */ 25 | public class MarketplaceWebServiceProductsException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceProductsException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceProductsException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceProductsException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceProductsException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceProductsException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceProductsException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/FBAInventoryServiceMWSException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 17 | 18 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by FBAInventoryServiceMWS operations. 24 | */ 25 | public class FBAInventoryServiceMWSException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public FBAInventoryServiceMWSException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public FBAInventoryServiceMWSException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public FBAInventoryServiceMWSException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public FBAInventoryServiceMWSException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public FBAInventoryServiceMWSException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public FBAInventoryServiceMWSException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/MarketplaceWebServiceOrdersException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01; 17 | 18 | import com.amazonservices.mws.orders._2013_09_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceOrders operations. 24 | */ 25 | public class MarketplaceWebServiceOrdersException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceOrdersException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceOrdersException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceOrdersException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceOrdersException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceOrdersException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceOrdersException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/FBAOutboundServiceMWSException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Outbound Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2016-02-01 14 | * Generated: Fri Jan 08 13:26:39 PST 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01; 17 | 18 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by FBAOutboundServiceMWS operations. 24 | */ 25 | public class FBAOutboundServiceMWSException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public FBAOutboundServiceMWSException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public FBAOutboundServiceMWSException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public FBAOutboundServiceMWSException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public FBAOutboundServiceMWSException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public FBAOutboundServiceMWSException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public FBAOutboundServiceMWSException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/MWSMerchantFulfillmentServiceException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * MWS Merchant Fulfillment Service 12 | * API Version: 2015-06-01 13 | * Library Version: 2016-03-30 14 | * Generated: Tue Mar 29 18:59:55 UTC 2016 15 | */ 16 | package com.amazonservices.mws.merchantfulfillment._2015_06_01; 17 | 18 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MWSMerchantFulfillmentService operations. 24 | */ 25 | public class MWSMerchantFulfillmentServiceException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MWSMerchantFulfillmentServiceException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MWSMerchantFulfillmentServiceException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MWSMerchantFulfillmentServiceException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MWSMerchantFulfillmentServiceException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MWSMerchantFulfillmentServiceException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MWSMerchantFulfillmentServiceException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersAsync.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import java.util.concurrent.Future; 19 | import com.amazonservices.mws.sellers.model.*; 20 | 21 | /** 22 | * This is the Sellers API section of the Marketplace Web Service. 23 | */ 24 | public interface MarketplaceWebServiceSellersAsync extends MarketplaceWebServiceSellers { 25 | 26 | /** 27 | * Get Service Status 28 | * 29 | * Returns the service status of a particular MWS API section. The operation 30 | * takes no input. 31 | * All API sections within the API are required to implement this operation. 32 | * 33 | * @param request 34 | * GetServiceStatusRequest request. 35 | * 36 | * @return Future response. 37 | */ 38 | Future getServiceStatusAsync( 39 | GetServiceStatusRequest request); 40 | 41 | /** 42 | * List Marketplace Participations 43 | * 44 | * Returns a list of marketplaces that the seller submitting the request can sell in, 45 | * and a list of participations that include seller-specific information in that marketplace. 46 | * 47 | * @param request 48 | * ListMarketplaceParticipationsRequest request. 49 | * 50 | * @return Future response. 51 | */ 52 | Future listMarketplaceParticipationsAsync( 53 | ListMarketplaceParticipationsRequest request); 54 | 55 | /** 56 | * List Marketplace Participations By Next Token 57 | * 58 | * Returns the next page of marketplaces and participations using the NextToken value 59 | * that was returned by your previous request to either ListMarketplaceParticipations or 60 | * ListMarketplaceParticipationsByNextToken. 61 | * 62 | * @param request 63 | * ListMarketplaceParticipationsByNextTokenRequest request. 64 | * 65 | * @return Future response. 66 | */ 67 | Future listMarketplaceParticipationsByNextTokenAsync( 68 | ListMarketplaceParticipationsByNextTokenRequest request); 69 | 70 | } -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/samples/MarketplaceWebServiceSellersSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers.samples; 17 | 18 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersAsyncClient; 19 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersClient; 20 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceSellers samples. 24 | */ 25 | public class MarketplaceWebServiceSellersSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceSellersAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceSellersClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceSellersAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceSellersConfig config = new MarketplaceWebServiceSellersConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceSellersAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/samples/MarketplaceWebServiceProductsSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.samples; 17 | 18 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsAsyncClient; 19 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsClient; 20 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceProducts samples. 24 | */ 25 | public class MarketplaceWebServiceProductsSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceProductsAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceProductsClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceProductsAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceProductsAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/samples/MarketplaceWebServiceOrdersSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01.samples; 17 | 18 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersAsyncClient; 19 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersClient; 20 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceOrders samples. 24 | */ 25 | public class MarketplaceWebServiceOrdersSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceOrdersAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceOrdersClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceOrdersAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceOrdersConfig config = new MarketplaceWebServiceOrdersConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceOrdersAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/samples/FBAInventoryServiceMWSSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01.samples; 17 | 18 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSAsyncClient; 19 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSClient; 20 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSConfig; 21 | 22 | /** 23 | * Configuration for FBAInventoryServiceMWS samples. 24 | */ 25 | public class FBAInventoryServiceMWSSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static FBAInventoryServiceMWSAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static FBAInventoryServiceMWSClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized FBAInventoryServiceMWSAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | FBAInventoryServiceMWSConfig config = new FBAInventoryServiceMWSConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new FBAInventoryServiceMWSAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/samples/FBAOutboundServiceMWSSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Outbound Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2016-02-01 14 | * Generated: Fri Jan 08 13:26:39 PST 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.samples; 17 | 18 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSAsyncClient; 19 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSClient; 20 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSConfig; 21 | 22 | /** 23 | * Configuration for FBAOutboundServiceMWS samples. 24 | */ 25 | public class FBAOutboundServiceMWSSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static FBAOutboundServiceMWSAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static FBAOutboundServiceMWSClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized FBAOutboundServiceMWSAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | FBAOutboundServiceMWSConfig config = new FBAOutboundServiceMWSConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new FBAOutboundServiceMWSAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/samples/MWSMerchantFulfillmentServiceSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * MWS Merchant Fulfillment Service 12 | * API Version: 2015-06-01 13 | * Library Version: 2016-03-30 14 | * Generated: Tue Mar 29 18:59:55 UTC 2016 15 | */ 16 | package com.amazonservices.mws.merchantfulfillment._2015_06_01.samples; 17 | 18 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceAsyncClient; 19 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceClient; 20 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceConfig; 21 | 22 | /** 23 | * Configuration for MWSMerchantFulfillmentService samples. 24 | */ 25 | public class MWSMerchantFulfillmentServiceSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MWSMerchantFulfillmentServiceAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MWSMerchantFulfillmentServiceClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MWSMerchantFulfillmentServiceAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MWSMerchantFulfillmentServiceConfig config = new MWSMerchantFulfillmentServiceConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MWSMerchantFulfillmentServiceAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ListAllFulfillmentOrdersResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | String 12 | String 13 | 14 | 1969-07-21T02:56:03Z 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | 29 | String 30 | String 31 | String 32 | 33 | true 34 | 35 | String 36 | String 37 | 38 | 39 | String 40 | String 41 | 42 | 43 | String 44 | String 45 | 46 | 47 | String 48 | String 49 | 50 | 51 | 1969-07-21T02:56:03Z 52 | String 53 | 1969-07-21T02:56:03Z 54 | 55 | String 56 | 57 | 58 | 59 | 60 | 61 | String 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsObject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2012 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Runtime Client Library 12 | */ 13 | package com.amazonservices.mws.client; 14 | 15 | import java.io.Serializable; 16 | 17 | /** 18 | * An object that can read/write from MwsReader/MwsWriter. 19 | * 20 | * @author mayerj 21 | */ 22 | public interface MwsObject extends Serializable { 23 | 24 | long serialVersionUID = -3697940880911238325L; 25 | /** 26 | * Read from a reader not including any enclosing tags/markers. 27 | * 28 | * For XML reads inner tags for elements but not the enclosing tag. This 29 | * method will read attributes if the reader is positioned on a start tag 30 | * otherwise it will not act as if no attributes were present. 31 | * 32 | * For JSON reads the name: elements but not the enclosing braces. 33 | * 34 | * @param r 35 | * The reader to read from. 36 | */ 37 | void readFragmentFrom(MwsReader r); 38 | 39 | /** 40 | * Write self to a JSON object representation. 41 | * 42 | * This includes beginning brace, labe:value contents, and ending brace. 43 | * 44 | * @return The JSON object representation. 45 | */ 46 | String toJSON(); 47 | 48 | /** 49 | * Render self to a fragment of JSON. 50 | * 51 | * This would be just the contents of the braces for the whole JSON object. 52 | * 53 | * @return The JSON fragment. 54 | */ 55 | String toJSONFragment(); 56 | 57 | /** 58 | * Write self to a XML object representation. 59 | * 60 | * This includes begin tag, attributes, inner tags, and end tag. 61 | * 62 | * @return The XML object representation. 63 | */ 64 | String toXML(); 65 | 66 | /** 67 | * Render self to an XML fragment. 68 | * 69 | * This includes the inner tags of the full XML representation, but not the 70 | * outer tag or any attributes. 71 | * 72 | * @return The XML Fragment. 73 | */ 74 | String toXMLFragment(); 75 | 76 | /** 77 | * Write the inner contents to a writer. 78 | * 79 | * Attributes are written. Then the inner values are written. 80 | * No begin or end markers are written. 81 | * 82 | * @param w 83 | * The write to write to. 84 | */ 85 | void writeFragmentTo(MwsWriter w); 86 | 87 | /** 88 | * Write the entire object to a writer. 89 | * 90 | * This includes the beginning marker, attribute values, inner contents and 91 | * ending marker. 92 | * 93 | * @param w 94 | * The writer to write to. 95 | */ 96 | void writeTo(MwsWriter w); 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellers.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import com.amazonservices.mws.sellers.model.*; 19 | 20 | /** 21 | * This is the Sellers API section of the Marketplace Web Service. 22 | */ 23 | public interface MarketplaceWebServiceSellers { 24 | 25 | /** 26 | * Get Service Status 27 | * 28 | * Returns the service status of a particular MWS API section. The operation 29 | * takes no input. 30 | * All API sections within the API are required to implement this operation. 31 | * 32 | * @param request 33 | * GetServiceStatusRequest request. 34 | * 35 | * @return GetServiceStatusResponse response. 36 | * 37 | * @throws MarketplaceWebServiceSellersException 38 | */ 39 | GetServiceStatusResponse getServiceStatus( 40 | GetServiceStatusRequest request) 41 | throws MarketplaceWebServiceSellersException; 42 | 43 | /** 44 | * List Marketplace Participations 45 | * 46 | * Returns a list of marketplaces that the seller submitting the request can sell in, 47 | * and a list of participations that include seller-specific information in that marketplace. 48 | * 49 | * @param request 50 | * ListMarketplaceParticipationsRequest request. 51 | * 52 | * @return ListMarketplaceParticipationsResponse response. 53 | * 54 | * @throws MarketplaceWebServiceSellersException 55 | */ 56 | ListMarketplaceParticipationsResponse listMarketplaceParticipations( 57 | ListMarketplaceParticipationsRequest request) 58 | throws MarketplaceWebServiceSellersException; 59 | 60 | /** 61 | * List Marketplace Participations By Next Token 62 | * 63 | * Returns the next page of marketplaces and participations using the NextToken value 64 | * that was returned by your previous request to either ListMarketplaceParticipations or 65 | * ListMarketplaceParticipationsByNextToken. 66 | * 67 | * @param request 68 | * ListMarketplaceParticipationsByNextTokenRequest request. 69 | * 70 | * @return ListMarketplaceParticipationsByNextTokenResponse response. 71 | * 72 | * @throws MarketplaceWebServiceSellersException 73 | */ 74 | ListMarketplaceParticipationsByNextTokenResponse listMarketplaceParticipationsByNextToken( 75 | ListMarketplaceParticipationsByNextTokenRequest request) 76 | throws MarketplaceWebServiceSellersException; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ListAllFulfillmentOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | String 12 | String 13 | 14 | 1969-07-21T02:56:03Z 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | 29 | String 30 | String 31 | String 32 | 33 | true 34 | 35 | String 36 | String 37 | 38 | 39 | String 40 | String 41 | 42 | 43 | String 44 | String 45 | 46 | 47 | String 48 | String 49 | 50 | 51 | 1969-07-21T02:56:03Z 52 | String 53 | 1969-07-21T02:56:03Z 54 | 55 | String 56 | 57 | 58 | 59 | 60 | 61 | String 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/GetOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | String 8 | 1969-07-21T02:56:03Z 9 | 1969-07-21T02:56:03Z 10 | String 11 | String 12 | String 13 | String 14 | String 15 | 16 | String 17 | String 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | 28 | 29 | String 30 | String 31 | 32 | 1 33 | 1 34 | 35 | 36 | 37 | String 38 | String 39 | 40 | String 41 | 42 | 43 | String 44 | String 45 | String 46 | String 47 | String 48 | true 49 | String 50 | String 51 | String 52 | 1969-07-21T02:56:03Z 53 | 1969-07-21T02:56:03Z 54 | 1969-07-21T02:56:03Z 55 | 1969-07-21T02:56:03Z 56 | true 57 | String 58 | true 59 | true 60 | 61 | 62 | 63 | 64 | String 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/FBAInventoryServiceMWSAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.model.*; 22 | 23 | public class FBAInventoryServiceMWSAsyncClient extends FBAInventoryServiceMWSClient implements FBAInventoryServiceMWSAsync { 24 | 25 | public FBAInventoryServiceMWSAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | FBAInventoryServiceMWSConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public FBAInventoryServiceMWSAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | FBAInventoryServiceMWSConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public FBAInventoryServiceMWSAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | FBAInventoryServiceMWSConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public FBAInventoryServiceMWSAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listInventorySupplyAsync( 68 | ListInventorySupplyRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListInventorySupply", ListInventorySupplyResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listInventorySupplyByNextTokenAsync( 75 | ListInventorySupplyByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListInventorySupplyByNextToken", ListInventorySupplyByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetMyFeesEstimateResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | String 10 | String 11 | String 12 | true 13 | 14 | 15 | String 16 | 100 17 | 18 | 19 | String 20 | 100 21 | 22 | 23 | 1 24 | 25 | String 26 | 100 27 | 28 | 29 | 30 | String 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 35 | String 36 | 100 37 | 38 | 39 | 40 | String 41 | 42 | String 43 | 100 44 | 45 | 46 | String 47 | 100 48 | 49 | 50 | String 51 | 100 52 | 53 | 54 | String 55 | 100 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | String 65 | String 66 | String 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | String 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/GetFulfillmentPreviewResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | 10 | 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | 14 | 15 | 16 | true 17 | true 18 | 19 | String 20 | String 21 | 22 | 23 | 24 | String 25 | 26 | String 27 | String 28 | 29 | 30 | 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 1969-07-21T02:56:03Z 35 | 1969-07-21T02:56:03Z 36 | 1969-07-21T02:56:03Z 37 | 38 | 39 | String 40 | 1 41 | String 42 | 43 | String 44 | String 45 | 46 | String 47 | 48 | 49 | 50 | 51 | 52 | 53 | String 54 | 1 55 | String 56 | 57 | String 58 | 59 | 60 | 61 | 62 | String 63 | 64 | String 65 | 66 | 67 | 68 | 69 | String 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.sellers.model.*; 22 | 23 | public class MarketplaceWebServiceSellersAsyncClient extends MarketplaceWebServiceSellersClient implements MarketplaceWebServiceSellersAsync { 24 | 25 | public MarketplaceWebServiceSellersAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | MarketplaceWebServiceSellersConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public MarketplaceWebServiceSellersAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | MarketplaceWebServiceSellersConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public MarketplaceWebServiceSellersAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | MarketplaceWebServiceSellersConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public MarketplaceWebServiceSellersAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listMarketplaceParticipationsAsync( 68 | ListMarketplaceParticipationsRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListMarketplaceParticipations", ListMarketplaceParticipationsResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listMarketplaceParticipationsByNextTokenAsync( 75 | ListMarketplaceParticipationsByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListMarketplaceParticipationsByNextToken", ListMarketplaceParticipationsByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/util/IPUtil.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by Fernflower decompiler) 4 | // 5 | 6 | package com.amazon.util; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.net.Inet4Address; 12 | import java.net.InetAddress; 13 | import java.net.NetworkInterface; 14 | import java.util.Arrays; 15 | import java.util.Enumeration; 16 | 17 | public class IPUtil { 18 | 19 | private static final Logger logger = LoggerFactory.getLogger(IPUtil.class); 20 | 21 | private static volatile String localIp = null; 22 | private static volatile Integer port = null; 23 | 24 | public IPUtil() { 25 | } 26 | 27 | public static String getLocalIp() { 28 | if (localIp == null) { 29 | synchronized (logger) { 30 | if (localIp == null) { 31 | localIp = getLocalIpInternal(); 32 | } 33 | } 34 | } 35 | return localIp; 36 | } 37 | 38 | private static String getLocalIpInternal() { 39 | try { 40 | Enumeration e = NetworkInterface.getNetworkInterfaces(); 41 | while (true) { 42 | while (e.hasMoreElements()) { 43 | NetworkInterface netInterface = (NetworkInterface) e.nextElement(); 44 | Enumeration addresses = netInterface.getInetAddresses(); 45 | 46 | while (addresses.hasMoreElements()) { 47 | InetAddress inetAddress = (InetAddress) addresses.nextElement(); 48 | if (inetAddress != null && inetAddress instanceof Inet4Address) { 49 | String ip = inetAddress.getHostAddress(); 50 | if (ip.startsWith("192.") || ip.startsWith("10.")) { 51 | return ip; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } catch (Exception var5) { 58 | var5.printStackTrace(); 59 | } 60 | return "127.0.0.1"; 61 | } 62 | 63 | public static Integer getPort() { 64 | if (port == null) { 65 | synchronized (logger) { 66 | if (port == null) { 67 | port = getPortInternal(); 68 | } 69 | } 70 | } 71 | return port; 72 | } 73 | 74 | private static Integer getPortInternal() { 75 | try { 76 | logger.info("获取容器端口开始..."); 77 | int tc = Thread.activeCount(); 78 | Thread[] ts = new Thread[tc]; 79 | Thread.enumerate(ts); 80 | for (Thread t : Arrays.asList(ts)) { 81 | if (t.getName().startsWith("http-bio-")) { 82 | logger.info("发现是tomcat容器..."); 83 | if (t.getName().replaceAll("http-bio-", "").split("-")[1].equals("Acceptor")) { 84 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[0]); 85 | } else { 86 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[1]); 87 | } 88 | } 89 | if (t.getName().startsWith("http") && t.getName().endsWith("Acceptor-0")) { 90 | logger.info("发现是tomcat插件容器..."); 91 | return Integer.valueOf(t.getName().split("-")[1]); 92 | } 93 | } 94 | } catch (Exception e) { 95 | logger.error("获取容器端口失败...", e); 96 | } 97 | return 1111; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonNextInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.amazon.util.IPUtil; 4 | import com.method.invoke.DefaultSystemInvoke; 5 | import com.method.invoke.NextInvokeProcessor; 6 | import com.method.invoke.base.BaseRequest; 7 | import org.apache.http.HttpResponse; 8 | import org.apache.http.client.HttpClient; 9 | import org.apache.http.client.config.RequestConfig; 10 | import org.apache.http.client.methods.HttpGet; 11 | import org.apache.http.impl.client.DefaultHttpClient; 12 | import org.apache.http.util.EntityUtils; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | import java.util.HashMap; 17 | import java.util.Iterator; 18 | import java.util.Map; 19 | 20 | /** 21 | * @author zhuzhenke 22 | * @date 2018/03/22 23 | */ 24 | public class AmazonNextInvokeProcessor implements NextInvokeProcessor { 25 | private static final Logger logger = LoggerFactory.getLogger(DefaultSystemInvoke.class); 26 | 27 | 28 | public AmazonNextInvokeProcessor() { 29 | } 30 | 31 | @Override 32 | public Long getNextInvokeTimeMillis(BaseRequest baseRequest, String sellerId) { 33 | try { 34 | //采用默认实现,频率控制不需要很准确 35 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 36 | return System.currentTimeMillis() + nextTime; 37 | 38 | //TODO 接口频率控制实现,也可以不实现 39 | // HttpClient httpClient = new DefaultHttpClient(); 40 | // 41 | // Map params = new HashMap(); 42 | // params.put("sellerId", sellerId); 43 | // params.put("requestName", getRequestName(baseRequest)); 44 | // params.put("localIp", IPUtil.getLocalIp()); 45 | // params.put("port", IPUtil.getPort()); 46 | // StringBuilder stringBuilder = new StringBuilder(); 47 | // Iterator iterator = params.keySet().iterator(); 48 | // int i = 0; 49 | // while (iterator.hasNext()) { 50 | // String key = iterator.next(); 51 | // if (i == 0) { 52 | // stringBuilder.append("?").append(key).append("=").append(params.get(key)); 53 | // } else { 54 | // stringBuilder.append("&").append(key).append("=").append(params.get(key)); 55 | // } 56 | // i++; 57 | // } 58 | // //这里调用统一控制中心的web接口,获取到当前request的执行时间 59 | // HttpGet httpGet = new HttpGet("http://XXX.com/XXXtime" + stringBuilder.toString()); 60 | // 61 | // RequestConfig requestConfig = RequestConfig.custom() 62 | // .setConnectTimeout(2000).setConnectionRequestTimeout(2000) 63 | // .setSocketTimeout(2000).build(); 64 | // httpGet.setConfig(requestConfig); 65 | // HttpResponse res = httpClient.execute(httpGet); 66 | // switch (res.getStatusLine().getStatusCode()) { 67 | // case 200: 68 | // String body = EntityUtils.toString(res.getEntity()); 69 | // return Long.valueOf(body); 70 | // default: 71 | // return System.currentTimeMillis() + 2000; 72 | // } 73 | } catch (Exception e) { 74 | logger.error("AmazonNextInvokeProcessor getNextInvokeTimeMillis error,baseRequest:{},sellerId:{}", getRequestName(baseRequest), sellerId, e); 75 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 76 | return System.currentTimeMillis() + nextTime; 77 | } 78 | } 79 | 80 | public String getRequestName(BaseRequest baseRequest) { 81 | if (baseRequest != null) { 82 | return baseRequest.getClass().getSimpleName(); 83 | } 84 | return "default"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.sellers.*; 24 | import com.amazonservices.mws.sellers.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceSellers client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceSellersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceSellersSampleConfig. 75 | MarketplaceWebServiceSellersClient client = MarketplaceWebServiceSellersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.products.*; 24 | import com.amazonservices.mws.products.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceProducts client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceProductsException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceProductsSampleConfig. 75 | MarketplaceWebServiceProductsClient client = MarketplaceWebServiceProductsSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.orders._2013_09_01.*; 24 | import com.amazonservices.mws.orders._2013_09_01.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceOrders client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceOrdersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceOrdersSampleConfig. 75 | MarketplaceWebServiceOrdersClient client = MarketplaceWebServiceOrdersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | --------------------------------------------------------------------------------
string
Java class for ServiceStatusEnum. 8 | * 9 | *
The following schema fragment specifies the expected content contained within this class. 10 | *
11 | *
12 | * <simpleType name="ServiceStatusEnum"> 13 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 14 | * <enumeration value="GREEN"/> 15 | * <enumeration value="GREEN_I"/> 16 | * <enumeration value="YELLOW"/> 17 | * <enumeration value="RED"/> 18 | * </restriction> 19 | * </simpleType> 20 | *
6 | * Call instances are created by {@link MwsConnection#newCall(String, String)}. 7 | * 8 | * @author mayerj 9 | * 10 | */ 11 | public interface MwsCall extends MwsWriter { 12 | 13 | /** 14 | * Invoke the request synchronously with error handling and backoff/retry logic. 15 | *
16 | * Call after writing request body. 17 | * 18 | * @return A reader to read the response body. 19 | * 20 | * @throws MwsException 21 | */ 22 | MwsReader invoke() throws MwsException; 23 | 24 | /** 25 | * Execute the request synchronously without error handling or backoff/retry logic. 26 | * 27 | * @return The unparsed response contents (caller must check status for error). 28 | */ 29 | MwsResponse execute(); 30 | 31 | /** 32 | * Gets metadata from response header. 33 | *
34 | * Available after invoke() returns successfully. 35 | * 36 | * @return Response header metadata. 37 | */ 38 | MwsResponseHeaderMetadata getResponseHeaderMetadata(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/method/invoke/exec/InvokeThreadFactory.java: -------------------------------------------------------------------------------- 1 | package com.method.invoke.exec; 2 | 3 | import java.util.concurrent.ThreadFactory; 4 | import java.util.concurrent.atomic.AtomicInteger; 5 | 6 | /** 7 | * 线程工厂 8 | * 9 | * @author zhuzhenke 10 | * @date 2018/03/20 11 | */ 12 | public class InvokeThreadFactory implements ThreadFactory { 13 | 14 | private final ThreadGroup group; 15 | private final AtomicInteger threadNumber = new AtomicInteger(1); 16 | private final String namePrefix; 17 | 18 | public InvokeThreadFactory() { 19 | SecurityManager s = System.getSecurityManager(); 20 | group = (s != null) ? s.getThreadGroup() : 21 | Thread.currentThread().getThreadGroup(); 22 | namePrefix = "invoke-limit-method-pool-thread-"; 23 | } 24 | 25 | @Override 26 | public Thread newThread(Runnable r) { 27 | Thread t = new Thread(group, r, 28 | namePrefix + threadNumber.getAndIncrement(), 29 | 0); 30 | if (t.isDaemon()) { 31 | t.setDaemon(false); 32 | } 33 | if (t.getPriority() != Thread.NORM_PRIORITY) { 34 | t.setPriority(Thread.NORM_PRIORITY); 35 | } 36 | return t; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsResponseMetadata.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Response metadata. 5 | * 6 | * @author mayerj 7 | */ 8 | public class MwsResponseMetadata extends AbstractMwsObject { 9 | 10 | /** The request id. */ 11 | private String requestId; 12 | 13 | /** 14 | * Gets the request id. 15 | * 16 | * @return The request id. 17 | */ 18 | public String getRequestId() { 19 | return requestId; 20 | } 21 | /** 22 | * Set the request id. 23 | * 24 | * @param value 25 | * The request id. 26 | * 27 | */ 28 | public void setRequestId(String value) { 29 | this.requestId = value; 30 | } 31 | 32 | @Override 33 | public void writeFragmentTo(MwsWriter w) { 34 | w.write("RequestId", requestId); 35 | } 36 | 37 | @Override 38 | public void readFragmentFrom(MwsReader r) { 39 | requestId = r.read("RequestId", String.class); 40 | } 41 | 42 | @Override 43 | public void writeTo(MwsWriter w) { 44 | String name = "ResponseMetadata"; 45 | w.beginObject(name); 46 | writeFragmentTo(w); 47 | w.endObject(name); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/commom/ReportType.java: -------------------------------------------------------------------------------- 1 | package com.amazon.commom; 2 | 3 | public enum ReportType { 4 | 5 | /** 6 | * 在售商品报告 7 | * "在售"、"禁止显示"、"在售(商品信息质量警告)"、"不可售(缺货)"会被找出来,"不可售(停售)"的不会被找出来 8 | */ 9 | _GET_MERCHANT_LISTINGS_DATA_, 10 | 11 | /** 12 | * 可售商品报告 13 | * "在售"、"在售(商品信息质量警告)"、"禁止显示"会被找出来,"不可售(停售)"、"不可售(缺货)"的不会被找出来 14 | */ 15 | _GET_MERCHANT_LISTINGS_DATA_BACK_COMPAT_, 16 | 17 | 18 | /** 19 | * 商品信息质量报告 (“商品信息质量和阻止上传的商品信息报告”) 20 | * "禁止显示"、"在售(商品信息质量警告)"会被找出来,但是商品"不可售(停售)"、"不可售(缺货)"、"在售"的不会找出来 21 | */ 22 | _GET_MERCHANT_LISTINGS_DEFECT_DATA_, 23 | 24 | /** 25 | * 可售商品报告 (“库存报告”) 26 | */ 27 | _GET_FLAT_FILE_OPEN_LISTINGS_DATA_, 28 | 29 | /** 30 | * 可售商品报告精简版 31 | */ 32 | _GET_MERCHANT_LISTINGS_DATA_LITE_, 33 | 34 | /** 35 | * 可售商品报告精简升级版 36 | */ 37 | _GET_MERCHANT_LISTINGS_DATA_LITER_, 38 | 39 | /** 40 | * 已售商品报告 41 | */ 42 | _GET_CONVERGED_FLAT_FILE_SOLD_LISTINGS_DATA_, 43 | 44 | /** 45 | * 可售商品报告精简版[只有sku asin price quantity,包含库存为0的商品] 46 | * _GET_MERCHANT_LISTINGS_DATA_LITE_ 47 | * 暂时不优化 48 | */ 49 | 50 | /** 51 | * 返回买家对您的业绩的负面和中性反馈(1 到 3 星) 52 | */ 53 | _GET_SELLER_FEEDBACK_DATA_, 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/ListMarketplaceParticipationsResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | String 15 | String 16 | String 17 | String 18 | String 19 | String 20 | 21 | 22 | 23 | 24 | String 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/mock/ListMarketplaceParticipationsByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 11 | 12 | 13 | 14 | String 15 | String 16 | String 17 | String 18 | String 19 | String 20 | 21 | 22 | 23 | 24 | String 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/ProductsUtil.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.products.model; 2 | 3 | import java.io.StringWriter; 4 | 5 | import javax.xml.transform.OutputKeys; 6 | import javax.xml.transform.Transformer; 7 | import javax.xml.transform.TransformerException; 8 | import javax.xml.transform.dom.DOMSource; 9 | import javax.xml.transform.stream.StreamResult; 10 | 11 | import com.amazonservices.mws.client.MwsUtl; 12 | 13 | import org.w3c.dom.Node; 14 | 15 | public class ProductsUtil { 16 | 17 | public static String formatXml(Node node) { 18 | try { 19 | Transformer transformer = MwsUtl.getTF().newTransformer(); 20 | transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); 21 | transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); 22 | transformer.setOutputProperty(OutputKeys.INDENT, "yes"); 23 | transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); 24 | StringWriter sw = new StringWriter(); 25 | StreamResult result = new StreamResult(sw); 26 | DOMSource source = new DOMSource(node); 27 | transformer.transform(source, result); 28 | return sw.toString(); 29 | } catch (TransformerException e) { 30 | throw new RuntimeException(e); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### JetBrains template 2 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 3 | 4 | *.iml 5 | 6 | ## Directory-based project format: 7 | .idea/ 8 | # if you remove the above rule, at least ignore the following: 9 | 10 | # User-specific stuff: 11 | # .idea/workspace.xml 12 | # .idea/tasks.xml 13 | # .idea/dictionaries 14 | 15 | # Sensitive or high-churn files: 16 | # .idea/dataSources.ids 17 | # .idea/dataSources.xml 18 | # .idea/sqlDataSources.xml 19 | # .idea/dynamic.xml 20 | # .idea/uiDesigner.xml 21 | 22 | # Gradle: 23 | # .idea/gradle.xml 24 | # .idea/libraries 25 | 26 | # Mongo Explorer plugin: 27 | # .idea/mongoSettings.xml 28 | 29 | ## File-based project format: 30 | *.ipr 31 | *.iws 32 | 33 | ## Plugin-specific files: 34 | 35 | # IntelliJ 36 | /out/ 37 | 38 | # mpeltonen/sbt-idea plugin 39 | .idea_modules/ 40 | 41 | # JIRA plugin 42 | atlassian-ide-plugin.xml 43 | 44 | # Crashlytics plugin (for Android Studio and IntelliJ) 45 | com_crashlytics_export_strings.xml 46 | crashlytics.properties 47 | crashlytics-build.properties 48 | ### Java template 49 | *.class 50 | 51 | # Mobile Tools for Java (J2ME) 52 | .mtj.tmp/ 53 | 54 | # Package Files # 55 | *.jar 56 | *.war 57 | *.ear 58 | *.log 59 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 60 | hs_err_pid* 61 | 62 | # Created by .ignore support plugin (hsz.mobi) 63 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsRequestType.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.client; 2 | 3 | /** 4 | * Defines metadata for an operation. 5 | *
6 | * This includes the service, version, operation name, response object class, 7 | * and call parameters. 8 | * 9 | * @author mayerj 10 | */ 11 | public interface MwsRequestType { 12 | 13 | /** 14 | * Get the class that will be thrown for an exception response. 15 | * 16 | * @return The exception class. 17 | */ 18 | MwsException wrapException(Throwable e); 19 | 20 | /** 21 | * Get the operation name that identifies the operation within the service 22 | * version. 23 | * 24 | * @return The operation name. 25 | */ 26 | String getOperationName(); 27 | 28 | /** 29 | * Get the class that will hold a successful response. 30 | * 31 | * @return The response class. 32 | */ 33 | Class extends MwsObject> getResponseClass(); 34 | 35 | /** 36 | * Wrap response header metadata and set into response object. 37 | * 38 | * @param response 39 | * @param rhmd 40 | */ 41 | void setRHMD(MwsObject response, MwsResponseHeaderMetadata rhmd); 42 | 43 | /** 44 | * Get the service path string that identifies the service and version to 45 | * call on the server. 46 | * 47 | * @return The service path. 48 | */ 49 | String getServicePath(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/config/AmazonAccountConfig.java: -------------------------------------------------------------------------------- 1 | package com.amazon.config; 2 | 3 | /** 4 | * @author zhuzhenke 5 | * @date 2018/04/22 6 | */ 7 | public class AmazonAccountConfig { 8 | 9 | private static String applicationName; 10 | private static String applicationVersion; 11 | private static String awsAccessKeyId; 12 | private static String awsSecretAccessKey; 13 | 14 | public static String getApplicationName() { 15 | return applicationName; 16 | } 17 | 18 | public static void setApplicationName(String applicationName) { 19 | AmazonAccountConfig.applicationName = applicationName; 20 | } 21 | 22 | public static String getApplicationVersion() { 23 | return applicationVersion; 24 | } 25 | 26 | public static void setApplicationVersion(String applicationVersion) { 27 | AmazonAccountConfig.applicationVersion = applicationVersion; 28 | } 29 | 30 | public static String getAwsAccessKeyId() { 31 | return awsAccessKeyId; 32 | } 33 | 34 | public static void setAwsAccessKeyId(String awsAccessKeyId) { 35 | AmazonAccountConfig.awsAccessKeyId = awsAccessKeyId; 36 | } 37 | 38 | public static String getAwsSecretAccessKey() { 39 | return awsSecretAccessKey; 40 | } 41 | 42 | public static void setAwsSecretAccessKey(String awsSecretAccessKey) { 43 | AmazonAccountConfig.awsSecretAccessKey = awsSecretAccessKey; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2014-09-30 12 | * Generated: Mon Sep 15 19:38:38 GMT 2014 13 | */ 14 | package com.amazonservices.mws.sellers.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2016-06-01 12 | * Generated: Mon Jun 13 10:07:47 PDT 2016 13 | */ 14 | package com.amazonservices.mws.products.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/model/MWSResponse.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Library Version: 2015-09-24 12 | * Generated: Fri Sep 25 20:06:20 GMT 2015 13 | */ 14 | package com.amazonservices.mws.orders._2013_09_01.model; 15 | 16 | import com.amazonservices.mws.client.MwsObject; 17 | 18 | /** 19 | * Interface implemented by responses. 20 | * 21 | * @author mayerj 22 | */ 23 | public interface MWSResponse extends MwsObject { 24 | 25 | /** 26 | * Set the response header metadata. 27 | * 28 | * @param rhmd 29 | */ 30 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd); 31 | 32 | /** 33 | * Get the response header metadata. 34 | * 35 | * @return The response header metadata. 36 | */ 37 | public ResponseHeaderMetadata getResponseHeaderMetadata(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/model/HasSellerSuspendedListingsEnum.java: -------------------------------------------------------------------------------- 1 | package com.amazonservices.mws.sellers.model; 2 | 3 | import javax.xml.bind.annotation.XmlEnum; 4 | import javax.xml.bind.annotation.XmlEnumValue; 5 | import javax.xml.bind.annotation.XmlType; 6 | 7 | /** 8 | *
Java class for HasSellerSuspendedListingsEnum. 9 | * 10 | *
The following schema fragment specifies the expected content contained within this class. 11 | *
12 | *
13 | * <simpleType name="HasSellerSuspendedListingsEnum"> 14 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 15 | * <enumeration value="Yes"/> 16 | * <enumeration value="No"/> 17 | * </restriction> 18 | * </simpleType> 19 | *
Java class for ServiceStatusEnum. 20 | * 21 | *
The following schema fragment specifies the expected content contained within this class. 22 | *
23 | *
24 | * <simpleType name="ServiceStatusEnum"> 25 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 26 | * <enumeration value="GREEN"/> 27 | * <enumeration value="GREEN_I"/> 28 | * <enumeration value="YELLOW"/> 29 | * <enumeration value="RED"/> 30 | * </restriction> 31 | * </simpleType> 32 | *
Java class for FeedProcessingStatus. 11 | * 12 | *
The following schema fragment specifies the expected content contained within this class. 13 | *
14 | *
15 | * <simpleType name="FeedProcessingStatus"> 16 | * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> 17 | * <enumeration value="_UNKNOWN_"/> 18 | * <enumeration value="_UNCONFIRMED_"/> 19 | * <enumeration value="_SUBMITTED_"/> 20 | * <enumeration value="_IN_PROGRESS_"/> 21 | * <enumeration value="_CANCELLED_"/> 22 | * <enumeration value="_DONE_"/> 23 | * <enumeration value="_IN_SAFETY_NET_"/> 24 | * </restriction> 25 | * </simpleType> 26 | *
6 | * Immutable object providing access to MwsCall response elements. 7 | * 8 | * @author mayerj 9 | */ 10 | public class MwsResponse { 11 | 12 | /** The http status of the response, ie 200,400,500,503,... */ 13 | private final int status; 14 | 15 | /** The message from the http status line. */ 16 | private final String message; 17 | 18 | /** The response header metadata constructed from the response headers. */ 19 | private final MwsResponseHeaderMetadata rhmd; 20 | 21 | /** The body content of the response. */ 22 | private final String content; 23 | 24 | /** 25 | * Get the HTTP status code from the response. 26 | * 27 | * @return The HTTP status code from the response. 28 | */ 29 | public int getHttpStatus() { 30 | return status; 31 | } 32 | 33 | /** 34 | * Get the HTTP status message from the response. 35 | * 36 | * @return The HTTP status message from the response. 37 | */ 38 | public String getHttpMessage() { 39 | return message; 40 | } 41 | 42 | /** 43 | * Get the response header metadata from the response http headers. 44 | * 45 | * @return The Response Header metadata. 46 | */ 47 | public MwsResponseHeaderMetadata getResponseHeaderMetadata() { 48 | return rhmd; 49 | } 50 | 51 | /** 52 | * Get the response body contents. 53 | * 54 | * @return The response body content as a String. 55 | */ 56 | public String getBodyContent() { 57 | return content; 58 | } 59 | 60 | /** 61 | * Construct immutable response. 62 | * 63 | * @param status 64 | * @param message 65 | * @param rhmd 66 | * @param content 67 | */ 68 | MwsResponse(int status, String message, MwsResponseHeaderMetadata rhmd, String content) { 69 | this.status = status; 70 | this.message = message; 71 | this.rhmd = rhmd; 72 | this.content=content; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/domain/report/ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_.java: -------------------------------------------------------------------------------- 1 | package com.amazon.domain.report; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * _GET_MERCHANT_LISTINGS_DATA_LITE_ 8 | * 对应报文头的先后顺序 9 | * seller-sku quantity price product-id 10 | * 11 | * @author zhuzhenke 12 | * @date 2018/03/26 13 | */ 14 | public class ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_ implements ResolveReportResult { 15 | 16 | private String sellerSku; 17 | private String quantity; 18 | private String price; 19 | private String productId; 20 | 21 | public String getPrice() { 22 | return price; 23 | } 24 | 25 | public void setPrice(String price) { 26 | this.price = price; 27 | } 28 | 29 | public String getProductId() { 30 | return productId; 31 | } 32 | 33 | public void setProductId(String productId) { 34 | this.productId = productId; 35 | } 36 | 37 | public String getQuantity() { 38 | return quantity; 39 | } 40 | 41 | public void setQuantity(String quantity) { 42 | this.quantity = quantity; 43 | } 44 | 45 | public String getSellerSku() { 46 | return sellerSku; 47 | } 48 | 49 | public void setSellerSku(String sellerSku) { 50 | this.sellerSku = sellerSku; 51 | } 52 | 53 | @Override 54 | public List resolveResult(List resultList) { 55 | List reportResultList = new ArrayList(); 56 | if (resultList == null || resultList.size() <= 1) { 57 | return reportResultList; 58 | } 59 | for (int i = 1; i < resultList.size(); i++) { 60 | String[] strings = resultList.get(i).split("\t"); 61 | ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_ object = new ReportResult_GET_MERCHANT_LISTINGS_DATA_LITE_(); 62 | 63 | object.setSellerSku(strings[0]); 64 | object.setQuantity(strings[1]); 65 | object.setPrice(strings[2]); 66 | object.setProductId(strings[3]); 67 | 68 | reportResultList.add(object); 69 | } 70 | 71 | return reportResultList; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/mock/GetEligibleShippingServicesResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | 14 | String 15 | 100 16 | 17 | 18 | String 19 | 20 | String 21 | 100 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | String 30 | 31 | 32 | 33 | 34 | String 35 | 36 | 37 | 38 | 39 | String 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import com.amazonservices.mws.sellers.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceSellers operations. 24 | */ 25 | public class MarketplaceWebServiceSellersException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceSellersException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceSellersException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceSellersException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceSellersException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceSellersException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceSellersException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/MarketplaceWebServiceProductsException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products; 17 | 18 | import com.amazonservices.mws.products.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceProducts operations. 24 | */ 25 | public class MarketplaceWebServiceProductsException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceProductsException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceProductsException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceProductsException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceProductsException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceProductsException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceProductsException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/FBAInventoryServiceMWSException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 17 | 18 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by FBAInventoryServiceMWS operations. 24 | */ 25 | public class FBAInventoryServiceMWSException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public FBAInventoryServiceMWSException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public FBAInventoryServiceMWSException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public FBAInventoryServiceMWSException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public FBAInventoryServiceMWSException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public FBAInventoryServiceMWSException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public FBAInventoryServiceMWSException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/MarketplaceWebServiceOrdersException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01; 17 | 18 | import com.amazonservices.mws.orders._2013_09_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MarketplaceWebServiceOrders operations. 24 | */ 25 | public class MarketplaceWebServiceOrdersException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MarketplaceWebServiceOrdersException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MarketplaceWebServiceOrdersException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MarketplaceWebServiceOrdersException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MarketplaceWebServiceOrdersException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MarketplaceWebServiceOrdersException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MarketplaceWebServiceOrdersException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/FBAOutboundServiceMWSException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Outbound Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2016-02-01 14 | * Generated: Fri Jan 08 13:26:39 PST 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01; 17 | 18 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by FBAOutboundServiceMWS operations. 24 | */ 25 | public class FBAOutboundServiceMWSException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public FBAOutboundServiceMWSException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public FBAOutboundServiceMWSException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public FBAOutboundServiceMWSException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public FBAOutboundServiceMWSException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public FBAOutboundServiceMWSException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public FBAOutboundServiceMWSException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/MWSMerchantFulfillmentServiceException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * MWS Merchant Fulfillment Service 12 | * API Version: 2015-06-01 13 | * Library Version: 2016-03-30 14 | * Generated: Tue Mar 29 18:59:55 UTC 2016 15 | */ 16 | package com.amazonservices.mws.merchantfulfillment._2015_06_01; 17 | 18 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.model.ResponseHeaderMetadata; 19 | import com.amazonservices.mws.client.MwsException; 20 | import com.amazonservices.mws.client.MwsResponseHeaderMetadata; 21 | 22 | /** 23 | * Exceptions thrown by MWSMerchantFulfillmentService operations. 24 | */ 25 | public class MWSMerchantFulfillmentServiceException extends MwsException { 26 | 27 | /** For serialization. */ 28 | private static final long serialVersionUID = 1L; 29 | 30 | @Override 31 | public ResponseHeaderMetadata getResponseHeaderMetadata() { 32 | MwsResponseHeaderMetadata baseRHMD = super.getResponseHeaderMetadata(); 33 | if(baseRHMD != null) { 34 | return new ResponseHeaderMetadata(baseRHMD); 35 | } else { 36 | return null; 37 | } 38 | } 39 | 40 | public void setResponseHeaderMetadata(ResponseHeaderMetadata rhmd) { 41 | super.setResponseHeaderMetadata(rhmd); 42 | } 43 | 44 | public MWSMerchantFulfillmentServiceException(String message) { 45 | super(0, message, null); 46 | } 47 | 48 | public MWSMerchantFulfillmentServiceException(String message, int statusCode) { 49 | super(statusCode, message, null); 50 | } 51 | 52 | public MWSMerchantFulfillmentServiceException(Throwable t) { 53 | super(0, null, t); 54 | } 55 | 56 | public MWSMerchantFulfillmentServiceException(String message, Throwable t) { 57 | super(0, message, t); 58 | } 59 | 60 | public MWSMerchantFulfillmentServiceException(String message, int statusCode, 61 | String errorCode, String errorType, String requestId, 62 | String xml, ResponseHeaderMetadata rhmd) { 63 | super(statusCode, message, errorCode, errorType, xml, rhmd); 64 | } 65 | 66 | public MWSMerchantFulfillmentServiceException(String message, int statusCode, 67 | String errorCode, String errorType, String requestId, 68 | String xml) { 69 | super(statusCode, message, errorCode, errorType, xml, null); 70 | } 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersAsync.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import java.util.concurrent.Future; 19 | import com.amazonservices.mws.sellers.model.*; 20 | 21 | /** 22 | * This is the Sellers API section of the Marketplace Web Service. 23 | */ 24 | public interface MarketplaceWebServiceSellersAsync extends MarketplaceWebServiceSellers { 25 | 26 | /** 27 | * Get Service Status 28 | * 29 | * Returns the service status of a particular MWS API section. The operation 30 | * takes no input. 31 | * All API sections within the API are required to implement this operation. 32 | * 33 | * @param request 34 | * GetServiceStatusRequest request. 35 | * 36 | * @return Future response. 37 | */ 38 | Future getServiceStatusAsync( 39 | GetServiceStatusRequest request); 40 | 41 | /** 42 | * List Marketplace Participations 43 | * 44 | * Returns a list of marketplaces that the seller submitting the request can sell in, 45 | * and a list of participations that include seller-specific information in that marketplace. 46 | * 47 | * @param request 48 | * ListMarketplaceParticipationsRequest request. 49 | * 50 | * @return Future response. 51 | */ 52 | Future listMarketplaceParticipationsAsync( 53 | ListMarketplaceParticipationsRequest request); 54 | 55 | /** 56 | * List Marketplace Participations By Next Token 57 | * 58 | * Returns the next page of marketplaces and participations using the NextToken value 59 | * that was returned by your previous request to either ListMarketplaceParticipations or 60 | * ListMarketplaceParticipationsByNextToken. 61 | * 62 | * @param request 63 | * ListMarketplaceParticipationsByNextTokenRequest request. 64 | * 65 | * @return Future response. 66 | */ 67 | Future listMarketplaceParticipationsByNextTokenAsync( 68 | ListMarketplaceParticipationsByNextTokenRequest request); 69 | 70 | } -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/samples/MarketplaceWebServiceSellersSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers.samples; 17 | 18 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersAsyncClient; 19 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersClient; 20 | import com.amazonservices.mws.sellers.MarketplaceWebServiceSellersConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceSellers samples. 24 | */ 25 | public class MarketplaceWebServiceSellersSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceSellersAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceSellersClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceSellersAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceSellersConfig config = new MarketplaceWebServiceSellersConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceSellersAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/samples/MarketplaceWebServiceProductsSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.samples; 17 | 18 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsAsyncClient; 19 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsClient; 20 | import com.amazonservices.mws.products.MarketplaceWebServiceProductsConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceProducts samples. 24 | */ 25 | public class MarketplaceWebServiceProductsSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceProductsAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceProductsClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceProductsAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceProductsAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/samples/MarketplaceWebServiceOrdersSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01.samples; 17 | 18 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersAsyncClient; 19 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersClient; 20 | import com.amazonservices.mws.orders._2013_09_01.MarketplaceWebServiceOrdersConfig; 21 | 22 | /** 23 | * Configuration for MarketplaceWebServiceOrders samples. 24 | */ 25 | public class MarketplaceWebServiceOrdersSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MarketplaceWebServiceOrdersAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MarketplaceWebServiceOrdersClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MarketplaceWebServiceOrdersAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MarketplaceWebServiceOrdersConfig config = new MarketplaceWebServiceOrdersConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MarketplaceWebServiceOrdersAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/samples/FBAInventoryServiceMWSSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01.samples; 17 | 18 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSAsyncClient; 19 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSClient; 20 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.FBAInventoryServiceMWSConfig; 21 | 22 | /** 23 | * Configuration for FBAInventoryServiceMWS samples. 24 | */ 25 | public class FBAInventoryServiceMWSSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static FBAInventoryServiceMWSAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static FBAInventoryServiceMWSClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized FBAInventoryServiceMWSAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | FBAInventoryServiceMWSConfig config = new FBAInventoryServiceMWSConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new FBAInventoryServiceMWSAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/samples/FBAOutboundServiceMWSSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Outbound Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2016-02-01 14 | * Generated: Fri Jan 08 13:26:39 PST 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.samples; 17 | 18 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSAsyncClient; 19 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSClient; 20 | import com.amazonservices.mws.FulfillmentOutboundShipment._2010_10_01.FBAOutboundServiceMWSConfig; 21 | 22 | /** 23 | * Configuration for FBAOutboundServiceMWS samples. 24 | */ 25 | public class FBAOutboundServiceMWSSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static FBAOutboundServiceMWSAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static FBAOutboundServiceMWSClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized FBAOutboundServiceMWSAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | FBAOutboundServiceMWSConfig config = new FBAOutboundServiceMWSConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new FBAOutboundServiceMWSAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/merchantfulfillment/_2015_06_01/samples/MWSMerchantFulfillmentServiceSampleConfig.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * MWS Merchant Fulfillment Service 12 | * API Version: 2015-06-01 13 | * Library Version: 2016-03-30 14 | * Generated: Tue Mar 29 18:59:55 UTC 2016 15 | */ 16 | package com.amazonservices.mws.merchantfulfillment._2015_06_01.samples; 17 | 18 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceAsyncClient; 19 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceClient; 20 | import com.amazonservices.mws.merchantfulfillment._2015_06_01.MWSMerchantFulfillmentServiceConfig; 21 | 22 | /** 23 | * Configuration for MWSMerchantFulfillmentService samples. 24 | */ 25 | public class MWSMerchantFulfillmentServiceSampleConfig { 26 | 27 | /** Developer AWS access key. */ 28 | private static final String accessKey = "replaceWithAccessKey"; 29 | 30 | /** Developer AWS secret key. */ 31 | private static final String secretKey = "replaceWithSecretKey"; 32 | 33 | /** The client application name. */ 34 | private static final String appName = "replaceWithAppName"; 35 | 36 | /** The client application version. */ 37 | private static final String appVersion = "replaceWithAppVersion"; 38 | 39 | /** 40 | * The endpoint for region service and version. 41 | * ex: serviceURL = MWSEndpoint.NA_PROD.toString(); 42 | */ 43 | private static final String serviceURL = "replaceWithServiceURL"; 44 | 45 | /** The client, lazy initialized. Async client is also a sync client. */ 46 | private static MWSMerchantFulfillmentServiceAsyncClient client = null; 47 | 48 | /** 49 | * Get a client connection ready to use. 50 | * 51 | * @return A ready to use client connection. 52 | */ 53 | public static MWSMerchantFulfillmentServiceClient getClient() { 54 | return getAsyncClient(); 55 | } 56 | 57 | /** 58 | * Get an async client connection ready to use. 59 | * 60 | * @return A ready to use client connection. 61 | */ 62 | public static synchronized MWSMerchantFulfillmentServiceAsyncClient getAsyncClient() { 63 | if (client==null) { 64 | MWSMerchantFulfillmentServiceConfig config = new MWSMerchantFulfillmentServiceConfig(); 65 | config.setServiceURL(serviceURL); 66 | // Set other client connection configurations here. 67 | client = new MWSMerchantFulfillmentServiceAsyncClient(accessKey, secretKey, 68 | appName, appVersion, config, null); 69 | } 70 | return client; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ListAllFulfillmentOrdersResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | String 12 | String 13 | 14 | 1969-07-21T02:56:03Z 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | 29 | String 30 | String 31 | String 32 | 33 | true 34 | 35 | String 36 | String 37 | 38 | 39 | String 40 | String 41 | 42 | 43 | String 44 | String 45 | 46 | 47 | String 48 | String 49 | 50 | 51 | 1969-07-21T02:56:03Z 52 | String 53 | 1969-07-21T02:56:03Z 54 | 55 | String 56 | 57 | 58 | 59 | 60 | 61 | String 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/client/MwsObject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2012 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Runtime Client Library 12 | */ 13 | package com.amazonservices.mws.client; 14 | 15 | import java.io.Serializable; 16 | 17 | /** 18 | * An object that can read/write from MwsReader/MwsWriter. 19 | * 20 | * @author mayerj 21 | */ 22 | public interface MwsObject extends Serializable { 23 | 24 | long serialVersionUID = -3697940880911238325L; 25 | /** 26 | * Read from a reader not including any enclosing tags/markers. 27 | * 28 | * For XML reads inner tags for elements but not the enclosing tag. This 29 | * method will read attributes if the reader is positioned on a start tag 30 | * otherwise it will not act as if no attributes were present. 31 | * 32 | * For JSON reads the name: elements but not the enclosing braces. 33 | * 34 | * @param r 35 | * The reader to read from. 36 | */ 37 | void readFragmentFrom(MwsReader r); 38 | 39 | /** 40 | * Write self to a JSON object representation. 41 | * 42 | * This includes beginning brace, labe:value contents, and ending brace. 43 | * 44 | * @return The JSON object representation. 45 | */ 46 | String toJSON(); 47 | 48 | /** 49 | * Render self to a fragment of JSON. 50 | * 51 | * This would be just the contents of the braces for the whole JSON object. 52 | * 53 | * @return The JSON fragment. 54 | */ 55 | String toJSONFragment(); 56 | 57 | /** 58 | * Write self to a XML object representation. 59 | * 60 | * This includes begin tag, attributes, inner tags, and end tag. 61 | * 62 | * @return The XML object representation. 63 | */ 64 | String toXML(); 65 | 66 | /** 67 | * Render self to an XML fragment. 68 | * 69 | * This includes the inner tags of the full XML representation, but not the 70 | * outer tag or any attributes. 71 | * 72 | * @return The XML Fragment. 73 | */ 74 | String toXMLFragment(); 75 | 76 | /** 77 | * Write the inner contents to a writer. 78 | * 79 | * Attributes are written. Then the inner values are written. 80 | * No begin or end markers are written. 81 | * 82 | * @param w 83 | * The write to write to. 84 | */ 85 | void writeFragmentTo(MwsWriter w); 86 | 87 | /** 88 | * Write the entire object to a writer. 89 | * 90 | * This includes the beginning marker, attribute values, inner contents and 91 | * ending marker. 92 | * 93 | * @param w 94 | * The writer to write to. 95 | */ 96 | void writeTo(MwsWriter w); 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellers.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import com.amazonservices.mws.sellers.model.*; 19 | 20 | /** 21 | * This is the Sellers API section of the Marketplace Web Service. 22 | */ 23 | public interface MarketplaceWebServiceSellers { 24 | 25 | /** 26 | * Get Service Status 27 | * 28 | * Returns the service status of a particular MWS API section. The operation 29 | * takes no input. 30 | * All API sections within the API are required to implement this operation. 31 | * 32 | * @param request 33 | * GetServiceStatusRequest request. 34 | * 35 | * @return GetServiceStatusResponse response. 36 | * 37 | * @throws MarketplaceWebServiceSellersException 38 | */ 39 | GetServiceStatusResponse getServiceStatus( 40 | GetServiceStatusRequest request) 41 | throws MarketplaceWebServiceSellersException; 42 | 43 | /** 44 | * List Marketplace Participations 45 | * 46 | * Returns a list of marketplaces that the seller submitting the request can sell in, 47 | * and a list of participations that include seller-specific information in that marketplace. 48 | * 49 | * @param request 50 | * ListMarketplaceParticipationsRequest request. 51 | * 52 | * @return ListMarketplaceParticipationsResponse response. 53 | * 54 | * @throws MarketplaceWebServiceSellersException 55 | */ 56 | ListMarketplaceParticipationsResponse listMarketplaceParticipations( 57 | ListMarketplaceParticipationsRequest request) 58 | throws MarketplaceWebServiceSellersException; 59 | 60 | /** 61 | * List Marketplace Participations By Next Token 62 | * 63 | * Returns the next page of marketplaces and participations using the NextToken value 64 | * that was returned by your previous request to either ListMarketplaceParticipations or 65 | * ListMarketplaceParticipationsByNextToken. 66 | * 67 | * @param request 68 | * ListMarketplaceParticipationsByNextTokenRequest request. 69 | * 70 | * @return ListMarketplaceParticipationsByNextTokenResponse response. 71 | * 72 | * @throws MarketplaceWebServiceSellersException 73 | */ 74 | ListMarketplaceParticipationsByNextTokenResponse listMarketplaceParticipationsByNextToken( 75 | ListMarketplaceParticipationsByNextTokenRequest request) 76 | throws MarketplaceWebServiceSellersException; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ListAllFulfillmentOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | String 12 | String 13 | 14 | 1969-07-21T02:56:03Z 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | 29 | String 30 | String 31 | String 32 | 33 | true 34 | 35 | String 36 | String 37 | 38 | 39 | String 40 | String 41 | 42 | 43 | String 44 | String 45 | 46 | 47 | String 48 | String 49 | 50 | 51 | 1969-07-21T02:56:03Z 52 | String 53 | 1969-07-21T02:56:03Z 54 | 55 | String 56 | 57 | 58 | 59 | 60 | 61 | String 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/GetOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | String 8 | 1969-07-21T02:56:03Z 9 | 1969-07-21T02:56:03Z 10 | String 11 | String 12 | String 13 | String 14 | String 15 | 16 | String 17 | String 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | 28 | 29 | String 30 | String 31 | 32 | 1 33 | 1 34 | 35 | 36 | 37 | String 38 | String 39 | 40 | String 41 | 42 | 43 | String 44 | String 45 | String 46 | String 47 | String 48 | true 49 | String 50 | String 51 | String 52 | 1969-07-21T02:56:03Z 53 | 1969-07-21T02:56:03Z 54 | 1969-07-21T02:56:03Z 55 | 1969-07-21T02:56:03Z 56 | true 57 | String 58 | true 59 | true 60 | 61 | 62 | 63 | 64 | String 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/FBAInventoryServiceMWSAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.model.*; 22 | 23 | public class FBAInventoryServiceMWSAsyncClient extends FBAInventoryServiceMWSClient implements FBAInventoryServiceMWSAsync { 24 | 25 | public FBAInventoryServiceMWSAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | FBAInventoryServiceMWSConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public FBAInventoryServiceMWSAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | FBAInventoryServiceMWSConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public FBAInventoryServiceMWSAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | FBAInventoryServiceMWSConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public FBAInventoryServiceMWSAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listInventorySupplyAsync( 68 | ListInventorySupplyRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListInventorySupply", ListInventorySupplyResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listInventorySupplyByNextTokenAsync( 75 | ListInventorySupplyByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListInventorySupplyByNextToken", ListInventorySupplyByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetMyFeesEstimateResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | String 10 | String 11 | String 12 | true 13 | 14 | 15 | String 16 | 100 17 | 18 | 19 | String 20 | 100 21 | 22 | 23 | 1 24 | 25 | String 26 | 100 27 | 28 | 29 | 30 | String 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 35 | String 36 | 100 37 | 38 | 39 | 40 | String 41 | 42 | String 43 | 100 44 | 45 | 46 | String 47 | 100 48 | 49 | 50 | String 51 | 100 52 | 53 | 54 | String 55 | 100 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | String 65 | String 66 | String 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | String 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/GetFulfillmentPreviewResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | 10 | 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | 14 | 15 | 16 | true 17 | true 18 | 19 | String 20 | String 21 | 22 | 23 | 24 | String 25 | 26 | String 27 | String 28 | 29 | 30 | 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 1969-07-21T02:56:03Z 35 | 1969-07-21T02:56:03Z 36 | 1969-07-21T02:56:03Z 37 | 38 | 39 | String 40 | 1 41 | String 42 | 43 | String 44 | String 45 | 46 | String 47 | 48 | 49 | 50 | 51 | 52 | 53 | String 54 | 1 55 | String 56 | 57 | String 58 | 59 | 60 | 61 | 62 | String 63 | 64 | String 65 | 66 | 67 | 68 | 69 | String 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.sellers.model.*; 22 | 23 | public class MarketplaceWebServiceSellersAsyncClient extends MarketplaceWebServiceSellersClient implements MarketplaceWebServiceSellersAsync { 24 | 25 | public MarketplaceWebServiceSellersAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | MarketplaceWebServiceSellersConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public MarketplaceWebServiceSellersAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | MarketplaceWebServiceSellersConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public MarketplaceWebServiceSellersAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | MarketplaceWebServiceSellersConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public MarketplaceWebServiceSellersAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listMarketplaceParticipationsAsync( 68 | ListMarketplaceParticipationsRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListMarketplaceParticipations", ListMarketplaceParticipationsResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listMarketplaceParticipationsByNextTokenAsync( 75 | ListMarketplaceParticipationsByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListMarketplaceParticipationsByNextToken", ListMarketplaceParticipationsByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/util/IPUtil.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by Fernflower decompiler) 4 | // 5 | 6 | package com.amazon.util; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.net.Inet4Address; 12 | import java.net.InetAddress; 13 | import java.net.NetworkInterface; 14 | import java.util.Arrays; 15 | import java.util.Enumeration; 16 | 17 | public class IPUtil { 18 | 19 | private static final Logger logger = LoggerFactory.getLogger(IPUtil.class); 20 | 21 | private static volatile String localIp = null; 22 | private static volatile Integer port = null; 23 | 24 | public IPUtil() { 25 | } 26 | 27 | public static String getLocalIp() { 28 | if (localIp == null) { 29 | synchronized (logger) { 30 | if (localIp == null) { 31 | localIp = getLocalIpInternal(); 32 | } 33 | } 34 | } 35 | return localIp; 36 | } 37 | 38 | private static String getLocalIpInternal() { 39 | try { 40 | Enumeration e = NetworkInterface.getNetworkInterfaces(); 41 | while (true) { 42 | while (e.hasMoreElements()) { 43 | NetworkInterface netInterface = (NetworkInterface) e.nextElement(); 44 | Enumeration addresses = netInterface.getInetAddresses(); 45 | 46 | while (addresses.hasMoreElements()) { 47 | InetAddress inetAddress = (InetAddress) addresses.nextElement(); 48 | if (inetAddress != null && inetAddress instanceof Inet4Address) { 49 | String ip = inetAddress.getHostAddress(); 50 | if (ip.startsWith("192.") || ip.startsWith("10.")) { 51 | return ip; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } catch (Exception var5) { 58 | var5.printStackTrace(); 59 | } 60 | return "127.0.0.1"; 61 | } 62 | 63 | public static Integer getPort() { 64 | if (port == null) { 65 | synchronized (logger) { 66 | if (port == null) { 67 | port = getPortInternal(); 68 | } 69 | } 70 | } 71 | return port; 72 | } 73 | 74 | private static Integer getPortInternal() { 75 | try { 76 | logger.info("获取容器端口开始..."); 77 | int tc = Thread.activeCount(); 78 | Thread[] ts = new Thread[tc]; 79 | Thread.enumerate(ts); 80 | for (Thread t : Arrays.asList(ts)) { 81 | if (t.getName().startsWith("http-bio-")) { 82 | logger.info("发现是tomcat容器..."); 83 | if (t.getName().replaceAll("http-bio-", "").split("-")[1].equals("Acceptor")) { 84 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[0]); 85 | } else { 86 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[1]); 87 | } 88 | } 89 | if (t.getName().startsWith("http") && t.getName().endsWith("Acceptor-0")) { 90 | logger.info("发现是tomcat插件容器..."); 91 | return Integer.valueOf(t.getName().split("-")[1]); 92 | } 93 | } 94 | } catch (Exception e) { 95 | logger.error("获取容器端口失败...", e); 96 | } 97 | return 1111; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonNextInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.amazon.util.IPUtil; 4 | import com.method.invoke.DefaultSystemInvoke; 5 | import com.method.invoke.NextInvokeProcessor; 6 | import com.method.invoke.base.BaseRequest; 7 | import org.apache.http.HttpResponse; 8 | import org.apache.http.client.HttpClient; 9 | import org.apache.http.client.config.RequestConfig; 10 | import org.apache.http.client.methods.HttpGet; 11 | import org.apache.http.impl.client.DefaultHttpClient; 12 | import org.apache.http.util.EntityUtils; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | import java.util.HashMap; 17 | import java.util.Iterator; 18 | import java.util.Map; 19 | 20 | /** 21 | * @author zhuzhenke 22 | * @date 2018/03/22 23 | */ 24 | public class AmazonNextInvokeProcessor implements NextInvokeProcessor { 25 | private static final Logger logger = LoggerFactory.getLogger(DefaultSystemInvoke.class); 26 | 27 | 28 | public AmazonNextInvokeProcessor() { 29 | } 30 | 31 | @Override 32 | public Long getNextInvokeTimeMillis(BaseRequest baseRequest, String sellerId) { 33 | try { 34 | //采用默认实现,频率控制不需要很准确 35 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 36 | return System.currentTimeMillis() + nextTime; 37 | 38 | //TODO 接口频率控制实现,也可以不实现 39 | // HttpClient httpClient = new DefaultHttpClient(); 40 | // 41 | // Map params = new HashMap(); 42 | // params.put("sellerId", sellerId); 43 | // params.put("requestName", getRequestName(baseRequest)); 44 | // params.put("localIp", IPUtil.getLocalIp()); 45 | // params.put("port", IPUtil.getPort()); 46 | // StringBuilder stringBuilder = new StringBuilder(); 47 | // Iterator iterator = params.keySet().iterator(); 48 | // int i = 0; 49 | // while (iterator.hasNext()) { 50 | // String key = iterator.next(); 51 | // if (i == 0) { 52 | // stringBuilder.append("?").append(key).append("=").append(params.get(key)); 53 | // } else { 54 | // stringBuilder.append("&").append(key).append("=").append(params.get(key)); 55 | // } 56 | // i++; 57 | // } 58 | // //这里调用统一控制中心的web接口,获取到当前request的执行时间 59 | // HttpGet httpGet = new HttpGet("http://XXX.com/XXXtime" + stringBuilder.toString()); 60 | // 61 | // RequestConfig requestConfig = RequestConfig.custom() 62 | // .setConnectTimeout(2000).setConnectionRequestTimeout(2000) 63 | // .setSocketTimeout(2000).build(); 64 | // httpGet.setConfig(requestConfig); 65 | // HttpResponse res = httpClient.execute(httpGet); 66 | // switch (res.getStatusLine().getStatusCode()) { 67 | // case 200: 68 | // String body = EntityUtils.toString(res.getEntity()); 69 | // return Long.valueOf(body); 70 | // default: 71 | // return System.currentTimeMillis() + 2000; 72 | // } 73 | } catch (Exception e) { 74 | logger.error("AmazonNextInvokeProcessor getNextInvokeTimeMillis error,baseRequest:{},sellerId:{}", getRequestName(baseRequest), sellerId, e); 75 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 76 | return System.currentTimeMillis() + nextTime; 77 | } 78 | } 79 | 80 | public String getRequestName(BaseRequest baseRequest) { 81 | if (baseRequest != null) { 82 | return baseRequest.getClass().getSimpleName(); 83 | } 84 | return "default"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.sellers.*; 24 | import com.amazonservices.mws.sellers.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceSellers client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceSellersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceSellersSampleConfig. 75 | MarketplaceWebServiceSellersClient client = MarketplaceWebServiceSellersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.products.*; 24 | import com.amazonservices.mws.products.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceProducts client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceProductsException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceProductsSampleConfig. 75 | MarketplaceWebServiceProductsClient client = MarketplaceWebServiceProductsSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.orders._2013_09_01.*; 24 | import com.amazonservices.mws.orders._2013_09_01.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceOrders client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceOrdersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceOrdersSampleConfig. 75 | MarketplaceWebServiceOrdersClient client = MarketplaceWebServiceOrdersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | --------------------------------------------------------------------------------
28 | * For XML reads inner tags for elements but not the enclosing tag. This 29 | * method will read attributes if the reader is positioned on a start tag 30 | * otherwise it will not act as if no attributes were present. 31 | *
32 | * For JSON reads the name: elements but not the enclosing braces. 33 | * 34 | * @param r 35 | * The reader to read from. 36 | */ 37 | void readFragmentFrom(MwsReader r); 38 | 39 | /** 40 | * Write self to a JSON object representation. 41 | *
42 | * This includes beginning brace, labe:value contents, and ending brace. 43 | * 44 | * @return The JSON object representation. 45 | */ 46 | String toJSON(); 47 | 48 | /** 49 | * Render self to a fragment of JSON. 50 | *
51 | * This would be just the contents of the braces for the whole JSON object. 52 | * 53 | * @return The JSON fragment. 54 | */ 55 | String toJSONFragment(); 56 | 57 | /** 58 | * Write self to a XML object representation. 59 | *
60 | * This includes begin tag, attributes, inner tags, and end tag. 61 | * 62 | * @return The XML object representation. 63 | */ 64 | String toXML(); 65 | 66 | /** 67 | * Render self to an XML fragment. 68 | *
69 | * This includes the inner tags of the full XML representation, but not the 70 | * outer tag or any attributes. 71 | * 72 | * @return The XML Fragment. 73 | */ 74 | String toXMLFragment(); 75 | 76 | /** 77 | * Write the inner contents to a writer. 78 | *
79 | * Attributes are written. Then the inner values are written. 80 | * No begin or end markers are written. 81 | * 82 | * @param w 83 | * The write to write to. 84 | */ 85 | void writeFragmentTo(MwsWriter w); 86 | 87 | /** 88 | * Write the entire object to a writer. 89 | *
90 | * This includes the beginning marker, attribute values, inner contents and 91 | * ending marker. 92 | * 93 | * @param w 94 | * The writer to write to. 95 | */ 96 | void writeTo(MwsWriter w); 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellers.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import com.amazonservices.mws.sellers.model.*; 19 | 20 | /** 21 | * This is the Sellers API section of the Marketplace Web Service. 22 | */ 23 | public interface MarketplaceWebServiceSellers { 24 | 25 | /** 26 | * Get Service Status 27 | * 28 | * Returns the service status of a particular MWS API section. The operation 29 | * takes no input. 30 | * All API sections within the API are required to implement this operation. 31 | * 32 | * @param request 33 | * GetServiceStatusRequest request. 34 | * 35 | * @return GetServiceStatusResponse response. 36 | * 37 | * @throws MarketplaceWebServiceSellersException 38 | */ 39 | GetServiceStatusResponse getServiceStatus( 40 | GetServiceStatusRequest request) 41 | throws MarketplaceWebServiceSellersException; 42 | 43 | /** 44 | * List Marketplace Participations 45 | * 46 | * Returns a list of marketplaces that the seller submitting the request can sell in, 47 | * and a list of participations that include seller-specific information in that marketplace. 48 | * 49 | * @param request 50 | * ListMarketplaceParticipationsRequest request. 51 | * 52 | * @return ListMarketplaceParticipationsResponse response. 53 | * 54 | * @throws MarketplaceWebServiceSellersException 55 | */ 56 | ListMarketplaceParticipationsResponse listMarketplaceParticipations( 57 | ListMarketplaceParticipationsRequest request) 58 | throws MarketplaceWebServiceSellersException; 59 | 60 | /** 61 | * List Marketplace Participations By Next Token 62 | * 63 | * Returns the next page of marketplaces and participations using the NextToken value 64 | * that was returned by your previous request to either ListMarketplaceParticipations or 65 | * ListMarketplaceParticipationsByNextToken. 66 | * 67 | * @param request 68 | * ListMarketplaceParticipationsByNextTokenRequest request. 69 | * 70 | * @return ListMarketplaceParticipationsByNextTokenResponse response. 71 | * 72 | * @throws MarketplaceWebServiceSellersException 73 | */ 74 | ListMarketplaceParticipationsByNextTokenResponse listMarketplaceParticipationsByNextToken( 75 | ListMarketplaceParticipationsByNextTokenRequest request) 76 | throws MarketplaceWebServiceSellersException; 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/ListAllFulfillmentOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 6 | 7 | String 8 | String 9 | String 10 | 1969-07-21T02:56:03Z 11 | String 12 | String 13 | 14 | 1969-07-21T02:56:03Z 15 | 1969-07-21T02:56:03Z 16 | 17 | 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | 29 | String 30 | String 31 | String 32 | 33 | true 34 | 35 | String 36 | String 37 | 38 | 39 | String 40 | String 41 | 42 | 43 | String 44 | String 45 | 46 | 47 | String 48 | String 49 | 50 | 51 | 1969-07-21T02:56:03Z 52 | String 53 | 1969-07-21T02:56:03Z 54 | 55 | String 56 | 57 | 58 | 59 | 60 | 61 | String 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/GetOrderResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | String 8 | 1969-07-21T02:56:03Z 9 | 1969-07-21T02:56:03Z 10 | String 11 | String 12 | String 13 | String 14 | String 15 | 16 | String 17 | String 18 | String 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | 28 | 29 | String 30 | String 31 | 32 | 1 33 | 1 34 | 35 | 36 | 37 | String 38 | String 39 | 40 | String 41 | 42 | 43 | String 44 | String 45 | String 46 | String 47 | String 48 | true 49 | String 50 | String 51 | String 52 | 1969-07-21T02:56:03Z 53 | 1969-07-21T02:56:03Z 54 | 1969-07-21T02:56:03Z 55 | 1969-07-21T02:56:03Z 56 | true 57 | String 58 | true 59 | true 60 | 61 | 62 | 63 | 64 | String 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentInventory/_2010_10_01/FBAInventoryServiceMWSAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * FBA Inventory Service MWS 12 | * API Version: 2010-10-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Mar 21 09:01:27 PDT 2016 15 | */ 16 | package com.amazonservices.mws.FulfillmentInventory._2010_10_01; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.FulfillmentInventory._2010_10_01.model.*; 22 | 23 | public class FBAInventoryServiceMWSAsyncClient extends FBAInventoryServiceMWSClient implements FBAInventoryServiceMWSAsync { 24 | 25 | public FBAInventoryServiceMWSAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | FBAInventoryServiceMWSConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public FBAInventoryServiceMWSAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | FBAInventoryServiceMWSConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public FBAInventoryServiceMWSAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | FBAInventoryServiceMWSConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public FBAInventoryServiceMWSAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listInventorySupplyAsync( 68 | ListInventorySupplyRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListInventorySupply", ListInventorySupplyResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listInventorySupplyByNextTokenAsync( 75 | ListInventorySupplyByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListInventorySupplyByNextToken", ListInventorySupplyByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/mock/GetMyFeesEstimateResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | String 10 | String 11 | String 12 | true 13 | 14 | 15 | String 16 | 100 17 | 18 | 19 | String 20 | 100 21 | 22 | 23 | 1 24 | 25 | String 26 | 100 27 | 28 | 29 | 30 | String 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 35 | String 36 | 100 37 | 38 | 39 | 40 | String 41 | 42 | String 43 | 100 44 | 45 | 46 | String 47 | 100 48 | 49 | 50 | String 51 | 100 52 | 53 | 54 | String 55 | 100 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | String 65 | String 66 | String 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | String 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/FulfillmentOutboundShipment/_2010_10_01/mock/GetFulfillmentPreviewResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | String 7 | 8 | String 9 | 10 | 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | 14 | 15 | 16 | true 17 | true 18 | 19 | String 20 | String 21 | 22 | 23 | 24 | String 25 | 26 | String 27 | String 28 | 29 | 30 | 31 | 32 | 33 | 1969-07-21T02:56:03Z 34 | 1969-07-21T02:56:03Z 35 | 1969-07-21T02:56:03Z 36 | 1969-07-21T02:56:03Z 37 | 38 | 39 | String 40 | 1 41 | String 42 | 43 | String 44 | String 45 | 46 | String 47 | 48 | 49 | 50 | 51 | 52 | 53 | String 54 | 1 55 | String 56 | 57 | String 58 | 59 | 60 | 61 | 62 | String 63 | 64 | String 65 | 66 | 67 | 68 | 69 | String 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/MarketplaceWebServiceSellersAsyncClient.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers; 17 | 18 | import java.util.concurrent.ExecutorService; 19 | import java.util.concurrent.Future; 20 | 21 | import com.amazonservices.mws.sellers.model.*; 22 | 23 | public class MarketplaceWebServiceSellersAsyncClient extends MarketplaceWebServiceSellersClient implements MarketplaceWebServiceSellersAsync { 24 | 25 | public MarketplaceWebServiceSellersAsyncClient( 26 | String accessKey, 27 | String secretKey, 28 | String applicationName, 29 | String applicationVersion, 30 | MarketplaceWebServiceSellersConfig config, 31 | ExecutorService executor) { 32 | super(accessKey, secretKey, applicationName, applicationVersion, config); 33 | connection.setExecutorService(executor); 34 | } 35 | 36 | public MarketplaceWebServiceSellersAsyncClient( 37 | String accessKey, 38 | String secretKey, 39 | String applicationName, 40 | String applicationVersion, 41 | MarketplaceWebServiceSellersConfig config) { 42 | super(accessKey, secretKey, applicationName, applicationVersion, config); 43 | } 44 | 45 | public MarketplaceWebServiceSellersAsyncClient( 46 | String accessKey, 47 | String secretKey, 48 | MarketplaceWebServiceSellersConfig config) { 49 | super(accessKey, secretKey, config); 50 | } 51 | 52 | public MarketplaceWebServiceSellersAsyncClient( 53 | String accessKey, 54 | String secretKey, 55 | String applicationName, 56 | String applicationVersion) { 57 | super(accessKey, secretKey, applicationName, applicationVersion); 58 | } 59 | 60 | public Future getServiceStatusAsync( 61 | GetServiceStatusRequest request) { 62 | return connection.callAsync( 63 | new RequestType("GetServiceStatus", GetServiceStatusResponse.class, servicePath), 64 | request); 65 | } 66 | 67 | public Future listMarketplaceParticipationsAsync( 68 | ListMarketplaceParticipationsRequest request) { 69 | return connection.callAsync( 70 | new RequestType("ListMarketplaceParticipations", ListMarketplaceParticipationsResponse.class, servicePath), 71 | request); 72 | } 73 | 74 | public Future listMarketplaceParticipationsByNextTokenAsync( 75 | ListMarketplaceParticipationsByNextTokenRequest request) { 76 | return connection.callAsync( 77 | new RequestType("ListMarketplaceParticipationsByNextToken", ListMarketplaceParticipationsByNextTokenResponse.class, servicePath), 78 | request); 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/util/IPUtil.java: -------------------------------------------------------------------------------- 1 | // 2 | // Source code recreated from a .class file by IntelliJ IDEA 3 | // (powered by Fernflower decompiler) 4 | // 5 | 6 | package com.amazon.util; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | import java.net.Inet4Address; 12 | import java.net.InetAddress; 13 | import java.net.NetworkInterface; 14 | import java.util.Arrays; 15 | import java.util.Enumeration; 16 | 17 | public class IPUtil { 18 | 19 | private static final Logger logger = LoggerFactory.getLogger(IPUtil.class); 20 | 21 | private static volatile String localIp = null; 22 | private static volatile Integer port = null; 23 | 24 | public IPUtil() { 25 | } 26 | 27 | public static String getLocalIp() { 28 | if (localIp == null) { 29 | synchronized (logger) { 30 | if (localIp == null) { 31 | localIp = getLocalIpInternal(); 32 | } 33 | } 34 | } 35 | return localIp; 36 | } 37 | 38 | private static String getLocalIpInternal() { 39 | try { 40 | Enumeration e = NetworkInterface.getNetworkInterfaces(); 41 | while (true) { 42 | while (e.hasMoreElements()) { 43 | NetworkInterface netInterface = (NetworkInterface) e.nextElement(); 44 | Enumeration addresses = netInterface.getInetAddresses(); 45 | 46 | while (addresses.hasMoreElements()) { 47 | InetAddress inetAddress = (InetAddress) addresses.nextElement(); 48 | if (inetAddress != null && inetAddress instanceof Inet4Address) { 49 | String ip = inetAddress.getHostAddress(); 50 | if (ip.startsWith("192.") || ip.startsWith("10.")) { 51 | return ip; 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } catch (Exception var5) { 58 | var5.printStackTrace(); 59 | } 60 | return "127.0.0.1"; 61 | } 62 | 63 | public static Integer getPort() { 64 | if (port == null) { 65 | synchronized (logger) { 66 | if (port == null) { 67 | port = getPortInternal(); 68 | } 69 | } 70 | } 71 | return port; 72 | } 73 | 74 | private static Integer getPortInternal() { 75 | try { 76 | logger.info("获取容器端口开始..."); 77 | int tc = Thread.activeCount(); 78 | Thread[] ts = new Thread[tc]; 79 | Thread.enumerate(ts); 80 | for (Thread t : Arrays.asList(ts)) { 81 | if (t.getName().startsWith("http-bio-")) { 82 | logger.info("发现是tomcat容器..."); 83 | if (t.getName().replaceAll("http-bio-", "").split("-")[1].equals("Acceptor")) { 84 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[0]); 85 | } else { 86 | return Integer.valueOf(t.getName().replaceAll("http-bio-", "").split("-")[1]); 87 | } 88 | } 89 | if (t.getName().startsWith("http") && t.getName().endsWith("Acceptor-0")) { 90 | logger.info("发现是tomcat插件容器..."); 91 | return Integer.valueOf(t.getName().split("-")[1]); 92 | } 93 | } 94 | } catch (Exception e) { 95 | logger.error("获取容器端口失败...", e); 96 | } 97 | return 1111; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/mock/ListOrdersByNextTokenResponse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | String 5 | 1969-07-21T02:56:03Z 6 | 1969-07-21T02:56:03Z 7 | 8 | 9 | String 10 | String 11 | 1969-07-21T02:56:03Z 12 | 1969-07-21T02:56:03Z 13 | String 14 | String 15 | String 16 | String 17 | String 18 | 19 | String 20 | String 21 | String 22 | String 23 | String 24 | String 25 | String 26 | String 27 | String 28 | String 29 | String 30 | 31 | 32 | String 33 | String 34 | 35 | 1 36 | 1 37 | 38 | 39 | 40 | String 41 | String 42 | 43 | String 44 | 45 | 46 | String 47 | String 48 | String 49 | String 50 | String 51 | true 52 | String 53 | String 54 | String 55 | 1969-07-21T02:56:03Z 56 | 1969-07-21T02:56:03Z 57 | 1969-07-21T02:56:03Z 58 | 1969-07-21T02:56:03Z 59 | true 60 | String 61 | true 62 | true 63 | 64 | 65 | 66 | 67 | String 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/amazon/invoke/AmazonNextInvokeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.amazon.invoke; 2 | 3 | import com.amazon.util.IPUtil; 4 | import com.method.invoke.DefaultSystemInvoke; 5 | import com.method.invoke.NextInvokeProcessor; 6 | import com.method.invoke.base.BaseRequest; 7 | import org.apache.http.HttpResponse; 8 | import org.apache.http.client.HttpClient; 9 | import org.apache.http.client.config.RequestConfig; 10 | import org.apache.http.client.methods.HttpGet; 11 | import org.apache.http.impl.client.DefaultHttpClient; 12 | import org.apache.http.util.EntityUtils; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | import java.util.HashMap; 17 | import java.util.Iterator; 18 | import java.util.Map; 19 | 20 | /** 21 | * @author zhuzhenke 22 | * @date 2018/03/22 23 | */ 24 | public class AmazonNextInvokeProcessor implements NextInvokeProcessor { 25 | private static final Logger logger = LoggerFactory.getLogger(DefaultSystemInvoke.class); 26 | 27 | 28 | public AmazonNextInvokeProcessor() { 29 | } 30 | 31 | @Override 32 | public Long getNextInvokeTimeMillis(BaseRequest baseRequest, String sellerId) { 33 | try { 34 | //采用默认实现,频率控制不需要很准确 35 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 36 | return System.currentTimeMillis() + nextTime; 37 | 38 | //TODO 接口频率控制实现,也可以不实现 39 | // HttpClient httpClient = new DefaultHttpClient(); 40 | // 41 | // Map params = new HashMap(); 42 | // params.put("sellerId", sellerId); 43 | // params.put("requestName", getRequestName(baseRequest)); 44 | // params.put("localIp", IPUtil.getLocalIp()); 45 | // params.put("port", IPUtil.getPort()); 46 | // StringBuilder stringBuilder = new StringBuilder(); 47 | // Iterator iterator = params.keySet().iterator(); 48 | // int i = 0; 49 | // while (iterator.hasNext()) { 50 | // String key = iterator.next(); 51 | // if (i == 0) { 52 | // stringBuilder.append("?").append(key).append("=").append(params.get(key)); 53 | // } else { 54 | // stringBuilder.append("&").append(key).append("=").append(params.get(key)); 55 | // } 56 | // i++; 57 | // } 58 | // //这里调用统一控制中心的web接口,获取到当前request的执行时间 59 | // HttpGet httpGet = new HttpGet("http://XXX.com/XXXtime" + stringBuilder.toString()); 60 | // 61 | // RequestConfig requestConfig = RequestConfig.custom() 62 | // .setConnectTimeout(2000).setConnectionRequestTimeout(2000) 63 | // .setSocketTimeout(2000).build(); 64 | // httpGet.setConfig(requestConfig); 65 | // HttpResponse res = httpClient.execute(httpGet); 66 | // switch (res.getStatusLine().getStatusCode()) { 67 | // case 200: 68 | // String body = EntityUtils.toString(res.getEntity()); 69 | // return Long.valueOf(body); 70 | // default: 71 | // return System.currentTimeMillis() + 2000; 72 | // } 73 | } catch (Exception e) { 74 | logger.error("AmazonNextInvokeProcessor getNextInvokeTimeMillis error,baseRequest:{},sellerId:{}", getRequestName(baseRequest), sellerId, e); 75 | Long nextTime = NextTimeMap.get(getRequestName(baseRequest), 2000L); 76 | return System.currentTimeMillis() + nextTime; 77 | } 78 | } 79 | 80 | public String getRequestName(BaseRequest baseRequest) { 81 | if (baseRequest != null) { 82 | return baseRequest.getClass().getSimpleName(); 83 | } 84 | return "default"; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/sellers/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2014 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Sellers 12 | * API Version: 2011-07-01 13 | * Library Version: 2014-09-30 14 | * Generated: Mon Sep 15 19:38:38 GMT 2014 15 | */ 16 | package com.amazonservices.mws.sellers.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.sellers.*; 24 | import com.amazonservices.mws.sellers.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceSellers client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceSellersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceSellersSampleConfig. 75 | MarketplaceWebServiceSellersClient client = MarketplaceWebServiceSellersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/products/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2016 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Products 12 | * API Version: 2011-10-01 13 | * Library Version: 2016-06-01 14 | * Generated: Mon Jun 13 10:07:47 PDT 2016 15 | */ 16 | package com.amazonservices.mws.products.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.products.*; 24 | import com.amazonservices.mws.products.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceProducts client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceProductsException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceProductsSampleConfig. 75 | MarketplaceWebServiceProductsClient client = MarketplaceWebServiceProductsSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/amazonservices/mws/orders/_2013_09_01/samples/GetServiceStatusSample.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2009-2015 Amazon Services. All Rights Reserved. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 7 | * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 8 | * CONDITIONS OF ANY KIND, either express or implied. See the License for the 9 | * specific language governing permissions and limitations under the License. 10 | ******************************************************************************* 11 | * Marketplace Web Service Orders 12 | * API Version: 2013-09-01 13 | * Library Version: 2015-09-24 14 | * Generated: Fri Sep 25 20:06:20 GMT 2015 15 | */ 16 | package com.amazonservices.mws.orders._2013_09_01.samples; 17 | 18 | import java.util.*; 19 | import javax.xml.datatype.XMLGregorianCalendar; 20 | import java.math.BigDecimal; 21 | 22 | import com.amazonservices.mws.client.*; 23 | import com.amazonservices.mws.orders._2013_09_01.*; 24 | import com.amazonservices.mws.orders._2013_09_01.model.*; 25 | 26 | 27 | /** Sample call for GetServiceStatus. */ 28 | public class GetServiceStatusSample { 29 | 30 | /** 31 | * Call the service, log response and exceptions. 32 | * 33 | * @param client 34 | * @param request 35 | * 36 | * @return The response. 37 | */ 38 | public static GetServiceStatusResponse invokeGetServiceStatus( 39 | MarketplaceWebServiceOrders client, 40 | GetServiceStatusRequest request) { 41 | try { 42 | // Call the service. 43 | GetServiceStatusResponse response = client.getServiceStatus(request); 44 | ResponseHeaderMetadata rhmd = response.getResponseHeaderMetadata(); 45 | // We recommend logging every the request id and timestamp of every call. 46 | System.out.println("Response:"); 47 | System.out.println("RequestId: "+rhmd.getRequestId()); 48 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 49 | String responseXml = response.toXML(); 50 | System.out.println(responseXml); 51 | return response; 52 | } catch (MarketplaceWebServiceOrdersException ex) { 53 | // Exception properties are important for diagnostics. 54 | System.out.println("Service Exception:"); 55 | ResponseHeaderMetadata rhmd = ex.getResponseHeaderMetadata(); 56 | if(rhmd != null) { 57 | System.out.println("RequestId: "+rhmd.getRequestId()); 58 | System.out.println("Timestamp: "+rhmd.getTimestamp()); 59 | } 60 | System.out.println("Message: "+ex.getMessage()); 61 | System.out.println("StatusCode: "+ex.getStatusCode()); 62 | System.out.println("ErrorCode: "+ex.getErrorCode()); 63 | System.out.println("ErrorType: "+ex.getErrorType()); 64 | throw ex; 65 | } 66 | } 67 | 68 | /** 69 | * Command line entry point. 70 | */ 71 | public static void main(String[] args) { 72 | 73 | // Get a client connection. 74 | // Make sure you've set the variables in MarketplaceWebServiceOrdersSampleConfig. 75 | MarketplaceWebServiceOrdersClient client = MarketplaceWebServiceOrdersSampleConfig.getClient(); 76 | 77 | // Create a request. 78 | GetServiceStatusRequest request = new GetServiceStatusRequest(); 79 | String sellerId = "example"; 80 | request.setSellerId(sellerId); 81 | String mwsAuthToken = "example"; 82 | request.setMWSAuthToken(mwsAuthToken); 83 | 84 | // Make the call. 85 | GetServiceStatusSample.invokeGetServiceStatus(client, request); 86 | 87 | } 88 | 89 | } 90 | --------------------------------------------------------------------------------
String