blob: b814a981f3750345728b915f2f4b2b849a3fe827 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska83e090e2014-10-22 14:25:35 -070015 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.flow;
alshabib902d41b2014-10-07 16:52:05 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.flow.FlowRuleBatchEntry.FlowRuleOperation;
alshabib902d41b2014-10-07 16:52:05 -070019
Sho SHIMIZU9639df72015-01-21 13:38:43 -080020import java.util.Optional;
21
alshabib902d41b2014-10-07 16:52:05 -070022
23public class FlowRuleBatchEntry
24 extends BatchOperationEntry<FlowRuleOperation, FlowRule> {
25
Sho SHIMIZU9639df72015-01-21 13:38:43 -080026 private final Optional<Long> id;
Brian O'Connor427a1762014-11-19 18:40:32 -080027
alshabib902d41b2014-10-07 16:52:05 -070028 public FlowRuleBatchEntry(FlowRuleOperation operator, FlowRule target) {
29 super(operator, target);
Sho SHIMIZU9639df72015-01-21 13:38:43 -080030 this.id = Optional.empty();
Brian O'Connor427a1762014-11-19 18:40:32 -080031 }
32
Sho SHIMIZU9639df72015-01-21 13:38:43 -080033 public FlowRuleBatchEntry(FlowRuleOperation operator, FlowRule target, long id) {
Brian O'Connor427a1762014-11-19 18:40:32 -080034 super(operator, target);
Sho SHIMIZU9639df72015-01-21 13:38:43 -080035 this.id = Optional.of(id);
Brian O'Connor427a1762014-11-19 18:40:32 -080036 }
37
Sho SHIMIZU9639df72015-01-21 13:38:43 -080038 public Optional<Long> id() {
Brian O'Connor427a1762014-11-19 18:40:32 -080039 return id;
alshabib902d41b2014-10-07 16:52:05 -070040 }
41
42 public enum FlowRuleOperation {
43 ADD,
44 REMOVE,
45 MODIFY
46 }
47
48}