/** * Determine whether the specified VTN contains at least one vBridge or * not. * * @param tname The name of the VTN. * @return {@code true} if the specified VTN contains at least one * vBridge. {@code false} otherwise. */ public boolean hasBridge(String tname) { LogicalDatastoreType oper = LogicalDatastoreType.OPERATIONAL; Optional<Vtn> opt = mdSal.read(oper, getTenantPath(tname)); boolean ret; if (opt.isPresent()) { List<Vbridge> vbridges = opt.get().getVbridge(); ret = (vbridges != null && !vbridges.isEmpty()); } else { ret = false; } return ret; }
/** * Determine whether the specified VTN contains at least one vBridge or * not. * * @param tname The name of the VTN. * @return True is returned on successful completion, else false is returned. */ public boolean hasBridge(String tname) { Vtn opt = mdSal.read(LogicalDatastoreType.OPERATIONAL, getTenantPath(tname)); boolean ret; if (opt != null) { List<Vbridge> vbridges = opt.getVbridge(); ret = (vbridges != null && !vbridges.isEmpty()); } else { ret = false; } return ret; }
return false; if (!Objects.equals(_vbridge, other.getVbridge())) { return false;
public VtnBuilder(Vtn base) { if (base.getKey() == null) { this._key = new VtnKey( base.getName() ); this._name = base.getName(); } else { this._key = base.getKey(); this._name = _key.getName(); } this._vbridge = base.getVbridge(); this._vtenantConfig = base.getVtenantConfig(); this._vterminal = base.getVterminal(); this._vtnInputFilter = base.getVtnInputFilter(); this._vtnPathMaps = base.getVtnPathMaps(); if (base instanceof VtnImpl) { VtnImpl impl = (VtnImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtns.Vtn> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.rev150328.vtns.Vtn>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
/** * Scan all the virtual nodes in the specified VTN. * * @param ctx A runtime context for transaction task. * @param vtn A {@link Vtn} instance. * @param data An arbitrary data to be passed to virtual nodes. * @throws VTNException An error occurred. */ private void scan(TxContext ctx, Vtn vtn, T data) throws VTNException { VnodeName tname = vtn.getName(); List<Vbridge> vbridges = vtn.getVbridge(); if (vbridges != null) { for (Vbridge vbridge: vbridges) { VnodeName bname = vbridge.getName(); VBridgeIdentifier vbrId = new VBridgeIdentifier(tname, bname); scan(ctx, new VBridge(vbrId, vbridge), data); } } List<Vterminal> vterminals = vtn.getVterminal(); if (vterminals != null) { for (Vterminal vterm: vterminals) { VnodeName bname = vterm.getName(); VTerminalIdentifier vtmId = new VTerminalIdentifier(tname, bname); scan(ctx, new VTerminal(vtmId, vterm), data); } } } }
List<Vbridge> vbrs = current.getVbridge(); if (vbrs != null) { for (Vbridge vb: vbrs) {