Class AuthHandler

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

public class AuthHandler extends Object
Class listener of messages carrying information about the authorization request. Defines the method for user authorization on the server.
  • Field Details

  • Constructor Details

    • AuthHandler

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

    • authHandle

      public void authHandle(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Performs user authorization on the server. Requests the user authorization service with the login and password received in the message, if the user is, then sends a service message a message AuthMessage with the name of the authorized user and a list of files in the cloud for this user. Additionally sends the following message FilesSizeRequest carrying information about the storage status for this user.If registration is refused, it returns the same service message with Login "none", which indicates to the client that authorization has not been completed.
      Parameters:
      ctx - channel context.
      msg - the message object.
      See Also: