protected static RateBucketPeriod getPeriod ( RateLimitingConfig config ) { RateLimitingPeriod period = config . getPeriod ( ) ; switch ( period ) { case Second : return RateBucketPeriod . Second ; case Day : return RateBucketPeriod . Day ; case Hour : return RateBucketPeriod . Hour ; case Minute : return RateBucketPeriod . Minute ; case Month : return RateBucketPeriod . Month ; case Year : return RateBucketPeriod . Year ; default : return RateBucketPeriod . Month ; } }
Gets the appropriate bucket period from the config .