public interface StockNotificationSession extends OsidSession
This session defines methods to receive notifications on adds/changes
to Stock
objects in this Warehouse.
This
also includes existing stocks that may appear or disappear due to changes
in the Warehouse
hierarchy, This session is intended for
consumers needing to synchronize their state with this service without the
use of polling. Notifications are cancelled when this session is closed.
The two views defined in this session correspond to the views in the
StockLookupSession.
Modifier and Type | Method and Description |
---|---|
boolean |
canRegisterForStockNotifications()
Tests if this user can register for
Stock
notifications. |
Warehouse |
getWarehouse()
Gets the
Warehouse associated with this session. |
Id |
getWarehouseId()
Gets the
Warehouse Id associated with
this session. |
void |
registerForChangedStock(Id stockId)
Registers for notification of an updated stock.
|
void |
registerForChangedStocks()
Registers for notification of updated stocks.
|
void |
registerForDeletedStock(Id stockId)
Registers for notification of a deleted stock.
|
void |
registerForDeletedStockAncestors(Id stockId)
Registers for notification if an ancestor is removed from the
specified stock in the stock hierarchy.
|
void |
registerForDeletedStockDescendants(Id warehouseId)
Registers for notification if a descendant is removed from the
specified stock in the stock hierarchy.
|
void |
registerForDeletedStocks()
Registers for notification of deleted stocks.
|
void |
registerForNewStockAncestors(Id stockId)
Registers for notification if an ancestor is added to the specified
stock in the stock hierarchy.
|
void |
registerForNewStockDescendants(Id warehouseId)
Registers for notification if a descendant is added to the specified
stock in the stock hierarchy.
|
void |
registerForNewStocks()
Register for notifications of new stocks.
|
void |
useFederatedWarehouseView()
Federates the view for methods in this session.
|
void |
useIsolatedWarehouseView()
Isolates the view for methods in this session.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getWarehouseId()
Warehouse
Id
associated with
this session. Warehouse Id
associated with this sessionmandatory
- This method must be implemented. Warehouse getWarehouse() throws OperationFailedException, PermissionDeniedException
Warehouse
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canRegisterForStockNotifications()
Stock
notifications. A return of true does not guarantee successful
authorization. A return of false indicates that it is known all
methods in this session will result in a PERMISSION_DENIED.
This is intended as a hint to an application that may opt not
to offer notification operations. false
if notification methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useFederatedWarehouseView()
mandatory
- This method is must be implemented. void useIsolatedWarehouseView()
mandatory
- This method is must be implemented. void registerForNewStocks() throws OperationFailedException, PermissionDeniedException
StockReceiver.newStocks()
is invoked when a new Stock
appears in this warehouse.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForNewStockAncestors(Id stockId) throws OperationFailedException, PermissionDeniedException
StockReceiver.newAncestorStock()
is invoked when the specified stock experiences an addition in
ancestry.stockId
- the Id
of the stock to monitorNullArgumentException
- stockId is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForNewStockDescendants(Id warehouseId) throws OperationFailedException, PermissionDeniedException
StockReceiver.newStockDescendant()
is invoked when the
specified stock experiences an addition in descendants.warehouseId
- the Id
of the stock to monitorNullArgumentException
- stockId is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedStocks() throws OperationFailedException, PermissionDeniedException
StockReceiver.changedStocks()
is invoked when a stock in this
warehouse is changed.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedStock(Id stockId) throws OperationFailedException, PermissionDeniedException
StockReceiver.changedStocks()
is invoked when the specified
stock in this warehouse is changed.stockId
- the Id
of the Stock
to
monitorNullArgumentException
- stockId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedStocks() throws OperationFailedException, PermissionDeniedException
StockReceiver.deletedStocks()
is invoked when a stock is
deleted or removed from this warehouse.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedStock(Id stockId) throws OperationFailedException, PermissionDeniedException
StockReceiver.deletedStocks()
is invoked when the specified
stock is deleted or removed from this warehouse.stockId
- the Id
of the Stock
to
monitorNullArgumentException
- stockId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedStockAncestors(Id stockId) throws OperationFailedException, PermissionDeniedException
StockReceiver.newAncestorStock()
is invoked when the specified
stock experiences a removal in ancestry.stockId
- the Id
of the stock to monitorNullArgumentException
- stockId is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedStockDescendants(Id warehouseId) throws OperationFailedException, PermissionDeniedException
StockReceiver.newStockDescendant()
is invoked when the
specified stock experiences a removal in descendants.warehouseId
- the Id
of the stock to monitorNullArgumentException
- stockId is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.