Class CmsFunctionAvailability


  • public class CmsFunctionAvailability
    extends java.lang.Object
    Helper class for computing dynamic function availability based on sitemap configuration settings.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(CmsUUID functionId)
      Adds a dynamic function id and enables whitelisting.
      void addAll​(java.util.Collection<CmsUUID> enabledIds)
      Adds all ids from the given collection.
      boolean checkAvailable​(CmsUUID id)
      Check if the function with the given id is available with this configuration.
      java.util.Collection<CmsUUID> getBlacklist()
      Gets the blacklist of explicitly removed functions that are not already covered by not being in a whitelist.
      java.util.Collection<CmsUUID> getWhitelist()
      Gets the whitelist of explicitly enabled functions.
      boolean isDefined()
      Checks if this object has any restrictions on functions.
      void remove​(CmsUUID functionId)
      Removes a single function.
      void removeAll()
      Removes all functions and enables the whitelist.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • add

        public void add​(CmsUUID functionId)
        Adds a dynamic function id and enables whitelisting.
        Parameters:
        functionId - the function id to add
      • addAll

        public void addAll​(java.util.Collection<CmsUUID> enabledIds)
        Adds all ids from the given collection.
        Parameters:
        enabledIds - the ids to add
      • checkAvailable

        public boolean checkAvailable​(CmsUUID id)
        Check if the function with the given id is available with this configuration.
        Parameters:
        id - the id to check
        Returns:
        true if the function is available
      • getBlacklist

        public java.util.Collection<CmsUUIDgetBlacklist()
        Gets the blacklist of explicitly removed functions that are not already covered by not being in a whitelist.
        Returns:
        the list of explicitly removed functions
      • getWhitelist

        public java.util.Collection<CmsUUIDgetWhitelist()
        Gets the whitelist of explicitly enabled functions.

        If no functions have been explicitly added, and no "remove all" option has been used, this will return null.

        Returns:
        the whitelist of functions
      • isDefined

        public boolean isDefined()
        Checks if this object has any restrictions on functions.
        Returns:
        true if this has any restrictions on functions
      • remove

        public void remove​(CmsUUID functionId)
        Removes a single function.
        Parameters:
        functionId - the id of the function
      • removeAll

        public void removeAll()
        Removes all functions and enables the whitelist.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()