org.opendaylight.protocol.concepts.KeyMapping.put()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(82)

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

KeyMapping.put介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.bgpcep/concepts

public static KeyMapping getKeyMapping(@Nonnull final InetAddress inetAddress, @Nullable final String password){
  if (!isNullOrEmpty(password)) {
    final KeyMapping keyMapping = new KeyMapping();
    keyMapping.put(inetAddress, password.getBytes(StandardCharsets.US_ASCII));
    return keyMapping;
  }
  return null;
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-rib-impl

@Override
public void onPeerAdded(final IpAddress ip, final BGPSessionPreferences prefs) {
  if (prefs.getMd5Password().isPresent()) {
    this.keys.put(IetfInetUtil.INSTANCE.inetAddressFor(ip), prefs.getMd5Password().get());
    this.channelConfig.setOption(EpollChannelOption.TCP_MD5SIG, this.keys);
  }
}

代码示例来源:origin: org.opendaylight.bgpcep/pcep-topology-provider

private Optional<KeyMapping> contructKeys() {
  KeyMapping ret = null;
  final List<Client> clients = getClient();
  if (clients != null && !clients.isEmpty()) {
    ret = KeyMapping.getKeyMapping();
    for (final Client c : clients) {
      if (c.getAddress() == null) {
        LOG.warn("Client {} does not have an address skipping it", c);
        continue;
      }
      final Rfc2385Key rfc2385KeyPassword = c.getPassword();
      if (rfc2385KeyPassword != null && !rfc2385KeyPassword.getValue().isEmpty()) {
        final String s = getAddressString(c.getAddress());
        ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
      }
    }
  }
  return Optional.fromNullable(ret);
}

代码示例来源:origin: org.opendaylight.bgpcep/bgp-bmp-impl

private Optional<KeyMapping> constructKeys() {
  final KeyMapping ret = KeyMapping.getKeyMapping();
  if (getMonitoredRouter() != null) {
    for (final MonitoredRouter mr : getMonitoredRouter()) {
      if (mr.getAddress() == null) {
        LOG.warn("Monitored router {} does not have an address skipping it", mr);
        continue;
      }
      final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
      if (rfc2385KeyPassword != null && !rfc2385KeyPassword.getValue().isEmpty()) {
        final String s = getAddressString(mr.getAddress());
        ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
      }
    }
  }
  return ret.isEmpty() ? Optional.<KeyMapping>absent() : Optional.<KeyMapping>of(ret);
}

相关文章