Salome HOME
Database class usage is removed from StudyService.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / LockServiceImpl.java
1 /*****************************************************************************
2  * Company         EURIWARE
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  * @author Maria KRUCHININA
20  *
21  */
22 public class LockServiceImpl implements LockService {
23         
24         /**
25          * logger.
26          */
27         private final static AppLogger LOG = AppLogger.getLogger(LockService.class);
28
29         /**
30          * Lock timeout period in milliseconds. A 24 hours by default.
31          */
32         private long _timeoutPeriod = 86400000L;
33
34         /**
35          * Lock a data row or update lock on a data row for one user.
36          * @param rowUid Row uid
37          * @param tableUid Table uid
38          * @param userUid User uid
39          * @throws LockAlreadyExistsException when a lock already exists for row uid and another user id
40          */
41         public void lock(final String rowUid, final String tableUid, final String userUid) throws LockAlreadyExistsException {
42                 //TODO:
43         }
44         
45         /**
46          * Unlock a data row for one user.
47          * @param rowUid Row uid
48          * @param tableUid Table uid
49          * @param userUid User uid
50          * @throws LockNotExistsException when lock does not exist
51          * @throws LockProtectedException lock exists for another user
52          */
53         public void unlock(final String rowUid, final String tableUid, final String userUid) throws LockNotExistsException, LockProtectedException {
54                 //TODO:
55         }
56
57         /** 
58          * Unlock all datas rox for one user.
59          * @param userUid User uid
60          */
61         @Override
62         public void unlockAll(String userUid) {
63                 // TODO Auto-generated method stub
64
65         }
66         
67         /**
68          * Check lock on a data row in a table for a user.
69          * @param rowUid Row uid
70          * @param tableUid Table uid
71          * @param userUid User uid
72          * @throws LockNotExistsException when lock does not exist
73          * @throws LockProtectedException lock exists for another user
74          * @throws LockOutdatedException when lock on object is in timeout but the
75          * owner of lock is another user
76          */
77         public void check(final String rowUid, final String tableUid, final String userUid) throws LockNotExistsException, LockProtectedException, LockOutdatedException {
78                 //TODO:
79         }
80         
81
82 }