|
@@ -32,51 +32,48 @@ import password.pwm.util.java.Percent;
|
|
|
import password.pwm.util.java.PwmNumberFormat;
|
|
|
import password.pwm.util.java.TimeDuration;
|
|
|
|
|
|
-import java.math.BigInteger;
|
|
|
import java.time.Instant;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
-import java.util.EnumSet;
|
|
|
import java.util.List;
|
|
|
import java.util.Locale;
|
|
|
import java.util.Map;
|
|
|
import java.util.TreeMap;
|
|
|
import java.util.TreeSet;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
-import java.util.concurrent.atomic.AtomicInteger;
|
|
|
+import java.util.concurrent.atomic.LongAdder;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Value
|
|
|
public class ReportSummaryData
|
|
|
{
|
|
|
private static final long MS_DAY = TimeDuration.DAY.asMillis();
|
|
|
- private static final BigInteger TWO = new BigInteger( "2" );
|
|
|
-
|
|
|
- private final AtomicInteger totalUsers = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasResponses = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasResponseSetTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasHelpdeskResponses = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasPasswordExpirationTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasAccountExpirationTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasLoginTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasChangePwTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasOtpSecret = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasOtpSecretSetTime = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger pwExpired = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger pwPreExpired = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger pwWarnPeriod = new AtomicInteger( 0 );
|
|
|
- private final AtomicInteger hasReceivedPwExpireNotification = new AtomicInteger( 0 );
|
|
|
-
|
|
|
- private final Map<DataStorageMethod, AtomicInteger> responseStorage = new ConcurrentHashMap<>();
|
|
|
- private final Map<Answer.FormatType, AtomicInteger> responseFormatType = new ConcurrentHashMap<>();
|
|
|
- private final Map<String, AtomicInteger> ldapProfile = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> pwExpireDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> accountExpireDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> changePwDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> responseSetDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> otpSetDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> loginDays = new ConcurrentHashMap<>();
|
|
|
- private final Map<Integer, AtomicInteger> pwExpireNotificationDays = new ConcurrentHashMap<>();
|
|
|
+
|
|
|
+ private final LongAdder totalUsers = new LongAdder();
|
|
|
+ private final LongAdder hasResponses = new LongAdder();
|
|
|
+ private final LongAdder hasResponseSetTime = new LongAdder();
|
|
|
+ private final LongAdder hasHelpdeskResponses = new LongAdder();
|
|
|
+ private final LongAdder hasPasswordExpirationTime = new LongAdder();
|
|
|
+ private final LongAdder hasAccountExpirationTime = new LongAdder();
|
|
|
+ private final LongAdder hasLoginTime = new LongAdder();
|
|
|
+ private final LongAdder hasChangePwTime = new LongAdder();
|
|
|
+ private final LongAdder hasOtpSecret = new LongAdder();
|
|
|
+ private final LongAdder hasOtpSecretSetTime = new LongAdder();
|
|
|
+ private final LongAdder pwExpired = new LongAdder();
|
|
|
+ private final LongAdder pwPreExpired = new LongAdder();
|
|
|
+ private final LongAdder pwWarnPeriod = new LongAdder();
|
|
|
+ private final LongAdder hasReceivedPwExpireNotification = new LongAdder();
|
|
|
+
|
|
|
+ private final Map<DataStorageMethod, LongAdder> responseStorage = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Answer.FormatType, LongAdder> responseFormatType = new ConcurrentHashMap<>();
|
|
|
+ private final Map<String, LongAdder> ldapProfile = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> pwExpireDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> accountExpireDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> changePwDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> responseSetDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> otpSetDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> loginDays = new ConcurrentHashMap<>();
|
|
|
+ private final Map<Integer, LongAdder> pwExpireNotificationDays = new ConcurrentHashMap<>();
|
|
|
|
|
|
private ReportSummaryData( )
|
|
|
{
|
|
@@ -90,82 +87,82 @@ public class ReportSummaryData
|
|
|
{
|
|
|
for ( final int day : trackedDays )
|
|
|
{
|
|
|
- reportSummaryData.pwExpireDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.accountExpireDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.changePwDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.responseSetDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.otpSetDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.loginDays.put( day, new AtomicInteger( 0 ) );
|
|
|
- reportSummaryData.pwExpireNotificationDays.put( day, new AtomicInteger( 0 ) );
|
|
|
+ reportSummaryData.pwExpireDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.accountExpireDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.changePwDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.responseSetDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.otpSetDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.loginDays.put( day, new LongAdder() );
|
|
|
+ reportSummaryData.pwExpireNotificationDays.put( day, new LongAdder() );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return reportSummaryData;
|
|
|
}
|
|
|
|
|
|
- public Map<DataStorageMethod, Integer> getResponseStorage( )
|
|
|
+ public Map<DataStorageMethod, Long> getResponseStorage( )
|
|
|
{
|
|
|
return Collections.unmodifiableMap( responseStorage.entrySet()
|
|
|
.stream()
|
|
|
.collect( Collectors.toMap( Map.Entry::getKey,
|
|
|
- e -> e.getValue().get() ) ) );
|
|
|
+ e -> e.getValue().sum() ) ) );
|
|
|
}
|
|
|
|
|
|
- public Map<Answer.FormatType, Integer> getResponseFormatType( )
|
|
|
+ public Map<Answer.FormatType, Long> getResponseFormatType( )
|
|
|
{
|
|
|
return Collections.unmodifiableMap( responseFormatType.entrySet()
|
|
|
.stream()
|
|
|
.collect( Collectors.toMap( Map.Entry::getKey,
|
|
|
- e -> e.getValue().get() ) ) );
|
|
|
+ e -> e.getValue().sum() ) ) );
|
|
|
}
|
|
|
|
|
|
void update( final UserCacheRecord userCacheRecord )
|
|
|
{
|
|
|
- totalUsers.incrementAndGet();
|
|
|
+ totalUsers.increment();
|
|
|
|
|
|
if ( userCacheRecord.isHasResponses() )
|
|
|
{
|
|
|
- hasResponses.incrementAndGet();
|
|
|
+ hasResponses.increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.isHasHelpdeskResponses() )
|
|
|
{
|
|
|
- hasHelpdeskResponses.incrementAndGet();
|
|
|
+ hasHelpdeskResponses.increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getResponseSetTime() != null )
|
|
|
{
|
|
|
- hasResponseSetTime.incrementAndGet();
|
|
|
+ hasResponseSetTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, responseSetDays );
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getPasswordExpirationTime() != null )
|
|
|
{
|
|
|
- hasPasswordExpirationTime.incrementAndGet();
|
|
|
+ hasPasswordExpirationTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, pwExpireDays );
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getAccountExpirationTime() != null )
|
|
|
{
|
|
|
- hasAccountExpirationTime.incrementAndGet();
|
|
|
+ hasAccountExpirationTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, accountExpireDays );
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getLastLoginTime() != null )
|
|
|
{
|
|
|
- hasLoginTime.incrementAndGet();
|
|
|
+ hasLoginTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, loginDays );
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getPasswordChangeTime() != null )
|
|
|
{
|
|
|
- hasChangePwTime.incrementAndGet();
|
|
|
+ hasChangePwTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, changePwDays );
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getPasswordExpirationNoticeSendTime() != null )
|
|
|
{
|
|
|
- hasReceivedPwExpireNotification.incrementAndGet();
|
|
|
+ hasReceivedPwExpireNotification.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, pwExpireNotificationDays );
|
|
|
}
|
|
|
|
|
@@ -173,23 +170,23 @@ public class ReportSummaryData
|
|
|
{
|
|
|
if ( userCacheRecord.getPasswordStatus().isExpired() )
|
|
|
{
|
|
|
- pwExpired.incrementAndGet();
|
|
|
+ pwExpired.increment();
|
|
|
}
|
|
|
if ( userCacheRecord.getPasswordStatus().isPreExpired() )
|
|
|
{
|
|
|
- pwPreExpired.incrementAndGet();
|
|
|
+ pwPreExpired.increment();
|
|
|
}
|
|
|
if ( userCacheRecord.getPasswordStatus().isWarnPeriod() )
|
|
|
{
|
|
|
- pwWarnPeriod.incrementAndGet();
|
|
|
+ pwWarnPeriod.increment();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getResponseStorageMethod() != null )
|
|
|
{
|
|
|
final DataStorageMethod method = userCacheRecord.getResponseStorageMethod();
|
|
|
- responseStorage.putIfAbsent( method, new AtomicInteger( 0 ) );
|
|
|
- responseStorage.get( method ).incrementAndGet();
|
|
|
+ responseStorage.computeIfAbsent( method, dataStorageMethod -> new LongAdder() );
|
|
|
+ responseStorage.get( method ).increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getLdapProfile() != null )
|
|
@@ -197,41 +194,41 @@ public class ReportSummaryData
|
|
|
final String userProfile = userCacheRecord.getLdapProfile();
|
|
|
if ( !ldapProfile.containsKey( userProfile ) )
|
|
|
{
|
|
|
- ldapProfile.put( userProfile, new AtomicInteger( 0 ) );
|
|
|
+ ldapProfile.put( userProfile, new LongAdder() );
|
|
|
}
|
|
|
- ldapProfile.get( userProfile ).incrementAndGet();
|
|
|
+ ldapProfile.get( userProfile ).increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getResponseFormatType() != null )
|
|
|
{
|
|
|
final Answer.FormatType type = userCacheRecord.getResponseFormatType();
|
|
|
- responseFormatType.putIfAbsent( type, new AtomicInteger( 0 ) );
|
|
|
- responseFormatType.get( type ).incrementAndGet();
|
|
|
+ responseFormatType.computeIfAbsent( type, formatType -> new LongAdder() );
|
|
|
+ responseFormatType.get( type ).increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.isHasOtpSecret() )
|
|
|
{
|
|
|
- hasOtpSecret.incrementAndGet();
|
|
|
+ hasOtpSecret.increment();
|
|
|
}
|
|
|
|
|
|
if ( userCacheRecord.getOtpSecretSetTime() != null )
|
|
|
{
|
|
|
- hasOtpSecretSetTime.incrementAndGet();
|
|
|
+ hasOtpSecretSetTime.increment();
|
|
|
incrementIfWithinTimeWindow( userCacheRecord, otpSetDays );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void incrementIfWithinTimeWindow(
|
|
|
final UserCacheRecord userCacheRecord,
|
|
|
- final Map<Integer, AtomicInteger> map
|
|
|
+ final Map<Integer, LongAdder> map
|
|
|
)
|
|
|
{
|
|
|
- for ( final Map.Entry<Integer, AtomicInteger> entry : map.entrySet() )
|
|
|
+ for ( final Map.Entry<Integer, LongAdder> entry : map.entrySet() )
|
|
|
{
|
|
|
final int day = entry.getKey();
|
|
|
final Instant eventDate = userCacheRecord.getOtpSecretSetTime();
|
|
|
final long timeWindow = MS_DAY * day;
|
|
|
- final AtomicInteger number = entry.getValue();
|
|
|
+ final LongAdder number = entry.getValue();
|
|
|
|
|
|
if ( eventDate != null )
|
|
|
{
|
|
@@ -243,7 +240,7 @@ public class ReportSummaryData
|
|
|
|| ( timeWindow < 0 && eventDate.isBefore( Instant.now() ) && eventDifference.isShorterThan( timeBoundary ) )
|
|
|
)
|
|
|
{
|
|
|
- number.incrementAndGet();
|
|
|
+ number.increment();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -253,20 +250,20 @@ public class ReportSummaryData
|
|
|
public List<PresentationRow> asPresentableCollection( final Configuration config, final Locale locale )
|
|
|
{
|
|
|
final ArrayList<PresentationRow> returnCollection = new ArrayList<>();
|
|
|
- final PresentationRowBuilder builder = new PresentationRowBuilder( config, this.totalUsers.get(), locale );
|
|
|
+ final PresentationRowBuilder builder = new PresentationRowBuilder( config, this.totalUsers.sum(), locale );
|
|
|
|
|
|
- returnCollection.add( builder.makeNoPctRow( "Field_Report_Sum_Total", this.totalUsers.get(), null ) );
|
|
|
- if ( totalUsers.get() == 0 )
|
|
|
+ returnCollection.add( builder.makeNoPctRow( "Field_Report_Sum_Total", this.totalUsers.sum(), null ) );
|
|
|
+ if ( totalUsers.sum() == 0 )
|
|
|
{
|
|
|
return returnCollection;
|
|
|
}
|
|
|
|
|
|
if ( config.getLdapProfiles().keySet().size() > 1 )
|
|
|
{
|
|
|
- for ( final Map.Entry<String, AtomicInteger> entry : new TreeMap<>( ldapProfile ).entrySet() )
|
|
|
+ for ( final Map.Entry<String, LongAdder> entry : new TreeMap<>( ldapProfile ).entrySet() )
|
|
|
{
|
|
|
final String userProfile = entry.getKey();
|
|
|
- final int count = entry.getValue().get();
|
|
|
+ final long count = entry.getValue().sum();
|
|
|
final String displayName = config.getLdapProfiles().containsKey( userProfile )
|
|
|
? config.getLdapProfiles().get( userProfile ).getDisplayName( locale )
|
|
|
: userProfile;
|
|
@@ -275,83 +272,83 @@ public class ReportSummaryData
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveLoginTime", this.hasLoginTime.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveLoginTime", this.hasLoginTime.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( loginDays.keySet() ) )
|
|
|
{
|
|
|
if ( day < 0 )
|
|
|
{
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_LoginTimePrevious", this.loginDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_LoginTimePrevious", this.loginDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveAccountExpirationTime", this.hasAccountExpirationTime.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveAccountExpirationTime", this.hasAccountExpirationTime.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( accountExpireDays.keySet() ) )
|
|
|
{
|
|
|
final String key = day < 0 ? "Field_Report_Sum_AccountExpirationPrevious" : "Field_Report_Sum_AccountExpirationNext";
|
|
|
- returnCollection.add( builder.makeRow( key, this.accountExpireDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( key, this.accountExpireDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HavePwExpirationTime", this.hasPasswordExpirationTime.get() ) );
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveExpiredPw", this.pwExpired.get() ) );
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HavePreExpiredPw", this.pwPreExpired.get() ) );
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveExpiredPwWarn", this.pwWarnPeriod.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HavePwExpirationTime", this.hasPasswordExpirationTime.sum() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveExpiredPw", this.pwExpired.sum() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HavePreExpiredPw", this.pwPreExpired.sum() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveExpiredPwWarn", this.pwWarnPeriod.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( pwExpireDays.keySet() ) )
|
|
|
{
|
|
|
final String key = day < 0 ? "Field_Report_Sum_PwExpirationPrevious" : "Field_Report_Sum_PwExpirationNext";
|
|
|
- returnCollection.add( builder.makeRow( key, this.pwExpireDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( key, this.pwExpireDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveChgPw", this.hasChangePwTime.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveChgPw", this.hasChangePwTime.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( changePwDays.keySet() ) )
|
|
|
{
|
|
|
if ( day < 0 )
|
|
|
{
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_ChgPwPrevious", this.changePwDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_ChgPwPrevious", this.changePwDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveResponses", this.hasResponses.get() ) );
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveHelpdeskResponses", this.hasHelpdeskResponses.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveResponses", this.hasResponses.sum() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveHelpdeskResponses", this.hasHelpdeskResponses.sum() ) );
|
|
|
for ( final DataStorageMethod storageMethod : JavaHelper.copiedEnumSet( this.getResponseStorage().keySet(), DataStorageMethod.class ) )
|
|
|
{
|
|
|
- final int count = this.getResponseStorage().get( storageMethod );
|
|
|
+ final long count = this.getResponseStorage().get( storageMethod );
|
|
|
returnCollection.add( builder.makeRow( "Field_Report_Sum_StorageMethod", count, storageMethod.toString() ) );
|
|
|
}
|
|
|
- for ( final Answer.FormatType formatType : EnumSet.copyOf( this.getResponseFormatType().keySet() ) )
|
|
|
+ for ( final Answer.FormatType formatType : JavaHelper.copiedEnumSet( this.getResponseFormatType().keySet(), Answer.FormatType.class ) )
|
|
|
{
|
|
|
- final int count = this.getResponseFormatType().get( formatType );
|
|
|
+ final long count = this.getResponseFormatType().get( formatType );
|
|
|
returnCollection.add( builder.makeRow( "Field_Report_Sum_ResponseFormatType", count, formatType.toString() ) );
|
|
|
}
|
|
|
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveResponseTime", this.hasResponseSetTime.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveResponseTime", this.hasResponseSetTime.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( responseSetDays.keySet() ) )
|
|
|
{
|
|
|
if ( day < 0 )
|
|
|
{
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_ResponseTimePrevious", this.responseSetDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_ResponseTimePrevious", this.responseSetDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ( this.hasOtpSecret.get() > 0 )
|
|
|
+ if ( this.hasOtpSecret.sum() > 0 )
|
|
|
{
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveOtpSecret", this.hasOtpSecret.get() ) );
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveOtpSecretSetTime", this.hasOtpSecretSetTime.get() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveOtpSecret", this.hasOtpSecret.sum() ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_HaveOtpSecretSetTime", this.hasOtpSecretSetTime.sum() ) );
|
|
|
for ( final Integer day : new TreeSet<>( otpSetDays.keySet() ) )
|
|
|
{
|
|
|
if ( day < 0 )
|
|
|
{
|
|
|
- returnCollection.add( builder.makeRow( "Field_Report_Sum_OtpSecretTimePrevious", this.otpSetDays.get( day ).get(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
+ returnCollection.add( builder.makeRow( "Field_Report_Sum_OtpSecretTimePrevious", this.otpSetDays.get( day ).sum(), String.valueOf( Math.abs( day ) ) ) );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if ( this.hasReceivedPwExpireNotification.get() > 0 )
|
|
|
+ if ( this.hasReceivedPwExpireNotification.sum() > 0 )
|
|
|
{
|
|
|
- returnCollection.add( new PresentationRow( "Has Received PwExpiry Notice", Integer.toString( this.hasReceivedPwExpireNotification.get() ), null ) );
|
|
|
+ returnCollection.add( new PresentationRow( "Has Received PwExpiry Notice", Long.toString( this.hasReceivedPwExpireNotification.sum() ), null ) );
|
|
|
for ( final Integer day : new TreeSet<>( pwExpireNotificationDays.keySet() ) )
|
|
|
{
|
|
|
if ( day < 0 )
|
|
|
{
|
|
|
- returnCollection.add( new PresentationRow( "PwExpireNotice " + day, Integer.toString( this.pwExpireNotificationDays.get( day ).get() ), null ) );
|
|
|
+ returnCollection.add( new PresentationRow( "PwExpireNotice " + day, Long.toString( this.pwExpireNotificationDays.get( day ).sum() ), null ) );
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -373,25 +370,25 @@ public class ReportSummaryData
|
|
|
public static class PresentationRowBuilder
|
|
|
{
|
|
|
private final Configuration config;
|
|
|
- private final int totalUsers;
|
|
|
+ private final long totalUsers;
|
|
|
private final Locale locale;
|
|
|
|
|
|
- PresentationRow makeRow( final String labelKey, final int valueCount )
|
|
|
+ PresentationRow makeRow( final String labelKey, final long valueCount )
|
|
|
{
|
|
|
return makeRow( labelKey, valueCount, null );
|
|
|
}
|
|
|
|
|
|
- PresentationRow makeRow( final String labelKey, final int valueCount, final String replacement )
|
|
|
+ PresentationRow makeRow( final String labelKey, final long valueCount, final String replacement )
|
|
|
{
|
|
|
return makeRowImpl( labelKey, valueCount, replacement );
|
|
|
}
|
|
|
|
|
|
- PresentationRow makeNoPctRow( final String labelKey, final int valueCount, final String replacement )
|
|
|
+ PresentationRow makeNoPctRow( final String labelKey, final long valueCount, final String replacement )
|
|
|
{
|
|
|
return makeRowImpl( labelKey, valueCount, replacement ).toBuilder().pct( null ).build();
|
|
|
}
|
|
|
|
|
|
- private PresentationRow makeRowImpl( final String labelKey, final int valueCount, final String replacement )
|
|
|
+ private PresentationRow makeRowImpl( final String labelKey, final long valueCount, final String replacement )
|
|
|
{
|
|
|
final String display = replacement == null
|
|
|
? LocaleHelper.getLocalizedMessage( locale, labelKey, config, Admin.class )
|