org.springframework.security.acls.model.AclService Maven / Gradle / Ivy
/*
* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.acls.model;
import java.util.List;
import java.util.Map;
/**
* Provides retrieval of {@link Acl} instances.
*
* @author Ben Alex
*/
public interface AclService {
/**
* Locates all object identities that use the specified parent. This is useful for
* administration tools.
* @param parentIdentity to locate children of
* @return the children (or null if none were found)
*/
List findChildren(ObjectIdentity parentIdentity);
/**
* Same as {@link #readAclsById(List)} except it returns only a single Acl.
*
* This method should not be called as it does not leverage the underlying
* implementation's potential ability to filter Acl entries based on a
* {@link Sid} parameter.
*
* @param object to locate an {@link Acl} for
* @return the {@link Acl} for the requested {@link ObjectIdentity} (never
* null)
* @throws NotFoundException if an {@link Acl} was not found for the requested
* {@link ObjectIdentity}
*/
Acl readAclById(ObjectIdentity object) throws NotFoundException;
/**
* Same as {@link #readAclsById(List, List)} except it returns only a single Acl.
* @param object to locate an {@link Acl} for
* @param sids the security identities for which {@link Acl} information is required
* (may be null to denote all entries)
* @return the {@link Acl} for the requested {@link ObjectIdentity} (never
* null)
* @throws NotFoundException if an {@link Acl} was not found for the requested
* {@link ObjectIdentity}
*/
Acl readAclById(ObjectIdentity object, List sids) throws NotFoundException;
/**
* Obtains all the Acls that apply for the passed Objects.
*
* The returned map is keyed on the passed objects, with the values being the
* Acl instances. Any unknown objects will not have a map key.
*
* @param objects the objects to find {@link Acl} information for
* @return a map with exactly one element for each {@link ObjectIdentity} passed as an
* argument (never null)
* @throws NotFoundException if an {@link Acl} was not found for each requested
* {@link ObjectIdentity}
*/
Map readAclsById(List objects) throws NotFoundException;
/**
* Obtains all the Acls that apply for the passed Objects, but only
* for the security identifies passed.
*
* Implementations MAY provide a subset of the ACLs via this method although
* this is NOT a requirement. This is intended to allow performance optimisations
* within implementations. Callers should therefore use this method in preference to
* the alternative overloaded version which does not have performance optimisation
* opportunities.
*
*
* The returned map is keyed on the passed objects, with the values being the
* Acl instances. Any unknown objects (or objects for which the interested
* Sids do not have entries) will not have a map key.
*
* @param objects the objects to find {@link Acl} information for
* @param sids the security identities for which {@link Acl} information is required
* (may be null to denote all entries)
* @return a map with exactly one element for each {@link ObjectIdentity} passed as an
* argument (never null)
* @throws NotFoundException if an {@link Acl} was not found for each requested
* {@link ObjectIdentity}
*/
Map readAclsById(List objects, List sids) throws NotFoundException;
}