Search in sources :

Example 6 with PwmNumberFormat

use of password.pwm.util.java.PwmNumberFormat in project pwm by pwm-project.

the class AppDashboardData method makeLocalDbTableSizes.

private static Map<LocalDB.DB, String> makeLocalDbTableSizes(final PwmApplication pwmApplication, final Locale locale) {
    final Map<LocalDB.DB, String> returnData = new LinkedHashMap<>();
    final LocalDB localDB = pwmApplication.getLocalDB();
    final PwmNumberFormat numberFormat = PwmNumberFormat.forLocale(locale);
    try {
        for (final LocalDB.DB db : LocalDB.DB.values()) {
            returnData.put(db, numberFormat.format(localDB.size(db)));
        }
    } catch (LocalDBException e) {
        LOGGER.error("error making localDB size bean: " + e.getMessage());
    }
    return Collections.unmodifiableMap(returnData);
}
Also used : PwmNumberFormat(password.pwm.util.java.PwmNumberFormat) LocalDBException(password.pwm.util.localdb.LocalDBException) LocalDB(password.pwm.util.localdb.LocalDB) LocalDB(password.pwm.util.localdb.LocalDB) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

PwmNumberFormat (password.pwm.util.java.PwmNumberFormat)6 ArrayList (java.util.ArrayList)4 LinkedHashMap (java.util.LinkedHashMap)3 DisplayElement (password.pwm.http.bean.DisplayElement)3 Instant (java.time.Instant)2 TimeDuration (password.pwm.util.java.TimeDuration)2 BigDecimal (java.math.BigDecimal)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 PwmAboutProperty (password.pwm.PwmAboutProperty)1 HealthRecord (password.pwm.health.HealthRecord)1 ReportStatusInfo (password.pwm.svc.report.ReportStatusInfo)1 SessionTrackService (password.pwm.svc.sessiontrack.SessionTrackService)1 LocaleHelper (password.pwm.util.LocaleHelper)1 LocalDB (password.pwm.util.localdb.LocalDB)1 LocalDBException (password.pwm.util.localdb.LocalDBException)1