Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[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 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
39
40 /**
41  * Represents an independent device on the network. A device consists of a set
42  * of entities, and all the information known about a given device comes only
43  * from merging all associated entities for that device.
44  *
45  * @author readams
46  */
47 public interface IDevice {
48     /**
49      * Get the primary key for this device.
50      *
51      * @return the primary key
52      */
53     public Long getDeviceKey();
54
55     /**
56      * Get the MAC address of the device as a Long value.
57      *
58      * @return the MAC address for the device
59      */
60     public long getMACAddress();
61
62     /**
63      * Get the MAC address of the device as a String value.
64      *
65      * @return the MAC address for the device
66      */
67     public String getMACAddressString();
68
69     /**
70      * Get all unique VLAN IDs for the device. If the device has untagged
71      * entities, then the value -1 will be returned.
72      *
73      * @return an array containing all unique VLAN IDs for the device.
74      */
75     public Short[] getVlanId();
76
77     /**
78      * Get all unique IPv4 addresses associated with the device.
79      *
80      * @return an array containing the unique IPv4 addresses for the device.
81      */
82     public Integer[] getIPv4Addresses();
83
84     /**
85      * Get all unique attachment points associated with the device. This will
86      * not include any blocked attachment points.
87      *
88      * @return an array containing all unique attachment points for the device
89      */
90     public SwitchPort[] getAttachmentPoints();
91
92     /**
93      * Get all old attachment points associated with the device. this is used in
94      * host movement scenario.
95      *
96      * @return an array containing all unique old attachment points for the
97      *         device
98      */
99     public SwitchPort[] getOldAP();
100
101     /**
102      * Get all unique attachment points associated with the device.
103      *
104      * @param includeError
105      *            whether to include blocked attachment points. Blocked
106      *            attachment points should not be used for forwarding, but could
107      *            be useful to show to a user
108      * @return an array containing all unique attachment points for the device
109      */
110     public SwitchPort[] getAttachmentPoints(boolean includeError);
111
112     /**
113      * Returns all unique VLAN IDs for the device that were observed on the
114      * given switch port
115      *
116      * @param swp
117      *            the switch port to query
118      * @return an array containing the unique VLAN IDs
119      */
120     public Short[] getSwitchPortVlanIds(SwitchPort swp);
121
122     /**
123      * Get the most recent timestamp for this device
124      *
125      * @return the last seen timestamp
126      */
127     public Date getLastSeen();
128
129     /**
130      * Get the entity class for the device.
131      *
132      * @return the entity class
133      * @see IEntityClassifierService
134      */
135     public IEntityClass getEntityClass();
136
137     public boolean isStaticHost();
138
139     public void setStaticHost(boolean isStatic);
140
141     public HostNodeConnector toHostNodeConnector();
142
143 }