Package org.apache.bookkeeper.proto
Interface ConnectionPeer
- All Known Subinterfaces:
BookieConnectionPeer,ClientConnectionPeer
public interface ConnectionPeer
Represents the connection to a BookKeeper client, from the Bookie side.
-
Method Summary
Modifier and TypeMethodDescriptionvoidUtility function to be used from AuthProviders to drop the connection.Returns the user which is bound to the connection.Additional principals bound to the connection, like TLS certificates.Address from which originated the connection.booleanisSecure()This flag returns true if a 'secure' channel in use, like TLS.voidsetAuthorizedId(BookKeeperPrincipal principal) Assign a principal to the current connection.
-
Method Details
-
getRemoteAddr
SocketAddress getRemoteAddr()Address from which originated the connection.- Returns:
-
getProtocolPrincipals
Collection<Object> getProtocolPrincipals()Additional principals bound to the connection, like TLS certificates.- Returns:
-
disconnect
void disconnect()Utility function to be used from AuthProviders to drop the connection. -
getAuthorizedId
BookKeeperPrincipal getAuthorizedId()Returns the user which is bound to the connection.- Returns:
- the principal or null if no auth takes place
or the auth plugin did not call
setAuthorizedId(org.apache.bookkeeper.auth.BookKeeperPrincipal) - See Also:
-
setAuthorizedId
Assign a principal to the current connection.- Parameters:
principal- the id of the user- See Also:
-
isSecure
boolean isSecure()This flag returns true if a 'secure' channel in use, like TLS.- Returns:
- true if the channel is 'secure'
-