blob: 95969f8c859299fabd53d5a0d917db3ff90230fe [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001/**
2* Copyright 2011,2012 Big Switch Networks, Inc.
3* Originally created by David Erickson, Stanford University
4*
5* Licensed under the Apache License, Version 2.0 (the "License"); you may
6* not use this file except in compliance with the License. You may obtain
7* a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14* License for the specific language governing permissions and limitations
15* under the License.
16**/
17
18package net.floodlightcontroller.devicemanager;
19
20import java.util.Date;
21
22
23/**
24 * Represents an independent device on the network. A device consists of a
25 * set of entities, and all the information known about a given device comes
26 * only from merging all associated entities for that device.
27 * @author readams
28 */
29public interface IDevice {
30 /**
31 * Get the primary key for this device.
32 * @return the primary key
33 */
34 public Long getDeviceKey();
35
36 /**
37 * Get the MAC address of the device as a Long value.
38 * @return the MAC address for the device
39 */
40 public long getMACAddress();
41
42 /**
43 * Get the MAC address of the device as a String value.
44 * @return the MAC address for the device
45 */
46 public String getMACAddressString();
47
48 /**
49 * Get all unique VLAN IDs for the device. If the device has untagged
50 * entities, then the value -1 will be returned.
51 * @return an array containing all unique VLAN IDs for the device.
52 */
53 public Short[] getVlanId();
54
55 /**
56 * Get all unique IPv4 addresses associated with the device.
57 * @return an array containing the unique IPv4 addresses for the device.
58 */
59 public Integer[] getIPv4Addresses();
60
61 /**
62 * Get all unique attachment points associated with the device. This will
63 * not include any blocked attachment points.
64 * @return an array containing all unique attachment points for the device
65 */
66 public SwitchPort[] getAttachmentPoints();
67
68 /**
69 * Get all unique attachment points associated with the device.
70 * @param includeError whether to include blocked attachment points.
71 * Blocked attachment points should not be used for forwarding, but
72 * could be useful to show to a user
73 * @return an array containing all unique attachment points for the device
74 */
75 public SwitchPort[] getAttachmentPoints(boolean includeError);
76
77 /**
78 * Returns all unique VLAN IDs for the device that were observed on
79 * the given switch port
80 * @param swp the switch port to query
81 * @return an array containing the unique VLAN IDs
82 */
83 public Short[] getSwitchPortVlanIds(SwitchPort swp);
84
85 /**
86 * Get the most recent timestamp for this device
87 * @return the last seen timestamp
88 */
89 public Date getLastSeen();
90
91 /**
92 * Get the entity class for the device.
93 * @return the entity class
94 * @see IEntityClassifierService
95 */
96 public IEntityClass getEntityClass();
97
98}