saveChanges and refresh added (does not need an implementation on
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / datahandler / DataHandler.java
index ded3ff3..dc2122f 100644 (file)
@@ -43,7 +43,7 @@ public interface DataHandler {
         * Finds the resourceName in the Datacontext and returns the Resource object
         * or null if not found
         * @param resourceName
-        *            resource name of the recource you are looking for
+        *            resource name of the resource you are looking for
         * @return <code>Resource</code>resource object <code>null</code>if no
         *         resource found with this recourceName
         */
@@ -68,30 +68,57 @@ public interface DataHandler {
        public Reservation findReservation(UUID id);
 
        /**
-        * Finds a group of reservations by their GroupID param in the Datacontext
+        * Finds a group of reservations by their GroupId param in the Datacontext
         * and returns the Reservation object or null if not found
-        * @param groupID
+        * @param groupId
         *            id of the Group Reservations you are looking for
-        * @return <code>Reservation</code>reservation objects <code>null</code>if
-        *         no reservation found with this groupID
+        * @return <code>List</code> with the reservation objects
         */
-       public List<Reservation> findGroupReservations(UUID groupID);
+       public List<Reservation> findGroupReservations(UUID groupId);
 
        /**
         * Finds reservations that overlaps with the given DateRange and returns the
         * Reservation objects or null if not found
         * @param range
         *            the range you want to get overlapping reservations for
-        * @return <code>Reservation</code>reservation object <code>null</code>if no
-        *         overlapping reservation found with this range
+        * @return <code>List</code> with the reservation objects
         */
        public List<Reservation> overlaps(DateRange range);
 
        /**
+        * Finds all reservations for the specific User
+        * @param user
+        *            the user you want to get all the reservations for
+        * @return <code>List</code> with the reservation objects
+        */
+       public List<Reservation> userReservations(User user);
+
+       /**
+        * Finds all reservations
+        * @return <code>List</code> with the all reservation
+        *         objects
+        */
+       public List<Reservation> findAllReservations();
+
+       /**
         * Adds a reservation to the Datacontext from a given Reservation object
         * @param reservation
         *            Reservation object
         * @throws Exception
         */
        public void addReservation(Reservation reservation) throws Exception;
+       
+       /**
+        * Saves the current changes on the local data to the datastorage
+        */
+       public void saveChanges();
+       
+       /**
+        * Synchronizes the local data with the datastorage
+        * 
+        * @param discardChanges
+        *                      <code>true</code> do not try to save the changes
+        *                      <code>false</code> try to save the changes
+        */
+       public void refresh(boolean discardChanges);
 }