1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package olr.om;
20
21 import java.sql.Connection;
22 import java.sql.SQLException;
23
24
25 public final class OmContext
26 {
27 private static Connection connection;
28 private static RdfUser user = null;
29
30 private OmContext() {}
31
32 /***
33 * @return Returns the connection.
34 */
35 static Connection getConnection()
36 {
37 try
38 {
39 assert(OmContext.connection != null
40 && !OmContext.connection.isClosed());
41 }
42 catch(SQLException e) {}
43
44 return OmContext.connection;
45 }
46
47 /***
48 * @param connection The connection to set.
49 */
50 public static void setConnection(Connection connection)
51 {
52 OmContext.connection = connection;
53 }
54
55 /***
56 * TODO Make only visible pacga wide
57 * @return Returns the user.
58 */
59 public static RdfUser getUser()
60 {
61 return OmContext.user;
62 }
63
64 public static void setUser(RdfUser user)
65 {
66 OmContext.user = user;
67 }
68 }