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

org.xins.client.XINSCallException Maven / Gradle / Ivy

The newest version!
/*
 * $Id: XINSCallException.java,v 1.20 2010/09/29 17:21:48 agoubard Exp $
 *
 * See the COPYRIGHT file for redistribution and use restrictions.
 */
package org.xins.client;

import org.xins.common.service.CallException;
import org.xins.common.service.TargetDescriptor;

/**
 * XINS-specific call exception.
 *
 * @version $Revision: 1.20 $ $Date: 2010/09/29 17:21:48 $
 * @author Ernst de Haan
 *
 * @since XINS 1.0.0
 */
public abstract class XINSCallException extends CallException {

   /**
    * Constructs a new XINSCallException based on a short reason,
    * the original request, target called, call duration, detail message and
    * cause exception.
    *
    * @param shortReason
    *    the short reason, cannot be null.
    *
    * @param request
    *    the original request, cannot be null.
    *
    * @param target
    *    descriptor for the target that was attempted to be called, can be null.
    *
    * @param duration
    *    the call duration in milliseconds, must be >= 0.
    *
    * @param detail
    *    a detailed description of the problem, can be null if
    *    there is no more detail.
    *
    * @param cause
    *    the cause exception, can be null.
    *
    * @throws IllegalArgumentException
    *    if shortReason == null
    *          || request == null
    *          || duration < 0.
    */
   XINSCallException(String           shortReason,
                     XINSCallRequest  request,
                     TargetDescriptor target,
                     long             duration,
                     String           detail,
                     Throwable        cause)
   throws IllegalArgumentException {

      // Call superconstructor
      super(shortReason, request, target, duration, detail, cause);
   }

   /**
    * Constructs a new XINSCallException based on a short reason,
    * a XINS call result, detail message and cause exception.
    *
    * @param shortReason
    *    the short reason, cannot be null.
    *
    * @param result
    *    the call result, cannot be null.
    *
    * @param detail
    *    a detailed description of the problem, can be null if
    *    there is no more detail.
    *
    * @param cause
    *    the cause exception, can be null.
    *
    * @throws IllegalArgumentException
    *    if shortReason == null || result == null.
    */
   XINSCallException(String           shortReason,
                     XINSCallResult   result,
                     String           detail,
                     Throwable        cause)
   throws IllegalArgumentException {

      // Call superconstructor
      super(shortReason,
            (result == null) ? null : result.getRequest(),
            (result == null) ? null : result.getSucceededTarget(),
            (result == null) ?   0L : result.getDuration(),
            detail,
            cause);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy