@Override public IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return this.endpoint.getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }
public IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(final URI destination, final SSLContext sslContext, final AuthenticationConfiguration authenticationConfiguration) { return endpoint.getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }
/** * Get a pre-existing connection to the destination. The connection authentication configuration is used to * authenticate * the peer if the connection supports multiple identity switching. The run authentication configuration is used to * authenticate * the peer if the connection does not support multiple identity switching. * <p> * If no existing connection was found, {@code null} is returned. If a non-{@code null} {@code IoFuture} is * returned, it may represent a complete connection, a failed attempt, or an in-progress attempt. * * @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 connectionConfiguration the connection authentication configuration (must not be {@code null}) * @param operateConfiguration the run authentication configuration (must not be {@code null}) * @return the existing connection, or {@code null} if no connection currently exists */ @Deprecated default IoFuture<Connection> getConnectionIfExists(URI destination, SSLContext sslContext, AuthenticationConfiguration connectionConfiguration, AuthenticationConfiguration operateConfiguration) { return new ToConnectionFuture(getConnectedIdentityIfExists(destination, sslContext, operateConfiguration)); }
protected boolean isConnected(final URI uri) { final IoFuture<ConnectionPeerIdentity> future = Endpoint.getCurrent().getConnectedIdentityIfExists(uri, "ejb", "jboss", AuthenticationContext.captureCurrent()); try { return future != null && future.getStatus() == IoFuture.Status.DONE && future.get().getConnection().isOpen(); } catch (IOException e) { // impossible throw Assert.unreachableCode(); } }
/** * Get a possibly shared, possibly existing connection to the destination, if the connection was already established. * The authentication and SSL configuration is specified directly. * <p> * If no existing connection was found, {@code null} is returned. If a non-{@code null} {@code IoFuture} is * returned, it may represent a complete connection, a failed attempt, or an in-progress attempt. * * @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 existing connection, or {@code null} if no connection currently exists */ default IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(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 getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }
@Override public IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return this.endpoint.getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }
public IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(final URI destination, final SSLContext sslContext, final AuthenticationConfiguration authenticationConfiguration) { return endpoint.getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }
/** * Get a pre-existing connection to the destination. The connection authentication configuration is used to * authenticate * the peer if the connection supports multiple identity switching. The run authentication configuration is used to * authenticate * the peer if the connection does not support multiple identity switching. * <p> * If no existing connection was found, {@code null} is returned. If a non-{@code null} {@code IoFuture} is * returned, it may represent a complete connection, a failed attempt, or an in-progress attempt. * * @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 connectionConfiguration the connection authentication configuration (must not be {@code null}) * @param operateConfiguration the run authentication configuration (must not be {@code null}) * @return the existing connection, or {@code null} if no connection currently exists */ @Deprecated default IoFuture<Connection> getConnectionIfExists(URI destination, SSLContext sslContext, AuthenticationConfiguration connectionConfiguration, AuthenticationConfiguration operateConfiguration) { return new ToConnectionFuture(getConnectedIdentityIfExists(destination, sslContext, operateConfiguration)); }
protected boolean isConnected(final URI uri) { final IoFuture<ConnectionPeerIdentity> future = Endpoint.getCurrent().getConnectedIdentityIfExists(uri, "ejb", "jboss", AuthenticationContext.captureCurrent()); try { return future != null && future.getStatus() == IoFuture.Status.DONE && future.get().getConnection().isOpen(); } catch (IOException e) { // impossible throw Assert.unreachableCode(); } }
protected boolean isConnected(final URI uri) { final IoFuture<ConnectionPeerIdentity> future = Endpoint.getCurrent().getConnectedIdentityIfExists(uri, "ejb", "jboss", AuthenticationContext.captureCurrent()); try { return future != null && future.getStatus() == IoFuture.Status.DONE && future.get().getConnection().isOpen(); } catch (IOException e) { // impossible throw Assert.unreachableCode(); } }
/** * Get a possibly shared, possibly existing connection to the destination, if the connection was already established. * The authentication and SSL configuration is specified directly. * <p> * If no existing connection was found, {@code null} is returned. If a non-{@code null} {@code IoFuture} is * returned, it may represent a complete connection, a failed attempt, or an in-progress attempt. * * @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 existing connection, or {@code null} if no connection currently exists */ default IoFuture<ConnectionPeerIdentity> getConnectedIdentityIfExists(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 getConnectedIdentityIfExists(destination, sslContext, authenticationConfiguration); }