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.config.beans;
021
022
023import org.apache.directory.server.config.ConfigurationElement;
024
025
026/**
027 * A class used to store the SASL mechanism handler configuration.
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public class SaslMechHandlerBean extends AdsBaseBean
032{
033    /** The SASL mechanism handler */
034    @ConfigurationElement(attributeType = "ads-saslMechName", isRdn = true)
035    private String saslMechName;
036
037    /** The SASL mechanism handler FQCN */
038    @ConfigurationElement(attributeType = "ads-saslMechClassName")
039    private String saslMechClassName;
040
041    /** The NTLM provider */
042    @ConfigurationElement(attributeType = "ads-ntlmMechProvider", isOptional = true)
043    private String ntlmMechProvider;
044
045
046    /**
047     * Create a new LdapServerSaslMechanisHandlerBean instance
048     */
049    public SaslMechHandlerBean()
050    {
051        super();
052    }
053
054
055    /**
056     * @return the ldapServerSaslMechName
057     */
058    public String getSaslMechName()
059    {
060        return saslMechName;
061    }
062
063
064    /**
065     * @param saslMechName the SaslMechName to set
066     */
067    public void setSaslMechName( String saslMechName )
068    {
069        this.saslMechName = saslMechName;
070    }
071
072
073    /**
074     * @return the SaslMechClassName
075     */
076    public String getSaslMechClassName()
077    {
078        return saslMechClassName;
079    }
080
081
082    /**
083     * @param saslMechClassName the SaslMechClassName to set
084     */
085    public void setSaslMechClassName( String saslMechClassName )
086    {
087        this.saslMechClassName = saslMechClassName;
088    }
089
090
091    /**
092     * @return the NtlmMechProvider
093     */
094    public String getNtlmMechProvider()
095    {
096        return ntlmMechProvider;
097    }
098
099
100    /**
101     * @param ntlmMechProvider the NtlmMechProvider to set
102     */
103    public void setNtlmMechProvider( String ntlmMechProvider )
104    {
105        this.ntlmMechProvider = ntlmMechProvider;
106    }
107
108
109    /**
110     * {@inheritDoc}
111     */
112    @Override
113    public String toString( String tabs )
114    {
115        StringBuilder sb = new StringBuilder();
116
117        sb.append( tabs ).append( "SASL mechanism handler :\n" );
118        sb.append( tabs ).append( "  SASL mechanism name :" ).append( saslMechName ).append( '\n' );
119        sb.append( tabs ).append( "  SASL mechanism class name :" ).append( saslMechClassName ).append( '\n' );
120        sb.append( toString( tabs, "  NTLM mechanism provider", ntlmMechProvider ) );
121
122        return sb.toString();
123    }
124
125
126    /**
127     * {@inheritDoc}
128     */
129    @Override
130    public String toString()
131    {
132        return toString( "" );
133    }
134}