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.factory.DefaultLdapServerFactory; 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> The max time limit</li> 038 * <li> the max size limit</li> 039 * <li> Should it allow anonymous access</li> 040 * <li> The keyStore file</li> 041 * <li> The certificate password</li> 042 * </ul> 043 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 044 */ 045@Documented 046@Inherited 047@Retention(RetentionPolicy.RUNTIME) 048@Target( 049 { ElementType.METHOD, ElementType.TYPE }) 050public @interface CreateLdapServer 051{ 052 /** @return The instance name */ 053 String name() default "DefaultLdapServer"; 054 055 056 /** @return The transports to use, default to LDAP */ 057 CreateTransport[] transports() default 058 {}; 059 060 061 /** @return The LdapServer factory */ 062 Class<?> factory() default DefaultLdapServerFactory.class; 063 064 065 /** @return The maximum size limit.*/ 066 long maxSizeLimit() default 1000; 067 068 069 /** @return The maximum time limit. */ 070 int maxTimeLimit() default 1000; 071 072 073 /** @return Tells if anonymous access are allowed or not. */ 074 boolean allowAnonymousAccess() default false; 075 076 077 /** @return The external keyStore file to use, default to the empty string */ 078 String keyStore() default ""; 079 080 081 /** @return The certificate password in base64, default to the empty string */ 082 String certificatePassword() default ""; 083 084 085 /** @return name of the classes implementing extended operations */ 086 Class<?>[] extendedOpHandlers() default 087 {}; 088 089 090 /** @return supported set of SASL mechanisms */ 091 SaslMechanism[] saslMechanisms() default 092 {}; 093 094 095 /** @return NTLM provider class, default value is a invalid class */ 096 Class<?> ntlmProvider() default Object.class; 097 098 099 /** @return The name of this host, validated during SASL negotiation. */ 100 String saslHost() default "ldap.example.com"; 101 102 103 /** @return The name of this host, validated during SASL negotiation. */ 104 String[] saslRealms() default {"example.com"}; 105 106 107 /** @return The service principal, used by GSSAPI. */ 108 String saslPrincipal() default "ldap/ldap.example.com@EXAMPLE.COM"; 109}