diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-06 08:02:52 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-06 08:02:52 +0300 |
| commit | 1d99762c7965d351510cfb5e08eac25e48d96038 (patch) | |
| tree | f469493e911878ab9055ccf0494211bf9015922d /src/main/java/protocols/implementations/VSBasicMulticastProtocol.java | |
| parent | 4d35597bd92607c4d194686e20b125044506c79a (diff) | |
Modernize project structure, update Maven config, move sources, add logging config, update README and .gitignore
Diffstat (limited to 'src/main/java/protocols/implementations/VSBasicMulticastProtocol.java')
| -rw-r--r-- | src/main/java/protocols/implementations/VSBasicMulticastProtocol.java | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/main/java/protocols/implementations/VSBasicMulticastProtocol.java b/src/main/java/protocols/implementations/VSBasicMulticastProtocol.java new file mode 100644 index 0000000..cfd5399 --- /dev/null +++ b/src/main/java/protocols/implementations/VSBasicMulticastProtocol.java @@ -0,0 +1,86 @@ +package protocols.implementations; + +import core.VSMessage; +import protocols.VSAbstractProtocol; + +/** + * The class VSBasicMulticastProtocol, an implementation of the basic multicast + * protocol. + * + * @author Paul C. Buetow + */ +public class VSBasicMulticastProtocol extends VSAbstractProtocol { + /** + * Instantiates a new VSBasicMulticast object. + */ + public VSBasicMulticastProtocol() { + super(VSAbstractProtocol.HAS_ON_CLIENT_START); + setClassname(getClass().toString()); + } + + /* (non-Javadoc) + * @see events.VSAbstractProtocol#onClientInit() + */ + public void onClientInit() { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onClientReset() + */ + public void onClientReset() { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onClientStart() + */ + public void onClientStart() { + VSMessage message = new VSMessage(); + message.setBoolean("isMulticast", true); + sendMessage(message); + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onClientRecv(core.VSMessage) + */ + public void onClientRecv(VSMessage recvMessage) { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onClientSchedule() + */ + public void onClientSchedule() { + } + + /* (non-Javadoc) + * @see events.VSAbstractProtocol#onServerInit() + */ + public void onServerInit() { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onServerReset() + */ + public void onServerReset() { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onServerRecv(core.VSMessage) + */ + public void onServerRecv(VSMessage recvMessage) { + if (recvMessage.getBoolean("isMulticast")) + log("Multicast received"); + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#onServerSchedule() + */ + public void onServerSchedule() { + } + + /* (non-Javadoc) + * @see protocols.VSAbstractProtocol#toString() + */ + public String toString() { + return super.toString(); + } +} |
