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
83baff3a
Commit
83baff3a
authored
12 years ago
by
Sandeep Hebbani
Browse files
Options
Downloads
Patches
Plain Diff
Added a get device iterator as a result of query for devices.
parent
0a752cf8
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
+41
-0
41 additions, 0 deletions
...tcontroller/devicemanager/internal/DeviceManagerImpl.java
with
41 additions
and
0 deletions
src/main/java/net/floodlightcontroller/devicemanager/internal/DeviceManagerImpl.java
+
41
−
0
View file @
83baff3a
...
...
@@ -54,6 +54,7 @@ import net.floodlightcontroller.devicemanager.IEntityClassListener;
import
net.floodlightcontroller.devicemanager.IEntityClassifierService
;
import
net.floodlightcontroller.devicemanager.IDeviceListener
;
import
net.floodlightcontroller.devicemanager.SwitchPort
;
import
net.floodlightcontroller.devicemanager.IDeviceService.DeviceField
;
import
net.floodlightcontroller.devicemanager.web.DeviceRoutable
;
import
net.floodlightcontroller.flowcache.IFlowReconcileListener
;
import
net.floodlightcontroller.flowcache.IFlowReconcileService
;
...
...
@@ -473,6 +474,46 @@ IFlowReconcileListener, IInfoProvider, IHAListener {
return
new
MultiIterator
<
Device
>(
iterators
.
iterator
());
}
protected
Iterator
<
Device
>
getDeviceIteratorForQuery
(
Long
macAddress
,
Short
vlan
,
Integer
ipv4Address
,
Long
switchDPID
,
Integer
switchPort
)
{
DeviceIndex
index
=
null
;
if
(
secondaryIndexMap
.
size
()
>
0
)
{
EnumSet
<
DeviceField
>
keys
=
getEntityKeys
(
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
index
=
secondaryIndexMap
.
get
(
keys
);
}
Iterator
<
Device
>
deviceIterator
=
null
;
if
(
index
==
null
)
{
// Do a full table scan
deviceIterator
=
deviceMap
.
values
().
iterator
();
}
else
{
// index lookup
Entity
entity
=
new
Entity
((
macAddress
==
null
?
0
:
macAddress
),
vlan
,
ipv4Address
,
switchDPID
,
switchPort
,
null
);
deviceIterator
=
new
DeviceIndexInterator
(
this
,
index
.
queryByEntity
(
entity
));
}
DeviceIterator
di
=
new
DeviceIterator
(
deviceIterator
,
null
,
macAddress
,
vlan
,
ipv4Address
,
switchDPID
,
switchPort
);
return
di
;
}
@Override
public
void
addListener
(
IDeviceListener
listener
)
{
...
...
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