DataHandler angepasst
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / datahandler / DataHandler.java
CommitLineData
7903e50e
M
1/*
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.
3 *
4 * Project Smart Reservation System.
5 *
6 * Distributable under GPL license. See terms of license at gnu.org.
7 */
8package ch.bfh.ti.srs.datahandler;
9
be594ada
M
10import java.util.HashSet;
11import java.util.List;
12import java.util.UUID;
13
7903e50e
M
14import ch.bfh.ti.daterange.DateRange;
15import ch.bfh.ti.srs.dataschema.Reservation;
16import ch.bfh.ti.srs.dataschema.Resource;
17import ch.bfh.ti.srs.dataschema.User;
18
19/**
20 * @author Michael Grossen
21 */
22public interface DataHandler {
a1e3ab08 23
7903e50e 24 /**
a1e3ab08
D
25 * Finds the user by userName param in the Datacontext and returns the User
26 * object or null if not found
27 * @param userName
28 * userName of the user you are looking for
29 * @return <code>User</code>user object <code>null</code>if no user found
30 * with this userName
7903e50e
M
31 */
32 public User findUser(String userName);
a1e3ab08 33
7903e50e
M
34 /**
35 * Adds a user to the Datacontext from a given User object
a1e3ab08
D
36 * @param user
37 * User object
7903e50e
M
38 * @throws Exception
39 */
40 public void addUser(User user) throws Exception;
a1e3ab08 41
7903e50e 42 /**
a1e3ab08
D
43 * Finds the resourceName in the Datacontext and returns the Resource object
44 * or null if not found
45 * @param resourceName
46 * resource name of the recource you are looking for
47 * @return <code>Resource</code>resource object <code>null</code>if no
48 * resource found with this recourceName
7903e50e
M
49 */
50 public Resource findResource(String resourceName);
a1e3ab08 51
7903e50e
M
52 /**
53 * Adds a resource to the Datacontext from a given Recource object
a1e3ab08
D
54 * @param resource
55 * Resource object
7903e50e
M
56 * @throws Exception
57 */
58 public void addResource(Resource resource) throws Exception;
a1e3ab08 59
7903e50e 60 /**
a1e3ab08
D
61 * Finds the reservation by the id param in the Datacontext and returns the
62 * Reservation object or null if not found
63 * @param id
64 * id of the Reservation you are looking for
65 * @return <code>Reservation</code>reservation object <code>null</code>if no
25d43fa9 66 * reservation found with this ID
7903e50e 67 */
be594ada 68 public Reservation findReservation(UUID id);
a1e3ab08 69
be594ada 70 /**
a1e3ab08
D
71 * Finds a group of reservations by their GroupID param in the Datacontext
72 * and returns the Reservation object or null if not found
73 * @param groupID
74 * id of the Group Reservations you are looking for
25d43fa9
M
75 * @return <code>Reservation</code>reservation objects <code>null</code>if
76 * no reservation found with this groupID
be594ada
M
77 */
78 public List<Reservation> findGroupReservations(UUID groupID);
a1e3ab08 79
25d43fa9
M
80 /**
81 * Finds reservations that overlaps with the given DateRange and returns the
82 * Reservation objects or null if not found
83 * @param range
84 * the range you want to get overlapping reservations for
85 * @return <code>Reservation</code>reservation object <code>null</code>if no
86 * overlapping reservation found with this range
87 */
be594ada 88 public List<Reservation> overlaps(DateRange range);
a1e3ab08 89
7903e50e
M
90 /**
91 * Adds a reservation to the Datacontext from a given Reservation object
a1e3ab08
D
92 * @param reservation
93 * Reservation object
7903e50e
M
94 * @throws Exception
95 */
a1e3ab08 96 public void addReservation(Reservation reservation) throws Exception;
7903e50e 97}