use of org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable in project onos by opennetworkinglab.
the class SoamManager method getDm.
@Override
public DelayMeasurementEntry getDm(MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId) throws CfmConfigException, SoamConfigException {
MepEntry mep = cfmMepService.getMep(mdName, maName, mepId);
if (mep == null || mep.deviceId() == null) {
throw new CfmConfigException("MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (deviceService.getDevice(mep.deviceId()) == null) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (!deviceService.getDevice(mep.deviceId()).is(SoamDmProgrammable.class)) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not implement SoamDmProgrammable");
}
log.debug("Retrieving DM for DM {} in MD {}, MA {}, MEP {} on Device {}", dmId, mdName, maName, mepId, mep.deviceId());
return deviceService.getDevice(mep.deviceId()).as(SoamDmProgrammable.class).getDm(mdName, maName, mepId, dmId);
}
use of org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable in project onos by opennetworkinglab.
the class SoamManager method getDmHistoricalStats.
@Override
public Collection<DelayMeasurementStatHistory> getDmHistoricalStats(MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId) throws SoamConfigException, CfmConfigException {
MepEntry mep = cfmMepService.getMep(mdName, maName, mepId);
if (mep == null || mep.deviceId() == null) {
throw new CfmConfigException("MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (deviceService.getDevice(mep.deviceId()) == null) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (!deviceService.getDevice(mep.deviceId()).is(SoamDmProgrammable.class)) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not implement SoamDmProgrammable");
}
log.debug("Retrieving History Stats for DM {} in MD {}, MA {}, MEP {} " + "on Device {}", dmId, mdName, maName, mepId, mep.deviceId());
return deviceService.getDevice(mep.deviceId()).as(SoamDmProgrammable.class).getDmHistoricalStats(mdName, maName, mepId, dmId);
}
use of org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable in project onos by opennetworkinglab.
the class SoamManager method getDmCurrentStat.
@Override
public DelayMeasurementStatCurrent getDmCurrentStat(MdId mdName, MaIdShort maName, MepId mepId, SoamId dmId) throws CfmConfigException, SoamConfigException {
MepEntry mep = cfmMepService.getMep(mdName, maName, mepId);
if (mep == null || mep.deviceId() == null) {
throw new CfmConfigException("MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (deviceService.getDevice(mep.deviceId()) == null) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (!deviceService.getDevice(mep.deviceId()).is(SoamDmProgrammable.class)) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not implement SoamDmProgrammable");
}
log.debug("Retrieving Current Stats for DM {} in MD {}, MA {}, MEP {} " + "on Device {}", dmId, mdName, maName, mepId, mep.deviceId());
return deviceService.getDevice(mep.deviceId()).as(SoamDmProgrammable.class).getDmCurrentStat(mdName, maName, mepId, dmId);
}
use of org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable in project onos by opennetworkinglab.
the class SoamManager method createDm.
@Override
public Optional<SoamId> createDm(MdId mdName, MaIdShort maName, MepId mepId, DelayMeasurementCreate dmNew) throws CfmConfigException, SoamConfigException {
DeviceId mepDeviceId = cfmMepService.getMep(mdName, maName, mepId).deviceId();
if (mepDeviceId == null) {
throw new CfmConfigException("Unable to create DM. MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (deviceService.getDevice(mepDeviceId) == null) {
throw new CfmConfigException("Device " + mepDeviceId + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (!deviceService.getDevice(mepDeviceId).is(SoamDmProgrammable.class)) {
throw new CfmConfigException("Device " + mepDeviceId + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not implement SoamDmProgrammable");
}
log.debug("Creating new DM in MD {}, MA {}, MEP {} on Device {}", mdName, maName, mepId, mepDeviceId);
return deviceService.getDevice(mepDeviceId).as(SoamDmProgrammable.class).createDm(mdName, maName, mepId, dmNew);
}
use of org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable in project onos by opennetworkinglab.
the class SoamManager method getAllDms.
@Override
public Collection<DelayMeasurementEntry> getAllDms(MdId mdName, MaIdShort maName, MepId mepId) throws CfmConfigException, SoamConfigException {
MepEntry mep = cfmMepService.getMep(mdName, maName, mepId);
if (mep == null || mep.deviceId() == null) {
throw new CfmConfigException("MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (deviceService.getDevice(mep.deviceId()) == null) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not exist");
} else if (!deviceService.getDevice(mep.deviceId()).is(SoamDmProgrammable.class)) {
throw new CfmConfigException("Device " + mep.deviceId() + " from MEP :" + mdName + "/" + maName + "/" + mepId + " does not implement SoamDmProgrammable");
}
log.debug("Retrieving DMs for MD {}, MA {}, MEP {} on Device {}", mdName, maName, mepId, mep.deviceId());
return deviceService.getDevice(mep.deviceId()).as(SoamDmProgrammable.class).getAllDms(mdName, maName, mepId);
}
Aggregations