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)
InventoryService
createInventoryEntry
in interface InventoryService
public CommandRequest<InventoryEntry> createInventoryEntry(java.lang.String sku, long quantityOnStock, java.lang.Long restockableInDays, org.joda.time.DateTime expectedDelivery)
InventoryService
createInventoryEntry
in interface InventoryService
restockableInDays
- 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)
InventoryService
createInventoryEntry
in interface InventoryService
restockableInDays
- 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)
InventoryService
bySku
in interface InventoryService
public FetchRequest<InventoryEntry> bySku(java.lang.String sku, java.lang.String channelId)
InventoryService
bySku
in interface InventoryService
public QueryRequest<InventoryEntry> queryBySku(java.lang.String sku)
InventoryService
queryBySku
in interface InventoryService
public QueryRequest<InventoryEntry> query()
InventoryService
query
in interface InventoryService
public CommandRequest<InventoryEntry> updateInventoryEntry(VersionedId id, InventoryEntryUpdate update)
updateInventoryEntry
in interface InventoryService
protected CommandRequest<T> createCommandRequest(java.lang.String url, Command command)
protected QueryRequest<T> queryImpl(java.lang.String url)