All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.org.jafer.zserver.operations.OperationException Maven / Gradle / Ivy

/**
 * JAFER Toolkit Poject.
 * Copyright (C) 2002, JAFER Toolkit Project, Oxford University.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *
 */

/**
 *  Title: JAFER Toolkit
 *  Description:
 *  Copyright: Copyright (c) 2001
 *  Company: Oxford University
 *
 *@author     Antony Corfield; Matthew Dovey; Colin Tatham
 *@version    1.0
 */

package org.jafer.zserver.operations;
import z3950.v3.PDU;

public class OperationException extends Exception {

  private PDU pduDiagnostic;

/**
 * Creates new OperationException with null as its detail message.
 * The cause is not initialized, and may subsequently be initialized by a
 * call to Throwable.initCause(java.lang.Throwable).
 */
  public OperationException() {}

/**
 * Creates new OperationException with the specified detail message.
 * The cause is not initialized, and may subsequently be initialized by a
 * call to Throwable.initCause(java.lang.Throwable).
 * @param message the detail message.
 */
  public OperationException(String message) {
    super(message);
  }

/**
 * Creates new OperationException with the specified detail message
 * and cause
 * @param message the detail message (which is saved for later retrieval by
 *  the Throwable.getMessage() method).
 * @param cause the cause (which is saved for later retrieval by the
 *  Throwable.getCause() method). A null value is permitted, and indicates that
 *  the cause is nonexistent or unknown.
 */
  public OperationException(String message, Throwable cause) {
    super(message, cause);
  }

/**
 * Constructs a new exception with the specified cause and a detail message of
 * (cause==null ? null : cause.toString()) which typically contains the class
 * and detail message of cause). This constructor is useful for exceptions that
 * are little more than wrappers for other throwables
 * @param cause the cause (which is saved for later retrieval by the
 *  Throwable.getCause() method). A null value is permitted, and indicates that
 *  the cause is nonexistent or unknown.
 */
  public OperationException(Throwable cause) {
    super(cause);
  }

  public OperationException(String message, PDU pduDiagnostic) {

    super (message);
    this.pduDiagnostic = pduDiagnostic;
  }

  public OperationException(String message, PDU pduDiagnostic, Throwable cause) {

    super (message, cause);
    this.pduDiagnostic = pduDiagnostic;
  }

  public PDU getPDUDiagnostic() {

    return pduDiagnostic;
  }

  public boolean hasPDUDiagnostic() {

    return !(pduDiagnostic == null);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy