blob: d47bc2e9dda5b95e59a7b0946be0aaa229654951 [file] [log] [blame]
sangho27462c62015-05-14 00:39:53 -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 */
16
17package org.onosproject.segmentrouting;
18
19import org.onosproject.net.flow.TrafficSelector;
20
21/**
22 * Interface for Segment Routing Policy.
23 */
24public interface Policy {
25 /**
26 * Enums for policy type.
27 */
28 enum Type {
29 // Tunnel flow policy type
30 TUNNEL_FLOW,
31
32 // Load balancing policy type
33 LOADBALANCE,
34
35 // policy to avoid specific routers or links
36 AVOID,
37
38 // Access Control policy type
39 DENY
40 }
41
42 /**
43 * Returns the policy ID.
44 *
45 * @return policy ID
46 */
47 String id();
48
49 /**
50 * Returns the traffic selector object.
51 *
52 * @return TrafficSelector object
53 */
54 TrafficSelector selector();
55
56 /**
57 * Returns the priority of the policy.
58 *
59 * @return priority
60 */
61 int priority();
62
63 /**
64 * Returns the policy type.
65 *
66 * @return policy type
67 */
68 Type type();
69
70 /**
71 * Creates a policy.
72 *
73 * @return true if succeeds, false otherwise
74 */
75 boolean create();
76
77 /**
78 * Removes the policy.
79 *
80 * @return true if succeeds, false otherwise
81 */
82 boolean remove();
83}