NodeCommands

interface NodeCommands : Remote

This interface defines the commands that a node in a distributed system can execute. It extends the Remote interface to allow these commands to be called from a remote machine.

Inheritors

Functions

Link copied to clipboard
abstract fun candidature(leaderId: Long, minDepth: Int, maxDepth: Int, senderAddress: Address)

Sends a candidature for the election.

Link copied to clipboard
abstract fun changeNNext(addr: Address?)

Changes the next neighbour of a node.

Link copied to clipboard
abstract fun changePrev(addr: Address?): Address?

Changes the previous neighbour of a node.

Link copied to clipboard
abstract fun elected(winner: Long, winnerAddress: Address, senderAddress: Address)

Notifies that a node has been elected.

Link copied to clipboard
abstract fun election(id: Long)

Starts an election in the distributed system.

Link copied to clipboard
abstract fun hello()

Sends a hello message to a node.

Link copied to clipboard
abstract fun join(addr: Address?): DSNeighbours?

Joins a node to the distributed system.

Link copied to clipboard
abstract fun nodeMissing(addr: Address?)

Notifies that a node is missing in the distributed system.

Link copied to clipboard
abstract fun register(nickName: String?, addr: Address?)

Registers a node in the distributed system.

Link copied to clipboard
abstract fun response(isPositiveResponse: Boolean, id: Long, senderAddress: Address)

Sends a response to a candidature.

Link copied to clipboard
abstract fun sendMessage(toNickName: String?, fromNickName: String?, message: String?)

Sends a message to a node.