Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.flow; |
| 17 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 18 | import java.util.Set; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 19 | |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 20 | import com.google.common.collect.ImmutableSet; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 21 | |
Yuta HIGUCHI | 4b52444 | 2014-10-28 22:23:57 -0700 | [diff] [blame] | 22 | public class CompletedBatchOperation implements BatchOperationResult<FlowRule> { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 23 | |
| 24 | |
| 25 | private final boolean success; |
Yuta HIGUCHI | 4b52444 | 2014-10-28 22:23:57 -0700 | [diff] [blame] | 26 | private final Set<FlowRule> failures; |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 27 | |
Yuta HIGUCHI | 4b52444 | 2014-10-28 22:23:57 -0700 | [diff] [blame] | 28 | public CompletedBatchOperation(boolean success, Set<? extends FlowRule> failures) { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 29 | this.success = success; |
Madan Jampani | 117aaae | 2014-10-23 10:04:05 -0700 | [diff] [blame] | 30 | this.failures = ImmutableSet.copyOf(failures); |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | @Override |
| 34 | public boolean isSuccess() { |
| 35 | return success; |
| 36 | } |
| 37 | |
| 38 | @Override |
Yuta HIGUCHI | 4b52444 | 2014-10-28 22:23:57 -0700 | [diff] [blame] | 39 | public Set<FlowRule> failedItems() { |
alshabib | 193525b | 2014-10-08 18:58:03 -0700 | [diff] [blame] | 40 | return failures; |
| 41 | } |
alshabib | 902d41b | 2014-10-07 16:52:05 -0700 | [diff] [blame] | 42 | |
| 43 | |
| 44 | } |