1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.server.kerberos.shared.store; 21 22 23 import javax.security.auth.kerberos.KerberosPrincipal; 24 25 26 /** 27 * The store interface used by Kerberos services. 28 * 29 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 30 * @version $Rev:330489 $, $Date: 2007-05-22 02:00:43 +0200 (Di, 22 Mai 2007) $ 31 */ 32 public interface PrincipalStore 33 { 34 /** 35 * Add a principal. 36 * 37 * @param entry 38 * @return The name of the principal being added. 39 * @throws Exception 40 */ 41 public String addPrincipal( PrincipalStoreEntry entry ) throws Exception; 42 43 44 /** 45 * Change a principal's password. 46 * 47 * @param principal 48 * @param newPassword 49 * @return The name of the principal whose password is being changed. 50 * @throws Exception 51 */ 52 public String changePassword( KerberosPrincipal principal, String newPassword ) throws Exception; 53 54 55 /** 56 * Delete a principal. 57 * 58 * @param principal 59 * @return The name of the principal being deleted. 60 * @throws Exception 61 */ 62 public String deletePrincipal( KerberosPrincipal principal ) throws Exception; 63 64 65 /** 66 * Get all principals for a given realm. 67 * 68 * @param realm 69 * @return An array of {@link PrincipalStoreEntry}'s. 70 * @throws Exception 71 */ 72 public PrincipalStoreEntry[] getAllPrincipals( String realm ) throws Exception; 73 74 75 /** 76 * Get a {@link PrincipalStoreEntry} given a Kerberos principal. 77 * 78 * @param principal 79 * @return The {@link PrincipalStoreEntry} for the given Kerberos principal. 80 * @throws Exception 81 */ 82 public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception; 83 }