private EdgeImpl(EdgeBuilder base) { if (base.getKey() == null) { this._key = new EdgeKey( base.getUuid() ); this._uuid = base.getUuid(); } else { this._key = base.getKey(); this._uuid = _key.getUuid(); } this._description = base.getDescription(); this._leftPortId = base.getLeftPortId(); this._name = base.getName(); this._qosAttributes = base.getQosAttributes(); this._rightPortId = base.getRightPortId(); this._status = base.getStatus(); this._tenantId = base.getTenantId(); this._adminStateUp = base.isAdminStateUp(); 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.faas.logical.faas.edges.rev151013.edges.container.edges.Edge>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.edges.rev151013.edges.container.edges.Edge>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.edges.rev151013.edges.container.edges.Edge>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.edges.rev151013.edges.container.edges.Edge>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
private static void attachPorts(List<Pair<Port, Port>> portLinks, WriteTransaction t) { for (Pair<Port, Port> portLink : portLinks) { EdgeBuilder edgeb = new EdgeBuilder(); Uuid edgeId = new Uuid(UUID.randomUUID().toString()); edgeb.setUuid(edgeId); edgeb.setLeftPortId(portLink.getFirst().getUuid()); edgeb.setRightPortId(portLink.getSecond().getUuid()); edgeb.setTenantId(portLink.getFirst().getTenantId()); t.put(logicalDatastoreType, UlnIidFactory.edgeIid(edgeb.getTenantId(), edgeId), edgeb.build(), true); PortBuilder lportb = new PortBuilder(portLink.getFirst()); lportb.setEdgeId(edgeId); t.put(logicalDatastoreType, UlnIidFactory.portIid(lportb.getTenantId(), lportb.getUuid()), lportb.build(), true); PortBuilder rportb = new PortBuilder(portLink.getSecond()); rportb.setEdgeId(edgeId); t.put(logicalDatastoreType, UlnIidFactory.portIid(rportb.getTenantId(), rportb.getUuid()), rportb.build(), true); LOG.debug("Attached Port {} to Port {} via Edge {}", lportb.getUuid().getValue(), rportb.getUuid() .getValue(), edgeb.getUuid().getValue()); } }