1 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 package org.springframework.security.acls;
16
17 import org.springframework.security.acls.objectidentity.ObjectIdentity;
18
19
20 /**
21 * Provides support for creating and storing <code>Acl</code> instances.
22 *
23 * @author Ben Alex
24 * @version $Id: MutableAclService.java 2142 2007-09-21 18:18:21Z luke_t $
25 */
26 public interface MutableAclService extends AclService {
27 //~ Methods ========================================================================================================
28
29 /**
30 * Creates an empty <code>Acl</code> object in the database. It will have no entries. The returned object
31 * will then be used to add entries.
32 *
33 * @param objectIdentity the object identity to create
34 *
35 * @return an ACL object with its ID set
36 *
37 * @throws AlreadyExistsException if the passed object identity already has a record
38 */
39 MutableAcl createAcl(ObjectIdentity objectIdentity)
40 throws AlreadyExistsException;
41
42 /**
43 * Removes the specified entry from the database.
44 *
45 * @param objectIdentity the object identity to remove
46 * @param deleteChildren whether to cascade the delete to children
47 *
48 * @throws ChildrenExistException if the deleteChildren argument was <code>false</code> but children exist
49 */
50 void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren)
51 throws ChildrenExistException;
52
53 /**
54 * Changes an existing <code>Acl</code> in the database.
55 *
56 * @param acl to modify
57 *
58 * @return DOCUMENT ME!
59 *
60 * @throws NotFoundException if the relevant record could not be found (did you remember to use {@link
61 * #createAcl(ObjectIdentity)} to create the object, rather than creating it with the <code>new</code>
62 * keyword?)
63 */
64 MutableAcl updateAcl(MutableAcl acl) throws NotFoundException;
65 }