- Finish exclusive locking support.

This commit is contained in:
Paulo Gustavo Veiga
2012-09-30 17:15:01 -03:00
committed by Paulo Gustavo Veiga
parent e5e2e86fce
commit a179875fee
24 changed files with 549 additions and 104 deletions

View File

@@ -45,6 +45,11 @@ public class MindmapServiceImpl
private NotificationService notificationService;
private String adminUser;
final private LockManager lockManager;
public MindmapServiceImpl() {
this.lockManager = new LockManagerImpl();
}
@Override
public boolean hasPermissions(@Nullable User user, int mapId, @NotNull CollaborationRole grantedRole) {
@@ -94,6 +99,11 @@ public class MindmapServiceImpl
if (mindMap.getTitle() == null || mindMap.getTitle().length() == 0) {
throw new WiseMappingException("The tile can not be empty");
}
// Update edition timeout ...
final LockManager lockManager = this.getLockManager();
lockManager.updateExpirationTimeout(mindMap, Utils.getUser());
mindmapManager.updateMindmap(mindMap, saveHistory);
}
@@ -264,6 +274,12 @@ public class MindmapServiceImpl
mindmapManager.updateCollaboration(collaboration);
}
@Override
@NotNull
public LockManager getLockManager() {
return this.lockManager;
}
private Collaboration getCollaborationBy(String email, Set<Collaboration> collaborations) {
Collaboration collaboration = null;