Class OutgoingSocketMessageEvent
java.lang.Object
de.craftsblock.craftscore.event.Event
de.craftsblock.craftscore.event.CancellableEvent
de.craftsblock.craftsnet.events.sockets.message.OutgoingSocketMessageEvent
- All Implemented Interfaces:
de.craftsblock.craftscore.event.Cancellable,GenericSocketEventBase,GenericSocketMessageEventBase
public class OutgoingSocketMessageEvent
extends de.craftsblock.craftscore.event.CancellableEvent
implements GenericSocketMessageEventBase
The OutgoingSocketMessageEvent class represents an event related to an outgoing message on a websocket connection.
It extends the base
CancellableEvent to support event cancellation.- Since:
- 2.1.1-SNAPSHOT
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOutgoingSocketMessageEvent(@NotNull SocketExchange exchange, @NotNull Frame frame) Constructs a new OutgoingSocketMessageEvent with the specified SocketExchange and message data. -
Method Summary
Modifier and TypeMethodDescription@NotNull SocketExchangeGets theSocketExchangewhich stores the involved client, server and some other data.@NotNull FramegetFrame()Gets the incoming message as aFrameobject.voidsetData(byte @NotNull [] data) Sets the outgoing message data for the event.voidSets the outgoing message frame.voidSets the opcode used to send the data.Methods inherited from class de.craftsblock.craftscore.event.CancellableEvent
isCancelled, setCancelledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.craftsblock.craftsnet.events.sockets.GenericSocketEventBase
getClient, getServerMethods inherited from interface de.craftsblock.craftsnet.events.sockets.message.GenericSocketMessageEventBase
getBuffer, getData, getOpcode, getUtf8
-
Constructor Details
-
OutgoingSocketMessageEvent
public OutgoingSocketMessageEvent(@NotNull @NotNull SocketExchange exchange, @NotNull @NotNull Frame frame) Constructs a new OutgoingSocketMessageEvent with the specified SocketExchange and message data.- Parameters:
exchange- The SocketExchange object representing the socket connection and its associated data.frame- TheFramethat contains the message information.
-
-
Method Details
-
getExchange
Gets theSocketExchangewhich stores the involved client, server and some other data.- Specified by:
getExchangein interfaceGenericSocketEventBase- Returns:
- The
SocketExchange.
-
getFrame
Gets the incoming message as aFrameobject.- Specified by:
getFramein interfaceGenericSocketMessageEventBase- Returns:
- The incoming message.
-
setOpcode
Sets the opcode used to send the data.- Parameters:
opcode- The opcode which should be used.
-
setData
public void setData(byte @NotNull [] data) Sets the outgoing message data for the event.- Parameters:
data- The outgoing message data to be set.
-
setFrame
Sets the outgoing message frame.- Parameters:
frame- The outgoing message frame.
-