diff options
author | Ashlee Young <ashlee@onosfw.com> | 2015-10-19 10:14:31 -0700 |
---|---|---|
committer | Ashlee Young <ashlee@onosfw.com> | 2015-10-19 10:14:31 -0700 |
commit | e9bb60be43af477f17b30ee1f2ba205565b7fa15 (patch) | |
tree | 981fd759a44b751fc45cde774f46fda37c11c257 /framework/src/onos/core/api/src/main/java/org | |
parent | 74f3941756a1386cbc1fa99ee73fdc8376a0b6a0 (diff) |
Updated onos src tree to commit id 1e60f97ae50c05b94fcb6a10520738bfb5efdfd1
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org')
20 files changed, 487 insertions, 388 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/OduSignalId.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/OduSignalId.java new file mode 100644 index 00000000..e19a673d --- /dev/null +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/OduSignalId.java @@ -0,0 +1,139 @@ +/* + * 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 static com.google.common.base.Preconditions.checkArgument; + +import java.util.Arrays; +import java.util.Objects; + +import org.onlab.util.HexString; + +import com.google.common.base.MoreObjects; +/** + * Implementation of ODU Signal ID. + * + * <p> + * See ITU G.709 "Interfaces for the Optical Transport Network (OTN)". + * </p> + */ +public class OduSignalId { + + private final int tributaryPortNumber; // Tributary Port number + private final int tributarySlotLength; // Number of Tributary Slots included in tsmap + private final byte[] tributarySlotBitmap; // Tributary slot bitmap + + public static final int TRIBUTARY_SLOT_BITMAP_SIZE = 10; + + /** + * Creates an instance with the specified arguments. + * + * @param tributaryPortNumber tributary port number + * @param tributarySlotLen tributary slot len + * @param tributarySlotBitmap tributary slot bitmap + */ + public OduSignalId(int tributaryPortNumber, int tributarySlotLen, + byte[] tributarySlotBitmap) { + + checkArgument(tributaryPortNumber <= 80 , + "tributaryPortNumber %s must be <= 80 ", + tributaryPortNumber); + + checkArgument(tributarySlotBitmap.length == TRIBUTARY_SLOT_BITMAP_SIZE, + "number of elements in list " + HexString.toHexString(tributarySlotBitmap) + + " must be equal to " + TRIBUTARY_SLOT_BITMAP_SIZE); + + checkArgument(tributarySlotLen <= 80 , + "tributarySlotLen %s must be <= 80 ", + tributarySlotLen); + + this.tributaryPortNumber = tributaryPortNumber; + this.tributarySlotLength = tributarySlotLen; + this.tributarySlotBitmap = Arrays.copyOf(tributarySlotBitmap, tributarySlotBitmap.length); + } + + /** + * Returns the OduSignalId representing the specified parameters. + * + * @param tributaryPortNumber tributary port number + * @param tributarySlotLen tributary slot len + * @param tributarySlotBitmap tributary slot bitmap + * @return OduSignalId + */ + public static OduSignalId oduSignalId(int tributaryPortNumber, int tributarySlotLen, + byte[] tributarySlotBitmap) { + return new OduSignalId(tributaryPortNumber, tributarySlotLen, tributarySlotBitmap); + } + + + /** + * Returns tributary port number. + * + * @return the tributaryPortNumber + */ + public int tributaryPortNumber() { + return tributaryPortNumber; + } + + /** + * Returns tributary slot length. + * + * @return the tributarySlotLen + */ + public int tributarySlotLength() { + return tributarySlotLength; + } + + /** + * Returns tributary slot bitmap. + * + * @return the tributarySlotBitmap + */ + public byte[] tributarySlotBitmap() { + return Arrays.copyOf(tributarySlotBitmap, tributarySlotBitmap.length); + } + + @Override + public int hashCode() { + return Objects.hash(tributaryPortNumber, tributarySlotLength, Arrays.hashCode(tributarySlotBitmap)); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof OduSignalId)) { + return false; + } + final OduSignalId other = (OduSignalId) obj; + return Objects.equals(this.tributaryPortNumber, other.tributaryPortNumber) + && Objects.equals(this.tributarySlotLength, other.tributarySlotLength) + && Arrays.equals(tributarySlotBitmap, other.tributarySlotBitmap); + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .omitNullValues() + .add("tributaryPortNumber", tributaryPortNumber) + .add("tributarySlotLength", tributarySlotLength) + .add("tributarySlotBitmap", HexString.toHexString(tributarySlotBitmap)) + .toString(); + } + +} + diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/behaviour/ControllerInfo.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/behaviour/ControllerInfo.java index ded3b3ae..0e509562 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/behaviour/ControllerInfo.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/behaviour/ControllerInfo.java @@ -34,6 +34,7 @@ public class ControllerInfo { * * @param ip the ip address * @param port the tcp port + * @param type the connection type */ public ControllerInfo(IpAddress ip, int port, String type) { this.ip = ip; diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java index a93dc071..965fd1f8 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/TypedStoredFlowEntry.java @@ -54,6 +54,8 @@ public interface TypedStoredFlowEntry extends StoredFlowEntry { /**
* Gets the flow live type for this entry.
+ *
+ * @return flow live type
*/
FlowLiveType flowLiveType();
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java index 7e1d43a5..ae940bdc 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java @@ -25,6 +25,8 @@ import org.onlab.packet.VlanId; import org.onosproject.net.IndexedLambda; import org.onosproject.net.Lambda; import org.onosproject.net.OchSignal; +import org.onosproject.net.OduSignalId; +import org.onosproject.net.OduSignalType; import org.onosproject.net.PortNumber; import org.onosproject.net.flow.criteria.Criterion.Type; import org.onosproject.net.OchSignalType; @@ -486,6 +488,26 @@ public final class Criteria { return new OchSignalTypeCriterion(signalType); } + /** + * Creates a match on ODU (Optical channel Data Unit) signal ID using the specified value. + * + * @param oduSignalId ODU Signal Id + * @return match criterion + */ + public static Criterion matchOduSignalId(OduSignalId oduSignalId) { + return new OduSignalIdCriterion(oduSignalId); + } + + /** + * Creates a match on ODU (Optical channel Data Unit) signal Type using the specified value. + * + * @param signalType ODU Signal Type + * @return match criterion + */ + public static Criterion matchOduSignalType(OduSignalType signalType) { + return new OduSignalTypeCriterion(signalType); + } + public static Criterion dummy() { return new DummyCriterion(); } diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criterion.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criterion.java index 12ab57de..10cb629f 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criterion.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/Criterion.java @@ -125,6 +125,10 @@ public interface Criterion { OCH_SIGID, /** Optical channel signal type (fixed or flexible). */ OCH_SIGTYPE, + /** ODU (Optical channel Data Unit) signal ID. */ + ODU_SIGID, + /** ODU (Optical channel Data Unit) signal type. */ + ODU_SIGTYPE, /** * An empty criterion. diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalIdCriterion.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalIdCriterion.java new file mode 100644 index 00000000..cb513397 --- /dev/null +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalIdCriterion.java @@ -0,0 +1,82 @@ +/* + * 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; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Objects; + +import org.onosproject.net.OduSignalId; + +/** + * Implementation of ODU (Optical channel Data Unit) signal ID signal criterion. + * This criterion is based on the specification of "OFPXMT_EXP_ODU_SIGID" in + * Open Networking Foundation "Optical Transport Protocol Extension Version 1.0", but + * defined in protocol agnostic way. + */ +public final class OduSignalIdCriterion implements Criterion { + + private final OduSignalId oduSignalId; + + /** + * Create an instance with the specified ODU signal ID. + * + * @param oduSignalId - ODU signal ID + */ + OduSignalIdCriterion(OduSignalId oduSignalId) { + this.oduSignalId = checkNotNull(oduSignalId); + } + + @Override + public Type type() { + return Type.ODU_SIGID; + } + + /** + * Returns the ODU Signal to match. + * + * @return the ODU signal to match + */ + public OduSignalId oduSignalId() { + return oduSignalId; + } + + @Override + public int hashCode() { + return Objects.hash(type(), oduSignalId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof OduSignalIdCriterion)) { + return false; + } + final OduSignalIdCriterion that = (OduSignalIdCriterion) obj; + return Objects.equals(this.oduSignalId, that.oduSignalId); + } + + @Override + public String toString() { + return toStringHelper(type().toString()) + .add("oduSignalId", oduSignalId) + .toString(); + } + +} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalTypeCriterion.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalTypeCriterion.java new file mode 100644 index 00000000..d92880db --- /dev/null +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OduSignalTypeCriterion.java @@ -0,0 +1,81 @@ +/* + * 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; +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Objects; + +import org.onosproject.net.OduSignalType; + +/** + * Implementation of ODU (Optical channel Data Unit) signal Type criterion. + * This criterion is based on the specification of "OFPXMT_EXP_ODU_SIGTYPE" in + * Open Networking Foundation "Optical Transport Protocol Extension Version 1.0", but + * defined in protocol agnostic way. + */ +public final class OduSignalTypeCriterion implements Criterion { + + private final OduSignalType signalType; + + /** + * Create an instance with the specified ODU signal Type. + * + * @param signalType - ODU signal Type + */ + OduSignalTypeCriterion(OduSignalType signalType) { + this.signalType = checkNotNull(signalType); + } + + @Override + public Type type() { + return Type.ODU_SIGTYPE; + } + + /** + * Returns the ODU Signal Type to match. + * + * @return the ODU signal Type to match + */ + public OduSignalType signalType() { + return signalType; + } + + @Override + public int hashCode() { + return Objects.hash(type(), signalType); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof OduSignalTypeCriterion)) { + return false; + } + final OduSignalTypeCriterion that = (OduSignalTypeCriterion) obj; + return Objects.equals(this.signalType, that.signalType); + } + + @Override + public String toString() { + return toStringHelper(type().toString()) + .add("signalType", signalType) + .toString(); + } +} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OpticalSignalTypeCriterion.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OpticalSignalTypeCriterion.java deleted file mode 100644 index b712675b..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/criteria/OpticalSignalTypeCriterion.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 java.util.Objects; - -import static com.google.common.base.MoreObjects.toStringHelper; - -/** - * Implementation of optical signal type criterion (8 bits unsigned - * integer). - * - * @deprecated in Cardinal Release - */ -@Deprecated -public final class OpticalSignalTypeCriterion implements Criterion { - private static final short MASK = 0xff; - private final short signalType; // Signal type value: 8 bits - private final Type type; - - /** - * Constructor. - * - * @param signalType the optical signal type to match (8 bits unsigned - * integer) - * @param type the match type. Should be Type.OCH_SIGTYPE - */ - OpticalSignalTypeCriterion(short signalType, Type type) { - this.signalType = (short) (signalType & MASK); - this.type = type; - } - - @Override - public Type type() { - return this.type; - } - - /** - * Gets the optical signal type to match. - * - * @return the optical signal type to match (8 bits unsigned integer) - */ - public short signalType() { - return signalType; - } - - @Override - public String toString() { - return toStringHelper(type().toString()) - .add("signalType", signalType).toString(); - } - - @Override - public int hashCode() { - return Objects.hash(type().ordinal(), signalType); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof OpticalSignalTypeCriterion) { - OpticalSignalTypeCriterion that = (OpticalSignalTypeCriterion) obj; - return Objects.equals(signalType, that.signalType) && - Objects.equals(type, that.type); - } - return false; - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java index d01ea298..eddbbb71 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instruction.java @@ -59,6 +59,11 @@ public interface Instruction { L0MODIFICATION, /** + * Signifies that the traffic should be modified in L1 way. + */ + L1MODIFICATION, + + /** * Signifies that the traffic should be modified in L2 way. */ L2MODIFICATION, @@ -86,6 +91,7 @@ public interface Instruction { /** * Returns the type of instruction. + * * @return type of instruction */ Type type(); diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java index c9f10685..26981e5e 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/Instructions.java @@ -25,10 +25,12 @@ import org.onosproject.core.GroupId; import org.onosproject.net.IndexedLambda; import org.onosproject.net.Lambda; import org.onosproject.net.OchSignal; +import org.onosproject.net.OduSignalId; import org.onosproject.net.PortNumber; import org.onosproject.net.flow.instructions.L0ModificationInstruction.L0SubType; import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModLambdaInstruction; import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModOchSignalInstruction; +import org.onosproject.net.flow.instructions.L1ModificationInstruction.ModOduSignalIdInstruction; import org.onosproject.net.flow.instructions.L3ModificationInstruction.L3SubType; import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPInstruction; import org.onosproject.net.flow.instructions.L3ModificationInstruction.ModIPv6FlowLabelInstruction; @@ -47,7 +49,6 @@ import static com.google.common.base.Preconditions.checkNotNull; */ public final class Instructions { - // Ban construction private Instructions() {} @@ -117,6 +118,16 @@ public final class Instructions { } /** + * Creates an L1 modification with the specified ODU signal Id. + * + * @param oduSignalId ODU Signal Id + * @return a L1 modification + */ + public static L1ModificationInstruction modL1OduSignalId(OduSignalId oduSignalId) { + checkNotNull(oduSignalId, "L1 ODU signal ID cannot be null"); + return new ModOduSignalIdInstruction(oduSignalId); + } + /** * Creates a l2 src modification. * * @param addr the mac address to modify to diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/L1ModificationInstruction.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/L1ModificationInstruction.java new file mode 100644 index 00000000..c6847d1c --- /dev/null +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/flow/instructions/L1ModificationInstruction.java @@ -0,0 +1,88 @@ +/* + * Copyright 2014-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.instructions; + +import org.onosproject.net.OduSignalId; + +import static com.google.common.base.MoreObjects.toStringHelper; + +import java.util.Objects; + +public abstract class L1ModificationInstruction implements Instruction { + + /** + * Represents the type of traffic treatment. + */ + public enum L1SubType { + /** + * ODU (Optical channel Data Unit) Signal Id modification. + */ + ODU_SIGID + } + + public abstract L1SubType subtype(); + + @Override + public final Type type() { + return Type.L1MODIFICATION; + } + + /** + * Represents an L1 ODU (Optical channel Data Unit) Signal Id modification instruction. + */ + public static final class ModOduSignalIdInstruction extends L1ModificationInstruction { + + private final OduSignalId oduSignalId; + + ModOduSignalIdInstruction(OduSignalId oduSignalId) { + this.oduSignalId = oduSignalId; + } + + @Override + public L1SubType subtype() { + return L1SubType.ODU_SIGID; + } + + public OduSignalId oduSignalId() { + return oduSignalId; + } + + @Override + public int hashCode() { + return Objects.hash(oduSignalId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ModOduSignalIdInstruction)) { + return false; + } + final ModOduSignalIdInstruction that = (ModOduSignalIdInstruction) obj; + return Objects.equals(this.oduSignalId, that.oduSignalId); + } + + @Override + public String toString() { + return toStringHelper(this) + .add("oduSignalId", oduSignalId) + .toString(); + } + } + +} 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 068663bd..3403486c 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 @@ -55,9 +55,10 @@ public interface HostProviderService extends ProviderService<HostProvider> { void hostVanished(HostId hostId); /** - * Notifies the core when a host is no longer detected on a network. + * Notifies the core when an IP is no longer associated with a host. * - * @param hostId id of the host that vanished + * @param hostId id of the host + * @param ipAddress ip address of host that vanished */ void removeIpFromHost(HostId hostId, IpAddress ipAddress); diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java deleted file mode 100644 index 74f22ae9..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/host/PortAddresses.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2014-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.host; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; - -import org.onlab.packet.MacAddress; -import org.onlab.packet.VlanId; -import org.onosproject.net.ConnectPoint; - -import com.google.common.base.MoreObjects; - -/** - * Represents address information bound to a port. - */ -public final class PortAddresses { - - private final ConnectPoint connectPoint; - private final Set<InterfaceIpAddress> ipAddresses; - private final MacAddress macAddress; - private final VlanId vlan; - - /** - * Constructs a PortAddresses object for the given connection point, with a - * set of IP addresses and a MAC address. Both address parameters are - * optional and can be set to null. - * - * @param connectPoint the connection point these addresses are for - * @param ipAddresses a set of interface IP addresses - * @param mac a MAC address - * @param vlan a VLAN ID - */ - public PortAddresses(ConnectPoint connectPoint, - Set<InterfaceIpAddress> ipAddresses, MacAddress mac, VlanId vlan) { - this.connectPoint = connectPoint; - this.ipAddresses = (ipAddresses == null) ? - Collections.<InterfaceIpAddress>emptySet() - : new HashSet<>(ipAddresses); - this.macAddress = mac; - this.vlan = vlan; - } - - /** - * Returns the connection point this address information is bound to. - * - * @return the connection point - */ - public ConnectPoint connectPoint() { - return connectPoint; - } - - /** - * Returns the set of interface IP addresses. - * - * @return the interface IP addresses - */ - public Set<InterfaceIpAddress> ipAddresses() { - return ipAddresses; - } - - /** - * Returns the MAC address. - * - * @return the MAC address - */ - public MacAddress mac() { - return macAddress; - } - - /** - * Returns the VLAN ID. - * - * @return the VLAN ID - */ - public VlanId vlan() { - return vlan; - } - - @Override - public boolean equals(Object other) { - if (this == other) { - return true; - } - - if (!(other instanceof PortAddresses)) { - return false; - } - - PortAddresses otherPa = (PortAddresses) other; - - return Objects.equals(this.connectPoint, otherPa.connectPoint) - && Objects.equals(this.ipAddresses, otherPa.ipAddresses) - && Objects.equals(this.macAddress, otherPa.macAddress) - && Objects.equals(this.vlan, otherPa.vlan); - } - - @Override - public int hashCode() { - return Objects.hash(connectPoint, ipAddresses, macAddress, vlan); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(getClass()) - .add("connect-point", connectPoint) - .add("ip-addresses", ipAddresses) - .add("mac-address", macAddress) - .add("vlan", vlan) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceService.java deleted file mode 100644 index 5468dfb7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceService.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.resource.device; - -import com.google.common.annotations.Beta; -import org.onosproject.net.Port; -import org.onosproject.net.intent.Intent; -import org.onosproject.net.intent.IntentId; - -import java.util.Set; - -/** - * Service for providing device resources. - */ -@Beta -public interface DeviceResourceService { - /** - * Request a set of ports needed to satisfy the intent. - * - * @param ports set of ports to allocate - * @param intent the intent - * @return true if ports were successfully allocated, false otherwise - */ - boolean requestPorts(Set<Port> ports, Intent intent); - - /** - * Returns the set of ports allocated for an intent. - * - * @param intentId the intent ID - * @return set of allocated ports - */ - Set<Port> getAllocations(IntentId intentId); - - /** - * Returns the intent allocated to a port. - * - * @param port the port - * @return intent ID allocated to the port - */ - IntentId getAllocations(Port port); - - /** - * Request a mapping between the given intents. - * - * @param keyIntentId the key intent ID - * @param valIntentId the value intent ID - * @return true if mapping was successful, false otherwise - */ - boolean requestMapping(IntentId keyIntentId, IntentId valIntentId); - - /** - * Returns the intents mapped to a lower intent. - * - * @param intentId the intent ID - * @return the set of intent IDs - */ - Set<IntentId> getMapping(IntentId intentId); - - /** - * Release mapping of given intent. - * - * @param intentId intent ID - */ - void releaseMapping(IntentId intentId); - - /** - * Release ports associated with given intent ID. - * - * @param intentId intent ID - */ - void releasePorts(IntentId intentId); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceStore.java deleted file mode 100644 index a52a843f..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/DeviceResourceStore.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.resource.device; - -import org.onosproject.net.DeviceId; -import org.onosproject.net.Port; -import org.onosproject.net.intent.IntentId; - -import java.util.Set; - -public interface DeviceResourceStore { - /** - * Returns unallocated ports on the given device. - * - * @param deviceId device ID - * @return set of unallocated ports - */ - Set<Port> getFreePorts(DeviceId deviceId); - - /** - * Allocates the given ports to the given intent. - * - * @param ports set of ports to allocate - * @param intentId intent ID - * @return true if allocation was successful, false otherwise - */ - boolean allocatePorts(Set<Port> ports, IntentId intentId); - - /** - * Returns set of ports allocated for an intent. - * - * @param intentId the intent ID - * @return set of allocated ports - */ - Set<Port> getAllocations(IntentId intentId); - - /** - * Returns intent allocated to a port. - * - * @param port the port - * @return intent ID allocated to the port - */ - IntentId getAllocations(Port port); - - /** - * Allocates the mapping between the given intents. - * - * @param keyIntentId key intent ID - * @param valIntentId value intent ID - * @return true if mapping was successful, false otherwise - */ - boolean allocateMapping(IntentId keyIntentId, IntentId valIntentId); - - /** - * Returns the set of intents mapped to a lower intent. - * - * @param intentId intent ID - * @return set of intent IDs - */ - Set<IntentId> getMapping(IntentId intentId); - - /** - * Releases the mapping of the given intent. - * - * @param intentId intent ID - */ - void releaseMapping(IntentId intentId); - - /** - * Releases the ports allocated to the given intent. - * - * @param intentId intent ID - * @return true if release was successful, false otherwise - */ - boolean releasePorts(IntentId intentId); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java index 67c539df..f17bfb8e 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java @@ -15,10 +15,12 @@ */ package org.onosproject.net.resource.device; +import com.google.common.annotations.Beta; import org.onosproject.net.intent.IntentId; import java.util.Set; +@Beta public interface IntentSetMultimap { /** diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java index f59670bc..5216839e 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java @@ -94,6 +94,7 @@ public interface FlowStatisticService { * @param pNumber the port number of the Device to query
* @param liveType the FlowLiveType to filter, null means no filtering .
* @param instType the InstructionType to filter, null means no filtering.
+ * @param topn topn //FIXME what?
* @return list of flow entry load
*/
List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber,
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java index 60da636a..1ec427c0 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/SummaryFlowEntryWithLoad.java @@ -94,6 +94,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns connect point.
+ *
+ * @return connect point
*/
public ConnectPoint connectPoint() {
return cp;
@@ -101,6 +103,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns total load of connect point.
+ *
+ * @return total load
*/
public Load totalLoad() {
return totalLoad;
@@ -108,6 +112,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns immediate load of connect point.
+ *
+ * @return immediate load
*/
public Load immediateLoad() {
return immediateLoad;
@@ -115,6 +121,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns short load of connect point.
+ *
+ * @return short load
*/
public Load shortLoad() {
return shortLoad;
@@ -122,6 +130,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns mid load of connect point.
+ *
+ * @return mid load
*/
public Load midLoad() {
return midLoad;
@@ -129,6 +139,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns long load of connect point.
+ *
+ * @return long load
*/
public Load longLoad() {
return longLoad;
@@ -136,6 +148,8 @@ public class SummaryFlowEntryWithLoad { /**
* Returns unknown load of connect point.
+ *
+ * @return unknown load
*/
public Load unknownLoad() {
return unknownLoad;
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java index 3e2dbdf8..a4cbd7d0 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/net/statistic/TypedFlowEntryWithLoad.java @@ -36,19 +36,37 @@ public class TypedFlowEntryWithLoad { private static final int MID_POLL_INTERVAL = 10;
private static final int LONG_POLL_INTERVAL = 15;
-
+ /**
+ * Creates a new typed flow entry with load.
+ *
+ * @param cp connect point
+ * @param tfe typed flow entry
+ * @param load load
+ */
public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe, Load load) {
this.cp = cp;
this.tfe = tfe;
this.load = load;
}
+ /**
+ * Creates a new typed flow entry with load.
+ *
+ * @param cp connect point
+ * @param tfe typed flow entry
+ */
public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe) {
this.cp = cp;
this.tfe = tfe;
this.load = new DefaultLoad(tfe.bytes(), 0, typedPollInterval(tfe));
}
+ /**
+ * Creates a new typed flow entry with load.
+ *
+ * @param cp connect point
+ * @param fe flow entry
+ */
public TypedFlowEntryWithLoad(ConnectPoint cp, FlowEntry fe) {
this.cp = cp;
this.tfe = newTypedStoredFlowEntry(fe);
@@ -70,6 +88,8 @@ public class TypedFlowEntryWithLoad { /**
* Returns short polling interval.
+ *
+ * @return short poll interval
*/
public static int shortPollInterval() {
return CAL_AND_POLL_INTERVAL;
@@ -77,6 +97,8 @@ public class TypedFlowEntryWithLoad { /**
* Returns mid polling interval.
+ *
+ * @return mid poll interval
*/
public static int midPollInterval() {
return MID_POLL_INTERVAL;
@@ -84,6 +106,8 @@ public class TypedFlowEntryWithLoad { /**
* Returns long polling interval.
+ *
+ * @return long poll interval
*/
public static int longPollInterval() {
return LONG_POLL_INTERVAL;
@@ -91,6 +115,8 @@ public class TypedFlowEntryWithLoad { /**
* Returns average polling interval.
+ *
+ * @return average poll interval
*/
public static int avgPollInterval() {
return (CAL_AND_POLL_INTERVAL + MID_POLL_INTERVAL + LONG_POLL_INTERVAL) / 3;
@@ -100,6 +126,7 @@ public class TypedFlowEntryWithLoad { * Returns current typed flow entry's polling interval.
*
* @param tfe typed flow entry
+ * @return typed poll interval
*/
public static long typedPollInterval(TypedStoredFlowEntry tfe) {
checkNotNull(tfe, "TypedStoredFlowEntry cannot be null");
@@ -120,6 +147,7 @@ public class TypedFlowEntryWithLoad { * Creates a new typed flow entry with the given flow entry fe.
*
* @param fe flow entry
+ * @return new typed flow entry
*/
public static TypedStoredFlowEntry newTypedStoredFlowEntry(FlowEntry fe) {
if (fe == null) {
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/store/service/AsyncAtomicCounter.java b/framework/src/onos/core/api/src/main/java/org/onosproject/store/service/AsyncAtomicCounter.java index c0df7134..cfaf314c 100644 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/store/service/AsyncAtomicCounter.java +++ b/framework/src/onos/core/api/src/main/java/org/onosproject/store/service/AsyncAtomicCounter.java @@ -63,6 +63,7 @@ public interface AsyncAtomicCounter { /** * Atomically sets the given value to the current value. * + * @param value new value * @return future void */ CompletableFuture<Void> set(long value); |