Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
970cfbb5
Commit
970cfbb5
authored
13 years ago
by
Kanzhe Jiang
Browse files
Options
Downloads
Patches
Plain Diff
Device is immutable. The new device needs to be returned when aged network address or AP is removed
parent
d4ac8fd3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+22
-7
22 additions, 7 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
22 additions
and
7 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
22
−
7
View file @
970cfbb5
...
@@ -1763,11 +1763,15 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
...
@@ -1763,11 +1763,15 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
deviceUpdateTask
.
reschedule
(
5
,
TimeUnit
.
SECONDS
);
deviceUpdateTask
.
reschedule
(
5
,
TimeUnit
.
SECONDS
);
}
}
// ********************
/**
// Device aging methods
* Remove aged network address from device
// ********************
*
* @param device
* @param currentDate
* @return the new device object since the device is immutable
*/
private
void
removeAgedNetworkAddresses
(
Device
device
,
Date
currentDate
)
{
private
Device
removeAgedNetworkAddresses
(
Device
device
,
Date
currentDate
)
{
Collection
<
DeviceNetworkAddress
>
addresses
=
Collection
<
DeviceNetworkAddress
>
addresses
=
device
.
getNetworkAddresses
();
device
.
getNetworkAddresses
();
...
@@ -1785,9 +1789,18 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
...
@@ -1785,9 +1789,18 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
removeNetworkAddressFromStorage
(
device
,
address
);
removeNetworkAddressFromStorage
(
device
,
address
);
}
}
}
}
return
devMgrMaps
.
getDeviceByDataLayerAddr
(
device
.
getDataLayerAddressAsLong
());
}
}
private
void
removeAgedAttachmentPoints
(
Device
device
,
Date
currentDate
)
{
/**
* Remove aged device attachment point
*
* @param device
* @param currentDate
* @return the new device object since the device is immutable
*/
private
Device
removeAgedAttachmentPoints
(
Device
device
,
Date
currentDate
)
{
Collection
<
DeviceAttachmentPoint
>
aps
=
device
.
getAttachmentPoints
();
Collection
<
DeviceAttachmentPoint
>
aps
=
device
.
getAttachmentPoints
();
for
(
DeviceAttachmentPoint
ap
:
aps
)
{
for
(
DeviceAttachmentPoint
ap
:
aps
)
{
...
@@ -1804,6 +1817,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
...
@@ -1804,6 +1817,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
removeAttachmentPointFromStorage
(
device
,
ap
);
removeAttachmentPointFromStorage
(
device
,
ap
);
}
}
}
}
return
devMgrMaps
.
getDeviceByDataLayerAddr
(
device
.
getDataLayerAddressAsLong
());
}
}
/**
/**
...
@@ -1815,8 +1830,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
...
@@ -1815,8 +1830,8 @@ public class DeviceManagerImpl implements IDeviceManager, IOFMessageListener,
Collection
<
Device
>
deviceColl
=
devMgrMaps
.
getDevices
();
Collection
<
Device
>
deviceColl
=
devMgrMaps
.
getDevices
();
for
(
Device
device:
deviceColl
)
{
for
(
Device
device:
deviceColl
)
{
removeAgedNetworkAddresses
(
device
,
currentDate
);
device
=
removeAgedNetworkAddresses
(
device
,
currentDate
);
removeAgedAttachmentPoints
(
device
,
currentDate
);
device
=
removeAgedAttachmentPoints
(
device
,
currentDate
);
if
((
device
.
getAttachmentPoints
().
size
()
==
0
)
&&
if
((
device
.
getAttachmentPoints
().
size
()
==
0
)
&&
(
device
.
getNetworkAddresses
().
size
()
==
0
)
&&
(
device
.
getNetworkAddresses
().
size
()
==
0
)
&&
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment