001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008 Sun Microsystems, Inc.
015 */
016
017package org.opends.guitools.controlpanel.event;
018
019//Note: in terms of synchronization, this implementation assumes that the
020//interrupt method is only called in the event thread (this class is used
021//when the user selects a node in the LDAP entry browser).
022/**
023 * The event that is create when there is an error reading an entry.  It is
024 * used in the LDAP entry browser to notify of this kind of errors.
025 */
026public class EntryReadErrorEvent
027{
028  private Object source;
029  private Throwable t;
030  private String dn;
031
032  /**
033   * Constructor for the event.
034   * @param source the source of this event.
035   * @param dn the DN of the entry we were searching.
036   * @param t the throwable that we got as error.
037   */
038  public EntryReadErrorEvent(Object source, String dn, Throwable t)
039  {
040    this.source = source;
041    this.t = t;
042    this.dn = dn;
043  }
044
045  /**
046   * Returns the source of the event.
047   * @return the source of the event.
048   */
049  public Object getSource()
050  {
051    return source;
052  }
053
054  /**
055   * Returns the throwable that we got as error.
056   * @return the throwable that we got as error.
057   */
058  public Throwable getError()
059  {
060    return t;
061  }
062
063  /**
064   * Returns the DN of the entry we were searching.
065   * @return the DN of the entry we were searching.
066   */
067  public String getDN()
068  {
069    return dn;
070  }
071}