Generation of Notifications and RPCs from YANG
[controller.git] / opendaylight / hosttracker_new / api / src / main / java / org / opendaylight / controller / hosttracker / IDevice.java
1 /*
2  * Copyright (c) 2011,2012 Big Switch Networks, Inc.
3  *
4  * Licensed under the Eclipse Public License, Version 1.0 (the
5  * "License"); you may not use this file except in compliance with the
6  * License. You may obtain a copy of the License at
7  *
8  *      http://www.eclipse.org/legal/epl-v10.html
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
13  * implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  *
16  * This file incorporates work covered by the following copyright and
17  * permission notice:
18  *
19  *    Originally created by David Erickson, Stanford University
20  *
21  *    Licensed under the Apache License, Version 2.0 (the "License");
22  *    you may not use this file except in compliance with the
23  *    License. You may obtain a copy of the License at
24  *
25  *         http://www.apache.org/licenses/LICENSE-2.0
26  *
27  *    Unless required by applicable law or agreed to in writing,
28  *    software distributed under the License is distributed on an "AS
29  *    IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
30  *    express or implied. See the License for the specific language
31  *    governing permissions and limitations under the License.
32  */
33
34 package org.opendaylight.controller.hosttracker;
35
36 import java.util.Date;
37
38 /**
39  * Represents an independent device on the network. A device consists of a set
40  * of entities, and all the information known about a given device comes only
41  * from merging all associated entities for that device.
42  *
43  * @author readams
44  */
45 public interface IDevice {
46     /**
47      * Get the primary key for this device.
48      *
49      * @return the primary key
50      */
51     public Long getDeviceKey();
52
53     /**
54      * Get the MAC address of the device as a Long value.
55      *
56      * @return the MAC address for the device
57      */
58     public long getMACAddress();
59
60     /**
61      * Get the MAC address of the device as a String value.
62      *
63      * @return the MAC address for the device
64      */
65     public String getMACAddressString();
66
67     /**
68      * Get all unique VLAN IDs for the device. If the device has untagged
69      * entities, then the value -1 will be returned.
70      *
71      * @return an array containing all unique VLAN IDs for the device.
72      */
73     public Short[] getVlanId();
74
75     /**
76      * Get all unique IPv4 addresses associated with the device.
77      *
78      * @return an array containing the unique IPv4 addresses for the device.
79      */
80     public Integer[] getIPv4Addresses();
81
82     /**
83      * Get all unique attachment points associated with the device. This will
84      * not include any blocked attachment points.
85      *
86      * @return an array containing all unique attachment points for the device
87      */
88     public SwitchPort[] getAttachmentPoints();
89
90     /**
91      * Get all old attachment points associated with the device. this is used in
92      * host movement scenario.
93      *
94      * @return an array containing all unique old attachment points for the
95      *         device
96      */
97     public SwitchPort[] getOldAP();
98
99     /**
100      * Get all unique attachment points associated with the device.
101      *
102      * @param includeError
103      *            whether to include blocked attachment points. Blocked
104      *            attachment points should not be used for forwarding, but could
105      *            be useful to show to a user
106      * @return an array containing all unique attachment points for the device
107      */
108     public SwitchPort[] getAttachmentPoints(boolean includeError);
109
110     /**
111      * Returns all unique VLAN IDs for the device that were observed on the
112      * given switch port
113      *
114      * @param swp
115      *            the switch port to query
116      * @return an array containing the unique VLAN IDs
117      */
118     public Short[] getSwitchPortVlanIds(SwitchPort swp);
119
120     /**
121      * Get the most recent timestamp for this device
122      *
123      * @return the last seen timestamp
124      */
125     public Date getLastSeen();
126
127     /**
128      * Get the entity class for the device.
129      *
130      * @return the entity class
131      * @see IEntityClassifierService
132      */
133     public IEntityClass getEntityClass();
134
135 }