001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2008 Sun Microsystems, Inc.
025 *      Portions Copyright 2014-2015 ForgeRock AS
026 */
027package org.opends.server.extensions;
028
029import javax.net.ssl.TrustManager;
030
031import org.opends.server.admin.std.server.TrustManagerProviderCfg;
032import org.opends.server.api.TrustManagerProvider;
033import org.forgerock.opendj.config.server.ConfigException;
034import org.opends.server.types.DirectoryException;
035import org.opends.server.types.InitializationException;
036
037/**
038 * This class provides an implementation of a trust manager provider that does
039 * not actually have the ability to provide a trust manager.  It will be used
040 * when no other trust manager provider has been defined in the server
041 * configuration.
042 */
043public class NullTrustManagerProvider
044       extends TrustManagerProvider<TrustManagerProviderCfg>
045{
046  /**
047   * Creates a new instance of this null trust manager provider.  The
048   * <CODE>initializeTrustManagerProvider</CODE> method must be called on the
049   * resulting object before it may be used.
050   */
051  public NullTrustManagerProvider()
052  {
053    // No implementation is required.
054  }
055
056
057
058  /** {@inheritDoc} */
059  public void initializeTrustManagerProvider(
060                     TrustManagerProviderCfg configuration)
061         throws ConfigException, InitializationException
062  {
063    // No implementation is required.
064  }
065
066
067
068  /**
069   * Performs any finalization that may be necessary for this trust manager
070   * provider.
071   */
072  public void finalizeTrustManagerProvider()
073  {
074    // No implementation is required.
075  }
076
077
078
079  /**
080   * Retrieves a <CODE>TrustManager</CODE> object that may be used for
081   * interactions requiring access to a trust manager.
082   *
083   * @return  A <CODE>TrustManager</CODE> object that may be used for
084   *          interactions requiring access to a trust manager.
085   *
086   * @throws  DirectoryException  If a problem occurs while attempting to obtain
087   *                              the set of trust managers.
088   */
089  public TrustManager[] getTrustManagers()
090         throws DirectoryException
091  {
092    return new TrustManager[0];
093  }
094}
095