Java 类org.projectfloodlight.openflow.protocol.OFTableFeaturesStatsReply 实例源码

项目:fresco_floodlight    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:fresco_floodlight    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:SDN-Multicast    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:SDN-Multicast    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:arscheduler    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:arscheduler    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:arscheduler    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:floodlight1.2-delay    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:floodlight1.2-delay    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:floodlight-hardware    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there
 * are no more remaining. Then, pass the list to the switch for
 * parsing and configuration.
 *
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 *
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        }
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:floodlight-hardware    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:ACAMPController    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:ACAMPController    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:ACAMPController    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:fast-failover-demo    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:fast-failover-demo    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:floodlightLB    文件:OFSwitch.java   
@Override
public void processOFTableFeatures(List<OFTableFeaturesStatsReply> replies) {
    /*
     * Parse out all the individual replies for each table.
     */
    for (OFTableFeaturesStatsReply reply : replies) {
        /*
         * Add or update the features for a particular table.
         */
        List<OFTableFeatures> tfs = reply.getEntries();
        for (OFTableFeatures tf : tfs) {
            tableFeaturesByTableId.put(tf.getTableId(), TableFeatures.of(tf));
            tables.add(tf.getTableId());
            log.trace("Received TableFeatures for TableId {}, TableName {}", tf.getTableId().toString(), tf.getName());
        }
    }
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
@Override
/**
 * Accumulate a list of the OFTableFeaturesStatsReply's until there 
 * are no more remaining. Then, pass the list to the switch for 
 * parsing and configuration.
 * 
 * The assumption is that the OFMessage dispatcher will call this each
 * time, which it does. We don't loop and receive here.
 * 
 * @param m, The potential OFTableFeaturesStatsReply message we want to include
 */
void processOFStatsReply(OFStatsReply m) {
    if (m.getStatsType() == OFStatsType.TABLE_FEATURES) {
        replies.add((OFTableFeaturesStatsReply) m);
        if (!((OFTableFeaturesStatsReply)m).getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
            handleTableFeaturesMessage(replies, false);
            nextState();
        } 
    } else {
        /* should only receive TABLE_FEATURES here */
        log.error("Received {} message but expected TABLE_FEATURES.", m.getStatsType().toString());
    }

}
项目:floodlightLB    文件:OFSwitchHandshakeHandlerVer13Test.java   
@SuppressWarnings("unchecked")
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
       expectLastCall().once();
       expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
   }
