org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid.equals()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid.equals()方法的一些代码示例,展示了Uuid.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Uuid.equals()方法的具体详情如下:
包路径:org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid
类名称:Uuid
方法名:equals

Uuid.equals介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.alto.basic/alto-simple-ird-impl

protected boolean isAcceptableContext(Uuid context) {
  if (m_entryContext.equals(context) || m_context.equals(context)) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

@VisibleForTesting
static boolean isRuleIdEqual(SecurityRule one, SecurityRule two) {
  checkNotNull(one);
  checkNotNull(two);
  return one.getSecurityGroupId().equals(two.getSecurityGroupId());
}

代码示例来源:origin: org.opendaylight.ovsdb/openstack.net-virt

private void handleInterfaceEventDelete(final OvsdbTerminationPointAugmentation intf, final Long dpId) {
  // Remove entry from neutronPortToDpIdCache based on interface uuid
  for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) {
    final String currPortUuid = entry.getKey();
    if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) {
      LOG.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
          currPortUuid, dpId, intf.getInterfaceUuid().getValue());
      neutronPortToDpIdCache.remove(currPortUuid);
      break;
    }
  }
}

代码示例来源:origin: org.opendaylight.netvirt/openstack.net-virt

private void handleInterfaceEventDelete(final OvsdbTerminationPointAugmentation intf, final Long dpId) {
  // Remove entry from neutronPortToDpIdCache based on interface uuid
  for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) {
    final String currPortUuid = entry.getKey();
    if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) {
      LOG.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}",
          currPortUuid, dpId, intf.getInterfaceUuid().getValue());
      neutronPortToDpIdCache.remove(currPortUuid);
      break;
    }
  }
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<SecurityGroup> findSecurityGroup(Uuid secGrpUuid, @Nullable SecurityGroups securityGroups) {
  Preconditions.checkNotNull(secGrpUuid);
  if (securityGroups == null || securityGroups.getSecurityGroup() == null) {
    return Optional.absent();
  }
  for (SecurityGroup secGroup : securityGroups.getSecurityGroup()) {
    if (secGrpUuid.equals(secGroup.getUuid())) {
      return Optional.of(secGroup);
    }
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

@Override
  public boolean apply(SecurityRule secRule) {
    return (secRule.getSecurityGroupId().equals(secGroup)
        && Objects.equal(secRule.getRemoteGroupId(), remoteSecGroup));
  }
}).toSet();

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<Subnet> findSubnet(Uuid uuid, @Nullable Subnets subnets) {
    if (subnets == null || subnets.getSubnet() == null) {
      return Optional.absent();
    }
    for (Subnet subnet : subnets.getSubnet()) {
      if (subnet.getUuid().equals(uuid)) {
        return Optional.of(subnet);
      }
    }
    return Optional.absent();
  }
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<Port> findPort(Uuid uuid, @Nullable Ports ports) {
  if (ports == null || ports.getPort() == null) {
    return Optional.absent();
  }
  for (Port port : ports.getPort()) {
    if (port.getUuid().equals(uuid)) {
      return Optional.of(port);
    }
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<SecurityRule> findSecurityRule(Uuid uuid, @Nullable SecurityRules securityRules) {
  if (securityRules == null || securityRules.getSecurityRule() == null) {
    return Optional.absent();
  }
  for (SecurityRule secRule : securityRules.getSecurityRule()) {
    if (secRule.getUuid().equals(uuid)) {
      return Optional.of(secRule);
    }
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<Router> findRouter(Uuid uuid, @Nullable Routers routers) {
    if (routers == null || routers.getRouter() == null) {
      return Optional.absent();
    }
    for (Router router : routers.getRouter()) {
      if (router.getUuid().equals(uuid)) {
        return Optional.of(router);
      }
    }
    return Optional.absent();
  }
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

public static Optional<Network> findNetwork(Uuid uuid, @Nullable Networks networks) {
  if (networks == null || networks.getNetwork() == null) {
    return Optional.absent();
  }
  for (Network network : networks.getNetwork()) {
    if (network.getUuid().equals(uuid)) {
      return Optional.of(network);
    }
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

@VisibleForTesting
static boolean isOneGroupIdWithinTwoRemoteGroupId(SecurityRule one, SecurityRule two) {
  return (two.getRemoteGroupId() == null || two.getRemoteGroupId().equals(
      one.getSecurityGroupId()));
}

代码示例来源:origin: org.opendaylight.netvirt/neutronvpn-impl

private void handleNeutronSubnetUpdated(Uuid subnetId, Uuid networkId, Uuid tenantId) {
  Uuid oldNetworkId = NeutronvpnUtils.getSubnetmap(dataBroker, subnetId).getNetworkId();
  if (oldNetworkId != null && !oldNetworkId.equals(networkId)) {
    deleteSubnetToNetworkMapping(subnetId, oldNetworkId);
  }
  if (networkId != null && !networkId.equals(oldNetworkId)) {
    createSubnetToNetworkMapping(subnetId, networkId);
  }
  nvpnManager.updateSubnetNode(subnetId, null, tenantId, networkId, null, null);
}

代码示例来源:origin: org.opendaylight.netvirt/neutronvpn-impl

protected static List<Uuid> getNeutronRouterSubnetIds(DataBroker broker, Uuid routerId) {
  logger.debug("getNeutronRouterSubnetIds for {}", routerId.getValue());
  List<Uuid> subnetIdList = new ArrayList<>();
  Optional<Subnetmaps> subnetMaps = read(broker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder
      (Subnetmaps.class).build());
  if (subnetMaps.isPresent() && subnetMaps.get().getSubnetmap() != null) {
    for (Subnetmap subnetmap : subnetMaps.get().getSubnetmap()) {
      if (routerId.equals(subnetmap.getRouterId())) {
        subnetIdList.add(subnetmap.getId());
      }
    }
  }
  logger.debug("returning from getNeutronRouterSubnetIds for {}", routerId.getValue());
  return subnetIdList;
}

代码示例来源:origin: org.opendaylight.netvirt/vpnmanager-impl

private boolean checkVpnAvailability(InterVpnLinkKey key, Uuid vpnId) {
  Preconditions.checkNotNull(vpnId);
  List<InterVpnLink> interVpnLinks = InterVpnLinkUtil.getAllInterVpnLinks(dataBroker);
  if ( interVpnLinks != null ) {
    for (InterVpnLink interVpnLink : interVpnLinks) {
      if (!key.equals(interVpnLink.getKey())
        && (vpnId.equals(interVpnLink.getFirstEndpoint().getVpnUuid())
          || vpnId.equals(interVpnLink.getSecondEndpoint().getVpnUuid()))) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: org.opendaylight.ovsdb/southbound-impl

private QueuesKey getQueueKey(Node node, UUID queueUuid) {
  List<Queues> queueList = node.getAugmentation(OvsdbNodeAugmentation.class).getQueues();
  if (queueList == null || queueList.isEmpty()) {
    LOG.debug("Deleting Queue {}, Ovsdb Node {} does not have a Queue list.", queueUuid.toString(), node);
    return null;
  }
  Iterator<Queues> itr = queueList.iterator();
  Uuid quUuid = new Uuid(queueUuid.toString());
  while (itr.hasNext()) {
    Queues queue = itr.next();
    if (queue.getQueueUuid().equals(quUuid)) {
      return queue.getKey();
    }
  }
  LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", queueUuid.toString(), node);
  return null;
}

代码示例来源:origin: org.opendaylight.netvirt/neutronvpn-impl

protected List<Uuid> getSubnetsforVpn(Uuid vpnid) {
  List<Uuid> subnets = new ArrayList<>();
  // read subnetmaps
  InstanceIdentifier<Subnetmaps> subnetmapsid = InstanceIdentifier.builder(Subnetmaps.class).build();
  Optional<Subnetmaps> subnetmaps = NeutronvpnUtils.read(dataBroker, LogicalDatastoreType.CONFIGURATION,
      subnetmapsid);
  if (subnetmaps.isPresent() && subnetmaps.get().getSubnetmap() != null) {
    List<Subnetmap> subnetMapList = subnetmaps.get().getSubnetmap();
    for (Subnetmap subnetMap : subnetMapList) {
      if (subnetMap.getVpnId() != null && subnetMap.getVpnId().equals(vpnid)) {
        subnets.add(subnetMap.getId());
      }
    }
  }
  return subnets;
}

代码示例来源:origin: org.opendaylight.netvirt/aclservice-impl

public static List<Ace> getAceWithRemoteAclId(DataBroker dataBroker, AclInterface port, Uuid remoteAcl) {
  List<Ace> remoteAclRuleList = new ArrayList<>();
  List<Uuid> aclList = port.getSecurityGroups();
  for (Uuid aclId : aclList) {
    Acl acl = getAcl(dataBroker, aclId.getValue());
    List<Ace> aceList = acl.getAccessListEntries().getAce();
    for (Ace ace : aceList) {
      Uuid tempRemoteAcl = getAccesssListAttributes(ace).getRemoteGroupId();
      if (tempRemoteAcl != null && tempRemoteAcl.equals(remoteAcl)) {
        remoteAclRuleList.add(ace);
      }
    }
  }
  return remoteAclRuleList;
}

代码示例来源:origin: org.opendaylight.ovsdb/southbound-impl

private AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) {
    final List<Autoattach> autoAttachList = node.getAugmentation(OvsdbNodeAugmentation.class).getAutoattach();
    if (autoAttachList == null || autoAttachList.isEmpty()) {
      return null;
    }
    for (final Autoattach autoAttach : autoAttachList) {
      if (autoAttach.getAutoattachUuid()
          .equals(new Uuid(autoAttachUuid.toString()))) {
        return autoAttach.getKey();
      }
    }
    return null;
  }
}

代码示例来源:origin: org.opendaylight.groupbasedpolicy/neutron-mapper

private static ContextId resolveL3ContextForPort(Port port, FixedIps portFixedIPs, Neutron neutron) {
    Set<Port> routerIfacePorts = PortUtils.findRouterInterfacePorts(neutron.getPorts());
    for (Port routerIfacePort : routerIfacePorts) {
      Uuid routerIfacePortSubnet = routerIfacePort.getFixedIps().get(0).getSubnetId();
      // if port is in the same subnet as router interface then we want to use L3Context of
      // router
      if (portFixedIPs.getSubnetId().equals(routerIfacePortSubnet)) {
        LOG.trace("Router interface port was found in the same subnet as port have {}", port);
        return new ContextId(routerIfacePort.getDeviceId());
      }
    }
    return new ContextId(port.getNetworkId().getValue());
  }
}

相关文章