Class DatagramRequestImpl
java.lang.Object
com.tenio.core.network.entity.protocol.implement.DatagramRequestImpl
- All Implemented Interfaces:
Request
Request implementation for Datagram channels.
- Since:
- 0.5.0
-
Field Summary
Fields inherited from interface com.tenio.core.network.entity.protocol.Request
ID_COUNTER
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
Retrieves the creation timestamp in milliseconds.getEvent()
Retrieves the server event associating to the request.long
getId()
Retrieves the unique ID of request.com.tenio.common.data.DataCollection
Retrieves the request message.Retrieves the priority of request.Retrieves the remote address associating to the client side whenever the server receives message from him.Retrieves the sender of request.int
hashCode()
It is generally necessary to override the hashCode method whenever equals method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.static Request
Creates a new request instance.setEvent
(ServerEvent event) Sets a server event associating to the request.setMessage
(com.tenio.common.data.DataCollection message) Sets the request message.setPriority
(RequestPriority priority) Sets priority for the request.setRemoteSocketAddress
(SocketAddress remoteSocketAddress) Sets the remote address associating to the client side whenever the server receives message from him.Sets the sender of request.toString()
-
Method Details
-
newInstance
Creates a new request instance.- Returns:
- a new instance of
Request
-
getId
public long getId()Description copied from interface:Request
Retrieves the unique ID of request. -
getSender
Description copied from interface:Request
Retrieves the sender of request. -
setSender
Description copied from interface:Request
Sets the sender of request. -
getRemoteSocketAddress
Description copied from interface:Request
Retrieves the remote address associating to the client side whenever the server receives message from him.- Specified by:
getRemoteSocketAddress
in interfaceRequest
- Returns:
- the remote address associating to the client side
-
setRemoteSocketAddress
Description copied from interface:Request
Sets the remote address associating to the client side whenever the server receives message from him.- Specified by:
setRemoteSocketAddress
in interfaceRequest
- Parameters:
remoteSocketAddress
- remote address associating to the client side- Returns:
- the request instance
-
getMessage
public com.tenio.common.data.DataCollection getMessage()Description copied from interface:Request
Retrieves the request message.- Specified by:
getMessage
in interfaceRequest
- Returns:
- an instance of
DataCollection
-
setMessage
Description copied from interface:Request
Sets the request message.- Specified by:
setMessage
in interfaceRequest
- Parameters:
message
- an instance ofDataCollection
- Returns:
- the
Request
itself
-
getPriority
Description copied from interface:Request
Retrieves the priority of request.- Specified by:
getPriority
in interfaceRequest
- Returns:
RequestPriority
priority of request- See Also:
-
setPriority
Description copied from interface:Request
Sets priority for the request.- Specified by:
setPriority
in interfaceRequest
- Parameters:
priority
-RequestPriority
priority of request- Returns:
- the pointer of request
- See Also:
-
getCreatedTimestamp
public long getCreatedTimestamp()Description copied from interface:Request
Retrieves the creation timestamp in milliseconds.- Specified by:
getCreatedTimestamp
in interfaceRequest
- Returns:
- the creation timestamp in milliseconds (
long
value)
-
getEvent
Description copied from interface:Request
Retrieves the server event associating to the request.- Specified by:
getEvent
in interfaceRequest
- Returns:
- a
ServerEvent
associating to the request
-
setEvent
Description copied from interface:Request
Sets a server event associating to the request.- Specified by:
setEvent
in interfaceRequest
- Parameters:
event
- aServerEvent
associating to the request- Returns:
- the pointer of request
-
equals
-
hashCode
public int hashCode()It is generally necessary to override the hashCode method whenever equals method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes. -
toString
-