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 */
026package org.opends.server.protocols.jmx;
027
028import org.opends.server.api.ClientConnection;
029
030
031/**
032 * Represents a Ldap credential used for JMX connection authentication.
033 * <p>
034 * In JMX Connection, one and only one instance of this class is expected
035 * to be found in each of the <code>publicCredentials</code> and
036 * <code>privateCredentials</code> sets of
037 * {@link javax.security.auth.Subject}. Those are the Jmx Client connection
038 * that will handle incoming requests.
039 */
040public class Credential
041{
042  /**
043   * The Client connection to be used.
044   */
045  private ClientConnection clientConnection;
046
047
048  /**
049   * Default Constructor.
050   *
051   * @param clientConnection
052   *           The  representation of this credential is a Jmx Client connection
053   * that will handle incoming requests.
054   */
055  public Credential(ClientConnection clientConnection)
056  {
057    this.clientConnection = clientConnection;
058  }
059
060  /**
061   * Returns the associated Client connection.
062   *
063   * @return the associated ClientConnection object. Can be null
064   */
065  public ClientConnection getClientConnection()
066  {
067    return clientConnection;
068  }
069}