1 package org.apache.archiva.admin.model.beans;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.util.ArrayList;
23 import java.util.HashMap;
24 import java.util.List;
28 * @author Olivier Lamy
31 @XmlRootElement( name = "ldapConfiguration" )
32 public class LdapConfiguration
39 private String hostName;
47 * ssl LDAP connection.
49 private boolean ssl = false;
54 private String baseDn;
57 * contextFactory to use.
59 private String contextFactory;
64 private String bindDn;
69 private String password;
72 * The LDAP authenticationMethod.
74 private String authenticationMethod;
79 private boolean bindAuthenticatorEnabled;
82 * Field extraProperties.
84 private Map<String, String> extraProperties = new HashMap<String, String>();
87 * field to ease json mapping wrapper on <code>extraProperties</code> field
89 private List<PropertyEntry> extraPropertiesEntries;
91 public LdapConfiguration()
96 public String getHostName()
101 public void setHostName( String hostName )
103 this.hostName = hostName;
111 public void setPort( int port )
116 public boolean isSsl()
121 public void setSsl( boolean ssl )
126 public String getBaseDn()
131 public void setBaseDn( String baseDn )
133 this.baseDn = baseDn;
136 public String getContextFactory()
138 return contextFactory;
141 public void setContextFactory( String contextFactory )
143 this.contextFactory = contextFactory;
146 public String getBindDn()
151 public void setBindDn( String bindDn )
153 this.bindDn = bindDn;
156 public String getPassword()
161 public void setPassword( String password )
163 this.password = password;
166 public String getAuthenticationMethod()
168 return authenticationMethod;
171 public void setAuthenticationMethod( String authenticationMethod )
173 this.authenticationMethod = authenticationMethod;
176 public Map<String, String> getExtraProperties()
178 return extraProperties;
181 public void setExtraProperties( Map<String, String> extraProperties )
183 this.extraProperties = extraProperties;
186 public boolean isBindAuthenticatorEnabled()
188 return bindAuthenticatorEnabled;
191 public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
193 this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
196 public List<PropertyEntry> getExtraPropertiesEntries()
198 extraPropertiesEntries = new ArrayList<PropertyEntry>( getExtraProperties().size() );
199 for ( Map.Entry<String, String> entry : getExtraProperties().entrySet() )
201 extraPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
203 return extraPropertiesEntries;
206 public void setExtraPropertiesEntries( List<PropertyEntry> extraPropertiesEntries )
208 this.extraPropertiesEntries = extraPropertiesEntries;
209 if ( extraPropertiesEntries != null )
211 for ( PropertyEntry propertyEntry : extraPropertiesEntries )
213 this.extraProperties.put( propertyEntry.getKey(), propertyEntry.getValue() );