Class PermissionManager

java.lang.Object
de.neo.rankbridge.shared.manager.PermissionManager

public class PermissionManager
extends java.lang.Object
The Manager for Discord and Teamspeak permissions.
Version:
1.0
Author:
Neo8
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.HashMap<java.lang.String,​java.lang.Long> discord_groups  
    private java.util.HashMap<java.lang.Long,​java.lang.String> group_discord  
    private java.util.HashMap<java.lang.Integer,​java.lang.String> group_teamspeak  
    private static PermissionManager INSTANCE  
    private MinecraftManager mgr  
    private java.util.HashMap<java.lang.String,​java.lang.Integer> teamspeak_group  
  • Constructor Summary

    Constructors 
    Constructor Description
    PermissionManager​(MinecraftManager mgr)
    New Instance.
  • Method Summary

    Modifier and Type Method Description
    java.lang.Boolean checkMinecraft​(int[] groups, java.lang.String uuid)
    Formats raw values and invokes checkMinecraft(String, String)
    java.lang.Boolean checkMinecraft​(java.lang.String s1, java.lang.String uuid)
    Updates the Minecraft permission.
    java.lang.Boolean checkTeamspeak​(int[] groups, java.lang.String uuid)
    Formats raw values and invokes checkTeamspeak(String, String)
    java.lang.Boolean checkTeamspeak​(java.lang.String s1, java.lang.String uuid)
    Updates the Teamspeak groups.
    java.lang.String getDiscordGroup​(java.lang.Long l)
    Returns a permission by role.
    java.lang.Long getDiscordGroup​(java.lang.String s)
    Returns a role by permission.
    static PermissionManager getInstance()
    Returns the Instance.
    java.lang.String getTeamspeakGroup​(java.lang.Integer l)
    Returns a permission by group.
    java.lang.Integer getTeamspeakGroup​(java.lang.String s)
    Returns a group by permission.
    java.lang.Boolean isDiscordRole​(java.lang.Long l)
    Is the role synchronized?
    java.lang.Boolean isTeamspeakGroup​(java.lang.Integer l)
    Is the group synchronized?

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • getDiscordGroup

      public java.lang.String getDiscordGroup​(java.lang.Long l)
      Returns a permission by role.
      Parameters:
      l - the role.
      Returns:
      the permission.
    • getDiscordGroup

      public java.lang.Long getDiscordGroup​(java.lang.String s)
      Returns a role by permission.
      Parameters:
      s - the permission.
      Returns:
      the role.
    • getTeamspeakGroup

      public java.lang.String getTeamspeakGroup​(java.lang.Integer l)
      Returns a permission by group.
      Parameters:
      l - the group.
      Returns:
      the permission.
    • getTeamspeakGroup

      public java.lang.Integer getTeamspeakGroup​(java.lang.String s)
      Returns a group by permission.
      Parameters:
      s - the permission.
      Returns:
      the group.
    • isDiscordRole

      public java.lang.Boolean isDiscordRole​(java.lang.Long l)
      Is the role synchronized?
      Parameters:
      l - the role
      Returns:
      Boolean whether the role is synchronized or not.
    • isTeamspeakGroup

      public java.lang.Boolean isTeamspeakGroup​(java.lang.Integer l)
      Is the group synchronized?
      Parameters:
      l - the group
      Returns:
      Boolean whether the group is synchronized or not.
    • checkTeamspeak

      public java.lang.Boolean checkTeamspeak​(int[] groups, java.lang.String uuid)
      Formats raw values and invokes checkTeamspeak(String, String)
      Parameters:
      groups - array of integers with groups.
      uuid - the uuid of the player. only used to give this to checkTeamspeak(String, String)
      Returns:
      return value of checkTeamspeak(String, String)
    • checkTeamspeak

      public java.lang.Boolean checkTeamspeak​(java.lang.String s1, java.lang.String uuid)
      Updates the Teamspeak groups.
      Parameters:
      s1 - the Groups as String.
      uuid - the Minecraft uuid.
      Returns:
      Boolean whether the verification is up to date or not.
    • checkMinecraft

      public java.lang.Boolean checkMinecraft​(int[] groups, java.lang.String uuid)
      Formats raw values and invokes checkMinecraft(String, String)
      Parameters:
      groups - array of integers with groups.
      uuid - the uuid of the player. only used to give this to checkMinecraft(String, String)
      Returns:
      return value of checkMinecraft(String, String)
    • checkMinecraft

      public java.lang.Boolean checkMinecraft​(java.lang.String s1, java.lang.String uuid)
      Updates the Minecraft permission.
      Parameters:
      s1 - the Groups as String.
      uuid - the Minecraft uuid.
      Returns:
      Boolean whether the verification is up to date or not.
    • getInstance

      public static PermissionManager getInstance()
      Returns the Instance.
      Returns:
      the instance.