class AnalyticsCacheSettings {

    public long fixedExpirationTimeOrDefault()
    {
        final CacheStrategy cacheStrategy = (CacheStrategy) systemSettingManager.getSystemSetting( CACHE_STRATEGY );

        if ( cacheStrategy != null && cacheStrategy.hasExpirationTimeSet() )
        {
            return cacheStrategy.toSeconds();
        }
        else
        {
            // Try to get a default value
            final CacheStrategy defaultExpirationTime = (CacheStrategy) CACHE_STRATEGY.getDefaultValue();

            if ( defaultExpirationTime.hasExpirationTimeSet() )
            {
                return defaultExpirationTime.toSeconds();
            }
            else
            {
                // Return ZERO (always expire)
                return NO_CACHE.toSeconds();
            }
        }
    }

    public  AnalyticsCacheSettings( final SystemSettingManager systemSettingManager );

}