Search in sources :

Example 1 with SoamDmProgrammable

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);
}
Also used : SoamDmProgrammable(org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable) MepEntry(org.onosproject.incubator.net.l2monitoring.cfm.MepEntry) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)

Example 2 with SoamDmProgrammable

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);
}
Also used : SoamDmProgrammable(org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable) MepEntry(org.onosproject.incubator.net.l2monitoring.cfm.MepEntry) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)

Example 3 with SoamDmProgrammable

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);
}
Also used : SoamDmProgrammable(org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable) MepEntry(org.onosproject.incubator.net.l2monitoring.cfm.MepEntry) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)

Example 4 with SoamDmProgrammable

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);
}
Also used : SoamDmProgrammable(org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable) DeviceId(org.onosproject.net.DeviceId) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)

Example 5 with SoamDmProgrammable

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);
}
Also used : SoamDmProgrammable(org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable) MepEntry(org.onosproject.incubator.net.l2monitoring.cfm.MepEntry) CfmConfigException(org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)

Aggregations

CfmConfigException (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmConfigException)5 SoamDmProgrammable (org.onosproject.incubator.net.l2monitoring.soam.SoamDmProgrammable)5 MepEntry (org.onosproject.incubator.net.l2monitoring.cfm.MepEntry)4 DeviceId (org.onosproject.net.DeviceId)1