org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri类的使用及代码示例

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

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

Uri介绍

[英]The uri type represents a Uniform Resource Identifier (URI) as defined by STD 66. Objects using the uri type MUST be in US-ASCII encoding, and MUST be normalized as described by RFC 3986 Sections 6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary percent-encoding is removed, and all case-insensitive characters are set to lowercase except for hexadecimal digits, which are normalized to uppercase as described in Section 6.2.2.1. The purpose of this normalization is to help provide unique URIs. Note that this normalization is not sufficient to provide uniqueness. Two URIs that are textually distinct after this normalization may still be equivalent. Objects using the uri type may restrict the schemes that they permit. For example, 'data:' and 'urn:' schemes might not be appropriate. A zero-length URI is not a valid URI. This can be used to express 'URI absent' where required. In the value set and its semantics, this type is equivalent to the Uri SMIv2 textual convention defined in RFC 5017.
[中]uri类型表示STD 66定义的统一资源标识符(uri)。使用uri类型的对象必须采用US-ASCII编码,并且必须按照RFC 3986第6.2.1、6.2.2.1和6.2.2.2节的描述进行规范化。删除所有不必要的百分比编码,并将所有不区分大小写的字符设置为小写,但十六进制数字除外,如第6.2.2.1节所述,十六进制数字标准化为大写。这种规范化的目的是帮助提供唯一的URI。请注意,这种规范化不足以提供唯一性。在这种规范化之后,文本上不同的两个URI可能仍然是等效的。使用uri类型的对象可能会限制它们允许的方案。例如,“data:”和“urn:”方案可能不合适。长度为零的URI不是有效的URI。如果需要,可以用它来表示“URI缺席”。在值集及其语义中,该类型相当于RFC 5017中定义的Uri SMIv2文本约定。

代码示例

代码示例来源:origin: org.opendaylight.mdsal.model/ietf-inet-types-2013-07-15

public static Uri getDefaultInstance(String defaultValue) {
  return new Uri(defaultValue);
}

代码示例来源:origin: org.opendaylight.vtn/manager.implementation

/**
 * Return a string configured in the given URI.
 *
 * @param uri  An {@link Uri} instance.
 * @return  A string configured in the given URI.
 *          Note that {@code null} is returned if {@code uri} is
 *          {@code null}.
 */
public static String getValue(Uri uri) {
  return (uri == null) ? null : uri.getValue();
}

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

private Uuid getQosEntryUuid(List<QosEntries> operQosEntries, Uri qosId) {
  if (operQosEntries != null && !operQosEntries.isEmpty()) {
    for (QosEntries qosEntry : operQosEntries) {
      if (qosEntry.getQosId().equals(qosId)) {
        return qosEntry.getQosUuid();
      }
    }
  }
  return null;
}

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

private String getQueueUuid(OvsdbQueueRef queueRef, OvsdbNodeAugmentation operNode) {
  QueuesKey queueKey = queueRef.getValue().firstKeyOf(Queues.class);
  if (operNode.getQueues() != null && !operNode.getQueues().isEmpty()) {
    for (Queues queue : operNode.getQueues()) {
      if (queue.getQueueId().equals(queueKey.getQueueId())) {
        return queue.getQueueUuid().getValue();
      }
    }
  }
  return SouthboundConstants.QUEUE_NAMED_UUID_PREFIX
      + TransactUtils.bytesToHexString(queueKey.getQueueId().getValue().getBytes());
}

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

