497f5256d5de0bbb817c663806da5d46d378cbe8
[onosfw.git] /
1 /*
2  * Copyright 2014-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 package org.onosproject.segmentrouting.grouphandler;
17
18 import java.util.List;
19
20 import org.onlab.packet.MacAddress;
21 import org.onosproject.net.DeviceId;
22
23 /**
24  * Mechanism through which group handler module retrieves
25  * the device specific attributes such as segment ID,
26  * Mac address...etc from group handler applications.
27  */
28 public interface DeviceProperties {
29     /**
30      * Returns the segment id of a device to be used in group creation.
31      *
32      * @param deviceId device identifier
33      * @return segment id of a device
34      */
35     int getSegmentId(DeviceId deviceId);
36     /**
37      * Returns the Mac address of a device to be used in group creation.
38      *
39      * @param deviceId device identifier
40      * @return mac address of a device
41      */
42     MacAddress getDeviceMac(DeviceId deviceId);
43     /**
44      * Indicates whether a device is edge device or transit/core device.
45      *
46      * @param deviceId device identifier
47      * @return boolean
48      */
49     boolean isEdgeDevice(DeviceId deviceId);
50     /**
51      * Returns all segment IDs to be considered in building auto
52      *
53      * created groups.
54      * @return list of segment IDs
55      */
56     List<Integer> getAllDeviceSegmentIds();
57 }