View Javadoc

1   /*
2    * Copyright 2012 DTO Labs, Inc. (http://dtolabs.com)
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  
18  /*
19  * RundeckJobDeleteBulk.java
20  * 
21  * User: Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
22  * Created: 10/1/12 4:12 PM
23  * 
24  */
25  package org.rundeck.api.domain;
26  
27  import java.util.*;
28  
29  
30  /**
31   * RundeckJobDeleteBulk represents the result of a bulk job delete request and contains
32   * a list of {@link RundeckJobDelete} objects.
33   *
34   * @author Greg Schueler <a href="mailto:greg@dtosolutions.com">greg@dtosolutions.com</a>
35   */
36  public class RundeckJobDeleteBulk implements Iterable<RundeckJobDelete> {
37      private List<RundeckJobDelete> results;
38      private int requestCount;
39      private boolean allsuccessful;
40  
41      public RundeckJobDeleteBulk(List<RundeckJobDelete> results, int requestCount, boolean allsuccessful) {
42          this.results = results;
43          this.requestCount = requestCount;
44          this.allsuccessful = allsuccessful;
45      }
46  
47      public List<RundeckJobDelete> getResults() {
48          return results;
49      }
50  
51      /**
52       * The number of job delete requests processed.
53       */
54      public int getRequestCount() {
55          return requestCount;
56      }
57  
58      /**
59       * True if all job delete requests were successful
60       */
61      public boolean isAllsuccessful() {
62          return allsuccessful;
63      }
64  
65      @Override
66      public Iterator<RundeckJobDelete> iterator() {
67          if(null!=results){
68              return results.iterator();
69          }else{
70              return null;
71          }
72      }
73  
74      @Override
75      public String toString() {
76          return "RundeckJobDeleteBulk{" +
77                 "results=" + results +
78                 ", requestCount=" + requestCount +
79                 ", allsuccessful=" + allsuccessful +
80                 '}';
81      }
82  }