public static State translatePortState(final PortState state) { StateBuilder nstate = new StateBuilder(); if (state != null) { nstate.setBlocked(state.isBlocked()); nstate.setLinkDown(state.isLinkDown()); nstate.setLive(state.isLive()); } return nstate.build(); }
private StateImpl(StateBuilder base) { this._blocked = base.isBlocked(); this._linkDown = base.isLinkDown(); this._live = base.isLive(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.flow.capable.port.State>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public static State translatePortState(final PortStateV10 state) { StateBuilder nstate = new StateBuilder(); if (state != null) { nstate.setBlocked(state.isBlocked()); nstate.setLinkDown(state.isLinkDown()); nstate.setLive(state.isLive()); } return nstate.build(); }
/** * Create a new node-connector instance. * * @return A {@link NodeConnector} instance. */ public NodeConnector createNodeConnector() { boolean down = Boolean.valueOf(!linkUp); StateBuilder stBuilder = new StateBuilder().setBlocked(Boolean.FALSE). setLinkDown(down).setLive(Boolean.FALSE); FlowCapableNodeConnectorBuilder fcBuilder = new FlowCapableNodeConnectorBuilder(). setState(stBuilder.build()).setName(portName). setHardwareAddress(macAddress). setAdvertisedFeatures(FEATURES_EMPTY). setPeerFeatures(FEATURES_EMPTY).setSupported(FEATURES_CURRENT). setCurrentFeature(FEATURES_CURRENT).setConfiguration(PORT_CONFIG). setPortNumber(new PortNumberUni(Long.valueOf(portNumber))); if (isOpenflow13(ofVersion)) { fcBuilder.setCurrentSpeed(SPEED_KBPS). setMaximumSpeed(SPEED_KBPS); } return new NodeConnectorBuilder(). setId(new NodeConnectorId(portIdentifier)). addAugmentation(FlowCapableNodeConnector.class, fcBuilder.build()). build(); }
.setName("bond"+lacpBond.getBondInstanceId()) .setPortNumber(PortNumberUniBuilder.getDefaultInstance(Long.valueOf(portNum).toString())) .setState(new StateBuilder().setLinkDown(false).setBlocked(false).setLive(false).build());