test_class.declarator: quotaService
test_class.modifier: private
test_class.original_string: private HostRequestsQuotaService quotaService;
test_class.type: HostRequestsQuotaService
test_class.var_name: quotaService
test_class.declarator: requestRegistry = mock(HostRequestIntervalRegistry.class)
test_class.modifier: private
test_class.original_string: private HostRequestIntervalRegistry requestRegistry = mock(HostRequestIntervalRegistry.class);
test_class.type: HostRequestIntervalRegistry
test_class.var_name: requestRegistry
test_class.declarator: requestsPolicy = mock(HostRequestLimitPolicy.class)
test_class.modifier: private
test_class.original_string: private HostRequestLimitPolicy requestsPolicy = mock(HostRequestLimitPolicy.class);
test_class.type: HostRequestLimitPolicy
test_class.var_name: requestsPolicy
test_class.declarator: registryCleaner = mock(IntervalRegistryCleaner.class)
test_class.modifier: private
test_class.original_string: private IntervalRegistryCleaner registryCleaner = mock(IntervalRegistryCleaner.class);
test_class.type: IntervalRegistryCleaner
test_class.var_name: registryCleaner
test_class.declarator: registryLogger = mock(IntervalRegistryLogger.class)
test_class.modifier: private
test_class.original_string: private IntervalRegistryLogger registryLogger = mock(IntervalRegistryLogger.class);
test_class.type: IntervalRegistryLogger
test_class.var_name: registryLogger
test_class.file: common/transport/src/test/java/com/hashmapinc/server/common/transport/quota/HostRequestsQuotaServiceTest.java
test_class.identifier: HostRequestsQuotaServiceTest
test_case.body: @Test
      public void serviceCanBeDisabled() {
          quotaService = new HostRequestsQuotaService(requestRegistry, requestsPolicy, registryCleaner, registryLogger, false);
          assertFalse(quotaService.isQuotaExceeded("key"));
          verifyNoMoreInteractions(requestRegistry, requestsPolicy);
      }
test_case.class_method_signature: HostRequestsQuotaServiceTest.serviceCanBeDisabled()
test_case.full_signature: @Test public void serviceCanBeDisabled()
test_case.identifier: serviceCanBeDisabled
test_case.invocations: assertFalse isQuotaExceeded verifyNoMoreInteractions
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void serviceCanBeDisabled()
focal_class.declarator: requestRegistry
focal_class.modifier: private final
focal_class.original_string: private final HostRequestIntervalRegistry requestRegistry;
focal_class.type: HostRequestIntervalRegistry
focal_class.var_name: requestRegistry
focal_class.declarator: requestsPolicy
focal_class.modifier: private final
focal_class.original_string: private final HostRequestLimitPolicy requestsPolicy;
focal_class.type: HostRequestLimitPolicy
focal_class.var_name: requestsPolicy
focal_class.declarator: registryCleaner
focal_class.modifier: private final
focal_class.original_string: private final IntervalRegistryCleaner registryCleaner;
focal_class.type: IntervalRegistryCleaner
focal_class.var_name: registryCleaner
focal_class.declarator: registryLogger
focal_class.modifier: private final
focal_class.original_string: private final IntervalRegistryLogger registryLogger;
focal_class.type: IntervalRegistryLogger
focal_class.var_name: registryLogger
focal_class.declarator: enabled
focal_class.modifier: private final
focal_class.original_string: private final boolean enabled;
focal_class.type: boolean
focal_class.var_name: enabled
focal_class.file: common/transport/src/main/java/com/hashmapinc/server/common/transport/quota/HostRequestsQuotaService.java
focal_class.identifier: HostRequestsQuotaService
focal_class.interfaces: implements QuotaService
focal_class.class_method_signature: HostRequestsQuotaService.HostRequestsQuotaService(HostRequestIntervalRegistry requestRegistry, HostRequestLimitPolicy requestsPolicy,
                                      IntervalRegistryCleaner registryCleaner, IntervalRegistryLogger registryLogger,
                                      @Value("${quota.host.enabled}") boolean enabled)
focal_class.full_signature: public  HostRequestsQuotaService(HostRequestIntervalRegistry requestRegistry, HostRequestLimitPolicy requestsPolicy,
                                      IntervalRegistryCleaner registryCleaner, IntervalRegistryLogger registryLogger,
                                      @Value("${quota.host.enabled}") boolean enabled)
focal_class.identifier: HostRequestsQuotaService
focal_class.modifiers: public
focal_class.parameters: (HostRequestIntervalRegistry requestRegistry, HostRequestLimitPolicy requestsPolicy,
                                      IntervalRegistryCleaner registryCleaner, IntervalRegistryLogger registryLogger,
                                      @Value("${quota.host.enabled}") boolean enabled)
focal_class.signature:  HostRequestsQuotaService(HostRequestIntervalRegistry requestRegistry, HostRequestLimitPolicy requestsPolicy,
                                      IntervalRegistryCleaner registryCleaner, IntervalRegistryLogger registryLogger,
                                      @Value("${quota.host.enabled}") boolean enabled)
focal_class.class_method_signature: HostRequestsQuotaService.init()
focal_class.full_signature: @PostConstruct public void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: HostRequestsQuotaService.close()
focal_class.full_signature: @PreDestroy public void close()
focal_class.identifier: close
focal_class.modifiers: @PreDestroy public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: HostRequestsQuotaService.isQuotaExceeded(String key)
focal_class.full_signature: @Override public boolean isQuotaExceeded(String key)
focal_class.identifier: isQuotaExceeded
focal_class.modifiers: @Override public
focal_class.parameters: (String key)
focal_class.return: boolean
focal_class.signature: boolean isQuotaExceeded(String key)
focal_method.body: @Override
      public boolean isQuotaExceeded(String key) {
          if (enabled) {
              long count = requestRegistry.tick(key);
              return !requestsPolicy.isValid(count);
          }
          return false;
      }
focal_method.class_method_signature: HostRequestsQuotaService.isQuotaExceeded(String key)
focal_method.full_signature: @Override public boolean isQuotaExceeded(String key)
focal_method.identifier: isQuotaExceeded
focal_method.invocations: tick isValid
focal_method.modifiers: @Override public
focal_method.parameters: (String key)
focal_method.return: boolean
focal_method.signature: boolean isQuotaExceeded(String key)