aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-09-22 12:49:09 -0700
committerAshlee Young <ashlee@onosfw.com>2015-09-22 12:49:09 -0700
commit81391595dca425ae58e2294898f09f11d9a32dbc (patch)
treef5d65c39a732150b2b29daa8de98a35d1236d3fb /framework/src/onos/core/api/src/main/java/org/onosproject/net
parent0aa37e73dcb3a55b8d889b0c32ff74055551b1f3 (diff)
bringing src to commit tag 65d551b50e782b0c1ea76c1a9ed1c5a801a5a7e4
Change-Id: Ib2da78962eaef856f418636c31b0f5c84286244f
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net')
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/Device.java2
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/IpElementId.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/BasicLinkConfig.java24
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/OpticalPortConfig.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java19
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java6
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java2
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java1
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/MplsBosCriterion.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/flowobjective/Objective.java6
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java34
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostService.java20
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostStore.java54
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java9
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java15
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketPriority.java4
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketProcessor.java14
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketService.java20
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketStore.java6
-rw-r--r--framework/src/onos/core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java2
24 files changed, 202 insertions, 141 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/Device.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/Device.java
index d9001825..ffbf7f96 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/Device.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/Device.java
@@ -25,7 +25,7 @@ public interface Device extends Element {
/**
* Coarse classification of the type of the infrastructure device.
*/
- public enum Type {
+ enum Type {
SWITCH, ROUTER, ROADM, OTN, ROADM_OTN, FIREWALL, BALANCER, IPS, IDS, CONTROLLER,
VIRTUAL, FIBER_SWITCH, MICROWAVE, OTHER
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/IpElementId.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/IpElementId.java
index 9e19b624..aba8ae47 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/IpElementId.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/IpElementId.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net;
import java.util.Objects;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/BasicLinkConfig.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/BasicLinkConfig.java
index b6068ee7..e962110c 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/BasicLinkConfig.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/BasicLinkConfig.java
@@ -17,6 +17,7 @@ package org.onosproject.net.config.basics;
import org.onosproject.net.Link;
import org.onosproject.net.LinkKey;
+import com.fasterxml.jackson.databind.JsonNode;
import java.time.Duration;
@@ -28,6 +29,7 @@ public class BasicLinkConfig extends AllowedEntityConfig<LinkKey> {
public static final String TYPE = "type";
public static final String LATENCY = "latency";
public static final String BANDWIDTH = "bandwidth";
+ public static final String IS_DURABLE = "durable";
/**
* Returns the link type.
@@ -87,4 +89,26 @@ public class BasicLinkConfig extends AllowedEntityConfig<LinkKey> {
return (BasicLinkConfig) setOrClear(BANDWIDTH, bandwidth);
}
+ /**
+ * Returns if link is durable in the network model or not.
+ *
+ * @return true for durable, false otherwise
+ */
+ public Boolean isDurable() {
+ JsonNode res = object.path(IS_DURABLE);
+ if (res.isMissingNode()) {
+ return null;
+ }
+ return res.asBoolean();
+ }
+
+ /**
+ * Sets durability for this link.
+ *
+ * @param isDurable true for durable, false otherwise
+ * @return this BasicLinkConfig
+ */
+ public BasicLinkConfig isDurable(Boolean isDurable) {
+ return (BasicLinkConfig) setOrClear(IS_DURABLE, isDurable);
+ }
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/OpticalPortConfig.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/OpticalPortConfig.java
index b06c4228..dfb494d6 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/OpticalPortConfig.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/config/basics/OpticalPortConfig.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.config.basics;
import java.util.Optional;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
index 44a4d364..5492fa98 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/DefaultFlowRule.java
@@ -291,6 +291,7 @@ public class DefaultFlowRule implements FlowRule {
public static final class Builder implements FlowRule.Builder {
private FlowId flowId;
+ private ApplicationId appId;
private Integer priority;
private DeviceId deviceId;
private Integer tableId = 0;
@@ -307,7 +308,7 @@ public class DefaultFlowRule implements FlowRule {
@Override
public FlowRule.Builder fromApp(ApplicationId appId) {
- this.flowId = computeFlowId(appId);
+ this.appId = appId;
return this;
}
@@ -357,16 +358,22 @@ public class DefaultFlowRule implements FlowRule {
@Override
public FlowRule build() {
- checkNotNull(flowId != null, "Either an application" +
+ checkArgument(flowId != null || appId != null, "Either an application" +
" id or a cookie must be supplied");
- checkNotNull(selector != null, "Traffic selector cannot be null");
- checkNotNull(timeout != null || permanent != null, "Must either have " +
+ checkNotNull(selector, "Traffic selector cannot be null");
+ checkArgument(timeout != null || permanent != null, "Must either have " +
"a timeout or be permanent");
- checkNotNull(deviceId != null, "Must refer to a device");
- checkNotNull(priority != null, "Priority cannot be null");
+ checkNotNull(deviceId, "Must refer to a device");
+ checkNotNull(priority, "Priority cannot be null");
checkArgument(priority >= MIN_PRIORITY, "Priority cannot be less than " +
MIN_PRIORITY);
+ // Computing a flow ID based on appId takes precedence over setting
+ // the flow ID directly
+ if (appId != null) {
+ flowId = computeFlowId(appId);
+ }
+
return new DefaultFlowRule(deviceId, selector, treatment, priority,
flowId, permanent, timeout, tableId);
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
index e446a9fe..a487cbc4 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRule.java
@@ -25,8 +25,8 @@ import org.onosproject.net.DeviceId;
*/
public interface FlowRule {
- static final int MAX_TIMEOUT = 60;
- static final int MIN_PRIORITY = 0;
+ int MAX_TIMEOUT = 60;
+ int MIN_PRIORITY = 0;
/**
* The FlowRule type is used to determine in which table the flow rule needs
@@ -36,7 +36,7 @@ public interface FlowRule {
* @deprecated in Cardinal Release
*/
@Deprecated
- static enum Type {
+ enum Type {
/*
* Default type - used in flow rule for single table switch NOTE: this
* setting should not be used as Table 0 in a multi-table pipeline
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java
index 8d36be49..d4d2d9ec 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleExtPayLoad.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.flow;
import static com.google.common.base.MoreObjects.toStringHelper;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
index e2971158..d4f959c3 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/FlowRuleService.java
@@ -32,7 +32,7 @@ public interface FlowRuleService
/**
* The topic used for obtaining globally unique ids.
*/
- static String FLOW_OP_TOPIC = "flow-ops-ids";
+ String FLOW_OP_TOPIC = "flow-ops-ids";
/**
* Returns the number of flow rules in the system.
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
index f2de9a0f..534f6b9e 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TrafficSelector.java
@@ -24,7 +24,6 @@ import org.onlab.packet.MplsLabel;
import org.onlab.packet.TpPort;
import org.onlab.packet.VlanId;
import org.onosproject.net.PortNumber;
-import org.onosproject.net.flow.DefaultTrafficSelector.Builder;
import org.onosproject.net.flow.criteria.Criterion;
/**
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/MplsBosCriterion.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/MplsBosCriterion.java
index 1ace8931..c8b6690d 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/MplsBosCriterion.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/MplsBosCriterion.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.flow.criteria;
import static com.google.common.base.MoreObjects.toStringHelper;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flowobjective/Objective.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flowobjective/Objective.java
index 090c298c..6ac7a7a2 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flowobjective/Objective.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flowobjective/Objective.java
@@ -26,9 +26,9 @@ import java.util.Optional;
@Beta
public interface Objective {
- static final boolean DEFAULT_PERMANENT = true;
- static final int DEFAULT_TIMEOUT = 0;
- static final int DEFAULT_PRIORITY = 32768;
+ boolean DEFAULT_PERMANENT = true;
+ int DEFAULT_TIMEOUT = 0;
+ int DEFAULT_PRIORITY = 32768;
/**
* Type of operation.
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
index d620fedb..8676e46a 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostAdminService.java
@@ -15,7 +15,6 @@
*/
package org.onosproject.net.host;
-import org.onosproject.net.ConnectPoint;
import org.onosproject.net.HostId;
/**
@@ -30,37 +29,4 @@ public interface HostAdminService extends HostService {
*/
void removeHost(HostId hostId);
- /**
- * Binds IP and MAC addresses to the given connection point.
- * <p>
- * The addresses are added to the set of addresses already bound to the
- * connection point.
- *
- * @param addresses address object containing addresses to add and the port
- * to add them to
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void bindAddressesToPort(PortAddresses addresses);
-
- /**
- * Removes the addresses contained in the given PortAddresses object from
- * the set of addresses bound to the port.
- *
- * @param portAddresses set of addresses to remove and port to remove them
- * from
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void unbindAddressesFromPort(PortAddresses portAddresses);
-
- /**
- * Removes all address information for the given connection point.
- *
- * @param connectPoint the connection point to remove address information
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void clearAddresses(ConnectPoint connectPoint);
-
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
index 8678a297..f7b7c499 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostProviderService.java
@@ -30,7 +30,20 @@ public interface HostProviderService extends ProviderService<HostProvider> {
* @param hostId id of the host that been detected
* @param hostDescription description of host and its location
*/
- void hostDetected(HostId hostId, HostDescription hostDescription);
+ @Deprecated
+ default void hostDetected(HostId hostId, HostDescription hostDescription) {
+ hostDetected(hostId, hostDescription, false);
+ }
+
+ /**
+ * Notifies the core when a host has been detected on a network along with
+ * information that identifies the host location.
+ *
+ * @param hostId id of the host that been detected
+ * @param hostDescription description of host and its location
+ * @param replaceIps replace IP set if true, merge IP set otherwise
+ */
+ void hostDetected(HostId hostId, HostDescription hostDescription, boolean replaceIps);
/**
* Notifies the core when a host is no longer detected on a network.
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostService.java
index be114f05..39012159 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostService.java
@@ -123,24 +123,4 @@ public interface HostService
*/
void requestMac(IpAddress ip);
- /**
- * Returns the addresses information for all connection points.
- *
- * @return the set of address bindings for all connection points
- * @deprecated in Drake release: use InterfaceService instead
- */
- @Deprecated
- Set<PortAddresses> getAddressBindings();
-
- /**
- * Retrieves the addresses that have been bound to the given connection
- * point.
- *
- * @param connectPoint the connection point to retrieve address bindings for
- * @return addresses bound to the port
- * @deprecated in Drake release: use InterfaceService instead
- */
- @Deprecated
- Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
-
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostStore.java
index ca11a942..5894fe92 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostStore.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/HostStore.java
@@ -39,12 +39,13 @@ public interface HostStore extends Store<HostEvent, HostStoreDelegate> {
* @param providerId provider identification
* @param hostId host identification
* @param hostDescription host description data
+ * @param replaceIps replace IP set if true, merge IP set otherwise
* @return appropriate event or null if no change resulted
*/
HostEvent createOrUpdateHost(ProviderId providerId, HostId hostId,
- HostDescription hostDescription);
+ HostDescription hostDescription,
+ boolean replaceIps);
- // FIXME: API to remove only IpAddress is missing
/**
* Removes the specified host from the inventory.
*
@@ -115,53 +116,4 @@ public interface HostStore extends Store<HostEvent, HostStoreDelegate> {
*/
Set<Host> getConnectedHosts(DeviceId deviceId);
- /**
- * Updates the address information for a given port. The given address
- * information is added to any previously held information for the port.
- *
- * @param addresses the port and address information
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void updateAddressBindings(PortAddresses addresses);
-
- /**
- * Removes the given addresses from the set of address information held for
- * a port.
- *
- * @param addresses the port and address information
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void removeAddressBindings(PortAddresses addresses);
-
- /**
- * Removes any previously stored address information for a given connection
- * point.
- *
- * @param connectPoint the connection point
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- void clearAddressBindings(ConnectPoint connectPoint);
-
- /**
- * Returns the address bindings stored for all connection points.
- *
- * @return the set of address bindings
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- Set<PortAddresses> getAddressBindings();
-
- /**
- * Returns the address bindings for a particular connection point.
- *
- * @param connectPoint the connection point to return address information
- * for
- * @return address information for the connection point
- * @deprecated in Drake release: address info now stored in InterfaceService
- */
- @Deprecated
- Set<PortAddresses> getAddressBindingsForPort(ConnectPoint connectPoint);
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
index bf469dbe..7df3c81e 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.intent;
import java.util.Collections;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
index 3c3c45ce..caa5fbb9 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.intent;
import java.util.List;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
index dffbabfe..0c831fd5 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
@@ -25,7 +25,6 @@ import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import com.google.common.base.MoreObjects;
-import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import static com.google.common.base.Preconditions.checkArgument;
@@ -159,12 +158,8 @@ public class PathIntent extends ConnectivityIntent {
* @param links links to be validated
*/
public static void validate(List<Link> links) {
- checkArgument(Iterables.all(links, new Predicate<Link>() {
- @Override
- public boolean apply(Link link) {
- return !link.src().elementId().equals(link.dst().elementId());
- }
- }), "element of src and dst in a link must be different: {}", links);
+ checkArgument(Iterables.all(links, link -> !link.src().elementId().equals(link.dst().elementId())),
+ "element of src and dst in a link must be different: {}", links);
boolean adjacentSame = true;
for (int i = 0; i < links.size() - 1; i++) {
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
index fc2eba70..5a034b4d 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/newresource/ResourceStore.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.onosproject.net.newresource;
import com.google.common.annotations.Beta;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketPriority.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketPriority.java
index 68c0a838..3eab9386 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketPriority.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketPriority.java
@@ -34,7 +34,7 @@ public enum PacketPriority {
private final int priorityValue;
- private PacketPriority(int priorityValue) {
+ PacketPriority(int priorityValue) {
this.priorityValue = priorityValue;
}
@@ -50,4 +50,4 @@ public enum PacketPriority {
public String toString() {
return String.valueOf(priorityValue);
}
-} \ No newline at end of file
+}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketProcessor.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketProcessor.java
index 98886775..0eba1b4e 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketProcessor.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketProcessor.java
@@ -22,9 +22,9 @@ import static com.google.common.base.Preconditions.checkArgument;
*/
public interface PacketProcessor {
- static final int ADVISOR_MAX = Integer.MAX_VALUE / 3;
- static final int DIRECTOR_MAX = (Integer.MAX_VALUE / 3) * 2;
- static final int OBSERVER_MAX = Integer.MAX_VALUE;
+ int ADVISOR_MAX = Integer.MAX_VALUE / 3;
+ int DIRECTOR_MAX = (Integer.MAX_VALUE / 3) * 2;
+ int OBSERVER_MAX = Integer.MAX_VALUE;
/**
* Returns a priority in the ADVISOR range, where processors can take early action and
@@ -38,7 +38,7 @@ public interface PacketProcessor {
static int advisor(int priority) {
int overallPriority = priority + 1;
checkArgument(overallPriority > 0 && overallPriority <= ADVISOR_MAX,
- "Priority not within ADVISOR range");
+ "Priority not within ADVISOR range");
return overallPriority;
}
@@ -53,7 +53,7 @@ public interface PacketProcessor {
static int director(int priority) {
int overallPriority = ADVISOR_MAX + priority + 1;
checkArgument(overallPriority > ADVISOR_MAX && overallPriority <= DIRECTOR_MAX,
- "Priority not within DIRECTOR range");
+ "Priority not within DIRECTOR range");
return overallPriority;
}
@@ -68,8 +68,8 @@ public interface PacketProcessor {
*/
static int observer(int priority) {
int overallPriority = DIRECTOR_MAX + priority + 1;
- checkArgument(overallPriority > DIRECTOR_MAX && overallPriority <= OBSERVER_MAX,
- "Priority not within OBSERVER range");
+ checkArgument(overallPriority > DIRECTOR_MAX,
+ "Priority not within OBSERVER range");
return overallPriority;
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketService.java
index 06c416ec..98f4d8e0 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketService.java
@@ -15,9 +15,13 @@
*/
package org.onosproject.net.packet;
+import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.flow.TrafficSelector;
+import java.util.List;
+import java.util.Map;
+
/**
* Service for intercepting data plane packets and for emitting synthetic
* outbound packets.
@@ -48,6 +52,15 @@ public interface PacketService {
void removeProcessor(PacketProcessor processor);
/**
+ * Returns priority bindings of all registered packet processors.
+ *
+ * @return list of existing packet processors
+ */
+ @Beta
+ // TODO: Consider returning list of PacketProcessorEntry with processor, priority and stats
+ Map<Integer, PacketProcessor> getProcessors();
+
+ /**
* Requests that packets matching the given selector are punted from the
* dataplane to the controller.
*
@@ -70,6 +83,13 @@ public interface PacketService {
ApplicationId appId);
/**
+ * Returns list of all existing requests ordered by priority.
+ *
+ * @return list of existing packet requests
+ */
+ List<PacketRequest> getRequests();
+
+ /**
* Emits the specified outbound packet onto the network.
*
* @param packet outbound packet
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketStore.java
index ff45cc0c..97f7cb55 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketStore.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/packet/PacketStore.java
@@ -17,7 +17,7 @@ package org.onosproject.net.packet;
import org.onosproject.store.Store;
-import java.util.Set;
+import java.util.List;
/**
* Manages routing of outbound packets.
@@ -52,8 +52,8 @@ public interface PacketStore extends Store<PacketEvent, PacketStoreDelegate> {
/**
* Obtains all existing requests in the system.
*
- * @return a set of packet requests
+ * @return list of packet requests in order of priority
*/
- Set<PacketRequest> existingRequests();
+ List<PacketRequest> existingRequests();
}
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java
index 8ffe17a4..9b27f4f8 100644
--- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java
+++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/proxyarp/ProxyArpService.java
@@ -21,7 +21,7 @@ import org.onosproject.net.ConnectPoint;
import org.onosproject.net.packet.PacketContext;
/**
- * Service for processing arp requests on behalf of applications.
+ * Service for processing ARP or NDP requests on behalf of applications.
*/
// TODO: move to the peer host package
public interface ProxyArpService {