Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-09-05 08:25:56 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46a220d6a028ce5414a27c27ba77ac1cc8df40d0
46a220d6
1 parent
29df6f4c
Implementing port methods in trivial core.
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleDeviceStore.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleDeviceStore.java
View file @
46a220d
package
org
.
onlab
.
onos
.
net
.
trivial
.
impl
;
import
com.google.common.collect.ImmutableList
;
import
org.onlab.onos.net.DefaultDevice
;
import
org.onlab.onos.net.DefaultPort
;
import
org.onlab.onos.net.Device
;
...
...
@@ -227,7 +228,13 @@ class SimpleDeviceStore {
*/
DeviceEvent
updatePortStatus
(
DeviceId
deviceId
,
PortDescription
portDescription
)
{
return
null
;
synchronized
(
this
)
{
Device
device
=
devices
.
get
(
deviceId
);
checkArgument
(
device
!=
null
,
DEVICE_NOT_FOUND
,
deviceId
);
Map
<
PortNumber
,
Port
>
ports
=
getPortMap
(
deviceId
);
Port
port
=
ports
.
get
(
portDescription
.
portNumber
());
return
updatePort
(
device
,
port
,
portDescription
,
ports
);
}
}
/**
...
...
@@ -237,7 +244,8 @@ class SimpleDeviceStore {
* @return list of device ports
*/
List
<
Port
>
getPorts
(
DeviceId
deviceId
)
{
return
null
;
Map
<
PortNumber
,
Port
>
ports
=
devicePorts
.
get
(
deviceId
);
return
ports
==
null
?
new
ArrayList
<
Port
>()
:
ImmutableList
.
copyOf
(
ports
.
values
());
}
/**
...
...
@@ -248,7 +256,8 @@ class SimpleDeviceStore {
* @return device port
*/
Port
getPort
(
DeviceId
deviceId
,
PortNumber
portNumber
)
{
return
null
;
Map
<
PortNumber
,
Port
>
ports
=
devicePorts
.
get
(
deviceId
);
return
ports
==
null
?
null
:
ports
.
get
(
portNumber
);
}
/**
...
...
Please
register
or
login
to post a comment