<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_40) on Tue Oct 07 13:22:01 CEST 2014 -->
<title>ExceptionUtil (Fluid Operations FedX documentation)</title>
<meta name="date" content="2014-10-07">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet_fedx.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ExceptionUtil (Fluid Operations FedX documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ExceptionUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
                <img src=images/fluidops.png>
            </em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/fluidops/fedx/exception/EntryUpdateException.html" title="class in com.fluidops.fedx.exception"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/fluidops/fedx/exception/FedXException.html" title="class in com.fluidops.fedx.exception"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/fluidops/fedx/exception/ExceptionUtil.html" target="_top">Frames</a></li>
<li><a href="ExceptionUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.fluidops.fedx.exception</div>
<h2 title="Class ExceptionUtil" class="title">Class ExceptionUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.fluidops.fedx.exception.ExceptionUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.39">ExceptionUtil</a>
extends java.lang.Object</pre>
<div class="block">Convenience functions to handle exceptions.</div>
<dl><dt><span class="strong">Author:</span></dt>
  <dd>Andreas Schwarte</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#ExceptionUtil()">ExceptionUtil</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E extends java.lang.Exception&gt;&nbsp;<br>E</code></td>
<td class="colLast"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#changeExceptionMessage(java.lang.String, E, java.lang.Class)">changeExceptionMessage</a></strong>(java.lang.String&nbsp;msgPrefix,
                                            E&nbsp;ex,
                                            java.lang.Class&lt;E&gt;&nbsp;exClazz)</code>
<div class="block">If possible change the message text of the specified exception.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#getExceptionString(java.lang.String, java.lang.Exception)">getExceptionString</a></strong>(java.lang.String&nbsp;msg,
                                    java.lang.Exception&nbsp;ex)</code>
<div class="block">Return the exception in a convenient representation, i.e.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#repairConnection(org.openrdf.repository.RepositoryConnection, java.lang.Exception)">repairConnection</a></strong>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                                java.lang.Exception&nbsp;ex)</code>
<div class="block">Walk the stack trace and in case of SocketException repair the connection of the
 particular endpoint.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static org.openrdf.query.QueryEvaluationException</code></td>
<td class="colLast"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#traceExceptionSource(org.openrdf.repository.RepositoryConnection, org.openrdf.query.QueryEvaluationException, java.lang.String)">traceExceptionSource</a></strong>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                                        org.openrdf.query.QueryEvaluationException&nbsp;ex,
                                        java.lang.String&nbsp;additionalInfo)</code>
<div class="block">Trace the exception source within the exceptions to identify the originating endpoint.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.openrdf.query.QueryEvaluationException</code></td>
<td class="colLast"><code><strong><a href="../../../../com/fluidops/fedx/exception/ExceptionUtil.html#traceExceptionSourceAndRepair(org.openrdf.repository.RepositoryConnection, org.openrdf.query.QueryEvaluationException, java.lang.String)">traceExceptionSourceAndRepair</a></strong>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                                                          org.openrdf.query.QueryEvaluationException&nbsp;ex,
                                                          java.lang.String&nbsp;additionalInfo)</code>
<div class="block">Repair the connection and then trace the exception source.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="ExceptionUtil()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ExceptionUtil</h4>
<pre>public&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.39">ExceptionUtil</a>()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="traceExceptionSource(org.openrdf.repository.RepositoryConnection, org.openrdf.query.QueryEvaluationException, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>traceExceptionSource</h4>
<pre>public static&nbsp;org.openrdf.query.QueryEvaluationException&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.73">traceExceptionSource</a>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                                                              org.openrdf.query.QueryEvaluationException&nbsp;ex,
                                                              java.lang.String&nbsp;additionalInfo)</pre>
<div class="block">Trace the exception source within the exceptions to identify the originating endpoint. The message
 of the provided exception is adapted to "@ endpoint.getId() - %orginalMessage".<p>
 
 Note that in addition HTTP error codes are extracted from the title, if the exception resulted from
 an HTTP error, such as for instance "503 Service unavailable"</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>conn</code> - the connection to identify the the endpoint</dd><dd><code>ex</code> - the exception</dd><dd><code>additionalInfo</code> - additional information that might be helpful, e.g. the subquery</dd>
