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 */ 020 package org.apache.directory.server.annotations; 021 022 import java.lang.annotation.Documented; 023 import java.lang.annotation.ElementType; 024 import java.lang.annotation.Inherited; 025 import java.lang.annotation.Retention; 026 import java.lang.annotation.RetentionPolicy; 027 import java.lang.annotation.Target; 028 029 import org.apache.directory.server.factory.DefaultLdapServerFactory; 030 031 032 /** 033 * A annotation used to define a LdapServer configuration. Many elements can be configured : 034 * <ul> 035 * <li> The server ID (or name)</li> 036 * <li> The max time limit</li> 037 * <li> the max size limit</li> 038 * <li> Should it allow anonymous access</li> 039 * <li> The keyStore file</li> 040 * <li> The certificate password</li> 041 * </ul> 042 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 043 * @version $Rev$, $Date$ 044 */ 045 @Documented 046 @Inherited 047 @Retention ( RetentionPolicy.RUNTIME ) 048 @Target ( { ElementType.METHOD, ElementType.TYPE } ) 049 public @interface CreateLdapServer 050 { 051 /** The instance name */ 052 String name() default "DefaultLdapServer"; 053 054 /** The transports to use, default to LDAP */ 055 CreateTransport[] transports() default {}; 056 057 /** The LdapServer factory */ 058 Class<?> factory() default DefaultLdapServerFactory.class; 059 060 /** The maximum size limit.*/ 061 long maxSizeLimit() default 1000; 062 063 /** The maximum time limit. */ 064 int maxTimeLimit() default 1000; 065 066 /** Tells if anonymous access are allowed or not. */ 067 boolean allowAnonymousAccess() default false; 068 069 /** The external keyStore file to use, default to the empty string */ 070 String keyStore() default ""; 071 072 /** The certificate password in base64, default to the empty string */ 073 String certificatePassword() default ""; 074 075 /** name of the classes implementing extended operations */ 076 Class<?>[] extendedOpHandlers() default {}; 077 078 /** supported set of SASL mechanisms */ 079 SaslMechanism[] saslMechanisms() default {}; 080 081 /** NTLM provider class, default value is a invalid class */ 082 Class<?> ntlmProvider() default Object.class; 083 084 /** The name of this host, validated during SASL negotiation. */ 085 String saslHost() default "ldap.example.com"; 086 087 /** The service principal, used by GSSAPI. */ 088 String saslPrincipal() default "ldap/ldap.example.com@EXAMPLE.COM"; 089 }