use of com.github.dedis.popstellar.model.network.method.message.data.lao.StateLao in project popstellar by dedis.
the class MessageHandler method notifyLaoUpdate.
/**
* Keep the UI up to date by notifying all observers the updated LAO state.
*
* <p>The LAO is updated if the channel of the message is a LAO channel and the message is not a
* WitnessSignatureMessage.
*
* <p>If a LAO has been created or modified then the LAO lists in the LAORepository are updated.
*
* @param laoRepository the repository to access the LAO lists
* @param data the data received
* @param channel the channel of the message received
*/
private void notifyLaoUpdate(LAORepository laoRepository, Data data, Channel channel) {
if (!(data instanceof WitnessMessageSignature) && channel.isLaoChannel()) {
LAOState laoState = laoRepository.getLaoById().get(channel.extractLaoId());
// Trigger an onNext
laoState.publish();
if (data instanceof StateLao || data instanceof CreateLao) {
laoRepository.setAllLaoSubject();
}
}
}
Aggregations