Search in sources :

Example 1 with NiciraResubmitTable

use of org.onosproject.driver.extensions.NiciraResubmitTable in project onos by opennetworkinglab.

the class NiciraResubmitTableCodec method decode.

@Override
public NiciraResubmitTable decode(ObjectNode json, CodecContext context) {
    if (json == null || !json.isObject()) {
        return null;
    }
    // parse in port number
    long portNumberLong = nullIsIllegal(json.get(RESUBMIT_PORT), RESUBMIT_PORT + MISSING_MEMBER_MESSAGE).asLong();
    PortNumber portNumber = PortNumber.portNumber(portNumberLong);
    // parse table id
    short tableId = (short) nullIsIllegal(json.get(RESUBMIT_TABLE), RESUBMIT_TABLE + MISSING_MEMBER_MESSAGE).asInt();
    return new NiciraResubmitTable(portNumber, tableId);
}
Also used : PortNumber(org.onosproject.net.PortNumber) NiciraResubmitTable(org.onosproject.driver.extensions.NiciraResubmitTable)

Aggregations

NiciraResubmitTable (org.onosproject.driver.extensions.NiciraResubmitTable)1 PortNumber (org.onosproject.net.PortNumber)1