001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.server.annotations; 021 022 023import java.lang.annotation.Documented; 024import java.lang.annotation.ElementType; 025import java.lang.annotation.Inherited; 026import java.lang.annotation.Retention; 027import java.lang.annotation.RetentionPolicy; 028import java.lang.annotation.Target; 029 030import org.apache.directory.server.constants.ServerDNConstants; 031 032 033/** 034 * A annotation used to define a LdapServer configuration. Many elements can be configured : 035 * <ul> 036 * <li> The server ID (or name)</li> 037 * <li>primary realm</li> 038 * <li>service principal</li> 039 * <li>maximum ticket lifetime</li> 040 * <li>maximum renewable lifetime</li> 041 * </ul> 042 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 043 */ 044@Documented 045@Inherited 046@Retention(RetentionPolicy.RUNTIME) 047@Target( 048 { ElementType.METHOD, ElementType.TYPE }) 049public @interface CreateKdcServer 050{ 051 /** @return The instance name */ 052 String name() default "DefaultKrbServer"; 053 054 055 /** @return The transports to use, default to LDAP */ 056 CreateTransport[] transports() default 057 {}; 058 059 060 /** @return The default kdc realm */ 061 String primaryRealm() default "EXAMPLE.COM"; 062 063 064 /** @return The default kdc service principal */ 065 String kdcPrincipal() default "krbtgt/EXAMPLE.COM@EXAMPLE.COM"; 066 067 068 /** @return The maximum ticket lifetime. */ 069 long maxTicketLifetime() default 60000 * 1440; 070 071 072 /** @return The maximum renewable lifetime. */ 073 long maxRenewableLifetime() default 60000 * 10080; 074 075 /** @return the change password server. 076 * NOTE: this annotation is declared as an array cause there is no 077 * way to define the default value as null for a value in annotation 078 * 079 * Only the one declaration of changepassword server is enough and 080 * the first element alone is taken into consideration, rest of the 081 * array elements will be ignored*/ 082 CreateChngPwdServer[] chngPwdServer() default {}; 083 084 /** @return the DN of the search base for finding users and services */ 085 String searchBaseDn() default ServerDNConstants.USER_EXAMPLE_COM_DN; 086}