Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / search / AddException.java
blob840316756072da90901cd807028da515e97b9c7a
1 // Copyright 2011 Google Inc. All rights reserved.
2 package com.google.appengine.api.search;
4 import java.util.ArrayList;
5 import java.util.List;
7 /**
8 * Thrown to indicate that a search service failure occurred while adding
9 * objects to the index.
12 public class AddException extends SearchBaseException {
13 private static final long serialVersionUID = 3608247775865189592L;
15 private final List<OperationResult> results;
16 private final List<String> ids;
18 /**
19 * Constructs an exception when some error occurred in
20 * the search service when adding some objects to the index.
22 * @param operationResult the error code and message detail associated with
23 * the failure
25 public AddException(OperationResult operationResult) {
26 this(operationResult, new ArrayList<OperationResult>(), new ArrayList<String>());
29 /**
30 * Constructs an exception when some error occurred in
31 * the search service when adding some objects to the index.
33 * @param operationResult the error code and message detail associated with
34 * the failure
35 * @param results the list of {@link OperationResult} where each result is
36 * associated with an object that was requested to be added to the index
37 * @param ids the list of Ids of the object requested to be
38 * added to the index. The search service may provide an Id if none was given
39 * for an object
41 public AddException(OperationResult operationResult,
42 List<OperationResult> results, List<String> ids) {
43 super(operationResult);
44 this.results = results;
45 this.ids = ids;
48 /**
49 * @return the list of {@link OperationResult} where each result is
50 * associated with a request to be add to the index
52 public List<OperationResult> getResults() {
53 return results;
56 /**
57 * @return the list of Ids of objects that were requested to be added to
58 * the index
60 public List<String> getIds() {
61 return ids;