com.mymed.controller.core.manager.reputation.reputation_manager
Class VerdictManager

java.lang.Object
  extended by com.mymed.controller.core.manager.reputation.reputation_manager.VerdictManager

public class VerdictManager
extends java.lang.Object

This class contains methods allowing the application level to store feedbacks concerning an atomic interaction between producer and consumer.

Author:
piccolo

Constructor Summary
VerdictManager(CassandraWrapper w)
           
 
Method Summary
 java.lang.String createAggregation(java.lang.String id)
          This method creates an empty aggregation of judgments
 boolean deleteAggregation(java.lang.String idAggregation)
          This method deletes an aggregation of judgments (note that it does not delete the judgments being part of the aggregation)
 boolean updateAggregation(java.lang.String idAggregation, java.lang.String idApp, java.lang.String idJudge, boolean isJudgeProducer, java.lang.String idCharged, double vote)
          This methods creates a new judgment given by a judge about a given charged and adds this judgment to an already created aggregation
 boolean updateReputation(java.lang.String idApp, java.lang.String idJudge, boolean isJudgeProducer, java.lang.String idCharged, double vote)
          This method causes the update of a reputation of a given user (the charged) caused by the submission of a new feedback by an other user (the judge)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerdictManager

public VerdictManager(CassandraWrapper w)
Method Detail

updateReputation

public boolean updateReputation(java.lang.String idApp,
                                java.lang.String idJudge,
                                boolean isJudgeProducer,
                                java.lang.String idCharged,
                                double vote)
This method causes the update of a reputation of a given user (the charged) caused by the submission of a new feedback by an other user (the judge)

Parameters:
idApp - the id of the used application
idJudge - the id of the user playing the role of judge
isJudgeProducer - a flag telling us whether the judge is a producer of a consumer
idCharged - the id of the user playing the role of charged
vote - the provided feedback
Returns:
true if the update operation exits with success, false otherwise

createAggregation

public java.lang.String createAggregation(java.lang.String id)
This method creates an empty aggregation of judgments

Parameters:
id - a value allowing us to identify uniquely the aggregation
Returns:
the id of the newly created aggregation

deleteAggregation

public boolean deleteAggregation(java.lang.String idAggregation)
This method deletes an aggregation of judgments (note that it does not delete the judgments being part of the aggregation)

Parameters:
idAggregation - the id of the aggregation to be deleted

updateAggregation

public boolean updateAggregation(java.lang.String idAggregation,
                                 java.lang.String idApp,
                                 java.lang.String idJudge,
                                 boolean isJudgeProducer,
                                 java.lang.String idCharged,
                                 double vote)
This methods creates a new judgment given by a judge about a given charged and adds this judgment to an already created aggregation

Parameters:
idAggregation - the id of aggregation where the new judgment will be added
idApp - the id of used application
idJudge - the id of the user being the judge
isJudgeProducer - a flag telling us whether the judge is a producer or a consumer
idCharged - the id of the used being the charged
vote - the provided feedback
Returns:
true if the update operation exits with success, false otherwise