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 2008 Sun Microsystems, Inc.
025 */
026
027package org.opends.guitools.controlpanel.event;
028
029//Note: in terms of synchronization, this implementation assumes that the
030//interrupt method is only called in the event thread (this class is used
031//when the user selects a node in the LDAP entry browser).
032/**
033 * The event that is create when there is an error reading an entry.  It is
034 * used in the LDAP entry browser to notify of this kind of errors.
035 */
036public class EntryReadErrorEvent
037{
038  private Object source;
039  private Throwable t;
040  private String dn;
041
042  /**
043   * Constructor for the event.
044   * @param source the source of this event.
045   * @param dn the DN of the entry we were searching.
046   * @param t the throwable that we got as error.
047   */
048  public EntryReadErrorEvent(Object source, String dn, Throwable t)
049  {
050    this.source = source;
051    this.t = t;
052    this.dn = dn;
053  }
054
055  /**
056   * Returns the source of the event.
057   * @return the source of the event.
058   */
059  public Object getSource()
060  {
061    return source;
062  }
063
064  /**
065   * Returns the throwable that we got as error.
066   * @return the throwable that we got as error.
067   */
068  public Throwable getError()
069  {
070    return t;
071  }
072
073  /**
074   * Returns the DN of the entry we were searching.
075   * @return the DN of the entry we were searching.
076   */
077  public String getDN()
078  {
079    return dn;
080  }
081}