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
Thomas Vachuska
2014-11-11 14:58:12 -0800
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
Gerrit Code Review
2014-11-11 14:58:12 -0800
Commit
23aa49fb9e2ce7334df2646935b9ddaaf396736c
23aa49fb
2 parents
e9aad093
fa2cd3ba
Merge "Use DeviceId instead of ElementId in WaypointConstraint for consistency"
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
core/api/src/main/java/org/onlab/onos/net/intent/constraint/WaypointConstraint.java
core/api/src/main/java/org/onlab/onos/net/intent/constraint/WaypointConstraint.java
View file @
23aa49f
...
...
@@ -17,7 +17,7 @@ package org.onlab.onos.net.intent.constraint;
import
com.google.common.base.MoreObjects
;
import
com.google.common.collect.ImmutableList
;
import
org.onlab.onos.net.
Element
Id
;
import
org.onlab.onos.net.
Device
Id
;
import
org.onlab.onos.net.Link
;
import
org.onlab.onos.net.Path
;
import
org.onlab.onos.net.intent.Constraint
;
...
...
@@ -35,20 +35,20 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/
public
class
WaypointConstraint
implements
Constraint
{
private
final
List
<
Element
Id
>
waypoints
;
private
final
List
<
Device
Id
>
waypoints
;
/**
* Creates a new waypoint constraint.
*
* @param waypoints waypoints
*/
public
WaypointConstraint
(
Element
Id
...
waypoints
)
{
public
WaypointConstraint
(
Device
Id
...
waypoints
)
{
checkNotNull
(
waypoints
,
"waypoints cannot be null"
);
checkArgument
(
waypoints
.
length
>
0
,
"length of waypoints should be more than 0"
);
this
.
waypoints
=
ImmutableList
.
copyOf
(
waypoints
);
}
public
List
<
Element
Id
>
waypoints
()
{
public
List
<
Device
Id
>
waypoints
()
{
return
waypoints
;
}
...
...
@@ -60,8 +60,8 @@ public class WaypointConstraint implements Constraint {
@Override
public
boolean
validate
(
Path
path
,
LinkResourceService
resourceService
)
{
LinkedList
<
Element
Id
>
waypoints
=
new
LinkedList
<>(
this
.
waypoints
);
Element
Id
current
=
waypoints
.
poll
();
LinkedList
<
Device
Id
>
waypoints
=
new
LinkedList
<>(
this
.
waypoints
);
Device
Id
current
=
waypoints
.
poll
();
// This is safe because Path class ensures the number of links are more than 0
Link
firstLink
=
path
.
links
().
get
(
0
);
if
(
firstLink
.
src
().
elementId
().
equals
(
current
))
{
...
...
Please
register
or
login
to post a comment