public TLSClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IMessageParser parser, String ref) throws Exception { String secRef = ref; if (secRef == null) { if (!config.isAttributeExist(Parameters.SecurityRef.ordinal())) { throw new IllegalArgumentException("No security_ref attribute present in local peer!"); } else { secRef = config.getStringValue(Parameters.SecurityRef.ordinal(), ""); } } this.sslConfig = TLSUtils.getSSLConfiguration(config, secRef); this.client = new TLSTransportClient(this, concurrentFactory, parser, sslConfig, new InetSocketAddress(remoteAddress, remotePort), new InetSocketAddress(localAddress, localPort)); // this.client.start(); }
public TLSClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IConnectionListener listener, IMessageParser parser, String ref) throws InterruptedException { this.listeners.add(listener); String secRef = ref; if (secRef == null) { if (!config.isAttributeExist(Parameters.SecurityRef.ordinal())) { throw new IllegalArgumentException("No security_ref attribute present in local peer!"); } else { secRef = config.getStringValue(Parameters.SecurityRef.ordinal(), ""); } } this.sslConfig = TLSUtils.getSSLConfiguration(config, secRef); this.client = new TLSTransportClient(this, concurrentFactory, parser, sslConfig, new InetSocketAddress(remoteAddress, remotePort), new InetSocketAddress(localAddress, localPort)); // this.client.start(); }
if (!conf.isAttributeExist(org.jdiameter.client.impl.helpers.Parameters.SecurityRef.ordinal())) { throw new IllegalArgumentException("No security_ref attribute present in local peer!");
public NetworkGuard(InetAddress[] inetAddress, int port, IConcurrentFactory concurrentFactory, IMessageParser parser, IMetaData data) throws Exception { this.parser = parser; this.localAddresses = inetAddress; this.port = port; this.concurrentFactory = concurrentFactory == null ? new DummyConcurrentFactory() : concurrentFactory; // extract sec_ref from local peer; Configuration conf = data.getConfiguration(); if (!conf.isAttributeExist(Parameters.SecurityRef.ordinal())) { throw new IllegalArgumentException("No security_ref attribute present in local peer!"); } String secRef = conf.getStringValue(Parameters.SecurityRef.ordinal(), ""); logger.debug("secRef: {}", secRef); // now need to get proper security data. this.localPeerSSLConfig = TLSUtils.getSSLConfiguration(conf, secRef); if (this.localPeerSSLConfig == null) { throw new IllegalArgumentException("No Security for security_reference '" + secRef + "'"); } this.bindDelay = data.getConfiguration().getLongValue(BindDelay.ordinal(), (Long) BindDelay.defValue()); this.binderExecutor.schedule(binderTask, bindDelay, TimeUnit.MILLISECONDS); }
if (peers != null && peers.length > 0) { for (Configuration peerConfig : peers) { if (peerConfig.isAttributeExist(PeerName.ordinal())) { String uri = peerConfig.getStringValue(PeerName.ordinal(), null); int rating = peerConfig.getIntValue(PeerRating.ordinal(), 0);