Class DatagramRequestImpl

java.lang.Object
com.tenio.core.network.entity.protocol.implement.DatagramRequestImpl
All Implemented Interfaces:
Request

public class DatagramRequestImpl extends Object implements Request
Request implementation for Datagram channels.
Since:
0.5.0
  • Method Details

    • newInstance

      public static Request 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.
      Specified by:
      getId in interface Request
      Returns:
      the unique long ID of request
    • getSender

      public DatagramChannel getSender()
      Description copied from interface: Request
      Retrieves the sender of request.
      Specified by:
      getSender in interface Request
      Returns:
      a Object that plays as a sender of the request
    • setSender

      public Request setSender(Object sender)
      Description copied from interface: Request
      Sets the sender of request.
      Specified by:
      setSender in interface Request
      Parameters:
      sender - a Object that plays as a sender of the request
      Returns:
      the pointer of request
    • getRemoteSocketAddress

      public SocketAddress 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 interface Request
      Returns:
      the remote address associating to the client side
    • setRemoteSocketAddress

      public Request setRemoteSocketAddress(SocketAddress remoteSocketAddress)
      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 interface Request
      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 interface Request
      Returns:
      an instance of DataCollection
    • setMessage

      public Request setMessage(com.tenio.common.data.DataCollection message)
      Description copied from interface: Request
      Sets the request message.
      Specified by:
      setMessage in interface Request
      Parameters:
      message - an instance of DataCollection
      Returns:
      the Request itself
    • getPriority

      public RequestPriority getPriority()
      Description copied from interface: Request
      Retrieves the priority of request.
      Specified by:
      getPriority in interface Request
      Returns:
      RequestPriority priority of request
      See Also:
    • setPriority

      public Request setPriority(RequestPriority priority)
      Description copied from interface: Request
      Sets priority for the request.
      Specified by:
      setPriority in interface Request
      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 interface Request
      Returns:
      the creation timestamp in milliseconds (long value)
    • getEvent

      public ServerEvent getEvent()
      Description copied from interface: Request
      Retrieves the server event associating to the request.
      Specified by:
      getEvent in interface Request
      Returns:
      a ServerEvent associating to the request
    • setEvent

      public Request setEvent(ServerEvent event)
      Description copied from interface: Request
      Sets a server event associating to the request.
      Specified by:
      setEvent in interface Request
      Parameters:
      event - a ServerEvent associating to the request
      Returns:
      the pointer of request
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • 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.
      Overrides:
      hashCode in class Object
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object