Community
Participate
Working Groups
An app might want to prevent a lockArea from being loaded by a user different from the one that created it originally. The LockArea class itself already supports this by saving the userID along with the locks. We need to add the following check, or (more likely) some mechanism that allows the following check to be invoked: String userID = lockArea.getUserID(); if (userID != null && !userID.equals(session.getUserID()) { throw new SecurityEx("Yada yada"); }
Ideas from our Skype discussion: interface DurableViewHandler { void openingView(); void openedView(); void closedView(); } Invoke openingView from within LockManager.openView. But where to add #addDurableViewHandler(..) ? On a new interface IRWDurableLockManager which derives from IDurableLockingManager...
Created attachment 203741 [details] Patch v1
Created attachment 203825 [details] Patch v2 I've moved common.locks.IDurableLockingManager to server.ILockingManager and added a new getter to IRepository. Please let me know what you think about my changes.
Included a slight change to ConcurrentArray, formerly known as FastList. Committed revision 9266.
Reopening to fix failure of testDurableViewHandler() if repo is restarted...
Adding: public DurableViewHandler[] getDurableViewHandlers() { return durableViewHandlers.get(); }
Fixing test: public class LockingManagerRestartRepositoryTest extends LockingManagerRestartSessionTest { protected void doBetweenSessionCloseAndOpen() { DurableViewHandler[] handlers = getRepository().getLockingManager().getDurableViewHandlers(); restartRepository(); for (DurableViewHandler handler : handlers) { getRepository().getLockingManager().addDurableViewHandler(handler); } } }
Closing.