2 * Copyright (c) 2011,2012 Big Switch Networks, Inc.
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
8 * http://www.eclipse.org/legal/epl-v10.html
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.
16 * This file incorporates work covered by the following copyright and
19 * Originally created by David Erickson, Stanford University
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
25 * http://www.apache.org/licenses/LICENSE-2.0
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.
34 package org.opendaylight.controller.hosttracker;
36 import java.util.Date;
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.
45 public interface IDevice {
47 * Get the primary key for this device.
49 * @return the primary key
51 public Long getDeviceKey();
54 * Get the MAC address of the device as a Long value.
56 * @return the MAC address for the device
58 public long getMACAddress();
61 * Get the MAC address of the device as a String value.
63 * @return the MAC address for the device
65 public String getMACAddressString();
68 * Get all unique VLAN IDs for the device. If the device has untagged
69 * entities, then the value -1 will be returned.
71 * @return an array containing all unique VLAN IDs for the device.
73 public Short[] getVlanId();
76 * Get all unique IPv4 addresses associated with the device.
78 * @return an array containing the unique IPv4 addresses for the device.
80 public Integer[] getIPv4Addresses();
83 * Get all unique attachment points associated with the device. This will
84 * not include any blocked attachment points.
86 * @return an array containing all unique attachment points for the device
88 public SwitchPort[] getAttachmentPoints();
91 * Get all old attachment points associated with the device. this is used in
92 * host movement scenario.
94 * @return an array containing all unique old attachment points for the
97 public SwitchPort[] getOldAP();
100 * Get all unique attachment points associated with the device.
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
108 public SwitchPort[] getAttachmentPoints(boolean includeError);
111 * Returns all unique VLAN IDs for the device that were observed on the
115 * the switch port to query
116 * @return an array containing the unique VLAN IDs
118 public Short[] getSwitchPortVlanIds(SwitchPort swp);
121 * Get the most recent timestamp for this device
123 * @return the last seen timestamp
125 public Date getLastSeen();
128 * Get the entity class for the device.
130 * @return the entity class
131 * @see IEntityClassifierService
133 public IEntityClass getEntityClass();