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 18:25:12 -0800
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
Gerrit Code Review
2014-11-11 18:25:12 -0800
Commit
503aafc1bceff628e7fddae5b82a705a303b22b9
503aafc1
2 parents
0e99ad96
cd4bac85
Merge "Make constraint objects serializable by Kryo"
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
0 deletions
core/api/src/main/java/org/onlab/onos/net/intent/constraint/AnnotationConstraint.java
core/api/src/main/java/org/onlab/onos/net/intent/constraint/LatencyConstraint.java
core/api/src/main/java/org/onlab/onos/net/intent/constraint/ObstacleConstraint.java
core/api/src/main/java/org/onlab/onos/net/intent/constraint/WaypointConstraint.java
core/store/serializers/src/main/java/org/onlab/onos/store/serializers/KryoNamespaces.java
core/api/src/main/java/org/onlab/onos/net/intent/constraint/AnnotationConstraint.java
View file @
503aafc
...
...
@@ -43,6 +43,12 @@ public class AnnotationConstraint extends BooleanConstraint {
this
.
threshold
=
threshold
;
}
// Constructor for serialization
private
AnnotationConstraint
()
{
this
.
key
=
""
;
this
.
threshold
=
0
;
}
/**
* Returns the key of link annotation this constraint designates.
* @return key of link annotation
...
...
core/api/src/main/java/org/onlab/onos/net/intent/constraint/LatencyConstraint.java
View file @
503aafc
...
...
@@ -43,6 +43,11 @@ public class LatencyConstraint implements Constraint {
this
.
latency
=
latency
;
}
// Constructor for serialization
private
LatencyConstraint
()
{
this
.
latency
=
Duration
.
ZERO
;
}
public
Duration
latency
()
{
return
latency
;
}
...
...
core/api/src/main/java/org/onlab/onos/net/intent/constraint/ObstacleConstraint.java
View file @
503aafc
...
...
@@ -21,6 +21,7 @@ import org.onlab.onos.net.DeviceId;
import
org.onlab.onos.net.Link
;
import
org.onlab.onos.net.resource.LinkResourceService
;
import
java.util.Collections
;
import
java.util.Objects
;
import
java.util.Set
;
...
...
@@ -39,6 +40,11 @@ public class ObstacleConstraint extends BooleanConstraint {
this
.
obstacles
=
ImmutableSet
.
copyOf
(
obstacles
);
}
// Constructor for serialization
private
ObstacleConstraint
()
{
this
.
obstacles
=
Collections
.
emptySet
();
}
@Override
public
boolean
isValid
(
Link
link
,
LinkResourceService
resourceService
)
{
DeviceId
src
=
link
.
src
().
deviceId
();
...
...
core/api/src/main/java/org/onlab/onos/net/intent/constraint/WaypointConstraint.java
View file @
503aafc
...
...
@@ -23,6 +23,7 @@ import org.onlab.onos.net.Path;
import
org.onlab.onos.net.intent.Constraint
;
import
org.onlab.onos.net.resource.LinkResourceService
;
import
java.util.Collections
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.Objects
;
...
...
@@ -48,6 +49,11 @@ public class WaypointConstraint implements Constraint {
this
.
waypoints
=
ImmutableList
.
copyOf
(
waypoints
);
}
// Constructor for serialization
private
WaypointConstraint
()
{
this
.
waypoints
=
Collections
.
emptyList
();
}
public
List
<
DeviceId
>
waypoints
()
{
return
waypoints
;
}
...
...
core/store/serializers/src/main/java/org/onlab/onos/store/serializers/KryoNamespaces.java
View file @
503aafc
...
...
@@ -75,10 +75,14 @@ import org.onlab.onos.net.intent.OpticalConnectivityIntent;
import
org.onlab.onos.net.intent.OpticalPathIntent
;
import
org.onlab.onos.net.intent.PathIntent
;
import
org.onlab.onos.net.intent.PointToPointIntent
;
import
org.onlab.onos.net.intent.constraint.AnnotationConstraint
;
import
org.onlab.onos.net.intent.constraint.BandwidthConstraint
;
import
org.onlab.onos.net.intent.constraint.BooleanConstraint
;
import
org.onlab.onos.net.intent.constraint.LambdaConstraint
;
import
org.onlab.onos.net.intent.constraint.LatencyConstraint
;
import
org.onlab.onos.net.intent.constraint.LinkTypeConstraint
;
import
org.onlab.onos.net.intent.constraint.ObstacleConstraint
;
import
org.onlab.onos.net.intent.constraint.WaypointConstraint
;
import
org.onlab.onos.net.link.DefaultLinkDescription
;
import
org.onlab.onos.net.packet.DefaultOutboundPacket
;
import
org.onlab.onos.net.provider.ProviderId
;
...
...
@@ -208,9 +212,14 @@ public final class KryoNamespaces {
LinkResourceRequest
.
class
,
Lambda
.
class
,
Bandwidth
.
class
,
// Constraints
LambdaConstraint
.
class
,
BandwidthConstraint
.
class
,
LinkTypeConstraint
.
class
,
LatencyConstraint
.
class
,
WaypointConstraint
.
class
,
ObstacleConstraint
.
class
,
AnnotationConstraint
.
class
,
BooleanConstraint
.
class
)
.
register
(
DefaultApplicationId
.
class
,
new
DefaultApplicationIdSerializer
())
...
...
Please
register
or
login
to post a comment