&& !operNode.getQosEntries().isEmpty()) {
for (QosEntries qosEntry : operNode.getQosEntries()) {
  if (qosEntry.getQosId().equals(qosId)) {
    uuidSet.add(new UUID(qosEntry.getQosUuid().getValue()));
    + TransactUtils.bytesToHexString(qosId.getValue().getBytes())));

代码示例来源:origin: org.opendaylight.mdsal.binding.model.ietf/rfc6991-ietf-inet-types

public static Uri getDefaultInstance(String defaultValue) {
  return new Uri(defaultValue);
}

代码示例来源:origin: org.opendaylight.vtn/manager.implementation

/**
 * Determine whether the given two URIs are identical or not.
 *
 * <p>
 *   Note that this method compares only strings configured in the given
 *   URIs. The type of classes are never compared.
 *
 * </p>
 *
 * @param u1  The first instance to be compared.
 * @param u2  The second instance to be compared.
 * @return  {@code true} only if {@code vh1} and {@code vh2} are identical.
 */
public static boolean equalsUri(Uri u1, Uri u2) {
  if (u1 == null) {
    return (u2 == null);
  } else if (u2 == null) {
    return false;
  }
  return Objects.equals(u1.getValue(), u2.getValue());
}

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

private Uuid getQueueUuid(List<Queues> operQueues, Uri queueId) {
  if (operQueues != null && !operQueues.isEmpty()) {
    for (Queues queueEntry : operQueues) {
      if (queueEntry.getQueueId().equals(queueId)) {
        return queueEntry.getQueueUuid();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.opendaylight.coretutorials/openconfig-bgp

public static Uri getDefaultInstance(String defaultValue) {
  return new Uri(defaultValue);
}

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

private void processOutputAction(OutputActionCase action, FlowTableLookUpResult result) {
  Uri nodeConnector = action.getOutputAction().getOutputNodeConnector();
  if (nodeConnector.getValue().matches("\\d+")) {
    result.outputNodeConnectors.add(nodeConnector);
  } else if (nodeConnector.getValue().matches("CONTROLLER")) {
    result.sendToController = true;
  }
}

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

private Uuid getAutoAttachUuid(List<Autoattach> currentAutoAttach, Uri autoattachId) {
    if (currentAutoAttach != null && !currentAutoAttach.isEmpty()) {
      for (final Autoattach autoAttach : currentAutoAttach) {
        if (autoAttach.getAutoattachId().equals(autoattachId)) {
          return autoAttach.getAutoattachUuid();
        }
      }
    }
    return null;
  }
}

代码示例来源:origin: org.opendaylight.netconf/ietf-netconf-monitoring

public static Location getDefaultInstance(String defaultValue) {
  return defaultValue.equals("NETCONF") ? new Location(Location.Enumeration.NETCONF) : new Location(new Uri(
      defaultValue));
}

代码示例来源:origin: org.opendaylight.netconf/netconf-monitoring

@XmlElement(name = "namespace")
public String getNamespace() {
  return schema.getNamespace().getValue().toString();
}

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

private Uuid getQueueEntryUuid(List<Queues> operQueues, Uri queueId) {
    if (operQueues != null && !operQueues.isEmpty()) {
      for (Queues queueEntry : operQueues) {
        if (queueEntry.getQueueId().equals(queueId)) {
          return queueEntry.getQueueUuid();
        }
      }
    }
    return null;
  }
}

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

private Map<Uri, Manager> getUriManagerMap(Map<UUID,Manager> uuidManagerMap) {
    Map<Uri, Manager> uriManagerMap = new HashMap<>();
    for (Map.Entry<UUID, Manager> uuidManagerMapEntry : uuidManagerMap.entrySet()) {
      uriManagerMap.put(
          new Uri(uuidManagerMapEntry.getValue().getTargetColumn().getData()),
          uuidManagerMapEntry.getValue());
    }
    return uriManagerMap;

  }
}

代码示例来源:origin: org.opendaylight.netconf/ietf-netconf-monitoring

public char[] getValue() {
  if (_value == null) {
    if (_enumeration != null) {
      _value = _enumeration.toString().toCharArray();
    } else
    if (_uri != null) {
      _value = _uri.getValue().toString().toCharArray();
    }
  }
  return _value == null ? null : _value.clone();
}

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

private Uuid getQosEntryUuid(List<QosEntries> operQosEntries, Uri qosId) {
    if (operQosEntries != null && !operQosEntries.isEmpty()) {
      for (QosEntries qosEntry : operQosEntries) {
        if (qosEntry.getQosId().equals(qosId)) {
          return qosEntry.getQosUuid();
        }
      }
    }
    return null;
  }
}

代码示例来源:origin: org.opendaylight.vtn/manager.implementation

/**
 * Create a MD-SAL transaction URI for the given flow entryu.
 *
 * @param vfent   A {@link VtnFlowEntry} instance.
 * @param prefix  Prefix of the URI.
 * @return  An {@link Uri} instance.
 */
public static Uri createTxUri(VtnFlowEntry vfent, String prefix) {
  StringBuilder builder = new StringBuilder(prefix);
  BigInteger cookie = vfent.getCookie().getValue();
  builder.append(Long.toHexString(cookie.longValue())).
    append('-').append(vfent.getOrder());
  return new Uri(builder.toString());
}

代码示例来源:origin: org.opendaylight.sfc/sfc-sb-rest

@Override
  protected void setRestUriList(DataObject dataObject) {
    ServiceFunctionGroup obj = (ServiceFunctionGroup) dataObject;

    if (obj.getRestUri() != null) {
      String restUri = obj.getRestUri().getValue() + SFG_REST_URI + obj.getName();
      this.restUriList = new ArrayList<>();
      this.restUriList.add(restUri);
      LOG.info("SFG will be send to REST URI {}", restUri);
    } else {
      this.restUriList = null;
    }
  }
}

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

private Uuid getAutoAttachUuid(List<Autoattach> currentAutoAttach, Uri autoAttachId) {
  if (currentAutoAttach != null && !currentAutoAttach.isEmpty()) {
    for (final Autoattach autoAttach : currentAutoAttach) {
      if (autoAttach.getAutoattachId().equals(autoAttachId)) {
        return autoAttach.getAutoattachUuid();
      }
    }
  }
  return null;
}

相关文章

微信公众号

最新文章

更多