Class UserPopulationDAO

    • Method Detail

      • getUserPopulationsAsJson

        public List<ObjectgetUserPopulationsAsJson​(boolean withAdmin)
        Gets all the populations to JSON format
        Parameters:
        withAdmin - True to include the "admin" population
        Returns:
        A list of object representing the UserPopulations
      • getUserPopulations

        public List<UserPopulationgetUserPopulations​(boolean includeAdminPopulation)
        Gets all the populations of this application
        Parameters:
        includeAdminPopulation - True to include the "admin" population
        Returns:
        A list of UserPopulation
      • getUserPopulationsIds

        public List<StringgetUserPopulationsIds()
        Gets the list of the ids of all the population of the application
        Returns:
        The list of the ids of all the populations
      • getIgnoredPopulations

        public Set<StringgetIgnoredPopulations()
        Returns the id of population which have a fatal invalid configuration. These populations can NOT be used by application.
        Returns:
        The ignored populations
      • getMisconfiguredPopulations

        public Set<StringgetMisconfiguredPopulations()
        Returns the id of population which have at least one user directory or one credential provider misconfigured These populations can be used by application.
        Returns:
        The misconfigured populations.
      • getConfigurationFile

        public File getConfigurationFile()
        Return the configuration file.
        Returns:
        the configuration file.
      • getEditionConfiguration

        public Map<String,​ObjectgetEditionConfiguration()
                                                         throws Exception
        Gets the configuration for creating/editing a user population.
        Returns:
        A map containing information about what is needed to create/edit a user population
        Throws:
        Exception - If an error occurs.
      • add

        public Map<String,​Objectadd​(String id,
                                            String label,
                                            List<Map<String,​String>> userDirectories,
                                            List<Map<String,​String>> credentialProviders)
        Adds a new population
        Parameters:
        id - The unique id of the population
        label - The label of the population
        userDirectories - A list of user directory parameters
        credentialProviders - A list of credential provider parameters
        Returns:
        A map containing the id of the created population, or the kind of error that occured
      • edit

        public Map<String,​Objectedit​(String id,
                                             String label,
                                             List<Map<String,​String>> userDirectories,
                                             List<Map<String,​String>> credentialProviders)
        Edits the given population.
        Parameters:
        id - The id of the population to edit
        label - The label of the population
        userDirectories - A list of user directory parameters
        credentialProviders - A list of credential provider parameters
        Returns:
        A map containing the id of the edited population, or the kind of error that occured
      • remove

        public Map<String,​Objectremove​(String id)
        Removes the given population.
        Parameters:
        id - The id of the population to remove
        Returns:
        A map containing the id of the removed population
      • remove

        public Map<String,​Objectremove​(String id,
                                               boolean forceDeletion)
        Removes the given population.
        Parameters:
        id - The id of the population to remove
        forceDeletion - Delete the population even if it is still in use
        Returns:
        A map containing the id of the removed population
      • enable

        public Map<String,​Objectenable​(String populationId,
                                               boolean enabled)
        Enables/Disables the given population
        Parameters:
        populationId - The id of the population to enable/disable
        enabled - True to enable the population, false to disable it.
        Returns:
        A map containing the id of the enabled/disabled population, or with an error.
      • isValid

        public boolean isValid​(String populationId)
        Determines if a population has a valid configuration
        Parameters:
        populationId - The id of the population to retrieve state
        Returns:
        A map, with the response as a boolean, or an error.
      • isEnabled

        public Map<String,​ObjectisEnabled​(String populationId)
        Returns the enabled state of the given population
        Parameters:
        populationId - The id of the population to retrieve state
        Returns:
        A map, with the response as a booolean, or an error.
      • canRemove

        public Map<String,​ObjectcanRemove​(String populationId)
        Determines if a population can be removed
        Parameters:
        populationId - The id of the population
        Returns:
        A map, with the response as a boolean, or an error.