Committed by
Gerrit Code Review
Added a simple constructor for code demo tomorrow.
Change-Id: I4bdebf68cc35c98b4c141f244cac424335094c9c
Showing
1 changed file
with
18 additions
and
0 deletions
... | @@ -20,6 +20,8 @@ import com.google.common.collect.ImmutableList; | ... | @@ -20,6 +20,8 @@ import com.google.common.collect.ImmutableList; |
20 | import org.onosproject.core.ApplicationId; | 20 | import org.onosproject.core.ApplicationId; |
21 | import org.onosproject.net.HostId; | 21 | import org.onosproject.net.HostId; |
22 | import org.onosproject.net.Link; | 22 | import org.onosproject.net.Link; |
23 | +import org.onosproject.net.flow.DefaultTrafficSelector; | ||
24 | +import org.onosproject.net.flow.DefaultTrafficTreatment; | ||
23 | import org.onosproject.net.flow.TrafficSelector; | 25 | import org.onosproject.net.flow.TrafficSelector; |
24 | import org.onosproject.net.flow.TrafficTreatment; | 26 | import org.onosproject.net.flow.TrafficTreatment; |
25 | import org.onosproject.net.intent.constraint.LinkTypeConstraint; | 27 | import org.onosproject.net.intent.constraint.LinkTypeConstraint; |
... | @@ -37,6 +39,22 @@ public final class HostToHostIntent extends ConnectivityIntent { | ... | @@ -37,6 +39,22 @@ public final class HostToHostIntent extends ConnectivityIntent { |
37 | private final HostId two; | 39 | private final HostId two; |
38 | 40 | ||
39 | /** | 41 | /** |
42 | + * Creates a new host-to-host intent with the supplied host pair and no | ||
43 | + * other traffic selection or treatment criteria. | ||
44 | + * | ||
45 | + * @param appId application identifier | ||
46 | + * @param one first host | ||
47 | + * @param two second host | ||
48 | + * @throws NullPointerException if {@code one} or {@code two} is null. | ||
49 | + */ | ||
50 | + public HostToHostIntent(ApplicationId appId, HostId one, HostId two) { | ||
51 | + this(appId, one, two, | ||
52 | + DefaultTrafficSelector.builder().build(), | ||
53 | + DefaultTrafficTreatment.builder().build(), | ||
54 | + ImmutableList.of(new LinkTypeConstraint(false, Link.Type.OPTICAL))); | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
40 | * Creates a new host-to-host intent with the supplied host pair. | 58 | * Creates a new host-to-host intent with the supplied host pair. |
41 | * | 59 | * |
42 | * @param appId application identifier | 60 | * @param appId application identifier | ... | ... |
-
Please register or login to post a comment