Search in sources :

Example 1 with SwitchFeatures

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures 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 SwitchFeatures

use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures 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)

Example 3 with SwitchFeatures

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

the class DeviceInitializationUtilTest method getSwitchFeatures.

@Test
public void getSwitchFeatures() throws Exception {
    final SwitchFeatures switchFeatures = DeviceInitializationUtil.getSwitchFeatures(connectionContext);
    assertEquals(TABLES, switchFeatures.getMaxTables().shortValue());
}
Also used : SwitchFeatures(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures) Test(org.junit.Test)

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 Test (org.junit.Test)1 SwitchFeatures (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SwitchFeatures)1