本文整理了Java中org.opendaylight.protocol.concepts.KeyMapping.put()
方法的一些代码示例,展示了KeyMapping.put()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyMapping.put()
方法的具体详情如下:
包路径:org.opendaylight.protocol.concepts.KeyMapping
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!