2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6 * ===========================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END====================================================
22 package org.onap.aaf.cadi;
24 import java.security.Principal;
25 import java.util.List;
30 * LUR: Local User Registry
32 * Concept by Robert Garskof, Implementation by Jonathan Gathman
34 * Where we can keep local copies of users and roles for faster Authorization when asked.
36 * Note: Author cannot resist the mental image of using a Fishing Lure to this LUR pattern
41 public interface Lur {
43 * Allow the Lur, which has correct Permission access, to create and hand back.
45 public Permission createPerm(String p);
48 * Fish for Principals in a Pond
50 * or more boringly, is the User identified within a named collection representing permission.
52 * @param principalName
55 public boolean fish(Principal bait, Permission ... pond);
58 * Fish all the Principals out a Pond
60 * For additional humor, pronounce the following with a Southern Drawl, "FishOil"
62 * or more boringly, load the List with Permissions found for Principal
64 * @param principalName
67 public void fishAll(Principal bait, List<Permission> permissions);
70 * Allow implementations to disconnect, or cleanup resources if unneeded
72 public void destroy();
75 * Does this LUR handle this pond exclusively? Important for EpiLUR to determine whether
76 * to try another (more expensive) LUR
80 public boolean handlesExclusively(Permission ... pond);
83 * Does the LUR support a particular kind of Principal
84 * This can be used to check name's domain, like above, or Principal type
86 public boolean handles(Principal principal);
89 * Clear: Clear any Caching, if exists
91 public void clear(Principal p, StringBuilder report);