org.zeroexchange.resource.read
Interface ResourceInformant

All Known Implementing Classes:
DefaultResourceInformant

public interface ResourceInformant

The service provides the calculation of the different resource parameters.

Author:
black

Method Summary
 BigDecimal getConsumeAmount(Resource resource)
          Returns the total confirmed consume amount of the resource.
 BigDecimal getProductionHours(Resource resource)
          Returns total production hours of the 'accepted' supplies.
 String getResourceUOM(Resource resource)
          Returns UOM's name for the resource.
 BigDecimal getSupplyAmount(Resource resource)
          Returns the total confirmed supply amount of the resource.
 Date getSupplyDate(Resource resource)
          Returns resource supply date.
 BigDecimal getUserContributionPrice(Resource resource, User user, ZECurrency currency)
          Returns value of the contribution made by the specified user into the specified resource.
 ResourceTender getUserTender(Resource resource, Integer userId)
          Returns the user's tender.
 BigDecimal getValue(Resource resource)
          Returns the 'accepted' resource supply price in the specified currency.
 String getValueUOM(Resource resource)
          Returns UOM's name for the exchange worth of the resource.
 boolean hasConsumers(Resource resource, User excludedUser)
          Returns true if the resource has at least one consumer.
 boolean hasSuppliers(Resource resource, User excludedUser)
          Returns true if the resource has at least one supplier.
 boolean isAcceptedTendersCountExceeded(Resource resource, Class<? extends ResourceTender> clazz)
          Returns true if allowed tenders count is exceeded.
 boolean isUserConsumer(Resource resource, Integer userId)
          Returns true if the user is the consumer of the specified resource.
 boolean isUserSupplier(Resource resource, Integer userId)
          Returns true if the user is the supplier of the specified resource.
 

Method Detail

getSupplyAmount

BigDecimal getSupplyAmount(Resource resource)
Returns the total confirmed supply amount of the resource. NOTE: should never return null.


getConsumeAmount

BigDecimal getConsumeAmount(Resource resource)
Returns the total confirmed consume amount of the resource. NOTE: should never return null.


getUserTender

ResourceTender getUserTender(Resource resource,
                             Integer userId)
Returns the user's tender.


isUserConsumer

boolean isUserConsumer(Resource resource,
                       Integer userId)
Returns true if the user is the consumer of the specified resource. If the resource is null, the method searches over all resources.


isUserSupplier

boolean isUserSupplier(Resource resource,
                       Integer userId)
Returns true if the user is the supplier of the specified resource. If the resource is null, the method searches over all resources.


getValue

BigDecimal getValue(Resource resource)
Returns the 'accepted' resource supply price in the specified currency.


getProductionHours

BigDecimal getProductionHours(Resource resource)
Returns total production hours of the 'accepted' supplies.


getUserContributionPrice

BigDecimal getUserContributionPrice(Resource resource,
                                    User user,
                                    ZECurrency currency)
Returns value of the contribution made by the specified user into the specified resource.


isAcceptedTendersCountExceeded

boolean isAcceptedTendersCountExceeded(Resource resource,
                                       Class<? extends ResourceTender> clazz)
Returns true if allowed tenders count is exceeded.


hasConsumers

boolean hasConsumers(Resource resource,
                     User excludedUser)
Returns true if the resource has at least one consumer.


hasSuppliers

boolean hasSuppliers(Resource resource,
                     User excludedUser)
Returns true if the resource has at least one supplier.


getSupplyDate

Date getSupplyDate(Resource resource)
Returns resource supply date.


getResourceUOM

String getResourceUOM(Resource resource)
Returns UOM's name for the resource. If the resource is a good, it returns Kilogram/Liter/Each/etc..., If the resource is a service, it returns "Session" It the resource is a currency, it returns the currency name


getValueUOM

String getValueUOM(Resource resource)
Returns UOM's name for the exchange worth of the resource.



Copyright © 2013. All Rights Reserved.