<dt><span class="strong">Returns:</span></dt><dd>a modified exception with endpoint source</dd></dl>
</li>
</ul>
<a name="traceExceptionSourceAndRepair(org.openrdf.repository.RepositoryConnection, org.openrdf.query.QueryEvaluationException, java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>traceExceptionSourceAndRepair</h4>
<pre>public static&nbsp;org.openrdf.query.QueryEvaluationException&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.111">traceExceptionSourceAndRepair</a>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                                                                       org.openrdf.query.QueryEvaluationException&nbsp;ex,
                                                                       java.lang.String&nbsp;additionalInfo)</pre>
<div class="block">Repair the connection and then trace the exception source.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>conn</code> - </dd><dd><code>ex</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="repairConnection(org.openrdf.repository.RepositoryConnection, java.lang.Exception)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>repairConnection</h4>
<pre>public static&nbsp;void&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.128">repairConnection</a>(org.openrdf.repository.RepositoryConnection&nbsp;conn,
                    java.lang.Exception&nbsp;ex)
                             throws <a href="../../../../com/fluidops/fedx/exception/FedXQueryException.html" title="class in com.fluidops.fedx.exception">FedXQueryException</a>,
                                    <a href="../../../../com/fluidops/fedx/exception/FedXRuntimeException.html" title="class in com.fluidops.fedx.exception">FedXRuntimeException</a></pre>
<div class="block">Walk the stack trace and in case of SocketException repair the connection of the
 particular endpoint.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>conn</code> - the connection to identify the endpoint</dd><dd><code>ex</code> - the exception</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/fluidops/fedx/exception/FedXRuntimeException.html" title="class in com.fluidops.fedx.exception">FedXRuntimeException</a></code> - if the connection could not be repaired</dd>
<dd><code><a href="../../../../com/fluidops/fedx/exception/FedXQueryException.html" title="class in com.fluidops.fedx.exception">FedXQueryException</a></code></dd></dl>
</li>
</ul>
<a name="getExceptionString(java.lang.String, java.lang.Exception)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExceptionString</h4>
<pre>public static&nbsp;java.lang.String&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.155">getExceptionString</a>(java.lang.String&nbsp;msg,
                                  java.lang.Exception&nbsp;ex)</pre>
<div class="block">Return the exception in a convenient representation, i.e. '%msg% (%CLASS%): %ex.getMessage()%'</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>msg</code> - </dd><dd><code>ex</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>the exception in a convenient representation</dd></dl>
</li>
</ul>
<a name="changeExceptionMessage(java.lang.String,java.lang.Exception,java.lang.Class)">
<!--   -->
</a><a name="changeExceptionMessage(java.lang.String, E, java.lang.Class)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>changeExceptionMessage</h4>
<pre>public static&nbsp;&lt;E extends java.lang.Exception&gt;&nbsp;E&nbsp;<a href="../../../../src-html/com/fluidops/fedx/exception/ExceptionUtil.html#line.173">changeExceptionMessage</a>(java.lang.String&nbsp;msgPrefix,
                                                       E&nbsp;ex,
                                                       java.lang.Class&lt;E&gt;&nbsp;exClazz)</pre>
<div class="block">If possible change the message text of the specified exception. This is only possible
 if the provided exception has a public constructor with String and Throwable as argument.
 The new message is set to 'msgPrefix. ex.getMessage()', all other exception elements 
 remain the same.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - </dd><dt><span class="strong">Parameters:</span></dt><dd><code>msgPrefix</code> - </dd><dd><code>ex</code> - </dd><dd><code>exClazz</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ExceptionUtil.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
                <img src=images/fluidops.png>
            </em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/fluidops/fedx/exception/EntryUpdateException.html" title="class in com.fluidops.fedx.exception"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/fluidops/fedx/exception/FedXException.html" title="class in com.fluidops.fedx.exception"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/fluidops/fedx/exception/ExceptionUtil.html" target="_top">Frames</a></li>
<li><a href="ExceptionUtil.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright &#169; 2008-2011 fluid Operations AG. All Rights Reserved.</i>
            </small></p>
</body>
</html>
