Package org.apache.bookkeeper.proto
Interface ConnectionPeer
-
- All Known Subinterfaces:
BookieConnectionPeer,ClientConnectionPeer
public interface ConnectionPeerRepresents the connection to a BookKeeper client, from the Bookie side.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddisconnect()Utility function to be used from AuthProviders to drop the connection.BookKeeperPrincipalgetAuthorizedId()Returns the user which is bound to the connection.java.util.Collection<java.lang.Object>getProtocolPrincipals()Additional principals bound to the connection, like TLS certificates.java.net.SocketAddressgetRemoteAddr()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 Detail
-
getRemoteAddr
java.net.SocketAddress getRemoteAddr()
Address from which originated the connection.- Returns:
-
getProtocolPrincipals
java.util.Collection<java.lang.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(org.apache.bookkeeper.auth.BookKeeperPrincipal)
-
setAuthorizedId
void setAuthorizedId(BookKeeperPrincipal principal)
Assign a principal to the current connection.- Parameters:
principal- the id of the user- See Also:
getAuthorizedId()
-
isSecure
boolean isSecure()
This flag returns true if a 'secure' channel in use, like TLS.- Returns:
- true if the channel is 'secure'
-
-