Initial import of CFM and SOAM api
Change-Id: Icf5cc2d5fb34b75460e80e8cced0d70265bcd33b
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementCreate.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementCreate.java
new file mode 100644
index 0000000..f74ff04
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementCreate.java
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.cfm.Mep.Priority;
+import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
+import org.onosproject.incubator.net.l2monitoring.soam.DefaultMeasurementCreateBase;
+import org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException;
+
+/**
+ * The default implementation of {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate}.
+ */
+public class DefaultDelayMeasurementCreate extends DefaultMeasurementCreateBase
+ implements DelayMeasurementCreate {
+
+ protected final DmType dmCfgType;
+ protected final Collection<MeasurementOption> measurementsEnabled;
+ protected final Short binsPerFdInterval;
+ protected final Short binsPerIfdvInterval;
+ protected final Short ifdvSelectionOffset;
+ protected final Short binsPerFdrInterval;
+ protected final Collection<DelayMeasurementThreshold> thresholds;
+
+ protected DefaultDelayMeasurementCreate(DefaultDmCreateBuilder builder) {
+ super(builder);
+ this.dmCfgType = builder.dmCfgType;
+ this.measurementsEnabled = builder.measurementsEnabled;
+ this.binsPerFdInterval = builder.binsPerFdInterval;
+ this.binsPerIfdvInterval = builder.binsPerIfdvInterval;
+ this.ifdvSelectionOffset = builder.ifdvSelectionOffset;
+ this.binsPerFdrInterval = builder.binsPerFdrInterval;
+ this.thresholds = builder.thresholds;
+ }
+
+ @Override
+ public DmType dmCfgType() {
+ return dmCfgType;
+ }
+
+ @Override
+ public Collection<MeasurementOption> measurementsEnabled() {
+ return measurementsEnabled;
+ }
+
+ @Override
+ public Short binsPerFdInterval() {
+ return binsPerFdInterval;
+ }
+
+ @Override
+ public Short binsPerIfdvInterval() {
+ return binsPerIfdvInterval;
+ }
+
+ @Override
+ public Short ifdvSelectionOffset() {
+ return ifdvSelectionOffset;
+ }
+
+ @Override
+ public Short binsPerFdrInterval() {
+ return binsPerFdrInterval;
+ }
+
+ @Override
+ public Collection<DelayMeasurementThreshold> thresholds() {
+ return thresholds;
+ }
+
+ public static DmCreateBuilder builder(DmType dmCfgType,
+ Version version, MepId remoteMepId, Priority priority)
+ throws SoamConfigException {
+ return new DefaultDmCreateBuilder(dmCfgType, version, remoteMepId, priority);
+ }
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate}.
+ */
+ protected static class DefaultDmCreateBuilder extends DefaultMeasCreateBaseBuilder
+ implements DmCreateBuilder {
+ protected final DmType dmCfgType;
+
+ protected Collection<MeasurementOption> measurementsEnabled;
+ protected Short binsPerFdInterval;
+ protected Short binsPerIfdvInterval;
+ protected Short ifdvSelectionOffset;
+ protected Short binsPerFdrInterval;
+ protected Collection<DelayMeasurementThreshold> thresholds;
+
+ protected DefaultDmCreateBuilder(DmType dmCfgType, Version version,
+ MepId remoteMepId, Priority priority)
+ throws SoamConfigException {
+ super(version, remoteMepId, priority);
+ this.dmCfgType = dmCfgType;
+ measurementsEnabled = new ArrayList<>();
+ thresholds = new ArrayList<>();
+ }
+
+ @Override
+ public DmCreateBuilder addToMeasurementsEnabled(
+ MeasurementOption measurementEnabled) {
+ this.measurementsEnabled.add(measurementEnabled);
+ return this;
+ }
+
+ @Override
+ public DmCreateBuilder binsPerFdInterval(Short binsPerFdInterval)
+ throws SoamConfigException {
+ if (binsPerFdInterval < 2 || binsPerFdInterval > 100) {
+ throw new SoamConfigException(
+ "Bins Per Fd Interval must be between 2..100. Rejecting: " +
+ binsPerFdInterval);
+ }
+ this.binsPerFdInterval = binsPerFdInterval;
+ return this;
+ }
+
+ @Override
+ public DmCreateBuilder binsPerIfdvInterval(Short binsPerIfdvInterval)
+ throws SoamConfigException {
+ if (binsPerIfdvInterval < 2 || binsPerIfdvInterval > 100) {
+ throw new SoamConfigException(
+ "Bins Per Ifdv Interval must be between 2..100. Rejecting: " +
+ binsPerIfdvInterval);
+ }
+ this.binsPerIfdvInterval = binsPerIfdvInterval;
+ return this;
+ }
+
+ @Override
+ public DmCreateBuilder ifdvSelectionOffset(Short ifdvSelectionOffset)
+ throws SoamConfigException {
+ if (ifdvSelectionOffset < 2 || ifdvSelectionOffset > 100) {
+ throw new SoamConfigException(
+ "IFDV Selection Offset must be between 2..100. Rejecting: " +
+ ifdvSelectionOffset);
+ }
+ this.ifdvSelectionOffset = ifdvSelectionOffset;
+ return this;
+ }
+
+ @Override
+ public DmCreateBuilder binsPerFdrInterval(Short binsPerFdrInterval)
+ throws SoamConfigException {
+ if (binsPerFdrInterval < 2 || binsPerFdrInterval > 100) {
+ throw new SoamConfigException(
+ "Bins Per Fd Interval must be between 2..100. Rejecting: " +
+ binsPerFdrInterval);
+ }
+ this.binsPerFdrInterval = binsPerFdrInterval;
+ return this;
+ }
+
+ @Override
+ public DmCreateBuilder addToThresholds(
+ DelayMeasurementThreshold threshold) {
+ this.thresholds.add(threshold);
+ return this;
+ }
+
+ @Override
+ public DelayMeasurementCreate build() {
+ return new DefaultDelayMeasurementCreate(this);
+ }
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementEntry.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementEntry.java
new file mode 100644
index 0000000..c53c63b
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementEntry.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.cfm.Mep.Priority;
+import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
+import org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException;
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+import com.google.common.collect.Lists;
+
+/**
+ * The default implementation of {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementEntry}.
+ */
+public final class DefaultDelayMeasurementEntry
+ extends DefaultDelayMeasurementCreate implements DelayMeasurementEntry {
+
+ private final SoamId dmId;
+ private final SessionStatus sessionStatus;
+ private final Duration frameDelayTwoWay;
+ private final Duration frameDelayForward;
+ private final Duration frameDelayBackward;
+ private final Duration interFrameDelayVariationTwoWay;
+ private final Duration interFrameDelayVariationForward;
+ private final Duration interFrameDelayVariationBackward;
+ private final DelayMeasurementStatCurrent currentResult;
+ private final Collection<DelayMeasurementStatHistory> historicalResults;
+
+ private DefaultDelayMeasurementEntry(DefaultDmEntryBuilder builder) {
+ super(builder);
+ this.dmId = builder.dmId;
+ this.currentResult = builder.currentResult;
+ this.historicalResults = builder.historicalResults;
+
+ this.sessionStatus = builder.sessionStatus;
+ this.frameDelayTwoWay = builder.frameDelayTwoWay;
+ this.frameDelayForward = builder.frameDelayForward;
+ this.frameDelayBackward = builder.frameDelayBackward;
+ this.interFrameDelayVariationTwoWay = builder.interFrameDelayVariationTwoWay;
+ this.interFrameDelayVariationForward = builder.interFrameDelayVariationForward;
+ this.interFrameDelayVariationBackward = builder.interFrameDelayVariationBackward;
+ }
+
+ @Override
+ public SoamId dmId() {
+ return dmId;
+ }
+
+ @Override
+ public SessionStatus sessionStatus() {
+ return sessionStatus;
+ }
+
+ @Override
+ public Duration frameDelayTwoWay() {
+ return frameDelayTwoWay;
+ }
+
+ @Override
+ public Duration frameDelayForward() {
+ return frameDelayForward;
+ }
+
+ @Override
+ public Duration frameDelayBackward() {
+ return frameDelayBackward;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationTwoWay() {
+ return interFrameDelayVariationTwoWay;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationForward() {
+ return interFrameDelayVariationForward;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationBackward() {
+ return interFrameDelayVariationBackward;
+ }
+
+ @Override
+ public DelayMeasurementStatCurrent currentResult() {
+ return currentResult;
+ }
+
+ @Override
+ public Collection<DelayMeasurementStatHistory> historicalResults() {
+ if (historicalResults != null) {
+ return Lists.newArrayList(historicalResults);
+ }
+ return null;
+ }
+
+ public static DmEntryBuilder builder(SoamId dmId, DmType dmCfgType,
+ Version version, MepId remoteMepId, Priority priority)
+ throws SoamConfigException {
+ return new DefaultDmEntryBuilder(dmId, dmCfgType, version,
+ remoteMepId, priority);
+ }
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementEntry}.
+ */
+ private static final class DefaultDmEntryBuilder extends DefaultDmCreateBuilder
+ implements DmEntryBuilder {
+ private final SoamId dmId;
+ private SessionStatus sessionStatus;
+ private Duration frameDelayTwoWay;
+ private Duration frameDelayForward;
+ private Duration frameDelayBackward;
+ private Duration interFrameDelayVariationTwoWay;
+ private Duration interFrameDelayVariationForward;
+ private Duration interFrameDelayVariationBackward;
+ private DelayMeasurementStatCurrent currentResult;
+ private Collection<DelayMeasurementStatHistory> historicalResults;
+
+ private DefaultDmEntryBuilder(SoamId dmId, DmType dmCfgType,
+ Version version, MepId remoteMepId, Priority priority)
+ throws SoamConfigException {
+ super(dmCfgType, version, remoteMepId, priority);
+ if (dmId == null) {
+ throw new SoamConfigException("DmId is null");
+ }
+ this.dmId = dmId;
+ historicalResults = new ArrayList<>();
+ }
+
+ @Override
+ public DmEntryBuilder sessionStatus(SessionStatus sessionStatus) {
+ this.sessionStatus = sessionStatus;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder frameDelayTwoWay(Duration frameDelayTwoWay) {
+ this.frameDelayTwoWay = frameDelayTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder frameDelayForward(Duration frameDelayForward) {
+ this.frameDelayForward = frameDelayForward;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder frameDelayBackward(Duration frameDelayBackward) {
+ this.frameDelayBackward = frameDelayBackward;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder interFrameDelayVariationTwoWay(
+ Duration interFrameDelayVariationTwoWay) {
+ this.interFrameDelayVariationTwoWay = interFrameDelayVariationTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder interFrameDelayVariationForward(
+ Duration interFrameDelayVariationForward) {
+ this.interFrameDelayVariationForward = interFrameDelayVariationForward;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder interFrameDelayVariationBackward(
+ Duration interFrameDelayVariationBackward) {
+ this.interFrameDelayVariationBackward = interFrameDelayVariationBackward;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder currentResult(DelayMeasurementStatCurrent currentResult) {
+ this.currentResult = currentResult;
+ return this;
+ }
+
+ @Override
+ public DmEntryBuilder addToHistoricalResults(
+ DelayMeasurementStatHistory historicalResult) {
+ this.historicalResults.add(historicalResult);
+ return this;
+ }
+
+ @Override
+ public DelayMeasurementEntry build() {
+ return new DefaultDelayMeasurementEntry(this);
+ }
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStat.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStat.java
new file mode 100644
index 0000000..01f0bc4
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStat.java
@@ -0,0 +1,589 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.Map;
+
+import com.google.common.collect.Maps;
+
+/**
+ * Abstract default implementation of DelayMeasurementStat.
+ * {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStat}.
+ */
+public abstract class DefaultDelayMeasurementStat implements DelayMeasurementStat {
+
+ private final Duration elapsedTime;
+ private final boolean suspectStatus;
+ private final Duration frameDelayTwoWayMin;
+ private final Duration frameDelayTwoWayMax;
+ private final Duration frameDelayTwoWayAvg;
+ private final Duration frameDelayForwardMin;
+ private final Duration frameDelayForwardMax;
+ private final Duration frameDelayForwardAvg;
+ private final Duration frameDelayBackwardMin;
+ private final Duration frameDelayBackwardMax;
+ private final Duration frameDelayBackwardAvg;
+ private final Duration interFrameDelayVariationTwoWayMin;
+ private final Duration interFrameDelayVariationTwoWayMax;
+ private final Duration interFrameDelayVariationTwoWayAvg;
+ private final Duration interFrameDelayVariationForwardMin;
+ private final Duration interFrameDelayVariationForwardMax;
+ private final Duration interFrameDelayVariationForwardAvg;
+ private final Duration interFrameDelayVariationBackwardMin;
+ private final Duration interFrameDelayVariationBackwardMax;
+ private final Duration interFrameDelayVariationBackwardAvg;
+ private final Duration frameDelayRangeTwoWayMax;
+ private final Duration frameDelayRangeTwoWayAvg;
+ private final Duration frameDelayRangeForwardMax;
+ private final Duration frameDelayRangeForwardAvg;
+ private final Duration frameDelayRangeBackwardMax;
+ private final Duration frameDelayRangeBackwardAvg;
+ private final Integer soamPdusSent;
+ private final Integer soamPdusReceived;
+ private final Map<Duration, Integer> frameDelayTwoWayBins;
+ private final Map<Duration, Integer> frameDelayForwardBins;
+ private final Map<Duration, Integer> frameDelayBackwardBins;
+ private final Map<Duration, Integer> interFrameDelayVariationTwoWayBins;
+ private final Map<Duration, Integer> interFrameDelayVariationForwardBins;
+ private final Map<Duration, Integer> interFrameDelayVariationBackwardBins;
+ private final Map<Duration, Integer> frameDelayRangeTwoWayBins;
+ private final Map<Duration, Integer> frameDelayRangeForwardBins;
+ private final Map<Duration, Integer> frameDelayRangeBackwardBins;
+
+ protected DefaultDelayMeasurementStat(DefaultDmStatBuilder builder) {
+ this.elapsedTime = builder.elapsedTime;
+ this.suspectStatus = builder.suspectStatus;
+ this.frameDelayTwoWayMin = builder.frameDelayTwoWayMin;
+ this.frameDelayTwoWayMax = builder.frameDelayTwoWayMax;
+ this.frameDelayTwoWayAvg = builder.frameDelayTwoWayAvg;
+ this.frameDelayForwardMin = builder.frameDelayForwardMin;
+ this.frameDelayForwardMax = builder.frameDelayForwardMax;
+ this.frameDelayForwardAvg = builder.frameDelayForwardAvg;
+ this.frameDelayBackwardMin = builder.frameDelayBackwardMin;
+ this.frameDelayBackwardMax = builder.frameDelayBackwardMax;
+ this.frameDelayBackwardAvg = builder.frameDelayBackwardAvg;
+ this.interFrameDelayVariationTwoWayMin = builder.interFrameDelayVariationTwoWayMin;
+ this.interFrameDelayVariationTwoWayMax = builder.interFrameDelayVariationTwoWayMax;
+ this.interFrameDelayVariationTwoWayAvg = builder.interFrameDelayVariationTwoWayAvg;
+ this.interFrameDelayVariationForwardMin = builder.interFrameDelayVariationForwardMin;
+ this.interFrameDelayVariationForwardMax = builder.interFrameDelayVariationForwardMax;
+ this.interFrameDelayVariationForwardAvg = builder.interFrameDelayVariationForwardAvg;
+ this.interFrameDelayVariationBackwardMin = builder.interFrameDelayVariationBackwardMin;
+ this.interFrameDelayVariationBackwardMax = builder.interFrameDelayVariationBackwardMax;
+ this.interFrameDelayVariationBackwardAvg = builder.interFrameDelayVariationBackwardAvg;
+ this.frameDelayRangeTwoWayMax = builder.frameDelayRangeTwoWayMax;
+ this.frameDelayRangeTwoWayAvg = builder.frameDelayRangeTwoWayAvg;
+ this.frameDelayRangeForwardMax = builder.frameDelayRangeForwardMax;
+ this.frameDelayRangeForwardAvg = builder.frameDelayRangeForwardAvg;
+ this.frameDelayRangeBackwardMax = builder.frameDelayRangeBackwardMax;
+ this.frameDelayRangeBackwardAvg = builder.frameDelayRangeBackwardAvg;
+ this.soamPdusSent = builder.soamPdusSent;
+ this.soamPdusReceived = builder.soamPdusReceived;
+ this.frameDelayTwoWayBins = builder.frameDelayTwoWayBins;
+ this.frameDelayForwardBins = builder.frameDelayForwardBins;
+ this.frameDelayBackwardBins = builder.frameDelayBackwardBins;
+ this.interFrameDelayVariationTwoWayBins = builder.interFrameDelayVariationTwoWayBins;
+ this.interFrameDelayVariationForwardBins = builder.interFrameDelayVariationForwardBins;
+ this.interFrameDelayVariationBackwardBins = builder.interFrameDelayVariationBackwardBins;
+ this.frameDelayRangeTwoWayBins = builder.frameDelayRangeTwoWayBins;
+ this.frameDelayRangeForwardBins = builder.frameDelayRangeForwardBins;
+ this.frameDelayRangeBackwardBins = builder.frameDelayRangeBackwardBins;
+ }
+
+ @Override
+ public Duration elapsedTime() {
+ return elapsedTime;
+ }
+
+ @Override
+ public boolean suspectStatus() {
+ return suspectStatus;
+ }
+
+ @Override
+ public Duration frameDelayTwoWayMin() {
+ return frameDelayTwoWayMin;
+ }
+
+ @Override
+ public Duration frameDelayTwoWayMax() {
+ return frameDelayTwoWayMax;
+ }
+
+ @Override
+ public Duration frameDelayTwoWayAvg() {
+ return frameDelayTwoWayAvg;
+ }
+
+ @Override
+ public Duration frameDelayForwardMin() {
+ return frameDelayForwardMin;
+ }
+
+ @Override
+ public Duration frameDelayForwardMax() {
+ return frameDelayForwardMax;
+ }
+
+ @Override
+ public Duration frameDelayForwardAvg() {
+ return frameDelayForwardAvg;
+ }
+
+ @Override
+ public Duration frameDelayBackwardMin() {
+ return frameDelayBackwardMin;
+ }
+
+ @Override
+ public Duration frameDelayBackwardMax() {
+ return frameDelayBackwardMax;
+ }
+
+ @Override
+ public Duration frameDelayBackwardAvg() {
+ return frameDelayBackwardAvg;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationTwoWayMin() {
+ return interFrameDelayVariationTwoWayMin;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationTwoWayMax() {
+ return interFrameDelayVariationTwoWayMax;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationTwoWayAvg() {
+ return interFrameDelayVariationTwoWayAvg;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationForwardMin() {
+ return interFrameDelayVariationForwardMin;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationForwardMax() {
+ return interFrameDelayVariationForwardMax;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationForwardAvg() {
+ return interFrameDelayVariationForwardAvg;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationBackwardMin() {
+ return interFrameDelayVariationBackwardMin;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationBackwardMax() {
+ return interFrameDelayVariationBackwardMax;
+ }
+
+ @Override
+ public Duration interFrameDelayVariationBackwardAvg() {
+ return interFrameDelayVariationBackwardAvg;
+ }
+
+ @Override
+ public Duration frameDelayRangeTwoWayMax() {
+ return frameDelayRangeTwoWayMax;
+ }
+
+ @Override
+ public Duration frameDelayRangeTwoWayAvg() {
+ return frameDelayRangeTwoWayAvg;
+ }
+
+ @Override
+ public Duration frameDelayRangeForwardMax() {
+ return frameDelayRangeForwardMax;
+ }
+
+ @Override
+ public Duration frameDelayRangeForwardAvg() {
+ return frameDelayRangeForwardAvg;
+ }
+
+ @Override
+ public Duration frameDelayRangeBackwardMax() {
+ return frameDelayRangeBackwardMax;
+ }
+
+ @Override
+ public Duration frameDelayRangeBackwardAvg() {
+ return frameDelayRangeBackwardAvg;
+ }
+
+ @Override
+ public Integer soamPdusSent() {
+ return soamPdusSent;
+ }
+
+ @Override
+ public Integer soamPdusReceived() {
+ return soamPdusReceived;
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayTwoWayBins() {
+ if (frameDelayTwoWayBins != null) {
+ return Maps.newHashMap(frameDelayTwoWayBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayForwardBins() {
+ if (frameDelayForwardBins != null) {
+ return Maps.newHashMap(frameDelayForwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayBackwardBins() {
+ if (frameDelayBackwardBins != null) {
+ return Maps.newHashMap(frameDelayBackwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> interFrameDelayVariationTwoWayBins() {
+ if (interFrameDelayVariationTwoWayBins != null) {
+ return Maps.newHashMap(interFrameDelayVariationTwoWayBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> interFrameDelayVariationForwardBins() {
+ if (interFrameDelayVariationForwardBins != null) {
+ return Maps.newHashMap(interFrameDelayVariationForwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> interFrameDelayVariationBackwardBins() {
+ if (interFrameDelayVariationBackwardBins != null) {
+ return Maps.newHashMap(interFrameDelayVariationBackwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayRangeTwoWayBins() {
+ if (frameDelayRangeTwoWayBins != null) {
+ return Maps.newHashMap(frameDelayRangeTwoWayBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayRangeForwardBins() {
+ if (frameDelayRangeForwardBins != null) {
+ return Maps.newHashMap(frameDelayRangeForwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map<Duration, Integer> frameDelayRangeBackwardBins() {
+ if (frameDelayRangeBackwardBins != null) {
+ return Maps.newHashMap(frameDelayRangeBackwardBins);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Abstract builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStat}.
+ */
+ protected abstract static class DefaultDmStatBuilder implements DmStatBuilder {
+
+ private final Duration elapsedTime;
+ private final boolean suspectStatus;
+ private Duration frameDelayTwoWayMin;
+ private Duration frameDelayTwoWayMax;
+ private Duration frameDelayTwoWayAvg;
+ private Duration frameDelayForwardMin;
+ private Duration frameDelayForwardMax;
+ private Duration frameDelayForwardAvg;
+ private Duration frameDelayBackwardMin;
+ private Duration frameDelayBackwardMax;
+ private Duration frameDelayBackwardAvg;
+ private Duration interFrameDelayVariationTwoWayMin;
+ private Duration interFrameDelayVariationTwoWayMax;
+ private Duration interFrameDelayVariationTwoWayAvg;
+ private Duration interFrameDelayVariationForwardMin;
+ private Duration interFrameDelayVariationForwardMax;
+ private Duration interFrameDelayVariationForwardAvg;
+ private Duration interFrameDelayVariationBackwardMin;
+ private Duration interFrameDelayVariationBackwardMax;
+ private Duration interFrameDelayVariationBackwardAvg;
+ private Duration frameDelayRangeTwoWayMax;
+ private Duration frameDelayRangeTwoWayAvg;
+ private Duration frameDelayRangeForwardMax;
+ private Duration frameDelayRangeForwardAvg;
+ private Duration frameDelayRangeBackwardMax;
+ private Duration frameDelayRangeBackwardAvg;
+ private Integer soamPdusSent;
+ private Integer soamPdusReceived;
+ private Map<Duration, Integer> frameDelayTwoWayBins;
+ private Map<Duration, Integer> frameDelayForwardBins;
+ private Map<Duration, Integer> frameDelayBackwardBins;
+ private Map<Duration, Integer> interFrameDelayVariationTwoWayBins;
+ private Map<Duration, Integer> interFrameDelayVariationForwardBins;
+ private Map<Duration, Integer> interFrameDelayVariationBackwardBins;
+ private Map<Duration, Integer> frameDelayRangeTwoWayBins;
+ private Map<Duration, Integer> frameDelayRangeForwardBins;
+ private Map<Duration, Integer> frameDelayRangeBackwardBins;
+
+ protected DefaultDmStatBuilder(Duration elapsedTime, boolean suspectStatus) {
+ this.elapsedTime = elapsedTime;
+ this.suspectStatus = suspectStatus;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayTwoWayMin(Duration frameDelayTwoWayMin) {
+ this.frameDelayTwoWayMin = frameDelayTwoWayMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayTwoWayMax(Duration frameDelayTwoWayMax) {
+ this.frameDelayTwoWayMax = frameDelayTwoWayMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayTwoWayAvg(Duration frameDelayTwoWayAvg) {
+ this.frameDelayTwoWayAvg = frameDelayTwoWayAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayForwardMin(Duration frameDelayForwardMin) {
+ this.frameDelayForwardMin = frameDelayForwardMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayForwardMax(Duration frameDelayForwardMax) {
+ this.frameDelayForwardMax = frameDelayForwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayForwardAvg(Duration frameDelayForwardAvg) {
+ this.frameDelayForwardAvg = frameDelayForwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayBackwardMin(Duration frameDelayBackwardMin) {
+ this.frameDelayBackwardMin = frameDelayBackwardMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayBackwardMax(Duration frameDelayBackwardMax) {
+ this.frameDelayBackwardMax = frameDelayBackwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayBackwardAvg(Duration frameDelayBackwardAvg) {
+ this.frameDelayBackwardAvg = frameDelayBackwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationTwoWayMin(Duration interFrameDelayVariationTwoWayMin) {
+ this.interFrameDelayVariationTwoWayMin = interFrameDelayVariationTwoWayMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationTwoWayMax(Duration interFrameDelayVariationTwoWayMax) {
+ this.interFrameDelayVariationTwoWayMax = interFrameDelayVariationTwoWayMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationTwoWayAvg(Duration interFrameDelayVariationTwoWayAvg) {
+ this.interFrameDelayVariationTwoWayAvg = interFrameDelayVariationTwoWayAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationForwardMin(Duration interFrameDelayVariationForwardMin) {
+ this.interFrameDelayVariationForwardMin = interFrameDelayVariationForwardMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationForwardMax(Duration interFrameDelayVariationForwardMax) {
+ this.interFrameDelayVariationForwardMax = interFrameDelayVariationForwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationForwardAvg(Duration interFrameDelayVariationForwardAvg) {
+ this.interFrameDelayVariationForwardAvg = interFrameDelayVariationForwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationBackwardMin(Duration interFrameDelayVariationBackwardMin) {
+ this.interFrameDelayVariationBackwardMin = interFrameDelayVariationBackwardMin;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationBackwardMax(Duration interFrameDelayVariationBackwardMax) {
+ this.interFrameDelayVariationBackwardMax = interFrameDelayVariationBackwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationBackwardAvg(Duration interFrameDelayVariationBackwardAvg) {
+ this.interFrameDelayVariationBackwardAvg = interFrameDelayVariationBackwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeTwoWayMax(Duration frameDelayRangeTwoWayMax) {
+ this.frameDelayRangeTwoWayMax = frameDelayRangeTwoWayMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeTwoWayAvg(Duration frameDelayRangeTwoWayAvg) {
+ this.frameDelayRangeTwoWayAvg = frameDelayRangeTwoWayAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeForwardMax(Duration frameDelayRangeForwardMax) {
+ this.frameDelayRangeForwardMax = frameDelayRangeForwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeForwardAvg(Duration frameDelayRangeForwardAvg) {
+ this.frameDelayRangeForwardAvg = frameDelayRangeForwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeBackwardMax(Duration frameDelayRangeBackwardMax) {
+ this.frameDelayRangeBackwardMax = frameDelayRangeBackwardMax;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeBackwardAvg(Duration frameDelayRangeBackwardAvg) {
+ this.frameDelayRangeBackwardAvg = frameDelayRangeBackwardAvg;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder soamPdusSent(Integer soamPdusSent) {
+ this.soamPdusSent = soamPdusSent;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder soamPdusReceived(Integer soamPdusReceived) {
+ this.soamPdusReceived = soamPdusReceived;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayTwoWayBins(Map<Duration, Integer> frameDelayTwoWayBins) {
+ this.frameDelayTwoWayBins = frameDelayTwoWayBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayForwardBins(Map<Duration, Integer> frameDelayForwardBins) {
+ this.frameDelayForwardBins = frameDelayForwardBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayBackwardBins(Map<Duration, Integer> frameDelayBackwardBins) {
+ this.frameDelayBackwardBins = frameDelayBackwardBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationTwoWayBins(
+ Map<Duration, Integer> interFrameDelayVariationTwoWayBins) {
+ this.interFrameDelayVariationTwoWayBins = interFrameDelayVariationTwoWayBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationForwardBins(
+ Map<Duration, Integer> interFrameDelayVariationForwardBins) {
+ this.interFrameDelayVariationForwardBins = interFrameDelayVariationForwardBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder interFrameDelayVariationBackwardBins(
+ Map<Duration, Integer> interFrameDelayVariationBackwardBins) {
+ this.interFrameDelayVariationBackwardBins = interFrameDelayVariationBackwardBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeTwoWayBins(Map<Duration, Integer> frameDelayRangeTwoWayBins) {
+ this.frameDelayRangeTwoWayBins = frameDelayRangeTwoWayBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeForwardBins(Map<Duration, Integer> frameDelayRangeForwardBins) {
+ this.frameDelayRangeForwardBins = frameDelayRangeForwardBins;
+ return this;
+ }
+
+ @Override
+ public DmStatBuilder frameDelayRangeBackwardBins(Map<Duration, Integer> frameDelayRangeBackwardBins) {
+ this.frameDelayRangeBackwardBins = frameDelayRangeBackwardBins;
+ return this;
+ }
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatCurrent.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatCurrent.java
new file mode 100644
index 0000000..7263134
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatCurrent.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.time.Instant;
+
+/**
+ * The default implementation of DelayMeasurementStatCurrent.
+ * {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent}.
+ */
+public final class DefaultDelayMeasurementStatCurrent
+ extends DefaultDelayMeasurementStat
+ implements DelayMeasurementStatCurrent {
+
+ private final Instant startTime;
+
+ protected DefaultDelayMeasurementStatCurrent(DefaultDmStatCurrentBuilder builder) {
+ super(builder);
+ this.startTime = builder.startTime;
+ }
+
+ @Override
+ public Instant startTime() {
+ return startTime;
+ }
+
+ public static DmStatCurrentBuilder builder(Duration elapsedTime, boolean suspectStatus) {
+ return new DefaultDmStatCurrentBuilder(elapsedTime, suspectStatus);
+ }
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent}.
+ */
+ private static final class DefaultDmStatCurrentBuilder extends DefaultDmStatBuilder
+ implements DmStatCurrentBuilder {
+
+ private Instant startTime;
+
+ private DefaultDmStatCurrentBuilder(Duration elapsedTime, boolean suspectStatus) {
+ super(elapsedTime, suspectStatus);
+ }
+
+ @Override
+ public DmStatCurrentBuilder startTime(Instant startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ @Override
+ public DelayMeasurementStat build() {
+ return new DefaultDelayMeasurementStatCurrent(this);
+ }
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatHistory.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatHistory.java
new file mode 100644
index 0000000..4db3683
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementStatHistory.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.time.Instant;
+
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+/**
+ * The default implementation of DelayMeasurementStatHistory.
+ * {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatHistory}.
+ */
+public class DefaultDelayMeasurementStatHistory extends DefaultDelayMeasurementStat
+ implements DelayMeasurementStatHistory {
+
+ private final SoamId historyStatsId;
+ private final Instant endTime;
+
+ protected DefaultDelayMeasurementStatHistory(DefaultDmStatHistoryBuilder builder) {
+ super(builder);
+ this.historyStatsId = builder.historyStatsId;
+ this.endTime = builder.endTime;
+ }
+
+ @Override
+ public SoamId historyStatsId() {
+ return historyStatsId;
+ }
+
+ @Override
+ public Instant endTime() {
+ return endTime;
+ }
+
+ public static DmStatHistoryBuilder builder(SoamId historyStatsId,
+ Duration elapsedTime, boolean suspectStatus) {
+ return new DefaultDmStatHistoryBuilder(
+ historyStatsId, elapsedTime, suspectStatus);
+ }
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatHistory}.
+ */
+ private static final class DefaultDmStatHistoryBuilder
+ extends DefaultDmStatBuilder implements DmStatHistoryBuilder {
+ private final SoamId historyStatsId;
+ private Instant endTime;
+
+ private DefaultDmStatHistoryBuilder(SoamId historyStatsId,
+ Duration elapsedTime, boolean suspectStatus) {
+ super(elapsedTime, suspectStatus);
+ this.historyStatsId = historyStatsId;
+ }
+
+ @Override
+ public DmStatHistoryBuilder endTime(Instant endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ @Override
+ public DelayMeasurementStat build() {
+ return new DefaultDelayMeasurementStatHistory(this);
+ }
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementThreshold.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementThreshold.java
new file mode 100644
index 0000000..90a8c25
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DefaultDelayMeasurementThreshold.java
@@ -0,0 +1,458 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+/**
+ * The default implementation of DelayMeasurementThreshold.
+ * {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementThreshold}.
+ */
+public final class DefaultDelayMeasurementThreshold
+ implements DelayMeasurementThreshold {
+
+ private final SoamId threshId;
+ private final Collection<ThresholdOption> thresholdsEnabled;
+ private final Duration measuredFrameDelayTwoWay;
+ private final Duration maxFrameDelayTwoWay;
+ private final Duration averageFrameDelayTwoWay;
+ private final Duration measuredInterFrameDelayVariationTwoWay;
+ private final Duration maxInterFrameDelayVariationTwoWay;
+ private final Duration averageInterFrameDelayVariationTwoWay;
+ private final Duration maxFrameDelayRangeTwoWay;
+ private final Duration averageFrameDelayRangeTwoWay;
+ private final Duration measuredFrameDelayForward;
+ private final Duration maxFrameDelayForward;
+ private final Duration averageFrameDelayForward;
+ private final Duration measuredInterFrameDelayVariationForward;
+ private final Duration maxInterFrameDelayVariationForward;
+ private final Duration averageInterFrameDelayVariationForward;
+ private final Duration maxFrameDelayRangeForward;
+ private final Duration averageFrameDelayRangeForward;
+ private final Duration measuredFrameDelayBackward;
+ private final Duration maxFrameDelayBackward;
+ private final Duration averageFrameDelayBackward;
+ private final Duration measuredInterFrameDelayVariationBackward;
+ private final Duration maxInterFrameDelayVariationBackward;
+ private final Duration averageInterFrameDelayVariationBackward;
+ private final Duration maxFrameDelayRangeBackward;
+ private final Duration averageFrameDelayRangeBackward;
+
+ private DefaultDelayMeasurementThreshold(DefaultDmThresholdBuilder builder) {
+ this.threshId = builder.threshId;
+ this.thresholdsEnabled = builder.thresholdsEnabled;
+ this.measuredFrameDelayTwoWay = builder.measuredFrameDelayTwoWay;
+ this.maxFrameDelayTwoWay = builder.maxFrameDelayTwoWay;
+ this.averageFrameDelayTwoWay = builder.averageFrameDelayTwoWay;
+ this.measuredInterFrameDelayVariationTwoWay =
+ builder.measuredInterFrameDelayVariationTwoWay;
+ this.maxInterFrameDelayVariationTwoWay =
+ builder.maxInterFrameDelayVariationTwoWay;
+ this.averageInterFrameDelayVariationTwoWay =
+ builder.averageInterFrameDelayVariationTwoWay;
+ this.maxFrameDelayRangeTwoWay = builder.maxFrameDelayRangeTwoWay;
+ this.averageFrameDelayRangeTwoWay = builder.averageFrameDelayRangeTwoWay;
+ this.measuredFrameDelayForward = builder.measuredFrameDelayForward;
+ this.maxFrameDelayForward = builder.maxFrameDelayForward;
+ this.averageFrameDelayForward = builder.averageFrameDelayForward;
+ this.measuredInterFrameDelayVariationForward =
+ builder.measuredInterFrameDelayVariationForward;
+ this.maxInterFrameDelayVariationForward =
+ builder.maxInterFrameDelayVariationForward;
+ this.averageInterFrameDelayVariationForward =
+ builder.averageInterFrameDelayVariationForward;
+ this.maxFrameDelayRangeForward = builder.maxFrameDelayRangeForward;
+ this.averageFrameDelayRangeForward = builder.averageFrameDelayRangeForward;
+ this.measuredFrameDelayBackward = builder.measuredFrameDelayBackward;
+ this.maxFrameDelayBackward = builder.maxFrameDelayBackward;
+ this.averageFrameDelayBackward = builder.averageFrameDelayBackward;
+ this.measuredInterFrameDelayVariationBackward =
+ builder.measuredInterFrameDelayVariationBackward;
+ this.maxInterFrameDelayVariationBackward =
+ builder.maxInterFrameDelayVariationBackward;
+ this.averageInterFrameDelayVariationBackward =
+ builder.averageInterFrameDelayVariationBackward;
+ this.maxFrameDelayRangeBackward =
+ builder.maxFrameDelayRangeBackward;
+ this.averageFrameDelayRangeBackward =
+ builder.averageFrameDelayRangeBackward;
+ }
+
+ @Override
+ public SoamId threshId() {
+ return threshId;
+ }
+
+ @Override
+ public Collection<ThresholdOption> thresholdsEnabled() {
+ return thresholdsEnabled;
+ }
+
+ @Override
+ public Duration measuredFrameDelayTwoWay() {
+ return measuredFrameDelayTwoWay;
+ }
+
+ @Override
+ public Duration maxFrameDelayTwoWay() {
+ return maxFrameDelayTwoWay;
+ }
+
+ @Override
+ public Duration averageFrameDelayTwoWay() {
+ return averageFrameDelayTwoWay;
+ }
+
+ @Override
+ public Duration measuredInterFrameDelayVariationTwoWay() {
+ return measuredInterFrameDelayVariationTwoWay;
+ }
+
+ @Override
+ public Duration maxInterFrameDelayVariationTwoWay() {
+ return maxInterFrameDelayVariationTwoWay;
+ }
+
+ @Override
+ public Duration averageInterFrameDelayVariationTwoWay() {
+ return averageInterFrameDelayVariationTwoWay;
+ }
+
+ @Override
+ public Duration maxFrameDelayRangeTwoWay() {
+ return maxFrameDelayRangeTwoWay;
+ }
+
+ @Override
+ public Duration averageFrameDelayRangeTwoWay() {
+ return averageFrameDelayRangeTwoWay;
+ }
+
+ @Override
+ public Duration measuredFrameDelayForward() {
+ return measuredFrameDelayForward;
+ }
+
+ @Override
+ public Duration maxFrameDelayForward() {
+ return maxFrameDelayForward;
+ }
+
+ @Override
+ public Duration averageFrameDelayForward() {
+ return averageFrameDelayForward;
+ }
+
+ @Override
+ public Duration measuredInterFrameDelayVariationForward() {
+ return measuredInterFrameDelayVariationForward;
+ }
+
+ @Override
+ public Duration maxInterFrameDelayVariationForward() {
+ return maxInterFrameDelayVariationForward;
+ }
+
+ @Override
+ public Duration averageInterFrameDelayVariationForward() {
+ return averageInterFrameDelayVariationForward;
+ }
+
+ @Override
+ public Duration maxFrameDelayRangeForward() {
+ return maxFrameDelayRangeForward;
+ }
+
+ @Override
+ public Duration averageFrameDelayRangeForward() {
+ return averageFrameDelayRangeForward;
+ }
+
+ @Override
+ public Duration measuredFrameDelayBackward() {
+ return measuredFrameDelayBackward;
+ }
+
+ @Override
+ public Duration maxFrameDelayBackward() {
+ return maxFrameDelayBackward;
+ }
+
+ @Override
+ public Duration averageFrameDelayBackward() {
+ return averageFrameDelayBackward;
+ }
+
+ @Override
+ public Duration measuredInterFrameDelayVariationBackward() {
+ return measuredInterFrameDelayVariationBackward;
+ }
+
+ @Override
+ public Duration maxInterFrameDelayVariationBackward() {
+ return maxInterFrameDelayVariationBackward;
+ }
+
+ @Override
+ public Duration averageInterFrameDelayVariationBackward() {
+ return averageInterFrameDelayVariationBackward;
+ }
+
+ @Override
+ public Duration maxFrameDelayRangeBackward() {
+ return maxFrameDelayRangeBackward;
+ }
+
+ @Override
+ public Duration averageFrameDelayRangeBackward() {
+ return averageFrameDelayRangeBackward;
+ }
+
+ public static DmThresholdBuilder builder(SoamId threshId) {
+ return new DefaultDmThresholdBuilder(threshId);
+ }
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementThreshold}.
+ */
+ private static final class DefaultDmThresholdBuilder implements DmThresholdBuilder {
+ private final SoamId threshId;
+ private Collection<ThresholdOption> thresholdsEnabled;
+ private Duration measuredFrameDelayTwoWay;
+ private Duration maxFrameDelayTwoWay;
+ private Duration averageFrameDelayTwoWay;
+ private Duration measuredInterFrameDelayVariationTwoWay;
+ private Duration maxInterFrameDelayVariationTwoWay;
+ private Duration averageInterFrameDelayVariationTwoWay;
+ private Duration maxFrameDelayRangeTwoWay;
+ private Duration averageFrameDelayRangeTwoWay;
+ private Duration measuredFrameDelayForward;
+ private Duration maxFrameDelayForward;
+ private Duration averageFrameDelayForward;
+ private Duration measuredInterFrameDelayVariationForward;
+ private Duration maxInterFrameDelayVariationForward;
+ private Duration averageInterFrameDelayVariationForward;
+ private Duration maxFrameDelayRangeForward;
+ private Duration averageFrameDelayRangeForward;
+ private Duration measuredFrameDelayBackward;
+ private Duration maxFrameDelayBackward;
+ private Duration averageFrameDelayBackward;
+ private Duration measuredInterFrameDelayVariationBackward;
+ private Duration maxInterFrameDelayVariationBackward;
+ private Duration averageInterFrameDelayVariationBackward;
+ private Duration maxFrameDelayRangeBackward;
+ private Duration averageFrameDelayRangeBackward;
+
+ protected DefaultDmThresholdBuilder(SoamId threshId) {
+ this.threshId = threshId;
+ this.thresholdsEnabled = new ArrayList<>();
+ }
+
+ @Override
+ public DmThresholdBuilder addToThresholdsEnabled(
+ ThresholdOption thresholdEnabled) {
+ this.thresholdsEnabled.add(thresholdEnabled);
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredFrameDelayTwoWay(
+ Duration measuredFrameDelayTwoWay) {
+ this.measuredFrameDelayTwoWay = measuredFrameDelayTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayTwoWay(
+ Duration maxFrameDelayTwoWay) {
+ this.maxFrameDelayTwoWay = maxFrameDelayTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayTwoWay(
+ Duration averageFrameDelayTwoWay) {
+ this.averageFrameDelayTwoWay = averageFrameDelayTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredInterFrameDelayVariationTwoWay(
+ Duration measuredInterFrameDelayVariationTwoWay) {
+ this.measuredInterFrameDelayVariationTwoWay =
+ measuredInterFrameDelayVariationTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxInterFrameDelayVariationTwoWay(
+ Duration maxInterFrameDelayVariationTwoWay) {
+ this.maxInterFrameDelayVariationTwoWay =
+ maxInterFrameDelayVariationTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageInterFrameDelayVariationTwoWay(
+ Duration averageInterFrameDelayVariationTwoWay) {
+ this.averageInterFrameDelayVariationTwoWay =
+ averageInterFrameDelayVariationTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayRangeTwoWay(
+ Duration maxFrameDelayRangeTwoWay) {
+ this.maxFrameDelayRangeTwoWay = maxFrameDelayRangeTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayRangeTwoWay(
+ Duration averageFrameDelayRangeTwoWay) {
+ this.averageFrameDelayRangeTwoWay = averageFrameDelayRangeTwoWay;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredFrameDelayForward(
+ Duration measuredFrameDelayForward) {
+ this.measuredFrameDelayForward = measuredFrameDelayForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayForward(
+ Duration maxFrameDelayForward) {
+ this.maxFrameDelayForward = maxFrameDelayForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayForward(
+ Duration averageFrameDelayForward) {
+ this.averageFrameDelayForward = averageFrameDelayForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredInterFrameDelayVariationForward(
+ Duration measuredInterFrameDelayVariationForward) {
+ this.measuredInterFrameDelayVariationForward =
+ measuredInterFrameDelayVariationForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxInterFrameDelayVariationForward(
+ Duration maxInterFrameDelayVariationForward) {
+ this.maxInterFrameDelayVariationForward =
+ maxInterFrameDelayVariationForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageInterFrameDelayVariationForward(
+ Duration averageInterFrameDelayVariationForward) {
+ this.averageInterFrameDelayVariationForward =
+ averageInterFrameDelayVariationForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayRangeForward(
+ Duration maxFrameDelayRangeForward) {
+ this.maxFrameDelayRangeForward = maxFrameDelayRangeForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayRangeForward(
+ Duration averageFrameDelayRangeForward) {
+ this.averageFrameDelayRangeForward = averageFrameDelayRangeForward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredFrameDelayBackward(
+ Duration measuredFrameDelayBackward) {
+ this.measuredFrameDelayBackward = measuredFrameDelayBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayBackward(
+ Duration maxFrameDelayBackward) {
+ this.maxFrameDelayBackward = maxFrameDelayBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayBackward(
+ Duration averageFrameDelayBackward) {
+ this.averageFrameDelayBackward = averageFrameDelayBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder measuredInterFrameDelayVariationBackward(
+ Duration measuredInterFrameDelayVariationBackward) {
+ this.measuredInterFrameDelayVariationBackward =
+ measuredInterFrameDelayVariationBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxInterFrameDelayVariationBackward(
+ Duration maxInterFrameDelayVariationBackward) {
+ this.maxInterFrameDelayVariationBackward =
+ maxInterFrameDelayVariationBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageInterFrameDelayVariationBackward(
+ Duration averageInterFrameDelayVariationBackward) {
+ this.averageInterFrameDelayVariationBackward =
+ averageInterFrameDelayVariationBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder maxFrameDelayRangeBackward(
+ Duration maxFrameDelayRangeBackward) {
+ this.maxFrameDelayRangeBackward = maxFrameDelayRangeBackward;
+ return this;
+ }
+
+ @Override
+ public DmThresholdBuilder averageFrameDelayRangeBackward(
+ Duration averageFrameDelayRangeBackward) {
+ this.averageFrameDelayRangeBackward = averageFrameDelayRangeBackward;
+ return this;
+ }
+
+ @Override
+ public DelayMeasurementThreshold build() {
+ return new DefaultDelayMeasurementThreshold(this);
+ }
+ }
+
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementCreate.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementCreate.java
new file mode 100644
index 0000000..4934146
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementCreate.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.soam.MeasurementCreateBase;
+import org.onosproject.incubator.net.l2monitoring.soam.SoamConfigException;
+
+/**
+ * A model of Delay Measurement from ITU Y.1731 Chapter 8.2, MEF 17, MEF 36.1 and MEF 39.
+ *
+ * In this model delay measurements entries are returned as a collection in the
+ * MepEntry. In this way Delay Measurements are created by calling on the
+ * Create Delay Measurement function, passing this DelayMeasurementCreate object
+ * and any other arguments needed.
+ * The Delay Measurement Entry is a result and not configured or
+ * persisted in ONOS, but instead is is passed on to some analytics system
+ */
+public interface DelayMeasurementCreate extends MeasurementCreateBase {
+ /**
+ * The type of Delay Measurement is to be performed.
+ * The exact PDUs to use are specified by this object in combination with version
+ * @return enumerated type
+ */
+ DmType dmCfgType();
+
+ /**
+ * A vector of bits that indicates the type of SOAM DM counters that are enabled.
+ * A present bit enables the specific SOAM DM counter.
+ * A not present bit disables the SOAM DM counter.
+ * If a particular SOAM DM counter is not supported the BIT value is not present.
+ * Not all SOAM DM counters are supported for all SOAM DM types.
+ * @return A collection of options
+ */
+ Collection<MeasurementOption> measurementsEnabled();
+
+ /**
+ * The number of measurement bins per Measurement Interval for Frame Delay measurements.
+ * At least 3 bins are to be supported; at least 10 bins are recommended to be supported
+ * @return the number of bins
+ */
+ Short binsPerFdInterval();
+
+ /**
+ * The number of measurement bins per Measurement Interval for Inter-Frame Delay Variation measurements.
+ * The minimum number of measurement bins to be supported is 2. The desired
+ * number of measurements bins to be supported is 10
+ * @return the number of bins
+ */
+ Short binsPerIfdvInterval();
+
+ /**
+ * The selection offset for Inter-Frame Delay Variation measurements.
+ * If this value is set to n, then the IFDV is calculated by taking the
+ * difference in frame delay between frame F and frame (F+n).
+ * reference: MEF-SOAM-PM-MIB.mefSoamDmCfgInterFrameDelayVariationSelectionOffset
+ * @return The selection offset
+ */
+ Short ifdvSelectionOffset();
+
+ /**
+ * The number of measurement bins per Measurement Interval for Frame Delay Range measurements.
+ * @return the number of bins
+ */
+ Short binsPerFdrInterval();
+
+ /**
+ * The Delay Measurement threshold configuration values for DM Performance Monitoring.
+ * The main purpose of the threshold configuration list is to configure
+ * threshold alarm notifications indicating that a specific performance metric
+ * is not being met
+ * @return a collection of Thresholds
+ */
+ Collection<DelayMeasurementThreshold> thresholds();
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementCreate}.
+ */
+ public interface DmCreateBuilder extends MeasCreateBaseBuilder {
+
+ DmCreateBuilder addToMeasurementsEnabled(
+ MeasurementOption measurementEnabled);
+
+ DmCreateBuilder binsPerFdInterval(Short binsPerFdInterval)
+ throws SoamConfigException;
+
+ DmCreateBuilder binsPerIfdvInterval(Short binsPerIfdvInterval)
+ throws SoamConfigException;
+
+ DmCreateBuilder ifdvSelectionOffset(Short ifdvSelectionOffset)
+ throws SoamConfigException;
+
+ DmCreateBuilder binsPerFdrInterval(Short binsPerFdrInterval)
+ throws SoamConfigException;
+
+ DmCreateBuilder addToThresholds(DelayMeasurementThreshold threshold);
+
+ DelayMeasurementCreate build();
+ }
+
+ /**
+ * Enumerated options for Delay Measurement Types.
+ */
+ public enum DmType {
+ /**
+ * DMM SOAM PDU generated, DMR responses received (one-way or two-way measurements).
+ */
+ DMDMM,
+ /**
+ * 1DM SOAM PDU generated (one-way measurements are made by the receiver).
+ */
+ DM1DMTX,
+ /**
+ * 1DM SOAM PDU received and tracked (one-way measurements).
+ */
+ DM1DMRX
+ }
+
+ /**
+ * Supported Versions of Y.1731.
+ */
+ public enum Version {
+ Y17312008("Y.1731-2008"),
+ Y17312011("Y.1731-2011");
+
+ private String literal;
+ private Version(String literal) {
+ this.literal = literal;
+ }
+
+ public String literal() {
+ return literal;
+ }
+ }
+
+ /**
+ * Selection of Measurement types.
+ */
+ public enum MeasurementOption {
+ SOAM_PDUS_SENT,
+ SOAM_PDUS_RECEIVED,
+ FRAME_DELAY_TWO_WAY_BINS,
+ FRAME_DELAY_TWO_WAY_MIN,
+ FRAME_DELAY_TWO_WAY_MAX,
+ FRAME_DELAY_TWO_WAY_AVERAGE,
+ FRAME_DELAY_FORWARD_BINS,
+ FRAME_DELAY_FORWARD_MIN,
+ FRAME_DELAY_FORWARD_MAX,
+ FRAME_DELAY_FORWARD_AVERAGE,
+ FRAME_DELAY_BACKWARD_BINS,
+ FRAME_DELAY_BACKWARD_MIN,
+ FRAME_DELAY_BACKWARD_MAX,
+ FRAME_DELAY_BACKWARD_AVERAGE,
+ INTER_FRAME_DELAY_VARIATION_FORWARD_BINS,
+ INTER_FRAME_DELAY_VARIATION_FORWARD_MIN,
+ INTER_FRAME_DELAY_VARIATION_FORWARD_MAX,
+ INTER_FRAME_DELAY_VARIATION_FORWARD_AVERAGE,
+ INTER_FRAME_DELAY_VARIATION_BACKWARD_BINS,
+ INTER_FRAME_DELAY_VARIATION_BACKWARD_MIN,
+ INTER_FRAME_DELAY_VARIATION_BACKWARD_MAX,
+ INTER_FRAME_DELAY_VARIATION_BACKWARD_AVERAGE,
+ INTER_FRAME_DELAY_VARIATION_TWO_WAY_BINS,
+ INTER_FRAME_DELAY_VARIATION_TWO_WAY_MIN,
+ INTER_FRAME_DELAY_VARIATION_TWO_WAY_MAX,
+ INTER_FRAME_DELAY_VARIATION_TWO_WAY_AVERAGE,
+ FRAME_DELAY_RANGE_FORWARD_BINS,
+ FRAME_DELAY_RANGE_FORWARD_MAX,
+ FRAME_DELAY_RANGE_FORWARD_AVERAGE,
+ FRAME_DELAY_RANGE_BACKWARD_BINS,
+ FRAME_DELAY_RANGE_BACKWARD_MAX,
+ FRAME_DELAY_RANGE_BACKWARD_AVERAGE,
+ FRAME_DELAY_RANGE_TWO_WAY_BINS,
+ FRAME_DELAY_RANGE_TWO_WAY_MAX,
+ FRAME_DELAY_RANGE_TWO_WAY_AVERAGE,
+ MEASURED_STATS_FRAME_DELAY_TWO_WAY,
+ MEASURED_STATS_FRAME_DELAY_FORWARD,
+ MEASURED_STATS_FRAME_DELAY_BACKWARD,
+ MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_TWO_WAY,
+ MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_FORWARD,
+ MEASURED_STATS_INTER_FRAME_DELAY_VARIATION_BACKWARD;
+ }
+
+ /**
+ * Selection of Data Patterns.
+ */
+ public enum DataPattern {
+ ZEROES,
+ ONES;
+ }
+
+ /**
+ * Selection of Test TLV Patterns.
+ */
+ public enum TestTlvPattern {
+ /**
+ * This test pattern is a Null signal without CRC-32.
+ */
+ NULL_SIGNAL_WITHOUT_CRC_32,
+ /**
+ * This test pattern is a Null signal with CRC-32.
+ */
+ NULL_SIGNAL_WITH_CRC_32,
+ /**
+ * This test pattern is a PRBS 2^31-1 without CRC-32.
+ */
+ PRBS_2311_WITHOUT_CRC_32,
+ /**
+ * This test pattern is a PRBS 2^31-1 with CRC-32.
+ */
+ PRBS_2311_WITH_CRC_32;
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementEntry.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementEntry.java
new file mode 100644
index 0000000..3571922
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementEntry.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+/**
+ * Delay Measurement from ITU Y.1731 Chapter 8.2, MEF 17, MEF 36.1 and MEF 39.
+ *
+ * This represents the result returned and includes the parameters used to
+ * configure the DM when it was created
+ */
+public interface DelayMeasurementEntry extends DelayMeasurementCreate {
+ /**
+ * This uniquely identifies a scheduled measurement.
+ * It is automatically generated by the server on creation of a new measurement
+ * @return the id
+ */
+ SoamId dmId();
+
+ /**
+ * The current status of the DM session.
+ * A value of 'active' indicates the current DM session is active,
+ * i.e. the current time lies between the start time and the stop time, and
+ * enabled is true. A value of 'not-active' indicates the current DM session
+ * is not active, i.e. it has not started yet, has stopped upon reaching the
+ * stop time, or is disabled
+ * @return the status
+ */
+ SessionStatus sessionStatus();
+
+ /**
+ * The two-way frame delay calculated by this MEP from the last received SOAM PDU.
+ * This object is undefined is measurement-type is dm1-transmitted or dm1-received
+ * @return The delay as a java duration
+ */
+ Duration frameDelayTwoWay();
+
+ /**
+ * The frame delay in the forward direction calculated by this MEP from the last received SOAM PDU.
+ * The value of this object may not be accurate in the absence of sufficiently
+ * precise clock synchronization.
+ * This object is undefined is measurement-type is dm1-transmitted
+ * @return The delay as a java duration
+ */
+ Duration frameDelayForward();
+
+ /**
+ * The frame delay in the backward direction calculated by this MEP from the last received SOAM PDU.
+ * The value of this object may not be accurate in the absence of sufficiently
+ * precise clock synchronization.
+ * This object is undefined is measurement-type is dm1-transmitted or dm1-received
+ * @return The delay as a java duration
+ */
+ Duration frameDelayBackward();
+
+ /**
+ * The last two-way inter-frame delay interval calculated by this MEP.
+ * The value of this object is undefined when measurement-type is dm1-transmitted or dm1-received
+ * @return The delay as a java duration
+ */
+ Duration interFrameDelayVariationTwoWay();
+
+ /**
+ * The last one-way inter-frame delay interval in the forward direction calculated by this MEP.
+ * The value of this object is undefined when measurement-type is dm1-transmitted
+ * @return The delay as a java duration
+ */
+ Duration interFrameDelayVariationForward();
+
+ /**
+ * The last one-way inter-frame delay interval in the backward direction calculated by this MEP.
+ * The value of this object is undefined when measurement-type is
+ * dm1-transmitted or dm1-received
+ * @return The delay as a java duration
+ */
+ Duration interFrameDelayVariationBackward();
+
+ /**
+ * The results for the current Measurement Interval in a SOAM Delay Measurement session.
+ * gathered during the interval indicated by measurement-interval.
+ * @return The current set of results
+ */
+ DelayMeasurementStatCurrent currentResult();
+
+ /**
+ * The results for history Measurement Intervals in a SOAM Delay Measurement session.
+ * @return A collection of history results
+ */
+ Collection<DelayMeasurementStatHistory> historicalResults();
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementEntry}.
+ */
+ public interface DmEntryBuilder extends DmCreateBuilder {
+ DmEntryBuilder sessionStatus(SessionStatus sessionStatus);
+
+ DmEntryBuilder frameDelayTwoWay(Duration frameDelayTwoWay);
+
+ DmEntryBuilder frameDelayForward(Duration frameDelayForward);
+
+ DmEntryBuilder frameDelayBackward(Duration frameDelayBackward);
+
+ DmEntryBuilder interFrameDelayVariationTwoWay(Duration interFrameDelayVariationTwoWay);
+
+ DmEntryBuilder interFrameDelayVariationForward(Duration interFrameDelayVariationForward);
+
+ DmEntryBuilder interFrameDelayVariationBackward(Duration interFrameDelayVariationBackward);
+
+ DmEntryBuilder currentResult(DelayMeasurementStatCurrent currentResult);
+
+ DmEntryBuilder addToHistoricalResults(
+ DelayMeasurementStatHistory historicalResult);
+
+ DelayMeasurementEntry build();
+ }
+
+ /**
+ * Session Status options.
+ */
+ public enum SessionStatus {
+ ACTIVE,
+ NOT_ACTIVE;
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStat.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStat.java
new file mode 100644
index 0000000..c218c06
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStat.java
@@ -0,0 +1,356 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.Map;
+
+/**
+ * Abstract object as a base for DelayMeasurementStatCurrent and DelayMeasurementStatHistory interfaces.
+ */
+public interface DelayMeasurementStat {
+ /**
+ * The time that the current Measurement Interval has been running.
+ * @return A java duration
+ */
+ Duration elapsedTime();
+
+ /**
+ * The suspect flag for the current measurement interval in which the notification was generated.
+ * reference MEF-SOAM-PM-MIB.mefSoamPmNotificationObjSuspect";
+ * @return true if the measurement might include an error
+ */
+ boolean suspectStatus();
+
+ /**
+ * The minimum two-way frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayTwoWayMin();
+
+ /**
+ * The maximum two-way frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayTwoWayMax();
+
+ /**
+ * The average two-way frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayTwoWayAvg();
+
+ /**
+ * The minimum foward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayForwardMin();
+
+ /**
+ * The maximum forward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayForwardMax();
+
+ /**
+ * The average forward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayForwardAvg();
+
+ /**
+ * The minimum backward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayBackwardMin();
+
+ /**
+ * The maximum backward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayBackwardMax();
+
+ /**
+ * The average backward frame delay calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayBackwardAvg();
+
+ /**
+ * The minimum two-way inter-frame delay interval calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationTwoWayMin();
+
+ /**
+ * The maximum two-way inter-frame delay interval calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationTwoWayMax();
+
+ /**
+ * The average two-way inter-frame delay interval calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationTwoWayAvg();
+
+ /**
+ * The minimum one-way inter-frame delay interval in the forward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationForwardMin();
+
+ /**
+ * The maximum one-way inter-frame delay interval in the forward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationForwardMax();
+
+ /**
+ * The average one-way inter-frame delay interval in the forward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationForwardAvg();
+
+ /**
+ * The minimum one-way inter-frame delay interval in the backward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationBackwardMin();
+
+ /**
+ * The maximum one-way inter-frame delay interval in the backward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationBackwardMax();
+
+ /**
+ * The average one-way inter-frame delay interval in the backward direction.
+ * calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration interFrameDelayVariationBackwardAvg();
+
+ /**
+ * The maximum two-way Frame Delay Range calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayRangeTwoWayMax();
+
+ /**
+ * The average two-way Frame Delay Range calculated by this MEP for this Measurement Interval.
+ * @return A java duration
+ */
+ Duration frameDelayRangeTwoWayAvg();
+
+ /**
+ * The maximum one-way Frame Delay Range in the forward direction.
+ * calculated by this MEP for this Measurement Interval
+ * @return A java duration
+ */
+ Duration frameDelayRangeForwardMax();
+
+ /**
+ * The average one-way Frame Delay Range in the forward direction.
+ * calculated by this MEP for this Measurement Interval
+ * @return A java duration
+ */
+ Duration frameDelayRangeForwardAvg();
+
+ /**
+ * The maximum one-way Frame Delay Range in the backward direction.
+ * calculated by this MEP for this Measurement Interval
+ * @return A java duration
+ */
+ Duration frameDelayRangeBackwardMax();
+
+ /**
+ * The average one-way Frame Delay Range in the backward direction.
+ * calculated by this MEP for this Measurement Interval
+ * @return A java duration
+ */
+ Duration frameDelayRangeBackwardAvg();
+
+ /**
+ * The count of the number of SOAM PDUs sent during this Measurement Interval.
+ * @return the count as an integer
+ */
+ Integer soamPdusSent();
+
+ /**
+ * The count of the number of SOAM PDUs received during this Measurement Interval.
+ * @return the count as an integer
+ */
+ Integer soamPdusReceived();
+
+ /**
+ * Bins calculated for two-way Frame Delay measurements.
+ * calculated by this MEP for this Measurement interval.
+ *
+ * The reply contains a set of counts of packets per bin
+ * The bin is defined by the durations given as the lower limit and the next
+ * size being the upper limit. For the largest duration, the count is of packets
+ * of that size up to infinity
+ *
+ * For example, if there are 4 elements in the result
+ * PT0.000S 4 - This means there are 4 packets in the 0-20ms bin
+ * PT0.020S 6 - This means there are 6 packets in the 20-30ms bin
+ * PT0.030S 8 - This means there are 8 packets in the 30-50ms bin
+ * PT0.050S 10 - This means there are 10 packets in the 50ms-infinity bin
+ *
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayTwoWayBins();
+
+ /**
+ * Bins calculated for one-way Frame Delay measurements in the Forward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayForwardBins();
+
+ /**
+ * Bins calculated for one-way Frame Delay measurements in the Backward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayBackwardBins();
+
+ /**
+ * Bins calculated for two-way Inter Frame Delay Variation measurements.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> interFrameDelayVariationTwoWayBins();
+
+ /**
+ * Bins calculated for one-way Inter Frame Delay Variation measurements in the Forward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> interFrameDelayVariationForwardBins();
+
+ /**
+ * Bins calculated for one-way Inter Frame Delay Variation measurements in the Backward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> interFrameDelayVariationBackwardBins();
+
+ /**
+ * Bins calculated for two-way Frame Delay Range measurements.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayRangeTwoWayBins();
+
+ /**
+ * Bins calculated for one-way Frame Delay Range measurements in the Forward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayRangeForwardBins();
+
+ /**
+ * Bins calculated for one-way Frame Delay Range measurements in the Backward direction.
+ * calculated by this MEP for this Measurement interval.
+ * @return A map of counts per time periods
+ */
+ Map<Duration, Integer> frameDelayRangeBackwardBins();
+
+ /**
+ * Abstract Builder interface for DelayMeasurementStat.
+ * {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStat}.
+ */
+ interface DmStatBuilder {
+ DmStatBuilder frameDelayTwoWayMin(Duration frameDelayTwoWayMin);
+
+ DmStatBuilder frameDelayTwoWayMax(Duration frameDelayTwoWayMax);
+
+ DmStatBuilder frameDelayTwoWayAvg(Duration frameDelayTwoWayAvg);
+
+ DmStatBuilder frameDelayForwardMin(Duration frameDelayForwardMin);
+
+ DmStatBuilder frameDelayForwardMax(Duration frameDelayForwardMax);
+
+ DmStatBuilder frameDelayForwardAvg(Duration frameDelayForwardAvg);
+
+ DmStatBuilder frameDelayBackwardMin(Duration frameDelayBackwardMin);
+
+ DmStatBuilder frameDelayBackwardMax(Duration frameDelayBackwardMax);
+
+ DmStatBuilder frameDelayBackwardAvg(Duration frameDelayBackwardAvg);
+
+ DmStatBuilder interFrameDelayVariationTwoWayMin(Duration interFrameDelayVariationTwoWayMin);
+
+ DmStatBuilder interFrameDelayVariationTwoWayMax(Duration interFrameDelayVariationTwoWayMax);
+
+ DmStatBuilder interFrameDelayVariationTwoWayAvg(Duration interFrameDelayVariationTwoWayAvg);
+
+ DmStatBuilder interFrameDelayVariationForwardMin(Duration interFrameDelayVariationForwardMin);
+
+ DmStatBuilder interFrameDelayVariationForwardMax(Duration interFrameDelayVariationForwardMax);
+
+ DmStatBuilder interFrameDelayVariationForwardAvg(Duration interFrameDelayVariationForwardAvg);
+
+ DmStatBuilder interFrameDelayVariationBackwardMin(Duration interFrameDelayVariationBackwardMin);
+
+ DmStatBuilder interFrameDelayVariationBackwardMax(Duration interFrameDelayVariationBackwardMax);
+
+ DmStatBuilder interFrameDelayVariationBackwardAvg(Duration interFrameDelayVariationBackwardAvg);
+
+ DmStatBuilder frameDelayRangeTwoWayMax(Duration frameDelayRangeTwoWayMax);
+
+ DmStatBuilder frameDelayRangeTwoWayAvg(Duration frameDelayRangeTwoWayAvg);
+
+ DmStatBuilder frameDelayRangeForwardMax(Duration frameDelayRangeForwardMax);
+
+ DmStatBuilder frameDelayRangeForwardAvg(Duration frameDelayRangeForwardAvg);
+
+ DmStatBuilder frameDelayRangeBackwardMax(Duration frameDelayRangeBackwardMax);
+
+ DmStatBuilder frameDelayRangeBackwardAvg(Duration frameDelayRangeBackwardAvg);
+
+ DmStatBuilder soamPdusSent(Integer soamPdusSent);
+
+ DmStatBuilder soamPdusReceived(Integer soamPdusReceived);
+
+ DmStatBuilder frameDelayTwoWayBins(Map<Duration, Integer> frameDelayTwoWayBins);
+
+ DmStatBuilder frameDelayForwardBins(Map<Duration, Integer> frameDelayForwardBins);
+
+ DmStatBuilder frameDelayBackwardBins(Map<Duration, Integer> frameDelayBackwardBins);
+
+ DmStatBuilder interFrameDelayVariationTwoWayBins(Map<Duration, Integer> interFrameDelayVariationTwoWayBins);
+
+ DmStatBuilder interFrameDelayVariationForwardBins(Map<Duration, Integer> interFrameDelayVariationForwardBins);
+
+ DmStatBuilder interFrameDelayVariationBackwardBins(Map<Duration, Integer> interFrameDelayVariationBackwardBins);
+
+ DmStatBuilder frameDelayRangeTwoWayBins(Map<Duration, Integer> frameDelayRangeTwoWayBins);
+
+ DmStatBuilder frameDelayRangeForwardBins(Map<Duration, Integer> frameDelayRangeForwardBins);
+
+ DmStatBuilder frameDelayRangeBackwardBins(Map<Duration, Integer> frameDelayRangeBackwardBins);
+
+ DelayMeasurementStat build();
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatCurrent.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatCurrent.java
new file mode 100644
index 0000000..f9bb25f
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatCurrent.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Instant;
+
+/**
+ * Object for representing Delay Measurement Current Stats.
+ */
+public interface DelayMeasurementStatCurrent extends DelayMeasurementStat {
+ /**
+ * The time that the current Measurement Interval started.
+ * @return The start time as a java Instant
+ */
+ Instant startTime();
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatCurrent}.
+ */
+ public interface DmStatCurrentBuilder extends DmStatBuilder {
+ DmStatCurrentBuilder startTime(Instant startTime);
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatHistory.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatHistory.java
new file mode 100644
index 0000000..c55c66a
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementStatHistory.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Instant;
+
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+/**
+ * Object for representing Delay Measurement History Stats.
+ */
+public interface DelayMeasurementStatHistory extends DelayMeasurementStat {
+ /**
+ * The identifier of the historic measurement.
+ * @return The id
+ */
+ SoamId historyStatsId();
+
+ /**
+ * The time that the historic Measurement Interval ended.
+ * @return A java Instant
+ */
+ Instant endTime();
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementStatHistory}.
+ */
+ public interface DmStatHistoryBuilder extends DmStatBuilder {
+ DmStatHistoryBuilder endTime(Instant endTime);
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementThreshold.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementThreshold.java
new file mode 100644
index 0000000..78ae5d4
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/DelayMeasurementThreshold.java
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.incubator.net.l2monitoring.soam.delay;
+
+import java.time.Duration;
+import java.util.Collection;
+
+import org.onosproject.incubator.net.l2monitoring.soam.SoamId;
+
+/**
+ * Object to represent a Delay Measurement Threshold.
+ */
+public interface DelayMeasurementThreshold {
+ /**
+ * The identifier or the scheduled measurement.
+ * @return The id
+ */
+ SoamId threshId();
+
+ /**
+ * A vector of bits that indicates the type of SOAM LM thresholds notifications that are enabled.
+ * A present bit enables the specific SOAM LM threshold notification and
+ * when the specific counter is enabled and the threshold is crossed a
+ * notification is generated.
+ * A not present bit disables the specific SOAM LM threshold notification. If
+ * a particular SOAM LM threshold is not supported the BIT value is not present.
+ * @return A collection of bit options
+ */
+ Collection<ThresholdOption> thresholdsEnabled();
+
+ /**
+ * The measurement two-way delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredFrameDelayTwoWay();
+
+ /**
+ * The maximum two-way delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayTwoWay();
+
+ /**
+ * The average two-way delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayTwoWay();
+
+ /**
+ * The measurement two-way IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredInterFrameDelayVariationTwoWay();
+
+ /**
+ * The maximum two-way IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxInterFrameDelayVariationTwoWay();
+
+ /**
+ * The average two-way IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageInterFrameDelayVariationTwoWay();
+
+ /**
+ * The maximum two-way Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayRangeTwoWay();
+
+ /**
+ * The average two-way Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayRangeTwoWay();
+
+ /**
+ * The measurement forward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredFrameDelayForward();
+
+ /**
+ * The maximum forward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayForward();
+
+ /**
+ * The average forward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayForward();
+
+ /**
+ * The measurement IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredInterFrameDelayVariationForward();
+
+ /**
+ * The maximum IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxInterFrameDelayVariationForward();
+
+ /**
+ * The average IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageInterFrameDelayVariationForward();
+
+ /**
+ * The maximum Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayRangeForward();
+
+ /**
+ * The average Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayRangeForward();
+
+ /**
+ * The measurement backward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredFrameDelayBackward();
+
+ /**
+ * The maximum backward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayBackward();
+
+ /**
+ * The average backward delay threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayBackward();
+
+ /**
+ * The measurement backward IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration measuredInterFrameDelayVariationBackward();
+
+ /**
+ * The maximum backward IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxInterFrameDelayVariationBackward();
+
+ /**
+ * The average backward IFDV threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageInterFrameDelayVariationBackward();
+
+ /**
+ * The maximum backward Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration maxFrameDelayRangeBackward();
+
+ /**
+ * The average backward Frame Delay Range threshold used to determine if a threshold notification is generated.
+ * @return A java duration
+ */
+ Duration averageFrameDelayRangeBackward();
+
+ /**
+ * Builder for {@link org.onosproject.incubator.net.l2monitoring.soam.delay.DelayMeasurementThreshold}.
+ */
+ public interface DmThresholdBuilder {
+ DmThresholdBuilder addToThresholdsEnabled(
+ ThresholdOption thresholdEnabled);
+
+ DmThresholdBuilder measuredFrameDelayTwoWay(
+ Duration measuredFrameDelayTwoWay);
+
+ DmThresholdBuilder maxFrameDelayTwoWay(Duration maxFrameDelayTwoWay);
+
+ DmThresholdBuilder averageFrameDelayTwoWay(Duration averageFrameDelayTwoWay);
+
+ DmThresholdBuilder measuredInterFrameDelayVariationTwoWay(
+ Duration measuredInterFrameDelayVariationTwoWay);
+
+ DmThresholdBuilder maxInterFrameDelayVariationTwoWay(
+ Duration maxInterFrameDelayVariationTwoWay);
+
+ DmThresholdBuilder averageInterFrameDelayVariationTwoWay(
+ Duration averageInterFrameDelayVariationTwoWay);
+
+ DmThresholdBuilder maxFrameDelayRangeTwoWay(
+ Duration maxFrameDelayRangeTwoWay);
+
+ DmThresholdBuilder averageFrameDelayRangeTwoWay(
+ Duration averageFrameDelayRangeTwoWay);
+
+ DmThresholdBuilder measuredFrameDelayForward(
+ Duration averageFrameDelayRangeTwoWay);
+
+ DmThresholdBuilder maxFrameDelayForward(
+ Duration maxFrameDelayForward);
+
+ DmThresholdBuilder averageFrameDelayForward(
+ Duration averageFrameDelayForward);
+
+ DmThresholdBuilder measuredInterFrameDelayVariationForward(
+ Duration measuredInterFrameDelayVariationForward);
+
+ DmThresholdBuilder maxInterFrameDelayVariationForward(
+ Duration maxInterFrameDelayVariationForward);
+
+ DmThresholdBuilder averageInterFrameDelayVariationForward(
+ Duration averageInterFrameDelayVariationForward);
+
+ DmThresholdBuilder maxFrameDelayRangeForward(
+ Duration maxFrameDelayRangeForward);
+
+ DmThresholdBuilder averageFrameDelayRangeForward(
+ Duration averageFrameDelayRangeForward);
+
+ DmThresholdBuilder measuredFrameDelayBackward(
+ Duration measuredFrameDelayBackward);
+
+ DmThresholdBuilder maxFrameDelayBackward(
+ Duration maxFrameDelayBackward);
+
+ DmThresholdBuilder averageFrameDelayBackward(
+ Duration averageFrameDelayBackward);
+
+ DmThresholdBuilder measuredInterFrameDelayVariationBackward(
+ Duration measuredInterFrameDelayVariationBackward);
+
+ DmThresholdBuilder maxInterFrameDelayVariationBackward(
+ Duration maxInterFrameDelayVariationBackward);
+
+ DmThresholdBuilder averageInterFrameDelayVariationBackward(
+ Duration averageInterFrameDelayVariationBackward);
+
+ DmThresholdBuilder maxFrameDelayRangeBackward(
+ Duration maxFrameDelayRangeBackward);
+
+ DmThresholdBuilder averageFrameDelayRangeBackward(
+ Duration averageFrameDelayRangeBackward);
+
+ public DelayMeasurementThreshold build();
+
+ }
+
+ /**
+ * Selection of Threshold choices.
+ */
+ public enum ThresholdOption {
+ MEASURED_FRAME_DELAY_TWO_WAY,
+ MAX_FRAME_DELAY_TWO_WAY,
+ AVERAGE_FRAME_DELAY_TWO_WAY,
+ MEASURED_INTER_FRAME_DELAY_VARIATION_TWO_WAY,
+ MAX_INTER_FRAME_DELAY_VARIATION_TWO_WAY,
+ AVERAGE_INTER_FRAME_DELAY_VARIATION_TWO_WAY,
+ MAX_FRAME_DELAY_RANGE_TWO_WAY,
+ AVERAGE_FRAME_DELAY_RANGE_TWO_WAY,
+ MEASURED_FRAME_DELAY_FORWARD,
+ MAX_FRAME_DELAY_FORWARD,
+ AVERAGE_FRAME_DELAY_FORWARD,
+ MEASURED_INTER_FRAME_DELAY_VARIATION_FORWARD,
+ MAX_INTER_FRAME_DELAY_VARIATION_FORWARD,
+ AVERAGE_INTER_FRAME_DELAY_VARIATION_FORWARD,
+ MAX_FRAME_DELAY_RANGE_FORWARD,
+ AVERAGE_FRAME_DELAY_RANGE_FORWARD,
+ MEASURED_FRAME_DELAY_BACKWARD,
+ MAX_FRAME_DELAY_BACKWARD,
+ AVERAGE_FRAME_DELAY_BACKWARD,
+ MEASURED_INTER_FRAME_DELAY_VARIATION_BACKWARD,
+ MAX_INTER_FRAME_DELAY_VARIATION_BACKWARD,
+ AVERAGE_INTER_FRAME_DELAY_VARIATION_BACKWARD,
+ MAX_FRAME_DELAY_RANGE_BACKWARD,
+ AVERAGE_FRAME_DELAY_RANGE_BACKWARD;
+ }
+}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/package-info.java b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/package-info.java
new file mode 100644
index 0000000..310eb12
--- /dev/null
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/l2monitoring/soam/delay/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * 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.
+ */
+
+/**
+ * Implementation of Service Operation and Maintenance related to Frame delay measurement.
+ *
+ * From ITU Y.1731 (ETH-DM) and MEF 17 Frame Delay Performance and Frame Delay Variation Performance
+ * MEF 36.1 Service OAM SNMP MIB for Performance Monitoring, MEF 39 Service OAM Performance Monitoring YANG Module
+ */
+package org.onosproject.incubator.net.l2monitoring.soam.delay;
\ No newline at end of file