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 Delegating Authenticator configuration.
028 *
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public class DelegatingAuthenticatorBean extends AuthenticatorBean
032{
033    /** The delegate host */
034    @ConfigurationElement(attributeType = "ads-delegateHost")
035    private String delegateHost;
036
037    /** The delegate port */
038    @ConfigurationElement(attributeType = "ads-delegatePort")
039    private int delegatePort;
040
041    /** Tells if we use SSL to connect */
042    @ConfigurationElement(attributeType = "ads-delegateSsl", isOptional = true)
043    private boolean delegateSsl;
044
045
046    /**
047     * @return the delegateHost
048     */
049    public String getDelegateHost()
050    {
051        return delegateHost;
052    }
053
054
055    /**
056     * @param delegateHost the delegateHost to set
057     */
058    public void setDelegateHost( String delegateHost )
059    {
060        this.delegateHost = delegateHost;
061    }
062
063
064    /**
065     * @return the delegatePort
066     */
067    public int getDelegatePort()
068    {
069        return delegatePort;
070    }
071
072
073    /**
074     * @param delegatePort the delegatePort to set
075     */
076    public void setDelegatePort( int delegatePort )
077    {
078        this.delegatePort = delegatePort;
079    }
080
081
082    /**
083     * {@inheritDoc}
084     */
085    public String toString( String tabs )
086    {
087        StringBuilder sb = new StringBuilder();
088
089        sb.append( tabs ).append( "Delegating Authenticator :\n" );
090        sb.append( super.toString( tabs + "  " ) );
091
092        sb.append( tabs ).append( "  delegate host : " ).append( delegateHost ).append( '\n' );
093        sb.append( tabs ).append( "  delegate port : " ).append( delegatePort ).append( '\n' );
094        sb.append( tabs ).append( "  delegate base DN : " ).append( baseDn ).append( '\n' );
095        sb.append( tabs ).append( "  delegate SSL : " ).append( delegateSsl ).append( '\n' );
096
097        return sb.toString();
098    }
099
100
101    /**
102     * {@inheritDoc}
103     */
104    public String toString()
105    {
106        return toString( "" );
107    }
108
109}