private void registerHandlers ( RaftServerProtocol protocol ) { protocol . registerOpenSessionHandler ( request -> runOnContextIfReady ( ( ) -> role . onOpenSession ( request ) , OpenSessionResponse :: builder ) ) ; protocol . registerCloseSessionHandler ( request -> runOnContextIfReady ( ( ) -> role . onCloseSession ( request ) , CloseSessionResponse :: builder ) ) ; protocol . registerKeepAliveHandler ( request -> runOnContextIfReady ( ( ) -> role . onKeepAlive ( request ) , KeepAliveResponse :: builder ) ) ; protocol . registerMetadataHandler ( request -> runOnContextIfReady ( ( ) -> role . onMetadata ( request ) , MetadataResponse :: builder ) ) ; protocol . registerConfigureHandler ( request -> runOnContext ( ( ) -> role . onConfigure ( request ) ) ) ; protocol . registerInstallHandler ( request -> runOnContext ( ( ) -> role . onInstall ( request ) ) ) ; protocol . registerJoinHandler ( request -> runOnContext ( ( ) -> role . onJoin ( request ) ) ) ; protocol . registerReconfigureHandler ( request -> runOnContext ( ( ) -> role . onReconfigure ( request ) ) ) ; protocol . registerLeaveHandler ( request -> runOnContext ( ( ) -> role . onLeave ( request ) ) ) ; protocol . registerTransferHandler ( request -> runOnContext ( ( ) -> role . onTransfer ( request ) ) ) ; protocol . registerAppendHandler ( request -> runOnContext ( ( ) -> role . onAppend ( request ) ) ) ; protocol . registerPollHandler ( request -> runOnContext ( ( ) -> role . onPoll ( request ) ) ) ; protocol . registerVoteHandler ( request -> runOnContext ( ( ) -> role . onVote ( request ) ) ) ; protocol . registerCommandHandler ( request -> runOnContextIfReady ( ( ) -> role . onCommand ( request ) , CommandResponse :: builder ) ) ; protocol . registerQueryHandler ( request -> runOnContextIfReady ( ( ) -> role . onQuery ( request ) , QueryResponse :: builder ) ) ; }
Registers server handlers on the configured protocol .