001/*
002 * Copyright 2009-2017 UnboundID Corp.
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2009-2017 UnboundID Corp.
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk.migrate.ldapjdk;
022
023
024
025import java.io.Serializable;
026
027import com.unboundid.util.NotExtensible;
028import com.unboundid.util.NotMutable;
029import com.unboundid.util.ThreadSafety;
030import com.unboundid.util.ThreadSafetyLevel;
031
032
033
034/**
035 * This class provides a data structure that may be used when authenticating a
036 * connection used to follow a referral.
037 * <BR><BR>
038 * This class is primarily intended to be used in the process of updating
039 * applications which use the Netscape Directory SDK for Java to switch to or
040 * coexist with the UnboundID LDAP SDK for Java.  For applications not written
041 * using the Netscape Directory SDK for Java, the
042 * {@link com.unboundid.ldap.sdk.ReferralConnector} class should be used
043 * instead.
044 */
045@NotExtensible()
046@NotMutable()
047@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
048public class LDAPRebindAuth
049       implements Serializable
050{
051  /**
052   * The serial version UID to use for this serializable class.
053   */
054  private static final long serialVersionUID = -844389460595019929L;
055
056
057
058  // The DN to use when authenticating.
059  private final String dn;
060
061  // The password to use when authenticating.
062  private final String password;
063
064
065
066  /**
067   * Creates a new LDAP rebind auth object with the provided information.
068   *
069   * @param  dn        The DN to use when authenticating.
070   * @param  password  The password to use when authenticating.
071   */
072  public LDAPRebindAuth(final String dn, final String password)
073  {
074    this.dn       = dn;
075    this.password = password;
076  }
077
078
079
080  /**
081   * Retrieves the DN to use when authenticating.
082   *
083   * @return  The DN to use when authenticating.
084   */
085  public String getDN()
086  {
087    return dn;
088  }
089
090
091
092  /**
093   * Retrieves the password to use when authenticating.
094   *
095   * @return  The password to use when authenticating.
096   */
097  public String getPassword()
098  {
099    return password;
100  }
101}