com.mymed.controller.core.manager.myjam
Class MyJamManager

java.lang.Object
  extended by com.mymed.controller.core.manager.AbstractManager
      extended by com.mymed.controller.core.manager.myjam.MyJamManager

public class MyJamManager
extends AbstractManager

Controls the insertion and the retrieving of data to/from the database.

Author:
iacopo

Constructor Summary
MyJamManager(MyJamStorageManager storageManager)
          TODO The identity of the users must be checked.
 
Method Summary
 void deleteReport(java.lang.String reportId)
           
 java.util.List<java.lang.String> getActiveReport(java.lang.String userId)
           
 java.util.List<MFeedBackBean> getFeedbacks(java.lang.String reportId)
          Returns an integer array with: - The number of negative feedbacks with index 0. - The number of positive feedbacks with index 1.
 MReportBean getReport(java.lang.String reportId)
           
 java.util.List<MReportBean> getUpdates(java.lang.String reportId, long timestamp)
          Returns a list of updates.
 void insertFeedback(java.lang.String reportId, java.lang.String updateId, MFeedBackBean feedback)
           
 MReportBean insertReport(MReportBean report, int latitude, int longitude)
          Insert a new report on the DB
 MReportBean insertUpdate(java.lang.String reportId, MReportBean update)
           
 java.util.List<MSearchBean> searchReports(int latitude, int longitude, int radius)
          Returns a list of reports, located in the circular area defined by latitude, longitude and radius.
 
Methods inherited from class com.mymed.controller.core.manager.AbstractManager
introspection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyJamManager

public MyJamManager(MyJamStorageManager storageManager)
TODO The identity of the users must be checked. Authorization.

Method Detail

insertReport

public MReportBean insertReport(MReportBean report,
                                int latitude,
                                int longitude)
                         throws InternalBackEndException,
                                IOBackEndException
Insert a new report on the DB

Parameters:
report -
Throws:
InternalBackEndException
IOBackEndException

searchReports

public java.util.List<MSearchBean> searchReports(int latitude,
                                                 int longitude,
                                                 int radius)
                                          throws InternalBackEndException,
                                                 IOBackEndException
Returns a list of reports, located in the circular area defined by latitude, longitude and radius.

Parameters:
latitude -
longitude -
radius -
Returns:
Throws:
InternalBackEndException
IOBackEndException

getReport

public MReportBean getReport(java.lang.String reportId)
                      throws InternalBackEndException
Parameters:
reportId -
Returns:
Throws:
InternalBackEndException

getActiveReport

public java.util.List<java.lang.String> getActiveReport(java.lang.String userId)
                                                 throws InternalBackEndException,
                                                        IOBackEndException
Throws:
InternalBackEndException
IOBackEndException

getUpdates

public java.util.List<MReportBean> getUpdates(java.lang.String reportId,
                                              long timestamp)
                                       throws InternalBackEndException
Returns a list of updates.

Parameters:
updateIds - List of update ids.
Returns:
Throws:
InternalBackEndException

getFeedbacks

public java.util.List<MFeedBackBean> getFeedbacks(java.lang.String reportId)
                                           throws InternalBackEndException,
                                                  IOBackEndException
Returns an integer array with: - The number of negative feedbacks with index 0. - The number of positive feedbacks with index 1.

Parameters:
reportId -
Returns:
Throws:
InternalBackEndException
IOBackEndException

insertUpdate

public MReportBean insertUpdate(java.lang.String reportId,
                                MReportBean update)
                         throws InternalBackEndException,
                                IOBackEndException
Throws:
InternalBackEndException
IOBackEndException

insertFeedback

public void insertFeedback(java.lang.String reportId,
                           java.lang.String updateId,
                           MFeedBackBean feedback)
                    throws InternalBackEndException,
                           IOBackEndException
Throws:
InternalBackEndException
IOBackEndException

deleteReport

public void deleteReport(java.lang.String reportId)
                  throws InternalBackEndException
Throws:
InternalBackEndException