View Javadoc

1   /*
2   * Licensed to the Apache Software Foundation (ASF) under one or more
3   * contributor license agreements.  See the NOTICE file distributed with
4   * this work for additional information regarding copyright ownership.
5   * The ASF licenses this file to You under the Apache License, Version 2.0
6   * (the "License"); you may not use this file except in compliance with
7   * the License.  You may obtain a copy of the License at
8   *
9   *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17  package org.apache.jetspeed.security.spi.impl.ldap;
18  
19  import javax.naming.NamingException;
20  import javax.naming.directory.SearchControls;
21  
22  public interface LdapMembershipDao {
23  
24  	public abstract String[] searchGroupMemberShipByGroup(
25  			final String userPrincipalUid, SearchControls cons)
26  			throws NamingException;
27  
28  	public abstract String[] searchGroupMemberShipByUser(
29  			final String userPrincipalUid, SearchControls cons)
30  			throws NamingException;
31  
32  	public abstract String[] searchRoleMemberShipByRole(
33  			final String userPrincipalUid, SearchControls cons)
34  			throws NamingException;
35  
36  	public abstract String[] searchRoleMemberShipByUser(
37  			final String userPrincipalUid, SearchControls cons)
38  			throws NamingException;
39  
40  	/***
41  	 * <p>
42  	 * Search user by group using the GroupMembershipAttribute.
43  	 * </p>
44  	 * 
45  	 * @param groupPrincipalUid
46  	 * @param cons
47  	 * @return
48  	 * @throws NamingException A {@link NamingException}.
49  	 */
50  	public abstract String[] searchUsersFromGroupByGroup(
51  			final String groupPrincipalUid, SearchControls cons)
52  			throws NamingException;
53  
54  	/***
55  	 * <p>
56  	 * Search user by group using the UserGroupMembershipAttribute.
57  	 * </p>
58  	 * 
59  	 * @param groupPrincipalUid
60  	 * @param cons
61  	 * @return
62  	 * @throws NamingException A {@link NamingException}.
63  	 */
64  	public abstract String[] searchUsersFromGroupByUser(
65  			final String groupPrincipalUid, SearchControls cons)
66  			throws NamingException;
67  
68  	/***
69  	 * <p>
70  	 * Search user by role using the RoleMembershipAttribute.
71  	 * </p>
72  	 * 
73  	 * @param groupPrincipalUid
74  	 * @param cons
75  	 * @return
76  	 * @throws NamingException A {@link NamingException}.
77  	 */
78  	public abstract String[] searchUsersFromRoleByRole(
79  			final String rolePrincipalUid, SearchControls cons)
80  			throws NamingException;
81  
82  	/***
83  	 * <p>
84  	 * Search user by role using the UserRoleMembershipAttribute.
85  	 * </p>
86  	 * 
87  	 * @param groupPrincipalUid
88  	 * @param cons
89  	 * @return
90  	 * @throws NamingException A {@link NamingException}.
91  	 */
92  	public abstract String[] searchUsersFromRoleByUser(
93  			final String groupPrincipalUid, SearchControls cons)
94  			throws NamingException;
95  	
96  	public abstract String[] searchRolesFromGroupByGroup(final String groupPrincipalUid,
97  			SearchControls cons) throws NamingException;
98  
99  	public abstract String[] searchRolesFromGroupByRole(final String groupPrincipalUid,
100 			SearchControls cons) throws NamingException;
101 
102 }