public void receiveAuthChallenge(final int id, final byte[] challenge) { if (id == 0 || id == 1) { // ignore return; } connection.getPeerIdentityContext().receiveChallenge(id, challenge); }
public void receiveAuthReject(final int id) { if (id == 0 || id == 1) { // ignore return; } connection.getPeerIdentityContext().receiveReject(id); }
ManagedConnection(final Connection delegate, final ConnectionInfo connectionInfo, final AuthenticationConfiguration authConfig, final FutureResult<Connection> futureResult) { this.delegate = delegate; this.connectionInfo = connectionInfo; this.authConfig = authConfig; this.futureResult = futureResult; delegate.addCloseHandler((c, e) -> connectionInfo.connectionClosed(authConfig, futureResult)); }
public Executor getRequestExecutor() { return channel.getConnection().getEndpoint().getXnioWorker(); }
protected void closeAction() throws IOException { connectionHandler.closeAsync(); connectionHandler.addCloseHandler((closed, exception) -> closeComplete()); for (Auth auth : authMap) { auth.dispose(); } final ConnectionPeerIdentityContext peerIdentityContext = this.peerIdentityContext; if (peerIdentityContext != null) peerIdentityContext.connectionClosed(); }
public void close() throws IOException { connectionInfo.connectionClosed(authConfig, futureResult); delegate.close(); }
@Override public IoFuture<Connection> connect(URI destination, InetSocketAddress bindAddress, OptionMap connectOptions, SSLContext sslContext, AuthenticationConfiguration connectionConfiguration) { return this.endpoint.connect(destination, bindAddress, connectOptions, sslContext, connectionConfiguration); }
@Override public SecurityIdentity getSecurityIdentity() { return connection.getLocalIdentity(); } }
public Key addCloseHandler(final CloseHandler<? super Endpoint> handler) { return endpoint.addCloseHandler((endpoint, ex) -> handler.handleClose(this, ex)); }
public void closeAsync() { connectionInfo.connectionClosed(authConfig, futureResult); delegate.closeAsync(); }
protected void closeAction() throws IOException { try { openListener.registrationTerminated(); } finally { super.closeAction(); } } };
public int getPeerIdentityId() { return getPeerIdentityContext().getCurrentIdentity().getIndex(); }
@Override public XnioWorker getXnioWorker() { return this.endpoint.getXnioWorker(); } }
@Override public IoFuture<ConnectionPeerIdentity> getConnectedIdentity(URI destination, SSLContext sslContext, AuthenticationConfiguration authenticationConfiguration) { return this.endpoint.getConnectedIdentity(destination, sslContext, authenticationConfiguration); }
public void receiveAuthDeleteAck(final int id) { if (id == 0 || id == 1) { // ignore return; } connection.getPeerIdentityContext().receiveDeleteAck(id); } }
public void receiveAuthSuccess(final int id, final byte[] challenge) { if (id == 0 || id == 1) { // ignore return; } connection.getPeerIdentityContext().receiveSuccess(id, challenge); }
public ConnectionPeerIdentity getConnectionAnonymousIdentity() { return getPeerIdentityContext().getAnonymousIdentity(); }
/** * Create a new endpoint builder. * * @return the new endpoint builder */ static EndpointBuilder builder() { return new EndpointBuilder(); } }
void connectionClosed(AuthenticationConfiguration authenticationConfiguration, final FutureResult<Connection> futureResult) { State state; do { synchronized (this) { state = this.state; } } while (! state.connectionClosed(authenticationConfiguration, futureResult)); }