public class StatusServiceImpl extends java.lang.Object implements StatusService
Modifier and Type | Field and Description |
---|---|
private TimestampCache |
cache |
private static org.slf4j.Logger |
log |
private OrderRepository |
orderRepository |
private ShopRepository |
shopRepository |
Constructor and Description |
---|
StatusServiceImpl(ShopRepository shopRepository,
OrderRepository orderRepository,
TimestampCache cacheProvider) |
Modifier and Type | Method and Description |
---|---|
private void |
captureTimestamp(GUID shopGuid) |
void |
createShop(GUID shopGuid,
java.lang.String redirectUri,
java.lang.String ep6RedirectUrl)
Creates a new database entry for a specific shop.
|
private void |
eraseTimestamp(GUID shopGuid) |
OrderStatus |
getOrderStatus(GUID shopGuid,
GUID orderGuid)
Returns status information about a specific order.
|
ShopStatus |
getShopStatus(GUID shopGuid)
Returns status information about a specific shop.
|
boolean |
isFirstSynchronization(GUID shopGuid)
Determines if the shop has already performed a successful synchronization
at least once.
|
boolean |
isReadyForSynchronization(GUID shopGuid)
Determines if the shop with the specified identifier is ready to perform
a synchronization.
|
void |
setBusy(GUID shopGuid)
Sets a specific shop sync-status to "busy".
|
void |
setConnected(GUID shopGuid)
Sets a specific shop connection-status to "connected".
|
void |
setDisconnected(GUID shopGuid)
Sets a specific shop connection-status to "disconnected".
|
void |
setIdle(GUID shopGuid)
Sets a specific shop sync-status to "idle".
|
void |
setOrderStatus(OrderStatus status)
Sets the status of a specific order.
|
void |
synchronizationAborted(GUID shopGuid)
Sets a specific shop sync-status to "idle" without updating the last
synchronization timestamp.
|
void |
synchronizationCompleted(GUID shopGuid)
Sets a specific shop sync-status to "idle" and updates the last
synchronization timestamp.
|
void |
synchronizationStarted(GUID shopGuid)
Sets a specific shop sync-status to "busy".
|
private static final org.slf4j.Logger log
private final ShopRepository shopRepository
private final OrderRepository orderRepository
private final TimestampCache cache
@Inject public StatusServiceImpl(ShopRepository shopRepository, OrderRepository orderRepository, TimestampCache cacheProvider)
public boolean isReadyForSynchronization(GUID shopGuid)
StatusService
isReadyForSynchronization
in interface StatusService
shopGuid
- GUID of the shop.public boolean isFirstSynchronization(GUID shopGuid)
StatusService
isFirstSynchronization
in interface StatusService
shopGuid
- GUID of the shop.public ShopStatus getShopStatus(GUID shopGuid)
StatusService
getShopStatus
in interface StatusService
shopGuid
- GUID of the shop to get information about.public OrderStatus getOrderStatus(GUID shopGuid, GUID orderGuid)
StatusService
getOrderStatus
in interface StatusService
shopGuid
- GUID of the shop containing the order.orderGuid
- Identifier of the order to get information about.public void setOrderStatus(OrderStatus status)
StatusService
setOrderStatus
in interface StatusService
status
- Order status to set.public void createShop(GUID shopGuid, java.lang.String redirectUri, java.lang.String ep6RedirectUrl)
StatusService
createShop
in interface StatusService
shopGuid
- GUID of the shop.redirectUri
- String used by Sage to redirect back to EpagesJep6RedirectUrl
- String used by EpagesJ to redirect back to Epages6public void setConnected(GUID shopGuid)
StatusService
setConnected
in interface StatusService
shopGuid
- GUID of the desired shop.public void setDisconnected(GUID shopGuid)
StatusService
setDisconnected
in interface StatusService
shopGuid
- GUID of the desired shop.public void setBusy(GUID shopGuid)
StatusService
setBusy
in interface StatusService
shopGuid
- GUID of the desired shop.public void setIdle(GUID shopGuid)
StatusService
setIdle
in interface StatusService
shopGuid
- GUID of the desired shop.public void synchronizationStarted(GUID shopGuid)
StatusService
synchronizationStarted
in interface StatusService
shopGuid
- GUID of the desired shop.public void synchronizationAborted(GUID shopGuid)
StatusService
synchronizationAborted
in interface StatusService
shopGuid
- GUID of the desired shop.public void synchronizationCompleted(GUID shopGuid)
StatusService
synchronizationCompleted
in interface StatusService
shopGuid
- GUID of the desired shop.private void captureTimestamp(GUID shopGuid)
private void eraseTimestamp(GUID shopGuid)