001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.security.spi.impl.ldap;
018:
019: import org.apache.jetspeed.security.SecurityException;
020:
021: /**
022: * <p>
023: * The ldap user principal DAO.
024: * </p>
025: *
026: * @author <a href="mailto:mike.long@dataline.com">Mike Long </a>, <a
027: * href="mailto:dlestrat@apache.org">David Le Strat</a>
028: */
029: public interface LdapUserPrincipalDao extends LdapPrincipalDao {
030: /**
031: * <p>
032: * Add a user to a group.
033: * </p>
034: *
035: * @param userPrincipalUid The user principal.
036: * @param groupPrincipalUid The group principal.
037: * @throws SecurityException A {@link SecurityException}.
038: */
039: void addGroup(String userPrincipalUid, String groupPrincipalUid)
040: throws SecurityException;
041:
042: /**
043: * <p>
044: * Remove a user from a group.
045: * </p>
046: *
047: * @param userPrincipalUid The user principal.
048: * @param groupPrincipalUid The group principal.
049: * @throws SecurityException A {@link SecurityException}.
050: */
051: void removeGroup(String userPrincipalUid, String groupPrincipalUid)
052: throws SecurityException;
053:
054: /**
055: * <p>
056: * Add a user to a group.
057: * </p>
058: *
059: * @param userPrincipalUid The user principal.
060: * @param rolePrincipalUid The role principal.
061: * @throws SecurityException A {@link SecurityException}.
062: */
063: void addRole(String userPrincipalUid, String rolePrincipalUid)
064: throws SecurityException;
065:
066: /**
067: * <p>
068: * Remove a user from a group.
069: * </p>
070: *
071: * @param userPrincipalUid The user principal.
072: * @param rolePrincipalUid The role principal.
073: * @throws SecurityException A {@link SecurityException}.
074: */
075: void removeRole(String userPrincipalUid, String rolePrincipalUid)
076: throws SecurityException;
077:
078: /**
079: * <p>
080: * Return an array of the group principal UIDS that belong to a specific user.
081: * </p>
082: *
083: * @param userPrincipalUid The user principal uid.
084: * @return The array of group uids asociated with this user
085: * @throws SecurityException A {@link SecurityException}.
086: */
087: String[] getGroupUidsForUser(String userPrincipalUid)
088: throws SecurityException;
089:
090: /**
091: * <p>
092: * Return an array of the role principal UIDS that belong to a specific user.
093: * </p>
094: *
095: * @param userPrincipalUid The user principal uid.
096: * @return The array of group uids asociated with this user
097: * @throws SecurityException A {@link SecurityException}.
098: */
099: String[] getRoleUidsForUser(String userPrincipalUid)
100: throws SecurityException;
101:
102: /**
103: * <p>
104: * Return an array of the user principal uids that belong to a group.
105: * </p>
106: *
107: * @param groupPrincipalUid The group uid.
108: * @return The array of user uids asociated with this group
109: * @throws SecurityException A {@link SecurityException}.
110: */
111: String[] getUserUidsForGroup(String groupPrincipalUid)
112: throws SecurityException;
113:
114: /**
115: * <p>
116: * Return an array of the user principal uids that belong to a role.
117: * </p>
118: *
119: * @param rolePrincipalUid The role uid.
120: * @return The array of user uids asociated with this group
121: * @throws SecurityException A {@link SecurityException}.
122: */
123: String[] getUserUidsForRole(String rolePrincipalUid)
124: throws SecurityException;
125:
126: /**
127: * <p>
128: * Return an array of the role principal UIDS that belong to a specific group.
129: * </p>
130: *
131: * @param groupPrincipalUid The group principal uid.
132: * @return The array of role uids asociated with this user
133: * @throws SecurityException A {@link SecurityException}.
134: */
135: String[] getRolesForGroup(String groupPrincipalUid)
136: throws SecurityException;
137:
138: /**
139: * <p>
140: * Add a role to a group.
141: * </p>
142: *
143: * @param groupPrincipalUid The group principal.
144: * @param rolePrincipalUid The role principal.
145: * @throws SecurityException A {@link SecurityException}.
146: */
147: void addRoleToGroup(String groupPrincipalUid,
148: String rolePrincipalUid) throws SecurityException;
149:
150: /**
151: * <p>
152: * Remove a role from a group.
153: * </p>
154: *
155: * @param groupPrincipalUid The group principal.
156: * @param rolePrincipalUid The role principal.
157: * @throws SecurityException A {@link SecurityException}.
158: */
159: void removeRoleFromGroup(String groupPrincipalUid,
160: String rolePrincipalUid) throws SecurityException;
161:
162: }
|