org.zeroexchange.resource.read
Class DAOResourceReader

java.lang.Object
  extended by org.zeroexchange.resource.read.DAOResourceReader
All Implemented Interfaces:
ResourceReader

public class DAOResourceReader
extends Object
implements ResourceReader

The default implementation of the resource service.

Author:
black

Constructor Summary
DAOResourceReader()
           
 
Method Summary
protected  void addProcessors(ProcessorAwareDataSet<Resource> dataSet, SortDescriptor sortDescriptor, Object resourcesFilter)
          Adds the sort/filtering processors.
 SlicingDataSet<Resource> getContractResources(Integer contractId, SortDescriptor sortDescriptor, Object resourcesFilter)
          Returns the resource for the specified contract.
 PropertySpecification getPropertySpecification(Resource resource, String propertyName)
          Returns property specification.
<T extends Resource>
T
getResource(Integer resourceId)
          Returns the resource by its id.
 DictionaryItem getUnitOfMeasure(Resource resource)
          Deprecated. 
 SlicingDataSet<Resource> getUserRelatedResources(int userId, SortDescriptor sortDescriptor, String filterQuery)
          Returns resources where user is participant.
 Collection<Resource> getUserResources(int userId, Set<Integer> resourcesIds)
          Returns resources belonging to the current user by their PKs.
 boolean isResourceAccepted(Resource resource)
          Returns true if the resource is accepted by the partner of the specified user.
 boolean isUserInRole(Resource resource, TenderType role, User flowUser)
          
 boolean isUserParticipant(Resource resource, Integer currentUserId)
          Returns true if the resource have the tender from the specified user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DAOResourceReader

public DAOResourceReader()
Method Detail

getPropertySpecification

public PropertySpecification getPropertySpecification(Resource resource,
                                                      String propertyName)
                                               throws BusinessLogicException
Returns property specification.

Specified by:
getPropertySpecification in interface ResourceReader
Throws:
BusinessLogicException

getUserResources

public Collection<Resource> getUserResources(int userId,
                                             Set<Integer> resourcesIds)
Returns resources belonging to the current user by their PKs.

Specified by:
getUserResources in interface ResourceReader

getResource

public <T extends Resource> T getResource(Integer resourceId)
Returns the resource by its id.

Specified by:
getResource in interface ResourceReader

getUserRelatedResources

public SlicingDataSet<Resource> getUserRelatedResources(int userId,
                                                        SortDescriptor sortDescriptor,
                                                        String filterQuery)
Returns resources where user is participant.

Specified by:
getUserRelatedResources in interface ResourceReader

getContractResources

public SlicingDataSet<Resource> getContractResources(Integer contractId,
                                                     SortDescriptor sortDescriptor,
                                                     Object resourcesFilter)
Returns the resource for the specified contract.

Specified by:
getContractResources in interface ResourceReader

addProcessors

protected void addProcessors(ProcessorAwareDataSet<Resource> dataSet,
                             SortDescriptor sortDescriptor,
                             Object resourcesFilter)
Adds the sort/filtering processors.


isUserInRole

public boolean isUserInRole(Resource resource,
                            TenderType role,
                            User flowUser)

Specified by:
isUserInRole in interface ResourceReader

isUserParticipant

public boolean isUserParticipant(Resource resource,
                                 Integer currentUserId)
Returns true if the resource have the tender from the specified user.

Specified by:
isUserParticipant in interface ResourceReader
Parameters:
resource - TODO

isResourceAccepted

public boolean isResourceAccepted(Resource resource)
Returns true if the resource is accepted by the partner of the specified user.

Specified by:
isResourceAccepted in interface ResourceReader
Parameters:
resource - TODO

getUnitOfMeasure

@Deprecated
public DictionaryItem getUnitOfMeasure(Resource resource)
Deprecated. 

UOM model should be refactored (use explicit UnitOfMeasure entity) Returns unit of measure dictionary item. UOM model should be refactored (use explicit UnitOfMeasure entity)

Specified by:
getUnitOfMeasure in interface ResourceReader


Copyright © 2013. All Rights Reserved.