123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264 |
- package org.apache.archiva.admin.model.beans;
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
- import javax.xml.bind.annotation.XmlRootElement;
- import java.io.Serializable;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
-
- /**
- * @author Olivier Lamy
- * @since 1.4-M4
- */
- @XmlRootElement(name = "ldapConfiguration")
- public class LdapConfiguration
- implements Serializable
- {
-
-
- /**
- * The LDAP host.
- */
- private String hostName;
-
- /**
- * The LDAP port.
- */
- private int port;
-
- /**
- * ssl LDAP connection.
- */
- private boolean ssl = false;
-
- /**
- * The LDAP base dn.
- */
- private String baseDn;
-
- /**
- * contextFactory to use.
- */
- private String contextFactory;
-
- /**
- * The LDAP bind dn.
- */
- private String bindDn;
-
- /**
- * The LDAP base dn for groups (if empty baseDn is used).
- */
- private String baseGroupsDn;
-
- /**
- * The LDAP password.
- */
- private String password;
-
- /**
- * The LDAP authenticationMethod.
- */
- private String authenticationMethod;
-
- /**
- *
- */
- private boolean bindAuthenticatorEnabled;
-
- /**
- * Will use role name as LDAP group.
- */
- private boolean useRoleNameAsGroup = false;
-
- /**
- * Field extraProperties.
- */
- private Map<String, String> extraProperties = new HashMap<String, String>();
-
- /**
- * field to ease json mapping wrapper on <code>extraProperties</code> field
- */
- private List<PropertyEntry> extraPropertiesEntries;
-
- /**
- * LDAP writable.
- */
- private boolean writable = false;
-
- public LdapConfiguration()
- {
- // no op
- }
-
- public String getHostName()
- {
- return hostName;
- }
-
- public void setHostName( String hostName )
- {
- this.hostName = hostName;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public void setPort( int port )
- {
- this.port = port;
- }
-
- public boolean isSsl()
- {
- return ssl;
- }
-
- public void setSsl( boolean ssl )
- {
- this.ssl = ssl;
- }
-
- public String getBaseDn()
- {
- return baseDn;
- }
-
- public void setBaseDn( String baseDn )
- {
- this.baseDn = baseDn;
- }
-
- public String getContextFactory()
- {
- return contextFactory;
- }
-
- public void setContextFactory( String contextFactory )
- {
- this.contextFactory = contextFactory;
- }
-
- public String getBindDn()
- {
- return bindDn;
- }
-
- public void setBindDn( String bindDn )
- {
- this.bindDn = bindDn;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public void setPassword( String password )
- {
- this.password = password;
- }
-
- public String getAuthenticationMethod()
- {
- return authenticationMethod;
- }
-
- public void setAuthenticationMethod( String authenticationMethod )
- {
- this.authenticationMethod = authenticationMethod;
- }
-
- public Map<String, String> getExtraProperties()
- {
- return extraProperties;
- }
-
- public void setExtraProperties( Map<String, String> extraProperties )
- {
- this.extraProperties = extraProperties;
- }
-
- public boolean isBindAuthenticatorEnabled()
- {
- return bindAuthenticatorEnabled;
- }
-
- public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
- {
- this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
- }
-
- public List<PropertyEntry> getExtraPropertiesEntries()
- {
- extraPropertiesEntries = new ArrayList<>( getExtraProperties().size() );
- for ( Map.Entry<String, String> entry : getExtraProperties().entrySet() )
- {
- extraPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
- }
- return extraPropertiesEntries;
- }
-
- public void setExtraPropertiesEntries( List<PropertyEntry> extraPropertiesEntries )
- {
- this.extraPropertiesEntries = extraPropertiesEntries;
- if ( extraPropertiesEntries != null )
- {
- for ( PropertyEntry propertyEntry : extraPropertiesEntries )
- {
- this.extraProperties.put( propertyEntry.getKey(), propertyEntry.getValue() );
- }
- }
- }
-
- public String getBaseGroupsDn()
- {
- return baseGroupsDn;
- }
-
- public void setBaseGroupsDn( String baseGroupsDn )
- {
- this.baseGroupsDn = baseGroupsDn;
- }
-
- public boolean isWritable()
- {
- return writable;
- }
-
- public void setWritable( boolean writable )
- {
- this.writable = writable;
- }
-
- public boolean isUseRoleNameAsGroup()
- {
- return useRoleNameAsGroup;
- }
-
- public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup )
- {
- this.useRoleNameAsGroup = useRoleNameAsGroup;
- }
- }
|