private Subnets newSubnets(String subnetIp) { SubnetsBuilder subnetsBuilder = new SubnetsBuilder(); subnetsBuilder.setDeviceVteps(new ArrayList<>()); subnetsBuilder.setGatewayIp(new IpAddress("0.0.0.0".toCharArray())); subnetsBuilder.setKey(new SubnetsKey(new IpPrefix(subnetIp.toCharArray()))); subnetsBuilder.setVlanId(0); subnetsBuilder.setVteps(new ArrayList<Vteps>()); return subnetsBuilder.build(); }
public boolean checkExistingSubnet(Map<SubnetObject, List<Vteps>> subVtepMapTemp, SubnetObject subObCli) { for (SubnetObject subOb : subVtepMapTemp.keySet()) { if (subOb.get_key().equals(subObCli.get_key())) { if (!(subOb.get_vlanId().equals(subObCli.get_vlanId()))) return true; if (!(subOb.get_gatewayIp().equals(subObCli.get_gatewayIp()))) return true; } } return false; }
private SubnetsImpl(SubnetsBuilder base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); 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.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
@Override public int hashCode() { if (hashValid) { return hash; } final int prime = 31; int result = 1; result = prime * result + ((_gatewayIp == null) ? 0 : _gatewayIp.hashCode()); result = prime * result + ((_key == null) ? 0 : _key.hashCode()); result = prime * result + ((_prefix == null) ? 0 : _prefix.hashCode()); result = prime * result + ((_vlanId == null) ? 0 : _vlanId.hashCode()); hash = result; hashValid = true; return result; }
LOG.debug("gateway is null"); SubnetsKey subnetsKey = new SubnetsKey(subnetMaskObj); Vteps vtepCli = new VtepsBuilder().setDpnId(dpnId).setIpAddress(ipAddressObj).setKey(vtepkey)
public SubnetsBuilder(Subnets base) { if (base.getKey() == null) { this._key = new SubnetsKey( base.getPrefix() ); this._prefix = base.getPrefix(); } else { this._key = base.getKey(); this._prefix = _key.getPrefix(); } this._deviceVteps = base.getDeviceVteps(); this._gatewayIp = base.getGatewayIp(); this._vlanId = base.getVlanId(); this._vteps = base.getVteps(); if (base instanceof SubnetsImpl) { SubnetsImpl impl = (SubnetsImpl) 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.genius.itm.rev160406.transport.zones.transport.zone.Subnets> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.Subnets>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
return false; } else if (!_key.equals(other.get_key())) { return false;
validateForDuplicates(vtepCli, transportZone); SubnetsKey subnetsKey = new SubnetsKey(subnetMaskObj); SubnetObject subObCli = new SubnetObject(gatewayIpObj, subnetsKey, subnetMaskObj, vlanId); if (tZones.containsKey(transportZone)) {
return; SubnetsKey subnetsKey = new SubnetsKey(subnetMaskObj); Vteps vtepCli = null; Subnets subCli = null;
.child(Subnets.class, new SubnetsKey(schema.getSubnet())).child(Vteps.class, vtepkey).build();