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;
38 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
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.
47 public interface IDevice {
49 * Get the primary key for this device.
51 * @return the primary key
53 public Long getDeviceKey();
56 * Get the MAC address of the device as a Long value.
58 * @return the MAC address for the device
60 public long getMACAddress();
63 * Get the MAC address of the device as a String value.
65 * @return the MAC address for the device
67 public String getMACAddressString();
70 * Get all unique VLAN IDs for the device. If the device has untagged
71 * entities, then the value -1 will be returned.
73 * @return an array containing all unique VLAN IDs for the device.
75 public Short[] getVlanId();
78 * Get all unique IPv4 addresses associated with the device.
80 * @return an array containing the unique IPv4 addresses for the device.
82 public Integer[] getIPv4Addresses();
85 * Get all unique attachment points associated with the device. This will
86 * not include any blocked attachment points.
88 * @return an array containing all unique attachment points for the device
90 public SwitchPort[] getAttachmentPoints();
93 * Get all old attachment points associated with the device. this is used in
94 * host movement scenario.
96 * @return an array containing all unique old attachment points for the
99 public SwitchPort[] getOldAP();
102 * Get all unique attachment points associated with the device.
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
110 public SwitchPort[] getAttachmentPoints(boolean includeError);
113 * Returns all unique VLAN IDs for the device that were observed on the
117 * the switch port to query
118 * @return an array containing the unique VLAN IDs
120 public Short[] getSwitchPortVlanIds(SwitchPort swp);
123 * Get the most recent timestamp for this device
125 * @return the last seen timestamp
127 public Date getLastSeen();
130 * Get the entity class for the device.
132 * @return the entity class
133 * @see IEntityClassifierService
135 public IEntityClass getEntityClass();
137 public boolean isStaticHost();
139 public void setStaticHost(boolean isStatic);
141 public HostNodeConnector toHostNodeConnector();