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

项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        /* 
         * no-op:
         * we can send any request at any time
         */
        break;
    }
}
项目:athena    文件:AbstractOpenFlowSwitch.java   
@Override
public final void sendRoleRequest(OFMessage msg) {
    if (msg instanceof OFRoleRequest ||
            msg instanceof OFNiciraControllerRoleRequest) {
        sendMsgsOnChannel(Collections.singletonList(msg));
        return;
    }
    throw new IllegalArgumentException("Someone is trying to send " +
                                               "a non role request message");
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        illegalMessageReceived(m);
        break;
    }
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:arscheduler    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlight1.2-delay    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /*
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlight-hardware    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /*
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:ACAMPController    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:fast-failover-demo    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        break;
    }
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:floodlightLB    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:DSC    文件:OFSwitchHandshakeHandler.java   
void processWrittenOFMessage(OFMessage m) {
    switch(m.getType()) {
    case ROLE_REQUEST:
        processOFRoleRequest((OFRoleRequest) m);
        break;
    case EXPERIMENTER:
        if (m instanceof OFNiciraControllerRoleRequest) {
            processOFNiciraControllerRoleRequest((OFNiciraControllerRoleRequest) m);
        }
        break;
    default:
        illegalMessageReceived(m);
        break;
    }
}
项目:DSC    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:DSC    文件:OFSwitchHandshakeHandler.java   
@Override
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    OFControllerRole role;
    switch (m.getRole()) {
    case ROLE_MASTER:
        role = OFControllerRole.ROLE_MASTER;
        break;
    case ROLE_SLAVE:
        role = OFControllerRole.ROLE_SLAVE;
        break;
    case ROLE_OTHER:
        role = OFControllerRole.ROLE_EQUAL;
        break;
    default:
        log.error("Attempted to change to invalid Nicira role {}.", m.getRole().toString());
        return;
    }
    /* 
     * This will get converted back to the correct factory of the switch later.
     * We will use OFRoleRequest though to simplify the API between OF versions.
     */
    sendRoleRequest(OFFactories.getFactory(OFVersion.OF_13).buildRoleRequest()
            .setGenerationId(U64.ZERO)
            .setXid(m.getXid())
            .setRole(role)
            .build());
}
项目:onos    文件:AbstractOpenFlowSwitch.java   
@Override
public final void sendRoleRequest(OFMessage msg) {
    if (msg instanceof OFRoleRequest ||
            msg instanceof OFNiciraControllerRoleRequest) {
        sendMsgsOnChannel(Collections.singletonList(msg));
        return;
    }
    throw new IllegalArgumentException("Someone is trying to send " +
                                               "a non role request message");
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandler.java   
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    unhandledMessageWritten(m);
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandlerVer10Test.java   
@Override
Class<?> getRoleRequestClass() {
    return OFNiciraControllerRoleRequest.class;
}
项目:fresco_floodlight    文件:OFSwitchHandshakeHandlerVer10Test.java   
@Override
public void verifyRoleRequest(OFMessage m, OFControllerRole expectedRole) {
    assertThat(m.getType(), equalTo(OFType.EXPERIMENTER));
    OFNiciraControllerRoleRequest roleRequest = (OFNiciraControllerRoleRequest)m;
    assertThat(roleRequest.getRole(), equalTo(NiciraRoleUtils.ofRoleToNiciraRole(expectedRole)));
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandler.java   
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    unhandledMessageWritten(m);
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandlerVer10Test.java   
@Override
Class<?> getRoleRequestClass() {
    return OFNiciraControllerRoleRequest.class;
}
项目:iTAP-controller    文件:OFSwitchHandshakeHandlerVer10Test.java   
@Override
public void verifyRoleRequest(OFMessage m, OFControllerRole expectedRole) {
    assertThat(m.getType(), equalTo(OFType.EXPERIMENTER));
    OFNiciraControllerRoleRequest roleRequest = (OFNiciraControllerRoleRequest)m;
    assertThat(roleRequest.getRole(), equalTo(NiciraRoleUtils.ofRoleToNiciraRole(expectedRole)));
}
项目:SDN-Multicast    文件:OFSwitchHandshakeHandler.java   
void processOFNiciraControllerRoleRequest(OFNiciraControllerRoleRequest m) {
    unhandledMessageWritten(m);
}