|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.devicemanager.internal.Device
public class Device
Concrete implementation of IDevice
Field Summary | |
---|---|
protected java.util.List<AttachmentPoint> |
attachmentPoints
The current attachment points for the device. |
protected DeviceManagerImpl |
deviceManager
|
protected java.lang.String |
dhcpClientName
|
protected Entity[] |
entities
|
protected static org.slf4j.Logger |
log
|
protected java.lang.String |
macAddressString
|
protected java.util.List<AttachmentPoint> |
oldAPs
These are the old attachment points for the device that were valid no more than INACTIVITY_TIME ago. |
protected java.lang.Short[] |
vlanIds
|
Constructor Summary | |
---|---|
Device(Device device,
Entity newEntity,
int insertionpoint)
Construct a new device consisting of the entities from the old device plus an additional entity. |
|
Device(DeviceManagerImpl deviceManager,
java.lang.Long deviceKey,
Entity entity,
IEntityClass entityClass)
Create a device from an entities |
|
Device(DeviceManagerImpl deviceManager,
java.lang.Long deviceKey,
java.lang.String dhcpClientName,
java.util.Collection<AttachmentPoint> oldAPs,
java.util.Collection<AttachmentPoint> attachmentPoints,
java.util.Collection<Entity> entities,
IEntityClass entityClass)
Create a device from a set of entities |
Method Summary | |
---|---|
boolean |
deleteAttachmentPoint(long sw)
|
boolean |
deleteAttachmentPoint(long sw,
int port)
Delete (sw,port) from the list of list of attachment points and oldAPs. |
protected int |
entityIndex(Entity entity)
Check whether the device contains the specified entity |
boolean |
equals(java.lang.Object obj)
|
SwitchPort[] |
getAttachmentPoints()
Get all unique attachment points associated with the device. |
SwitchPort[] |
getAttachmentPoints(boolean includeError)
Get all unique attachment points associated with the device. |
java.lang.Long |
getDeviceKey()
Get the primary key for this device. |
java.lang.String |
getDHCPClientName()
|
Entity[] |
getEntities()
|
IEntityClass |
getEntityClass()
Get the entity class for the device. |
java.lang.Integer[] |
getIPv4Addresses()
Get all unique IPv4 addresses associated with the device. |
java.util.Date |
getLastSeen()
Get the most recent timestamp for this device |
long |
getMACAddress()
Get the MAC address of the device as a Long value. |
java.lang.String |
getMACAddressString()
Get the MAC address of the device as a String value. |
SwitchPort[] |
getOldAP()
Get all old attachment points associated with the device. |
java.lang.Short[] |
getSwitchPortVlanIds(SwitchPort swp)
Returns all unique VLAN IDs for the device that were observed on the given switch port |
java.lang.Short[] |
getVlanId()
Get all unique VLAN IDs for the device. |
int |
hashCode()
|
java.lang.String |
toString()
|
protected boolean |
updateAttachmentPoint()
Update the known attachment points. |
protected boolean |
updateAttachmentPoint(long sw,
int port,
long lastSeen)
Update the list of attachment points given that a new packet-in was seen from (sw, port) at time (lastSeen). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static org.slf4j.Logger log
protected final DeviceManagerImpl deviceManager
protected final Entity[] entities
protected final java.lang.String macAddressString
protected final java.lang.Short[] vlanIds
protected volatile java.lang.String dhcpClientName
protected volatile java.util.List<AttachmentPoint> oldAPs
protected volatile java.util.List<AttachmentPoint> attachmentPoints
Constructor Detail |
---|
public Device(DeviceManagerImpl deviceManager, java.lang.Long deviceKey, Entity entity, IEntityClass entityClass)
deviceManager
- the device manager for this devicedeviceKey
- the unique identifier for this device objectentity
- the initial entity for the deviceentityClass
- the entity classes associated with the entitypublic Device(DeviceManagerImpl deviceManager, java.lang.Long deviceKey, java.lang.String dhcpClientName, java.util.Collection<AttachmentPoint> oldAPs, java.util.Collection<AttachmentPoint> attachmentPoints, java.util.Collection<Entity> entities, IEntityClass entityClass)
deviceManager
- the device manager for this devicedeviceKey
- the unique identifier for this device objectentities
- the initial entities for the deviceentityClass
- the entity class associated with the entitiespublic Device(Device device, Entity newEntity, int insertionpoint)
device
- the old device objectnewEntity
- the entity to add. newEntity must be have the same
entity class as deviceif
- positive indicates the index in the entities array were the
new entity should be inserted. If negative we will compute the
correct insertion pointMethod Detail |
---|
protected boolean updateAttachmentPoint()
protected boolean updateAttachmentPoint(long sw, int port, long lastSeen)
sw
- port
- lastSeen
-
public boolean deleteAttachmentPoint(long sw, int port)
sw
- port
-
public boolean deleteAttachmentPoint(long sw)
public SwitchPort[] getOldAP()
IDevice
getOldAP
in interface IDevice
public SwitchPort[] getAttachmentPoints()
IDevice
getAttachmentPoints
in interface IDevice
public SwitchPort[] getAttachmentPoints(boolean includeError)
IDevice
getAttachmentPoints
in interface IDevice
includeError
- whether to include blocked attachment points.
Blocked attachment points should not be used for forwarding, but
could be useful to show to a user
public java.lang.Long getDeviceKey()
IDevice
getDeviceKey
in interface IDevice
public long getMACAddress()
IDevice
getMACAddress
in interface IDevice
public java.lang.String getMACAddressString()
IDevice
getMACAddressString
in interface IDevice
public java.lang.Short[] getVlanId()
IDevice
getVlanId
in interface IDevice
public java.lang.Integer[] getIPv4Addresses()
IDevice
getIPv4Addresses
in interface IDevice
public java.lang.Short[] getSwitchPortVlanIds(SwitchPort swp)
IDevice
getSwitchPortVlanIds
in interface IDevice
swp
- the switch port to query
public java.util.Date getLastSeen()
IDevice
getLastSeen
in interface IDevice
public IEntityClass getEntityClass()
IDevice
getEntityClass
in interface IDevice
IEntityClassifierService
public Entity[] getEntities()
public java.lang.String getDHCPClientName()
protected int entityIndex(Entity entity)
entity
- the entity to search for
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |