mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-09-12 07:10:07 +02:00
Update session for the same user.
This commit is contained in:
parent
6560973237
commit
07c8a1d8c7
@ -41,4 +41,6 @@ public interface LockManager {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user) throws WiseMappingException;
|
LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user) throws WiseMappingException;
|
||||||
|
|
||||||
|
long generateSession();
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,11 @@ class LockManagerImpl implements LockManager {
|
|||||||
return this.lock(mindmap, user, System.nanoTime());
|
return this.lock(mindmap, user, System.nanoTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long generateSession() {
|
||||||
|
return System.nanoTime();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user, long session) throws WiseMappingException {
|
public LockInfo lock(@NotNull Mindmap mindmap, @NotNull User user, long session) throws WiseMappingException {
|
||||||
|
@ -163,7 +163,7 @@ public class MindmapController {
|
|||||||
} else {
|
} else {
|
||||||
final LockInfo lock = lockManager.lock(mindmap, collaborator);
|
final LockInfo lock = lockManager.lock(mindmap, collaborator);
|
||||||
model.addAttribute("lockTimestamp", lock.getTimestamp());
|
model.addAttribute("lockTimestamp", lock.getTimestamp());
|
||||||
model.addAttribute(LOCK_SESSION_ATTRIBUTE, lock.getSession());
|
model.addAttribute(LOCK_SESSION_ATTRIBUTE, lockManager.generateSession());
|
||||||
}
|
}
|
||||||
model.addAttribute("lockInfo", lockManager.getLockInfo(mindmap));
|
model.addAttribute("lockInfo", lockManager.getLockInfo(mindmap));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user