blob: 33539e48e4667e9e81bb51b5d5573c460f05e84e [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Ray Milkey7bf273c2017-09-27 16:15:15 -070016package org.onosproject.net.flow.oldbatch;
Madan Jampani117aaae2014-10-23 10:04:05 -070017
Madan Jampani117aaae2014-10-23 10:04:05 -070018import java.util.List;
Brian O'Connor72cb19a2015-01-16 16:14:41 -080019import java.util.Set;
Madan Jampani117aaae2014-10-23 10:04:05 -070020
Jordan Haltermanf7554092017-07-30 15:05:51 -070021import com.google.common.collect.ImmutableSet;
22import com.google.common.collect.Lists;
23import org.onosproject.net.DeviceId;
24
Ray Milkeyc4dd7262015-08-21 09:33:42 -070025@Deprecated
26/**
27 * @deprecated in Drake release - no longer a public API
28 */
Madan Jampani117aaae2014-10-23 10:04:05 -070029public class FlowRuleBatchRequest {
30
Brian O'Connor72cb19a2015-01-16 16:14:41 -080031 /**
Hongtao Yin142b7582015-01-21 14:41:30 -080032 * This id is used to carry to id of the original
Brian O'Connor72cb19a2015-01-16 16:14:41 -080033 * FlowOperations and track where this batch operation
34 * came from. The id is unique cluster wide.
35 */
36 private final long batchId;
Madan Jampani117aaae2014-10-23 10:04:05 -070037
Brian O'Connor72cb19a2015-01-16 16:14:41 -080038 private final Set<FlowRuleBatchEntry> ops;
39
Brian O'Connor72cb19a2015-01-16 16:14:41 -080040 public FlowRuleBatchRequest(long batchId, Set<FlowRuleBatchEntry> ops) {
Yuta HIGUCHI9def0472014-10-23 15:51:10 -070041 this.batchId = batchId;
Jordan Haltermanf7554092017-07-30 15:05:51 -070042 this.ops = ImmutableSet.copyOf(ops);
Madan Jampani117aaae2014-10-23 10:04:05 -070043 }
44
Brian O'Connor72cb19a2015-01-16 16:14:41 -080045 public Set<FlowRuleBatchEntry> ops() {
46 return ops;
Madan Jampani117aaae2014-10-23 10:04:05 -070047 }
48
Brian O'Connor72cb19a2015-01-16 16:14:41 -080049 public FlowRuleBatchOperation asBatchOperation(DeviceId deviceId) {
Madan Jampani117aaae2014-10-23 10:04:05 -070050 List<FlowRuleBatchEntry> entries = Lists.newArrayList();
Brian O'Connor72cb19a2015-01-16 16:14:41 -080051 entries.addAll(ops);
52 return new FlowRuleBatchOperation(entries, deviceId, batchId);
Madan Jampani117aaae2014-10-23 10:04:05 -070053 }
Yuta HIGUCHI9def0472014-10-23 15:51:10 -070054
Brian O'Connor72cb19a2015-01-16 16:14:41 -080055 public long batchId() {
Yuta HIGUCHI9def0472014-10-23 15:51:10 -070056 return batchId;
57 }
Madan Jampani117aaae2014-10-23 10:04:05 -070058}