View Javadoc

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.jdbc;
16  
17  import org.springframework.security.acls.NotFoundException;
18  import org.springframework.security.acls.objectidentity.ObjectIdentity;
19  import org.springframework.security.acls.sid.Sid;
20  
21  import java.util.Map;
22  
23  
24  /**
25   * Performs lookups for {@link org.springframework.security.acls.AclService}.
26   * 
27   * @author Ben Alex
28   * @version $Id: LookupStrategy.java 2866 2008-04-05 08:07:20Z benalex $
29   */
30  public interface LookupStrategy {
31      //~ Methods ========================================================================================================
32  
33      /**
34       * Perform database-specific optimized lookup.
35       *
36       * @param objects the identities to lookup (required)
37       * @param sids the SIDs for which identities are required (may be <tt>null</tt> - implementations may elect not
38       *        to provide SID optimisations)
39       *
40       * @return a <tt>Map</tt> where keys represent the {@link ObjectIdentity} of the located {@link Acl} and values
41       *         are the located {@link Acl} (never <tt>null</tt> although some entries may be missing; this method
42       *         should not throw {@link NotFoundException}, as a chain of {@link LookupStrategy}s may be used
43       *         to automatically create entries if required) 
44       */
45      Map readAclsById(ObjectIdentity[] objects, Sid[] sids);
46  }