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

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

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

KeyMapping.getKeyMapping介绍

暂无

代码示例

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

PeerRegistryListenerImpl(final ChannelConfig channelConfig) {
  this.channelConfig = channelConfig;
  this.keys = KeyMapping.getKeyMapping();
}

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

public static KeyMapping getKeyMapping(@Nonnull final InetAddress inetAddress, final Optional<Rfc2385Key> password){
    if (password.isPresent()) {
      return getKeyMapping(inetAddress, password.get().getValue());
    }
    return null;
  }
}

代码示例来源:origin: org.opendaylight.bgpcep/pcep-pcc-mock

private void createPCC(@Nonnull final InetSocketAddress localAddress, @Nonnull final PCCTunnelManager tunnelManager,
            final BigInteger initialDBVersion) throws InterruptedException, ExecutionException {
  final PCEPSessionNegotiatorFactory<PCEPSessionImpl> snf = getSessionNegotiatorFactory();
  for (final InetSocketAddress pceAddress : this.remoteAddress) {
    this.pccDispatcher.createClient(pceAddress, this.reconnectTime,
      new PCEPSessionListenerFactory() {
        @Override
        public PCEPSessionListener getSessionListener() {
          return new PCCSessionListener(remoteAddress.indexOf(pceAddress), tunnelManager, pcError);
        }
      }, snf, KeyMapping.getKeyMapping(pceAddress.getAddress(), password), localAddress, initialDBVersion);
  }
}

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

public static KeyMapping getNeighborKey(final Neighbor neighbor) {
  final String authPassword = neighbor.getConfig().getAuthPassword();
  if (authPassword != null) {
    KeyMapping.getKeyMapping(INSTANCE.inetAddressFor(neighbor.getNeighborAddress()), authPassword);
  }
  return null;
}

代码示例来源: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);
}

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

private void connectMonitoredRouters(final BmpDispatcher dispatcher) {
  if (this.monitoredRouters != null) {
    for (final MonitoredRouter mr : this.monitoredRouters) {
      if (mr.getActive()) {
        Preconditions.checkNotNull(mr.getAddress());
        Preconditions.checkNotNull(mr.getPort());
        final String s = mr.getAddress().getIpv4Address().getValue();
        final InetAddress addr = InetAddresses.forString(s);
        KeyMapping ret = null;
        final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
        ret = KeyMapping.getKeyMapping(addr, rfc2385KeyPassword.getValue());
        dispatcher.createClient(
          Ipv4Util.toInetSocketAddress(mr.getAddress(), mr.getPort()),
          this.sessionManager, Optional.<KeyMapping>fromNullable(ret));
      }
    }
  }
}

相关文章