View Javadoc

1   package com.bradmcevoy.http;
2   
3   import com.bradmcevoy.http.exceptions.NotAuthorizedException;
4   
5   /**
6    * A collection which allows locking "unmapped resources". This means that a LOCK
7    * method can effectively create an empty resource which is immediately locked.
8    * Implement this in conjunction with {@see LockableResource} on child resources to fully
9    * support locking.
10   * <P/>
11   * <I>Note that this interface now extends {@see LockableResource} because collection resources
12   * need to implement both in most cases.</I>
13   * <P/>
14   * If, however, you don't want your collection resources to be lockable, just
15   * implement {@see ConditionalCompatibleResource}.
16   * <P/>
17   * See <A HREF="http://www.ettrema.com:8080/browse/MIL-14">http://www.ettrema.com:8080/browse/MIL-14</A>.
18   * <P/>
19   * @author brad
20   */
21  public interface  LockingCollectionResource extends CollectionResource, LockableResource {
22      
23      /**
24       * Create an empty non-collection resource of the given name and immediately
25       * lock it.
26       * <P/>
27       * It is suggested that the implementor have a specific Resource class to act
28       * as the lock null resource. You should consider using the {@see LockNullResource}
29       * interface.
30       *
31       * @see  LockNullResource
32       * 
33       * @param name - the name of the resource to create
34       * @param timeout - in seconds
35       * @param lockInfo
36       * @return
37       */
38      public LockToken createAndLock(String name, LockTimeout timeout, LockInfo lockInfo) throws NotAuthorizedException;
39      
40  }