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 Delegating Authenticator configuration.
28   *
29   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
30   */
31  public class DelegatingAuthenticatorBean extends AuthenticatorBean
32  {
33      /** The delegate host */
34      @ConfigurationElement(attributeType = "ads-delegateHost")
35      private String delegateHost;
36  
37      /** The delegate port */
38      @ConfigurationElement(attributeType = "ads-delegatePort")
39      private int delegatePort;
40  
41      /** Tells if we use SSL to connect */
42      @ConfigurationElement(attributeType = "ads-delegateSsl", isOptional = true)
43      private boolean delegateSsl;
44  
45  
46      /**
47       * @return the delegateHost
48       */
49      public String getDelegateHost()
50      {
51          return delegateHost;
52      }
53  
54  
55      /**
56       * @param delegateHost the delegateHost to set
57       */
58      public void setDelegateHost( String delegateHost )
59      {
60          this.delegateHost = delegateHost;
61      }
62  
63  
64      /**
65       * @return the delegatePort
66       */
67      public int getDelegatePort()
68      {
69          return delegatePort;
70      }
71  
72  
73      /**
74       * @param delegatePort the delegatePort to set
75       */
76      public void setDelegatePort( int delegatePort )
77      {
78          this.delegatePort = delegatePort;
79      }
80  
81  
82      /**
83       * {@inheritDoc}
84       */
85      @Override
86      public String toString( String tabs )
87      {
88          StringBuilder sb = new StringBuilder();
89  
90          sb.append( tabs ).append( "Delegating Authenticator :\n" );
91          sb.append( super.toString( tabs + "  " ) );
92  
93          sb.append( tabs ).append( "  delegate host : " ).append( delegateHost ).append( '\n' );
94          sb.append( tabs ).append( "  delegate port : " ).append( delegatePort ).append( '\n' );
95          sb.append( tabs ).append( "  delegate base DN : " ).append( baseDn ).append( '\n' );
96          sb.append( tabs ).append( "  delegate SSL : " ).append( delegateSsl ).append( '\n' );
97  
98          return sb.toString();
99      }
100 
101 
102     /**
103      * {@inheritDoc}
104      */
105     @Override
106     public String toString()
107     {
108         return toString( "" );
109     }
110 
111 }