package com.bonus.mq.mqtt;

public class MqttAuth {

   public static class Authorizing {
      public static final Response ALLOW = new Response("allow");
      public static final Response DENY = new Response("deny");

      public static class Response {
         private String result;

         public String getResult() {
            return this.result;
         }

         public Response(final String result) {
            this.result = result;
         }

      }

      public static class Request {
         private String username;
         private String clientId;
         private String topic;
         private String action;

         public String getUsername() {
            return this.username;
         }

         public String getClientId() {
            return this.clientId;
         }

         public String getTopic() {
            return this.topic;
         }

         public String getAction() {
            return this.action;
         }

         public void setUsername(final String username) {
            this.username = username;
         }

         public void setClientId(final String clientId) {
            this.clientId = clientId;
         }

         public void setTopic(final String topic) {
            this.topic = topic;
         }

         public void setAction(final String action) {
            this.action = action;
         }

      }
   }

   public static class Authenticating {
      public static final Response ALLOW = new Response("allow", false);
      public static final Response ALLOW_SUPER = new Response("allow", true);
      public static final Response DENY = new Response("deny", false);

      public static class Response {
         private String result;
         private boolean is_superuser;

         public String getResult() {
            return this.result;
         }

         public boolean is_superuser() {
            return this.is_superuser;
         }

         public Response(final String result, final boolean is_superuser) {
            this.result = result;
            this.is_superuser = is_superuser;
         }

      }

      public static class Request {
         private String username;
         private String password;
         private String clientId;

         public String getUsername() {
            return this.username;
         }

         public String getPassword() {
            return this.password;
         }

         public String getClientId() {
            return this.clientId;
         }

         public void setUsername(final String username) {
            this.username = username;
         }

         public void setPassword(final String password) {
            this.password = password;
         }

         public void setClientId(final String clientId) {
            this.clientId = clientId;
         }

      }
   }
}
