Package org.jboss.remoting3.spi
Interface ConnectionHandler
-
- All Superinterfaces:
AutoCloseable
,Closeable
,HandleableCloseable<ConnectionHandler>
public interface ConnectionHandler extends HandleableCloseable<ConnectionHandler>
A connection to a foreign endpoint. This interface is implemented by the protocol implementation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.remoting3.HandleableCloseable
HandleableCloseable.Key
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SocketAddress
getLocalAddress()
Get the local address, if any.org.wildfly.security.auth.server.SecurityIdentity
getLocalIdentity()
Get the local identity corresponding to the peer authentication which was performed on this connection, if it is an incoming connection.String
getLocalSaslServerName()
Get the local SASL server name that we have given to the peer.Set<String>
getOfferedMechanisms()
Get the available SASL mechanisms.SocketAddress
getPeerAddress()
Get the peer address, if any.String
getPeerSaslServerName()
Get the SASL server name that the peer gives for itself.Principal
getPrincipal()
Get the principal used to authenticate the local client against the peer.String
getRemoteEndpointName()
Get the name of the remote endpoint.SSLSession
getSslSession()
/** Get the underlyingSSLSession
for this connection if one is established.org.xnio.Cancellable
open(String serviceType, org.xnio.Result<Channel> result, org.xnio.OptionMap optionMap)
Open a request handler.void
sendAuthChallenge(int id, byte[] challenge)
Send an authentication challenge.void
sendAuthDelete(int id)
Send an authentication delete message.void
sendAuthDeleteAck(int id)
Send an authentication delete acknowledgement message.void
sendAuthReject(int id)
Send an authentication reject message.void
sendAuthRequest(int id, String mechName, byte[] initialResponse)
Send an authentication request.void
sendAuthResponse(int id, byte[] response)
Send an authentication response.void
sendAuthSuccess(int id, byte[] challenge)
Send an authentication complete message.boolean
supportsRemoteAuth()
Determine if the connection handler supports the remote authentication protocol.-
Methods inherited from interface org.jboss.remoting3.HandleableCloseable
addCloseHandler, awaitClosed, awaitClosedUninterruptibly, close, closeAsync, isOpen
-
-
-
-
Method Detail
-
open
org.xnio.Cancellable open(String serviceType, org.xnio.Result<Channel> result, org.xnio.OptionMap optionMap)
Open a request handler.- Parameters:
serviceType
- the service type stringresult
- the result for the connected channeloptionMap
- the options for this service- Returns:
- a handle which may be used to cancel the pending operation
-
getSslSession
SSLSession getSslSession()
/** Get the underlyingSSLSession
for this connection if one is established.- Returns:
- the
SSLSession
for the connection if one is established, otherwise returnsnull
.
-
getRemoteEndpointName
String getRemoteEndpointName()
Get the name of the remote endpoint.- Returns:
- the remote endpoint name
-
getLocalAddress
SocketAddress getLocalAddress()
Get the local address, if any.- Returns:
- the local address, or
null
if there is none
-
getPeerAddress
SocketAddress getPeerAddress()
Get the peer address, if any.- Returns:
- the peer address, or
null
if there is none
-
getPeerSaslServerName
String getPeerSaslServerName()
Get the SASL server name that the peer gives for itself.- Returns:
- the SASL server name that the peer gives for itself (must not be
null
)
-
getLocalSaslServerName
String getLocalSaslServerName()
Get the local SASL server name that we have given to the peer.- Returns:
- the local SASL server name that we have given to the peer (must not be
null
)
-
getLocalIdentity
org.wildfly.security.auth.server.SecurityIdentity getLocalIdentity()
Get the local identity corresponding to the peer authentication which was performed on this connection, if it is an incoming connection. Outbound connections may returnnull
for this property.- Returns:
- the local identity of a connection, or
null
if the connection has no local identity and no local security domain configuration
-
supportsRemoteAuth
boolean supportsRemoteAuth()
Determine if the connection handler supports the remote authentication protocol.- Returns:
true
if remote authentication is supported,false
otherwise
-
getOfferedMechanisms
Set<String> getOfferedMechanisms()
Get the available SASL mechanisms.- Returns:
- the available SASL mechanisms
-
getPrincipal
Principal getPrincipal()
Get the principal used to authenticate the local client against the peer.- Returns:
- the local client principal, or
null
if the connection is inbound
-
sendAuthRequest
void sendAuthRequest(int id, String mechName, byte[] initialResponse) throws IOException
Send an authentication request.- Parameters:
id
- the ID number to usemechName
- the mechanism name (notnull
)initialResponse
- the initial response (possiblynull
)- Throws:
IOException
- if a transmission error occurs
-
sendAuthChallenge
void sendAuthChallenge(int id, byte[] challenge) throws IOException
Send an authentication challenge.- Parameters:
id
- the ID number to usechallenge
- the challenge body (notnull
)- Throws:
IOException
- if a transmission error occurs
-
sendAuthResponse
void sendAuthResponse(int id, byte[] response) throws IOException
Send an authentication response.- Parameters:
id
- the ID number to useresponse
- the response body (notnull
)- Throws:
IOException
- if a transmission error occurs
-
sendAuthSuccess
void sendAuthSuccess(int id, byte[] challenge) throws IOException
Send an authentication complete message.- Parameters:
id
- the ID number to usechallenge
- the final challenge (may benull
if none is needed)- Throws:
IOException
- if a transmission error occurs
-
sendAuthReject
void sendAuthReject(int id) throws IOException
Send an authentication reject message.- Parameters:
id
- the ID number to use- Throws:
IOException
- if a transmission error occurs
-
sendAuthDelete
void sendAuthDelete(int id) throws IOException
Send an authentication delete message.- Parameters:
id
- the ID number to use- Throws:
IOException
- if a transmission error occurs
-
sendAuthDeleteAck
void sendAuthDeleteAck(int id) throws IOException
Send an authentication delete acknowledgement message.- Parameters:
id
- the ID number to use- Throws:
IOException
- if a transmission error occurs
-
-