blob: 93f62ac9726fb33dd0b987594a7c108c278079ea [file] [log] [blame]
alshabibfaa1e362015-04-02 15:01:54 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.net.flowobjective;
17
18import org.onosproject.net.flow.criteria.Criterion;
19
20import java.util.Collection;
21
22/**
23 * Represents a filtering flow objective. Each filter is mapping
24 * from a criterion to a collection of criteria. The mapping will
25 * be used by a device driver to construct the actual flow rules to
26 * be installed on the device.
27 */
28public interface FilteringObjective extends Objective {
29
30 /**
31 * Represents filtering key used in this filter.
32 *
33 * @return a criterion
34 */
35 Criterion key();
36
37 /**
38 * The set of conditions the filter must provision at the device.
39 *
40 * @return a collection of criteria
41 */
42 Collection<Criterion> conditions();
43
44 /**
45 * Builder of Filtering objective entities.
46 */
47 public interface Builder extends Objective.Builder {
48
49 /**
50 * Add a filtering condition.
51 *
52 * @param criterion new criterion
53 * @return a filtering builder
54 */
55 public Builder addCondition(Criterion criterion);
56
57 /**
58 * Add a filtering key.
59 *
60 * @param criterion new criterion
61 * @return a filtering builder.
62 */
63 public Builder withKey(Criterion criterion);
64
65 /**
66 * Builds the filtering objective that will be added.
67 *
68 * @return a filtering objective
69 */
70 public FilteringObjective add();
71
72 /**
73 * Builds the filtering objective that will be removed.
74 *
75 * @return a filtering objective.
76 */
77 public FilteringObjective remove();
78
79
80 }
81
82}