public class OrderServiceImpl extends java.lang.Object implements OrderService
Modifier and Type | Field and Description |
---|---|
protected ProjectEndpoints |
endpoints |
protected org.codehaus.jackson.type.TypeReference<QueryResult<T>> |
queryResultTypeReference |
protected RequestFactory |
requestFactory |
protected org.codehaus.jackson.type.TypeReference<T> |
typeReference |
Constructor and Description |
---|
OrderServiceImpl(RequestFactory requestFactory,
ProjectEndpoints endpoints) |
Modifier and Type | Method and Description |
---|---|
QueryRequest<Order> |
all()
Deprecated.
|
FetchRequest<Order> |
byId(java.lang.String id)
Finds an order by an id.
|
protected CommandRequest<T> |
createCommandRequest(java.lang.String url,
Command command) |
CommandRequest<Order> |
createOrder(CreateOrderBuilder builder)
Creates an order based on a cart, and deletes the cart.
|
CommandRequest<Order> |
createOrder(VersionedId cartId)
Creates an order based on a cart, and deletes the cart.
|
CommandRequest<Order> |
createOrder(VersionedId cartId,
PaymentState paymentState)
Creates an order based on a cart, and deletes the cart.
|
QueryRequest<Order> |
forCustomer(java.lang.String customerId)
Queries all orders of given customer.
|
QueryRequest<Order> |
query()
Queries orders in current project.
|
protected QueryRequest<T> |
queryImpl(java.lang.String url) |
CommandRequest<Order> |
updateOrder(VersionedId orderId,
OrderUpdate orderUpdate)
Updates the order, e.g.
|
CommandRequest<Order> |
updatePaymentState(VersionedId orderId,
PaymentState paymentState)
Deprecated.
|
CommandRequest<Order> |
updateShipmentState(VersionedId orderId,
ShipmentState shipmentState)
Deprecated.
|
protected ProjectEndpoints endpoints
protected RequestFactory requestFactory
protected org.codehaus.jackson.type.TypeReference<T> typeReference
protected org.codehaus.jackson.type.TypeReference<QueryResult<T>> queryResultTypeReference
public OrderServiceImpl(RequestFactory requestFactory, ProjectEndpoints endpoints)
public FetchRequest<Order> byId(java.lang.String id)
OrderService
byId
in interface OrderService
@Deprecated public QueryRequest<Order> all()
OrderService
all
in interface OrderService
public QueryRequest<Order> query()
OrderService
query
in interface OrderService
public QueryRequest<Order> forCustomer(java.lang.String customerId)
OrderService
forCustomer
in interface OrderService
@Deprecated public CommandRequest<Order> updatePaymentState(VersionedId orderId, PaymentState paymentState)
OrderService
updatePaymentState
in interface OrderService
@Deprecated public CommandRequest<Order> updateShipmentState(VersionedId orderId, ShipmentState shipmentState)
OrderService
updateShipmentState
in interface OrderService
public CommandRequest<Order> updateOrder(VersionedId orderId, OrderUpdate orderUpdate)
OrderService
updateOrder
in interface OrderService
orderId
- the versioned id of the order to updateorderUpdate
- the changes to be appliedpublic CommandRequest<Order> createOrder(VersionedId cartId, PaymentState paymentState)
OrderService
createOrder
in interface OrderService
OutOfStockException
if some of the products
in the cart are not available anymore.
This can only happen if the cart is in the
ReserveOnOrder
mode.
PriceChangedException
if the price, tax or
shipping of some line items changed since the items were added to the cart.
public CommandRequest<Order> createOrder(VersionedId cartId)
OrderService
createOrder
in interface OrderService
OutOfStockException
if some of the products
in the cart are not available anymore.
This can only happen if the cart is in the
ReserveOnOrder
mode.
PriceChangedException
if the price, tax or
shipping of some line items changed since the items were added to the cart.
public CommandRequest<Order> createOrder(CreateOrderBuilder builder)
OrderService
createOrder
in interface OrderService
OutOfStockException
if some of the products
in the cart are not available anymore.
This can only happen if the cart is in the
ReserveOnOrder
mode.
PriceChangedException
if the price, tax or
shipping of some line items changed since the items were added to the cart.
protected CommandRequest<T> createCommandRequest(java.lang.String url, Command command)
protected QueryRequest<T> queryImpl(java.lang.String url)