]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/org/splat/service/LockServiceImpl.java
Salome HOME
The checkin from SALOME operation is updated (ScenarioService.checkin()). Versioning...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / LockServiceImpl.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   02.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import org.splat.exception.LockAlreadyExistsException;
13 import org.splat.exception.LockNotExistsException;
14 import org.splat.exception.LockOutdatedException;
15 import org.splat.exception.LockProtectedException;
16 import org.splat.log.AppLogger;
17
18 /**
19  * The service to lock objects in the database.
20  * 
21  * @author Maria KRUCHININA
22  */
23 public class LockServiceImpl implements LockService {
24
25         /**
26          * logger.
27          */
28         private final static AppLogger LOG = AppLogger.getLogger(LockService.class); // RKV: NOPMD: TODO: Complete the service.
29
30         /**
31          * Lock timeout period in milliseconds. A 24 hours by default.
32          */
33         private final long _timeoutPeriod = 86400000L; // RKV: NOPMD: TODO: Complete the service.
34
35         /**
36          * Lock a data row or update lock on a data row for one user.
37          * 
38          * @param rowUid
39          *            Row uid
40          * @param tableUid
41          *            Table uid
42          * @param userUid
43          *            User uid
44          * @throws LockAlreadyExistsException
45          *             when a lock already exists for row uid and another user id
46          */
47         public void lock(final String rowUid, final String tableUid,
48                         final String userUid) throws LockAlreadyExistsException {
49                 // TODO:
50         }
51
52         /**
53          * Unlock a data row for one user.
54          * 
55          * @param rowUid
56          *            Row uid
57          * @param tableUid
58          *            Table uid
59          * @param userUid
60          *            User uid
61          * @throws LockNotExistsException
62          *             when lock does not exist
63          * @throws LockProtectedException
64          *             lock exists for another user
65          */
66         public void unlock(final String rowUid, final String tableUid,
67                         final String userUid) throws LockNotExistsException,
68                         LockProtectedException {
69                 // TODO:
70         }
71
72         /**
73          * Unlock all datas rox for one user.
74          * 
75          * @param userUid
76          *            User uid
77          */
78         @Override
79         public void unlockAll(final String userUid) {
80                 // TODO Auto-generated method stub
81
82         }
83
84         /**
85          * Check lock on a data row in a table for a user.
86          * 
87          * @param rowUid
88          *            Row uid
89          * @param tableUid
90          *            Table uid
91          * @param userUid
92          *            User uid
93          * @throws LockNotExistsException
94          *             when lock does not exist
95          * @throws LockProtectedException
96          *             lock exists for another user
97          * @throws LockOutdatedException
98          *             when lock on object is in timeout but the owner of lock is another user
99          */
100         public void check(final String rowUid, final String tableUid,
101                         final String userUid) throws LockNotExistsException,
102                         LockProtectedException, LockOutdatedException {
103                 // TODO:
104         }
105
106 }