Class DefaultRateThrottlingPolicy

    • Constructor Detail

      • DefaultRateThrottlingPolicy

        public DefaultRateThrottlingPolicy​(ThrottlingRate defaultRate,
                                           ThrottlingPolicy delegate)
        Constructs a new DefaultRateThrottlingPolicy.
        Parameters:
        defaultRate - the rate to return if the one returned by the delegate is null.
        delegate - the wrapped datasource to execute
    • Method Detail

      • lookup

        public org.forgerock.util.promise.Promise<ThrottlingRate,​Exception> lookup​(org.forgerock.services.context.Context context,
                                                                                         org.forgerock.http.protocol.Request request)
        Description copied from interface: ThrottlingPolicy
        Returns the ThrottlingRate that should be used for the provided request.
        Specified by:
        lookup in interface ThrottlingPolicy
        Parameters:
        context - The current context which might be used to retrieve the throttling rate.
        request - The current request which might be used to retrieve the throttling rate.
        Returns:
        A Promise representing the ThrottlingRate that should be used for the request.