Class UserCounter

  • All Implemented Interfaces:
    com.logicaldoc.core.security.UserListener

    public class UserCounter
    extends Object
    implements com.logicaldoc.core.security.UserListener
    Counter class optimized for database user counting. No internal static counter is maintained and a direct database query is always performed.
    Since:
    5.2
    Author:
    Marco Meschieri - LogicalDOC
    • Constructor Detail

      • UserCounter

        public UserCounter()
    • Method Detail

      • afterStore

        public void afterStore​(com.logicaldoc.core.security.User user,
                               com.logicaldoc.core.security.UserHistory transaction,
                               Map<String,​Object> dictionary)
                        throws Exception
        Specified by:
        afterStore in interface com.logicaldoc.core.security.UserListener
        Throws:
        Exception
      • beforeStore

        public void beforeStore​(com.logicaldoc.core.security.User user,
                                com.logicaldoc.core.security.UserHistory transaction,
                                Map<String,​Object> dictionary)
                         throws Exception
        Specified by:
        beforeStore in interface com.logicaldoc.core.security.UserListener
        Throws:
        Exception
      • validateUserCount

        public static void validateUserCount​(com.logicaldoc.core.security.Tenant tenant,
                                             boolean addingNewUser)
                                      throws MaxUsersException,
                                             com.logicaldoc.core.PersistenceException
        Throws:
        MaxUsersException
        com.logicaldoc.core.PersistenceException
      • validateGuestCount

        public static void validateGuestCount​(com.logicaldoc.core.security.Tenant tenant,
                                              boolean addingNewUser)
                                       throws MaxGuestsException,
                                              com.logicaldoc.core.PersistenceException
        Throws:
        MaxGuestsException
        com.logicaldoc.core.PersistenceException
      • validateUserCount

        public static void validateUserCount​(long tenantId,
                                             boolean addingNewUser)
                                      throws MaxUsersException,
                                             com.logicaldoc.core.PersistenceException
        Throws:
        MaxUsersException
        com.logicaldoc.core.PersistenceException
      • validateGuestCount

        public static void validateGuestCount​(long tenantId,
                                              boolean addingNewUser)
                                       throws MaxGuestsException,
                                              com.logicaldoc.core.PersistenceException
        Throws:
        MaxGuestsException
        com.logicaldoc.core.PersistenceException