private void sendMailToOperators(long currentNum, long maxNum) throws MailOperationException {
   List<PlatformUser> recipients = userLicenseDao.getPlatformOperators();
   SendMailStatus<PlatformUser> mailStatus =
       cs.sendMail(
           EmailType.USER_NUM_EXCEEDED,
           new Object[] {Long.valueOf(maxNum), Long.valueOf(currentNum)},
           null,
           recipients.toArray(new PlatformUser[recipients.size()]));
   if (mailStatus != null) {
     for (SendMailStatusItem<PlatformUser> sendMailStatusItem : mailStatus.getMailStatus()) {
       if (sendMailStatusItem.errorOccurred()) {
         MailOperationException mpe = new MailOperationException();
         logger.logWarn(
             Log4jLogger.SYSTEM_LOG,
             sendMailStatusItem.getException(),
             LogMessageIdentifier.WARN_MAIL_USER_NUM_EXCEEDED_FAILED);
         throw mpe;
       }
     }
   }
 }
 @RolesAllowed("PLATFORM_OPERATOR")
 public long countRegisteredUsers() {
   return userLicenseDao.countRegisteredUsers();
 }