@Override public IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return this.endpoint.getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
public IoFuture<ConnectionPeerIdentity> getConnectedIdentity(final URI destination, final SSLContext sslContext, final AuthenticationConfiguration authenticationConfiguration) { return endpoint.getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
/** * Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is selected from * the currently active authentication context with the given abstract type (if specified). * * @param destination the destination URI (must not be {@code null}) * @param abstractType the abstract type of the connection (may be {@code null}) * @param abstractTypeAuthority the authority name of the abstract type of the connection (may be {@code null}) * @return the future connection identity (not {@code null}) */ default IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority) { return getConnectedIdentity(destination, abstractType, abstractTypeAuthority, AuthenticationContext.captureCurrent()); }
/** * Get a possibly pre-existing connection to the destination. The given abstract type and authority are used * to locate the authentication configuration. * * @param destination the destination URI (must not be {@code null}) * @param abstractType the abstract type of the connection (may be {@code null}) * @param abstractTypeAuthority the authority name of the abstract type of the connection (may be {@code null}) * @return the future (or existing) connection */ @Deprecated default IoFuture<Connection> getConnection(URI destination, String abstractType, String abstractTypeAuthority) { return new ToConnectionFuture(getConnectedIdentity(destination, abstractType, abstractTypeAuthority)); }
/** * Get a possibly pre-existing connection to the destination. The given authentication configuration is used to * authenticate the connection. * <p> * The given SSL context factory is used only for TLS-based protocols. It may be {@code null}, but in such cases, * no TLS-based protocols will be available. * * @param destination the destination URI (must not be {@code null}) * @param sslContext the SSL context to use for secure connections (may be {@code null}) * @param authenticationConfiguration the authentication configuration to use (must not be {@code null}) * @return the future (or existing) connection */ @Deprecated default IoFuture<Connection> getConnection(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return new ToConnectionFuture(getConnectedIdentity(destination, sslContext, authenticationConfiguration)); }
private IoFuture<ConnectionPeerIdentity> getFuturePeerIdentityPrivileged(final URI location) { final Supplier<AuthenticationContext> supplier = providerEnvironment.getAuthenticationContextSupplier(); final AuthenticationContext context = supplier.get(); final SSLContext sslContext; try { sslContext = CLIENT.getSSLContext(location, context, "jndi", "jboss"); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(new IOException(e)); } final AuthenticationConfiguration authenticationConfiguration = CLIENT.getAuthenticationConfiguration(location, context, -1, "jndi", "jboss"); return endpoint.getConnectedIdentity(location, sslContext, authenticationConfiguration); } }
private IoFuture<ConnectionPeerIdentity> getConnection(final AbstractInvocationContext context, final URI target, @NotNull AuthenticationContext authenticationContext) throws Exception { Affinity affinity = context.getLocator().getAffinity(); String cluster = (affinity instanceof ClusterAffinity) ? ((ClusterAffinity) affinity).getClusterName() : context.getInitialCluster(); if (cluster != null) { return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> discoveredNodeRegistry.getConnectedIdentityUsingClusterEffective(Endpoint.getCurrent(), target, "ejb", "jboss", authenticationContext, cluster)); } return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> Endpoint.getCurrent().getConnectedIdentity(target, "ejb", "jboss", authenticationContext)); } }
ConnectionPeerIdentity getPeerIdentity() throws IOException { SSLContext finalSslContext; if (sslContext == null) { try { finalSslContext = CLIENT.getSSLContext(location, AuthenticationContext.captureCurrent(), "jta", "jboss"); } catch (GeneralSecurityException e) { throw new IOException(e); } } else { finalSslContext = sslContext; } AuthenticationConfiguration finalAuthenticationConfiguration; if (authenticationConfiguration == null) { finalAuthenticationConfiguration = CLIENT.getAuthenticationConfiguration(location, AuthenticationContext.captureCurrent(), -1, "jta", "jboss"); } else { finalAuthenticationConfiguration = authenticationConfiguration; } return endpoint.getConnectedIdentity(location, finalSslContext, finalAuthenticationConfiguration).get(); }
IoFuture<ConnectionPeerIdentity> getConnectedIdentityUsingClusterEffective(Endpoint endpoint, URI destination, String abstractType, String abstractTypeAuthority, AuthenticationContext context, String clusterName) { Assert.checkNotNullParam("destination", destination); Assert.checkNotNullParam("context", context); URI effectiveAuth = clusterName != null ? effectiveAuthURIs.get(clusterName) : null; boolean updateAuth = effectiveAuth != null; if (!updateAuth) { effectiveAuth = destination; } final AuthenticationContextConfigurationClient client = AUTH_CONFIGURATION_CLIENT; final SSLContext sslContext; try { sslContext = client.getSSLContext(destination, context); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(Logs.REMOTING.failedToConfigureSslContext(e)); } final AuthenticationConfiguration authenticationConfiguration = client.getAuthenticationConfiguration(effectiveAuth, context, -1, abstractType, abstractTypeAuthority); return endpoint.getConnectedIdentity(destination, sslContext, updateAuth ? fixupOverrides(authenticationConfiguration, destination) : authenticationConfiguration); }
/** * Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is selected from * the given context with the given abstract type (if specified). * * @param destination the destination URI (must not be {@code null}) * @param abstractType the abstract type of the connection (may be {@code null}) * @param abstractTypeAuthority the authority name of the abstract type of the connection (may be {@code null}) * @param context the authentication context to use (must not be {@code null}) * @return the future connection identity (not {@code null}) */ default IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority, AuthenticationContext context) { Assert.checkNotNullParam("destination", destination); Assert.checkNotNullParam("context", context); final AuthenticationContextConfigurationClient client = AUTH_CONFIGURATION_CLIENT; final SSLContext sslContext; try { sslContext = client.getSSLContext(destination, context); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(Messages.conn.failedToConfigureSslContext(e)); } final AuthenticationConfiguration authenticationConfiguration = client.getAuthenticationConfiguration(destination, context, -1, abstractType, abstractTypeAuthority); return getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
@Override public IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return this.endpoint.getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
public IoFuture<ConnectionPeerIdentity> getConnectedIdentity(final URI destination, final SSLContext sslContext, final AuthenticationConfiguration authenticationConfiguration) { return endpoint.getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
/** * Get a possibly shared, possibly existing connection to the destination. The authentication and SSL configuration is selected from * the currently active authentication context with the given abstract type (if specified). * * @param destination the destination URI (must not be {@code null}) * @param abstractType the abstract type of the connection (may be {@code null}) * @param abstractTypeAuthority the authority name of the abstract type of the connection (may be {@code null}) * @return the future connection identity (not {@code null}) */ default IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, String abstractType, String abstractTypeAuthority) { return getConnectedIdentity(destination, abstractType, abstractTypeAuthority, AuthenticationContext.captureCurrent()); }
/** * Get a possibly pre-existing connection to the destination. The given abstract type and authority are used * to locate the authentication configuration. * * @param destination the destination URI (must not be {@code null}) * @param abstractType the abstract type of the connection (may be {@code null}) * @param abstractTypeAuthority the authority name of the abstract type of the connection (may be {@code null}) * @return the future (or existing) connection */ @Deprecated default IoFuture<Connection> getConnection(URI destination, String abstractType, String abstractTypeAuthority) { return new ToConnectionFuture(getConnectedIdentity(destination, abstractType, abstractTypeAuthority)); }
/** * Get a possibly pre-existing connection to the destination. The given authentication configuration is used to * authenticate the connection. * <p> * The given SSL context factory is used only for TLS-based protocols. It may be {@code null}, but in such cases, * no TLS-based protocols will be available. * * @param destination the destination URI (must not be {@code null}) * @param sslContext the SSL context to use for secure connections (may be {@code null}) * @param authenticationConfiguration the authentication configuration to use (must not be {@code null}) * @return the future (or existing) connection */ @Deprecated default IoFuture<Connection> getConnection(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return new ToConnectionFuture(getConnectedIdentity(destination, sslContext, authenticationConfiguration)); }
private IoFuture<ConnectionPeerIdentity> getFuturePeerIdentityPrivileged(final URI location) { final Supplier<AuthenticationContext> supplier = providerEnvironment.getAuthenticationContextSupplier(); final AuthenticationContext context = supplier.get(); final SSLContext sslContext; try { sslContext = CLIENT.getSSLContext(location, context, "jndi", "jboss"); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(new IOException(e)); } final AuthenticationConfiguration authenticationConfiguration = CLIENT.getAuthenticationConfiguration(location, context, -1, "jndi", "jboss"); return endpoint.getConnectedIdentity(location, sslContext, authenticationConfiguration); } }
private IoFuture<ConnectionPeerIdentity> getFuturePeerIdentityPrivileged(final URI location) { final Supplier<AuthenticationContext> supplier = providerEnvironment.getAuthenticationContextSupplier(); final AuthenticationContext context = supplier.get(); final SSLContext sslContext; try { sslContext = CLIENT.getSSLContext(location, context, "jndi", "jboss"); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(new IOException(e)); } final AuthenticationConfiguration authenticationConfiguration = CLIENT.getAuthenticationConfiguration(location, context, -1, "jndi", "jboss"); return endpoint.getConnectedIdentity(location, sslContext, authenticationConfiguration); } }
private IoFuture<ConnectionPeerIdentity> getConnection(final AbstractInvocationContext context, final URI target, @NotNull AuthenticationContext authenticationContext) throws Exception { Affinity affinity = context.getLocator().getAffinity(); String cluster = (affinity instanceof ClusterAffinity) ? ((ClusterAffinity) affinity).getClusterName() : context.getInitialCluster(); if (cluster != null) { return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> discoveredNodeRegistry.getConnectedIdentityUsingClusterEffective(Endpoint.getCurrent(), target, "ejb", "jboss", authenticationContext, cluster)); } return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> Endpoint.getCurrent().getConnectedIdentity(target, "ejb", "jboss", authenticationContext)); } }
private IoFuture<ConnectionPeerIdentity> getConnection(final AbstractInvocationContext context, final URI target, @NotNull AuthenticationContext authenticationContext) throws Exception { Affinity affinity = context.getLocator().getAffinity(); String cluster = (affinity instanceof ClusterAffinity) ? ((ClusterAffinity) affinity).getClusterName() : context.getInitialCluster(); if (cluster != null) { return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> discoveredNodeRegistry.getConnectedIdentityUsingClusterEffective(Endpoint.getCurrent(), target, "ejb", "jboss", authenticationContext, cluster)); } return doPrivileged((PrivilegedAction<IoFuture<ConnectionPeerIdentity>>) () -> Endpoint.getCurrent().getConnectedIdentity(target, "ejb", "jboss", authenticationContext)); } }
IoFuture<ConnectionPeerIdentity> getConnectedIdentityUsingClusterEffective(Endpoint endpoint, URI destination, String abstractType, String abstractTypeAuthority, AuthenticationContext context, String clusterName) { Assert.checkNotNullParam("destination", destination); Assert.checkNotNullParam("context", context); URI effectiveAuth = clusterName != null ? effectiveAuthURIs.get(clusterName) : null; boolean updateAuth = effectiveAuth != null; if (!updateAuth) { effectiveAuth = destination; } final AuthenticationContextConfigurationClient client = AUTH_CONFIGURATION_CLIENT; final SSLContext sslContext; try { sslContext = client.getSSLContext(destination, context); } catch (GeneralSecurityException e) { return new FailedIoFuture<>(Logs.REMOTING.failedToConfigureSslContext(e)); } final AuthenticationConfiguration authenticationConfiguration = client.getAuthenticationConfiguration(effectiveAuth, context, -1, abstractType, abstractTypeAuthority); return endpoint.getConnectedIdentity(destination, sslContext, updateAuth ? fixupOverrides(authenticationConfiguration, destination) : authenticationConfiguration); }