public class InventoryServiceImpl extends java.lang.Object implements InventoryService
| 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 |
|---|
InventoryServiceImpl(RequestFactory requestFactory,
ProjectEndpoints endpoints) |
| Modifier and Type | Method and Description |
|---|---|
FetchRequest<InventoryEntry> |
bySku(java.lang.String sku)
Fetches the InventoryEntry by sku which does not have any channel.
|
FetchRequest<InventoryEntry> |
bySku(java.lang.String sku,
java.lang.String channelId)
Fetches the InventoryEntry by sku which does have a channel.
|
protected CommandRequest<T> |
createCommandRequest(java.lang.String url,
Command command) |
CommandRequest<InventoryEntry> |
createInventoryEntry(java.lang.String sku,
long quantityOnStock)
Creates a new InventoryEntry that does not belong to a Channel.
|
CommandRequest<InventoryEntry> |
createInventoryEntry(java.lang.String sku,
long quantityOnStock,
java.lang.Long restockableInDays,
org.joda.time.DateTime expectedDelivery)
Creates a new InventoryEntry that does not belong to a Channel.
|
CommandRequest<InventoryEntry> |
createInventoryEntry(java.lang.String sku,
long quantityOnStock,
java.lang.Long restockableInDays,
org.joda.time.DateTime expectedDelivery,
java.lang.String channelId)
Creates a new InventoryEntry that does belong to a Channel.
|
QueryRequest<InventoryEntry> |
query()
Queries inventory entries.
|
QueryRequest<InventoryEntry> |
queryBySku(java.lang.String sku)
Searches all InventoryEntry objects that have the given sku.
|
protected QueryRequest<T> |
queryImpl(java.lang.String url) |
CommandRequest<InventoryEntry> |
updateInventoryEntry(VersionedId id,
InventoryEntryUpdate update) |
protected ProjectEndpoints endpoints
protected RequestFactory requestFactory
protected org.codehaus.jackson.type.TypeReference<T> typeReference
protected org.codehaus.jackson.type.TypeReference<QueryResult<T>> queryResultTypeReference
public InventoryServiceImpl(RequestFactory requestFactory, ProjectEndpoints endpoints)
public CommandRequest<InventoryEntry> createInventoryEntry(java.lang.String sku, long quantityOnStock)
InventoryServicecreateInventoryEntry in interface InventoryServicepublic CommandRequest<InventoryEntry> createInventoryEntry(java.lang.String sku, long quantityOnStock, java.lang.Long restockableInDays, org.joda.time.DateTime expectedDelivery)
InventoryServicecreateInventoryEntry in interface InventoryServicerestockableInDays - optional the time difference in days to get the item in stock again.expectedDelivery - optional expected date for the delivery of the item.public CommandRequest<InventoryEntry> createInventoryEntry(java.lang.String sku, long quantityOnStock, java.lang.Long restockableInDays, org.joda.time.DateTime expectedDelivery, java.lang.String channelId)
InventoryServicecreateInventoryEntry in interface InventoryServicerestockableInDays - optional the time difference in days to get the item in stock again.expectedDelivery - optional expected date for the delivery of the item.public FetchRequest<InventoryEntry> bySku(java.lang.String sku)
InventoryServicebySku in interface InventoryServicepublic FetchRequest<InventoryEntry> bySku(java.lang.String sku, java.lang.String channelId)
InventoryServicebySku in interface InventoryServicepublic QueryRequest<InventoryEntry> queryBySku(java.lang.String sku)
InventoryServicequeryBySku in interface InventoryServicepublic QueryRequest<InventoryEntry> query()
InventoryServicequery in interface InventoryServicepublic CommandRequest<InventoryEntry> updateInventoryEntry(VersionedId id, InventoryEntryUpdate update)
updateInventoryEntry in interface InventoryServiceprotected CommandRequest<T> createCommandRequest(java.lang.String url, Command command)
protected QueryRequest<T> queryImpl(java.lang.String url)