Interface GroupConfigurationProvider


  • public interface GroupConfigurationProvider
    This class provides access to the groups of the cloud (groups.json file).
    • Method Detail

      • reload

        void reload()
        Reloads the groups.json file
      • getGroupConfigurations

        java.util.Collection<GroupConfiguration> getGroupConfigurations()
        Gets all groups that are registered in the cloud
        Returns:
        a list containing the group configurations of all groups
      • setGroupConfigurations

        void setGroupConfigurations​(@NotNull
                                    @NotNull java.util.Collection<GroupConfiguration> groupConfigurations)
        Clears all existing groups and sets the given collection as the new groups
        Parameters:
        groupConfigurations - the new groups
      • getGroupConfiguration

        @Nullable
        @Nullable GroupConfiguration getGroupConfiguration​(@NotNull
                                                           @NotNull java.lang.String name)
        Gets a specific group by its name
        Parameters:
        name - the name of the group
        Returns:
        the group or null if no group with that name exists
      • isGroupConfigurationPresent

        boolean isGroupConfigurationPresent​(@NotNull
                                            @NotNull java.lang.String name)
        Checks whether the group with a specific name exists
        Parameters:
        name - the name of the group
        Returns:
        true if the group exists or false otherwise
      • addGroupConfiguration

        void addGroupConfiguration​(@NotNull
                                   @NotNull GroupConfiguration groupConfiguration)
        Adds a new group to the cloud
        Parameters:
        groupConfiguration - the group to be added
      • removeGroupConfiguration

        void removeGroupConfiguration​(@NotNull
                                      @NotNull java.lang.String name)
        Removes a group from the cloud
        Parameters:
        name - the name of the group to be removed
      • removeGroupConfiguration

        void removeGroupConfiguration​(@NotNull
                                      @NotNull GroupConfiguration groupConfiguration)
        Removes a group from the cloud
        Parameters:
        groupConfiguration - the group to be removed (the only thing that matters in this object is the name, the rest is ignored)
      • reloadAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> reloadAsync()
        Reloads the groups.json file
      • getGroupConfigurationsAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.util.Collection<GroupConfiguration>> getGroupConfigurationsAsync()
        Gets all groups that are registered in the cloud
        Returns:
        a list containing the group configurations of all groups
      • setGroupConfigurationsAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> setGroupConfigurationsAsync​(@NotNull
                                                                                                         @NotNull java.util.Collection<GroupConfiguration> groupConfigurations)
        Clears all existing groups and sets the given collection as the new groups
        Parameters:
        groupConfigurations - the new groups
      • getGroupConfigurationAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<GroupConfiguration> getGroupConfigurationAsync​(@NotNull
                                                                                                            @NotNull java.lang.String name)
        Gets a specific group by its name
        Parameters:
        name - the name of the group
        Returns:
        the group or null if no group with that name exists
      • isGroupConfigurationPresentAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Boolean> isGroupConfigurationPresentAsync​(@NotNull
                                                                                                                 @NotNull java.lang.String name)
        Checks whether the group with a specific name exists
        Parameters:
        name - the name of the group
        Returns:
        true if the group exists or false otherwise
      • addGroupConfigurationAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> addGroupConfigurationAsync​(@NotNull
                                                                                                        @NotNull GroupConfiguration groupConfiguration)
        Adds a new group to the cloud
        Parameters:
        groupConfiguration - the group to be added
      • removeGroupConfigurationAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> removeGroupConfigurationAsync​(@NotNull
                                                                                                           @NotNull java.lang.String name)
        Removes a group from the cloud
        Parameters:
        name - the name of the group to be removed
      • removeGroupConfigurationAsync

        @NotNull
        @NotNull de.dytanic.cloudnet.common.concurrent.ITask<java.lang.Void> removeGroupConfigurationAsync​(@NotNull
                                                                                                           @NotNull GroupConfiguration groupConfiguration)
        Removes a group from the cloud
        Parameters:
        groupConfiguration - the group to be removed (the only thing that matters in this object is the name, the rest is ignored)