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 java.security.Principal;
20  
21  import org.apache.jetspeed.security.SecurityException;
22  
23  /***
24   * <p>
25   * Generic DAO interface for LDAP principals.
26   * </p>
27   * 
28   * @author <a href="mailto:mike.long@dataline.com">Mike Long </a>, <a
29   *         href="mailto:dlestrat@apache.org">David Le Strat</a>
30   */
31  public interface LdapPrincipalDao extends LdapReadOnlyPrincipalDao
32  {
33      /***
34       * <p>
35       * Makes a new ldap entry for the specified principal.
36       * </p>
37       * 
38       * @param principalUid The principal uid.
39       * @throws SecurityException Throws a {@link SecurityException}.
40       */
41      abstract void create(final String principalUid) throws SecurityException;
42  
43      /***
44       * <p>
45       * Deletes a ldap entry for the specified principal.
46       * </p>
47       * 
48       * @param principalUid The principal uid.
49       * @throws SecurityException Throws a {@link SecurityException}.
50       */
51      abstract void delete(final String principalUid) throws SecurityException;
52  
53      /***
54       * <p>
55       * Search the ldap directory for the principal.
56       * </p>
57       * 
58       * @param principalUid The uid value of the principal.
59       * @param principalType The type of principal.
60       * @return All the objects of this LDAP class type.
61       */
62      Principal[] find(final String principalUid, String principalType) throws SecurityException;
63  
64      /***
65       * <p>
66       * Converts the uid to an ldap acceptable name.
67       * </p>
68       * 
69       * @param uid The uid.
70       * @return The converted name.
71       */
72      String convertUidToLdapAcceptableName(String uid);
73  }