Search in sources :

Example 1 with FeatureCapability

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability in project openflowplugin by opendaylight.

the class BuildSwitchCapabilitiesOF13 method build.

@Override
public SwitchFeatures build(GetFeaturesOutput features) {
    SwitchFeaturesBuilder builderSwFeatures = new SwitchFeaturesBuilder();
    builderSwFeatures.setMaxBuffers(features.getBuffers());
    builderSwFeatures.setMaxTables(features.getTables());
    List<Class<? extends FeatureCapability>> capabilities = new ArrayList<>();
    if (features.getCapabilities().isOFPCFLOWSTATS()) {
        capabilities.add(FlowFeatureCapabilityFlowStats.class);
    }
    if (features.getCapabilities().isOFPCGROUPSTATS()) {
        capabilities.add(FlowFeatureCapabilityGroupStats.class);
    }
    if (features.getCapabilities().isOFPCIPREASM()) {
        capabilities.add(FlowFeatureCapabilityIpReasm.class);
    }
    if (features.getCapabilities().isOFPCPORTBLOCKED()) {
        capabilities.add(FlowFeatureCapabilityPortBlocked.class);
    }
    if (features.getCapabilities().isOFPCPORTSTATS()) {
        capabilities.add(FlowFeatureCapabilityPortStats.class);
    }
    if (features.getCapabilities().isOFPCQUEUESTATS()) {
        capabilities.add(FlowFeatureCapabilityQueueStats.class);
    }
    if (features.getCapabilities().isOFPCTABLESTATS()) {
        capabilities.add(FlowFeatureCapabilityTableStats.class);
    }
    builderSwFeatures.setCapabilities(capabilities);
    return builderSwFeatures.build();
}
Also used : FeatureCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability) ArrayList(java.util.ArrayList) SwitchFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeaturesBuilder)

Example 2 with FeatureCapability

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability in project openflowplugin by opendaylight.

the class BuildSwitchCapabilitiesOF10 method build.

@Override
public SwitchFeatures build(GetFeaturesOutput features) {
    SwitchFeaturesBuilder builderSwFeatures = new SwitchFeaturesBuilder();
    builderSwFeatures.setMaxBuffers(features.getBuffers());
    builderSwFeatures.setMaxTables(features.getTables());
    List<Class<? extends FeatureCapability>> capabilities = new ArrayList<>();
    if (features.getCapabilitiesV10().isOFPCARPMATCHIP()) {
        capabilities.add(FlowFeatureCapabilityArpMatchIp.class);
    }
    if (features.getCapabilitiesV10().isOFPCFLOWSTATS()) {
        capabilities.add(FlowFeatureCapabilityFlowStats.class);
    }
    if (features.getCapabilitiesV10().isOFPCIPREASM()) {
        capabilities.add(FlowFeatureCapabilityIpReasm.class);
    }
    if (features.getCapabilitiesV10().isOFPCPORTSTATS()) {
        capabilities.add(FlowFeatureCapabilityPortStats.class);
    }
    if (features.getCapabilitiesV10().isOFPCQUEUESTATS()) {
        capabilities.add(FlowFeatureCapabilityQueueStats.class);
    }
    if (features.getCapabilitiesV10().isOFPCRESERVED()) {
        capabilities.add(FlowFeatureCapabilityReserved.class);
    }
    if (features.getCapabilitiesV10().isOFPCSTP()) {
        capabilities.add(FlowFeatureCapabilityStp.class);
    }
    if (features.getCapabilitiesV10().isOFPCTABLESTATS()) {
        capabilities.add(FlowFeatureCapabilityTableStats.class);
    }
    builderSwFeatures.setCapabilities(capabilities);
    return builderSwFeatures.build();
}
Also used : FeatureCapability(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability) ArrayList(java.util.ArrayList) SwitchFeaturesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeaturesBuilder)

Aggregations

ArrayList (java.util.ArrayList)2 FeatureCapability (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FeatureCapability)2 SwitchFeaturesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeaturesBuilder)2