org.zeroexchange.resource.stock
Class ServiceStockManager

java.lang.Object
  extended by org.zeroexchange.resource.stock.ServiceStockManager
All Implemented Interfaces:
DataProcessor, ResourceStockManager

public class ServiceStockManager
extends Object
implements ResourceStockManager, DataProcessor

Author:
black

Constructor Summary
ServiceStockManager()
           
 
Method Summary
 void freeAmount(ResourceTender tender, Resource resource)
          Reserves amount for the specified resource.
 BigDecimal getAmount(Resource resource, User user)
          Returns resource category.
 BigDecimal getConsumeAmount(Resource resource)
          Returns consume amount for the resource.
 String getProcessingCategoryAlias()
          Returns alias of the processing category
 Class<?> getProcessingClass()
          Returns root hierarchy current processor can operate
 BigDecimal getSupplyAmount(Resource resource)
          Returns supply amount for the resource.
 boolean isAmountManagementEnabled(Resource resource, TenderType tenderType)
          Returns true of the amount management is enabled for consumers.
 boolean isAutoMovementEnabled(Resource resource)
          Returns is auto-supply is enabled for the current resuorce.
 boolean isPriceManagementEnabled(Resource resource)
          Returns true if the price management is enabled for the specified resource.
 void performAutoMovement(Resource resource)
          Performs resource auto-move if possible.
 void reserveAmount(ResourceTender tender, Resource resource)
          Reserves amount for the specified resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceStockManager

public ServiceStockManager()
Method Detail

getProcessingCategoryAlias

public String getProcessingCategoryAlias()
Returns alias of the processing category

Specified by:
getProcessingCategoryAlias in interface ResourceStockManager

getAmount

public BigDecimal getAmount(Resource resource,
                            User user)
Returns resource category.

Specified by:
getAmount in interface ResourceStockManager

reserveAmount

public void reserveAmount(ResourceTender tender,
                          Resource resource)
Reserves amount for the specified resource.

Specified by:
reserveAmount in interface ResourceStockManager

freeAmount

public void freeAmount(ResourceTender tender,
                       Resource resource)
Reserves amount for the specified resource.

Specified by:
freeAmount in interface ResourceStockManager

performAutoMovement

public void performAutoMovement(Resource resource)
Performs resource auto-move if possible.

Specified by:
performAutoMovement in interface ResourceStockManager

isAutoMovementEnabled

public boolean isAutoMovementEnabled(Resource resource)
Returns is auto-supply is enabled for the current resuorce.

Specified by:
isAutoMovementEnabled in interface ResourceStockManager

isPriceManagementEnabled

public boolean isPriceManagementEnabled(Resource resource)
Returns true if the price management is enabled for the specified resource.

Specified by:
isPriceManagementEnabled in interface ResourceStockManager

isAmountManagementEnabled

public boolean isAmountManagementEnabled(Resource resource,
                                         TenderType tenderType)
Returns true of the amount management is enabled for consumers.

Specified by:
isAmountManagementEnabled in interface ResourceStockManager

getSupplyAmount

public BigDecimal getSupplyAmount(Resource resource)
Returns supply amount for the resource.

Specified by:
getSupplyAmount in interface ResourceStockManager

getConsumeAmount

public BigDecimal getConsumeAmount(Resource resource)
Returns consume amount for the resource.

Specified by:
getConsumeAmount in interface ResourceStockManager

getProcessingClass

public Class<?> getProcessingClass()
Description copied from interface: DataProcessor
Returns root hierarchy current processor can operate

Specified by:
getProcessingClass in interface DataProcessor


Copyright © 2013. All Rights Reserved.