Class RegUserHandler

java.lang.Object
com.cloud.serverpak.handlers.RegUserHandler

public class RegUserHandler extends Object
Message Listener class RegUserRequest.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final AuthService
    Authorization service.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The constructor saves a reference to the main listener.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    regHandle(io.netty.channel.ChannelHandlerContext ctx, Object msg)
    Processes a service message - a request to register a new user, checks if there is a user with the same nickname in the database, if there is, then sends refusal to register, and in the absence registers it and sends a response to the client, that the registration was successful.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • authService

      private final AuthService authService
      Authorization service.
  • Constructor Details

    • RegUserHandler

      public RegUserHandler(MainHandler mainHandler)
      The constructor saves a reference to the main listener.
      Parameters:
      mainHandler - Netty's main listener.
  • Method Details

    • regHandle

      public void regHandle(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Processes a service message - a request to register a new user, checks if there is a user with the same nickname in the database, if there is, then sends refusal to register, and in the absence registers it and sends a response to the client, that the registration was successful.
      Parameters:
      ctx - channel context.
      msg - the message object.