项目:floodlightLB    文件:OFSwitchHandlerTestBase.java   
protected OFTableFeaturesStatsReply createTableFeaturesStatsReply() {
    OFTableFeaturesStatsReply statsReply = factory.buildTableFeaturesStatsReply()
            .setEntries(Collections.singletonList(factory.buildTableFeatures()
                    .setConfig(0)
                    .setMaxEntries(100)
                    .setMetadataMatch(U64.NO_MASK)
                    .setMetadataWrite(U64.NO_MASK)
                    .setName("MyTable")
                    .setTableId(TableId.of(1))
                    .setProperties(Collections.singletonList((OFTableFeatureProp)factory.buildTableFeaturePropMatch()
                            .setOxmIds(Collections.singletonList(U32.of(100)))
                            .build())
                            ).build()
                    )

                    ).build();
    return statsReply;
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandlerVer13Test.java   
public void handleTableFeatures(boolean subHandShakeComplete) throws Exception {
    // build the table features stats reply
    OFTableFeaturesStatsReply tf = createTableFeaturesStatsReply();

    reset(sw);
    sw.startDriverHandshake();
    expectLastCall().once();
    expect(sw.isDriverHandshakeComplete()).andReturn(subHandShakeComplete).once();
    sw.processOFTableFeatures(anyObject(List.class));
    expectLastCall().once();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    replay(sw);

    switchHandler.processOFMessage(tf);
}
项目:fresco_floodlight    文件:OFSwitch.java   
/**
 * Append a listener to receive an OFStatsReply and update the 
 * internal OFSwitch data structures.
 * 
 * This presently taps into the following stats request 
 * messages to listen for the corresponding reply:
 * -- OFTableFeaturesStatsRequest
 * 
 * Extend this to tap into and update other OFStatsType messages.
 * 
 * @param future
 * @param request
 * @return
 */
private <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> addInternalStatsReplyListener(final ListenableFuture<List<REPLY>> future, OFStatsRequest<REPLY> request) {
    switch (request.getStatsType()) {
    case TABLE_FEATURES:
        /* case YOUR_CASE_HERE */
        future.addListener(new Runnable() {
            /*
             * We know the reply will be a list of OFStatsReply.
             */
            @SuppressWarnings("unchecked")
            @Override
            public void run() {
                /*
                 * The OFConnection handles REPLY_MORE for us in the case there
                 * are multiple OFStatsReply messages with the same XID.
                 */
                try {
                    List<? extends OFStatsReply> replies = future.get();
                    if (!replies.isEmpty()) {
                        /*
                         * By checking only the 0th element, we assume all others are the same type.
                         * TODO If not, what then?
                         */
                        switch (replies.get(0).getStatsType()) {
                        case TABLE_FEATURES:
                            processOFTableFeatures((List<OFTableFeaturesStatsReply>) future.get());
                            break;
                            /* case YOUR_CASE_HERE */
                        default:
                            throw new Exception("Received an invalid OFStatsReply of " 
                                    + replies.get(0).getStatsType().toString() + ". Expected TABLE_FEATURES.");
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, MoreExecutors.sameThreadExecutor()); /* No need for another thread. */
    default:
        break;
    }
    return future; /* either unmodified or with an additional listener */
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
WaitTableFeaturesReplyState() {
    super(false);
    replies = new ArrayList<OFTableFeaturesStatsReply>();
}
项目:SDN-Multicast    文件:OFSwitch.java   
/**
 * Append a listener to receive an OFStatsReply and update the 
 * internal OFSwitch data structures.
 * 
 * This presently taps into the following stats request 
 * messages to listen for the corresponding reply:
 * -- OFTableFeaturesStatsRequest
 * 
 * Extend this to tap into and update other OFStatsType messages.
 * 
 * @param future
 * @param request
 * @return
 */
private <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> addInternalStatsReplyListener(final ListenableFuture<List<REPLY>> future, OFStatsRequest<REPLY> request) {
    switch (request.getStatsType()) {
    case TABLE_FEATURES:
        /* case YOUR_CASE_HERE */
        future.addListener(new Runnable() {
            /*
             * We know the reply will be a list of OFStatsReply.
             */
            @SuppressWarnings("unchecked")
            @Override
            public void run() {
                /*
                 * The OFConnection handles REPLY_MORE for us in the case there
                 * are multiple OFStatsReply messages with the same XID.
                 */
                try {
                    List<? extends OFStatsReply> replies = future.get();
                    if (!replies.isEmpty()) {
                        /*
                         * By checking only the 0th element, we assume all others are the same type.
                         * TODO If not, what then?
                         */
                        switch (replies.get(0).getStatsType()) {
                        case TABLE_FEATURES:
                            processOFTableFeatures((List<OFTableFeaturesStatsReply>) future.get());
                            break;
                            /* case YOUR_CASE_HERE */
                        default:
                            throw new Exception("Received an invalid OFStatsReply of " 
                                    + replies.get(0).getStatsType().toString() + ". Expected TABLE_FEATURES.");
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, MoreExecutors.sameThreadExecutor()); /* No need for another thread. */
    default:
        break;
    }
    return future; /* either unmodified or with an additional listener */
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
WaitTableFeaturesReplyState() {
    super(false);
    replies = new ArrayList<OFTableFeaturesStatsReply>();
}
项目:arscheduler    文件:OFSwitch.java   
/**
 * Append a listener to receive an OFStatsReply and update the 
 * internal OFSwitch data structures.
 * 
 * This presently taps into the following stats request 
 * messages to listen for the corresponding reply:
 * -- OFTableFeaturesStatsRequest
 * 
 * Extend this to tap into and update other OFStatsType messages.
 * 
 * @param future
 * @param request
 * @return
 */
private <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> addInternalStatsReplyListener(final ListenableFuture<List<REPLY>> future, OFStatsRequest<REPLY> request) {
    switch (request.getStatsType()) {
    case TABLE_FEATURES:
        /* case YOUR_CASE_HERE */
        future.addListener(new Runnable() {
            /*
             * We know the reply will be a list of OFStatsReply.
             */
            @SuppressWarnings("unchecked")
            @Override
            public void run() {
                /*
                 * The OFConnection handles REPLY_MORE for us in the case there
                 * are multiple OFStatsReply messages with the same XID.
                 */
                try {
                    List<? extends OFStatsReply> replies = future.get();
                    if (!replies.isEmpty()) {
                        /*
                         * By checking only the 0th element, we assume all others are the same type.
                         * TODO If not, what then?
                         */
                        switch (replies.get(0).getStatsType()) {
                        case TABLE_FEATURES:
                            processOFTableFeatures((List<OFTableFeaturesStatsReply>) future.get());
                            break;
                            /* case YOUR_CASE_HERE */
                        default:
                            throw new Exception("Received an invalid OFStatsReply of " 
                                    + replies.get(0).getStatsType().toString() + ". Expected TABLE_FEATURES.");
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, MoreExecutors.sameThreadExecutor()); /* No need for another thread. */
    default:
        break;
    }
    return future; /* either unmodified or with an additional listener */
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
WaitTableFeaturesReplyState() {
    super(false);
    replies = new ArrayList<OFTableFeaturesStatsReply>();
}
项目:floodlight1.2-delay    文件:OFSwitch.java   
/**
 * Append a listener to receive an OFStatsReply and update the 
 * internal OFSwitch data structures.
 * 
 * This presently taps into the following stats request 
 * messages to listen for the corresponding reply:
 * -- OFTableFeaturesStatsRequest
 * 
 * Extend this to tap into and update other OFStatsType messages.
 * 
 * @param future
 * @param request
 * @return
 */
private <REPLY extends OFStatsReply> ListenableFuture<List<REPLY>> addInternalStatsReplyListener(final ListenableFuture<List<REPLY>> future, OFStatsRequest<REPLY> request) {
    switch (request.getStatsType()) {
    case TABLE_FEATURES:
        /* case YOUR_CASE_HERE */
        future.addListener(new Runnable() {
            /*
             * We know the reply will be a list of OFStatsReply.
             */
            @SuppressWarnings("unchecked")
            @Override
            public void run() {
                /*
                 * The OFConnection handles REPLY_MORE for us in the case there
                 * are multiple OFStatsReply messages with the same XID.
                 */
                try {
                    List<? extends OFStatsReply> replies = future.get();
                    if (!replies.isEmpty()) {
                        /*
                         * By checking only the 0th element, we assume all others are the same type.
                         * TODO If not, what then?
                         */
                        switch (replies.get(0).getStatsType()) {
                        case TABLE_FEATURES:
                            processOFTableFeatures((List<OFTableFeaturesStatsReply>) future.get());
                            break;
                            /* case YOUR_CASE_HERE */
                        default:
                            throw new Exception("Received an invalid OFStatsReply of " 
                                    + replies.get(0).getStatsType().toString() + ". Expected TABLE_FEATURES.");
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }, MoreExecutors.sameThreadExecutor()); /* No need for another thread. */
    default:
        break;
    }
    return future; /* either unmodified or with an additional listener */
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
WaitTableFeaturesReplyState() {
    super(false);
    replies = new ArrayList<OFTableFeaturesStatsReply>();
}