@@ -0,0 +1,2486 @@
+/*%0D%0A * Copyright 2015 MarkLogic Corporation%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *    http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0Apackage com.marklogic.client.datamovement;%0D%0A%0D%0Aimport com.marklogic.client.DatabaseClient;%0D%0Aimport com.marklogic.client.io.Format;%0D%0A%0D%0Apublic class QueryBatchException extends Exception implements QueryEvent %7B%0D%0A  private QueryEvent queryEvent;%0D%0A%0D%0A  public QueryBatchException(QueryEvent queryEvent, Throwable cause) %7B%0D%0A    super(cause);%0D%0A    this.queryEvent = queryEvent;%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public QueryBatcher getBatcher() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getBatcher();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public DatabaseClient getClient() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getClient();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public long getJobBatchNumber() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getJobBatchNumber();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public long getJobResultsSoFar() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getJobResultsSoFar();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public long getForestBatchNumber() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getForestBatchNumber();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public long getForestResultsSoFar() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getForestResultsSoFar();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public Forest getForest() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getForest();%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public long getServerTimestamp() %7B%0D%0A    if ( queryEvent == null ) throw new IllegalStateException(%22QueryEvent is null%22);%0D%0A    return queryEvent.getServerTimestamp();%0D%0A  %7D%0D%0A%7D%0D%0A

fix #531 -- rename QueryHostException to QueryBatchException to align better with QueryBatch and QueryBatcher