View Javadoc
1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  package org.apache.directory.server.config.beans;
21  
22  
23  import org.apache.directory.server.config.ConfigurationElement;
24  
25  
26  /**
27   * A class used to store the SASL mechanism handler configuration.
28   *
29   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30   */
31  public class SaslMechHandlerBean extends AdsBaseBean
32  {
33      /** The SASL mechanism handler */
34      @ConfigurationElement(attributeType = "ads-saslMechName", isRdn = true)
35      private String saslMechName;
36  
37      /** The SASL mechanism handler FQCN */
38      @ConfigurationElement(attributeType = "ads-saslMechClassName")
39      private String saslMechClassName;
40  
41      /** The NTLM provider */
42      @ConfigurationElement(attributeType = "ads-ntlmMechProvider", isOptional = true)
43      private String ntlmMechProvider;
44  
45  
46      /**
47       * Create a new LdapServerSaslMechanisHandlerBean instance
48       */
49      public SaslMechHandlerBean()
50      {
51          super();
52      }
53  
54  
55      /**
56       * @return the ldapServerSaslMechName
57       */
58      public String getSaslMechName()
59      {
60          return saslMechName;
61      }
62  
63  
64      /**
65       * @param saslMechName the SaslMechName to set
66       */
67      public void setSaslMechName( String saslMechName )
68      {
69          this.saslMechName = saslMechName;
70      }
71  
72  
73      /**
74       * @return the SaslMechClassName
75       */
76      public String getSaslMechClassName()
77      {
78          return saslMechClassName;
79      }
80  
81  
82      /**
83       * @param saslMechClassName the SaslMechClassName to set
84       */
85      public void setSaslMechClassName( String saslMechClassName )
86      {
87          this.saslMechClassName = saslMechClassName;
88      }
89  
90  
91      /**
92       * @return the NtlmMechProvider
93       */
94      public String getNtlmMechProvider()
95      {
96          return ntlmMechProvider;
97      }
98  
99  
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 }