org.chorem.pollen.business.services
Class ServiceVoteImpl

java.lang.Object
  extended by org.chorem.pollen.business.services.ServiceVoteImpl
All Implemented Interfaces:
ServiceVote

public class ServiceVoteImpl
extends Object
implements ServiceVote

Implémentation du service de gestion des votes.

Version:
$Id: ServiceVoteImpl.java 2933 2010-03-12 14:31:05Z fdesbois $
Author:
rannou

Constructor Summary
ServiceVoteImpl()
           
 
Method Summary
 String createVote(VoteDTO voteDTO, PollAccountDTO pollAccountDTO)
          Rajouter un vote à un sondage
 boolean deleteVote(String voteId)
          Supprime un vote de la base de données
 List<VoteDTO> getVotesByPoll(PollDTO poll, int startIndex, int endIndex)
          Retrieve existings votes from the poll.
 boolean hasAlreadyVoted(String votingId, PollDTO poll)
          Test if the votingId has already voted for the poll.
 List<VoteDTO> selectVotes(Map<String,Object> properties)
          Retourne les votes d'un sondage
 boolean updateVote(VoteDTO voteDTO)
          Mise à jour d'un vote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceVoteImpl

public ServiceVoteImpl()
Method Detail

createVote

public String createVote(VoteDTO voteDTO,
                         PollAccountDTO pollAccountDTO)
Description copied from interface: ServiceVote
Rajouter un vote à un sondage

Specified by:
createVote in interface ServiceVote
Parameters:
voteDTO - Le DTO du vote
Returns:
L'ID du vote créé

updateVote

public boolean updateVote(VoteDTO voteDTO)
Description copied from interface: ServiceVote
Mise à jour d'un vote

Specified by:
updateVote in interface ServiceVote
Parameters:
voteDTO - Le DTO du vote
Returns:
Retourne TRUE si la mise à jour s'est correctement déroulée

deleteVote

public boolean deleteVote(String voteId)
Description copied from interface: ServiceVote
Supprime un vote de la base de données

Specified by:
deleteVote in interface ServiceVote
Parameters:
voteId - L'identifiant du vote
Returns:
Retourne TRUE si la suppression s'est correctement déroulée

getVotesByPoll

public List<VoteDTO> getVotesByPoll(PollDTO poll,
                                    int startIndex,
                                    int endIndex)
Description copied from interface: ServiceVote
Retrieve existings votes from the poll. Only needed votes inside the range (startIndex and endIndex) will be retrieve. The results will be ordered by creationDate (the last vote done will be at the end of the list).

Specified by:
getVotesByPoll in interface ServiceVote
Parameters:
poll - to retrieve votes
startIndex - begin range for resulting votes
endIndex - end range for resulting votes
Returns:
the votes corresponding to the poll between the range

hasAlreadyVoted

public boolean hasAlreadyVoted(String votingId,
                               PollDTO poll)
Description copied from interface: ServiceVote
Test if the votingId has already voted for the poll.

Specified by:
hasAlreadyVoted in interface ServiceVote
Parameters:
votingId - to test existing vote
poll - where the votingId can have already voted
Returns:
true if the votingId has already voted or false otherwise

selectVotes

public List<VoteDTO> selectVotes(Map<String,Object> properties)
Description copied from interface: ServiceVote
Retourne les votes d'un sondage

Specified by:
selectVotes in interface ServiceVote
Parameters:
properties - La HashMap pour sélectionner les votes d'un sondage. Il faut y mettre le bon champs pollId
Returns:
Les votes d'un sondage dans un DTO, le tout stocké dans une liste.


Copyright © 2009-2010 CodeLutin. All Rights Reserved.