test_class.declarator: taskScheduler
test_class.modifier: @Mock
test_class.original_string: @Mock
      TaskScheduler taskScheduler;
test_class.type: TaskScheduler
test_class.var_name: taskScheduler
test_class.declarator: ngsiClient = Mockito.mock(NgsiClient.class, RETURNS_SMART_NULLS)
test_class.modifier: @Mock
test_class.original_string: @Mock
      NgsiClient ngsiClient = Mockito.mock(NgsiClient.class, RETURNS_SMART_NULLS);
test_class.type: NgsiClient
test_class.var_name: ngsiClient
test_class.declarator: subscriptionManager
test_class.modifier: @Autowired
      @InjectMocks
test_class.original_string: @Autowired
      @InjectMocks
      SubscriptionManager subscriptionManager;
test_class.type: SubscriptionManager
test_class.var_name: subscriptionManager
test_class.file: cepheus-cep/src/test/java/com/orange/cepheus/cep/SubscriptionManagerTest.java
test_class.identifier: SubscriptionManagerTest
test_case.body: @Test
      public void testInvalideSubscription() {
          // Mock future for unsubscribeContext
          ListenableFuture<UnsubscribeContextResponse> responseFuture = Mockito.mock(ListenableFuture.class);
          doNothing().when(responseFuture).addCallback(any(), any());
          when(ngsiClient.unsubscribeContext(eq("http://iotAgent"), eq(null), eq("9999"))).thenReturn(responseFuture);
          subscriptionManager.validateSubscriptionId("9999", "http://iotAgent");
      }
test_case.class_method_signature: SubscriptionManagerTest.testInvalideSubscription()
test_case.full_signature: @Test public void testInvalideSubscription()
test_case.identifier: testInvalideSubscription
test_case.invocations: mock addCallback when doNothing any any thenReturn when unsubscribeContext eq eq eq validateSubscriptionId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalideSubscription()
focal_class.declarator: logger = LoggerFactory.getLogger(SubscriptionManager.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = LoggerFactory.getLogger(SubscriptionManager.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: subscriptionPeriodicity
focal_class.modifier: @Value("${subscriptionManager.periodicity:300000}")
      private
focal_class.original_string: @Value("${subscriptionManager.periodicity:300000}")
      private long subscriptionPeriodicity;
focal_class.type: long
focal_class.var_name: subscriptionPeriodicity
focal_class.declarator: subscriptionDuration
focal_class.modifier: @Value("${subscriptionManager.duration:PT1H}")
      private
focal_class.original_string: @Value("${subscriptionManager.duration:PT1H}")
      private String subscriptionDuration;
focal_class.type: String
focal_class.var_name: subscriptionDuration
focal_class.declarator: validateSubscriptionsId
focal_class.modifier: @Value("${subscriptionManager.validateSubscriptionsId:true}")
      private
focal_class.original_string: @Value("${subscriptionManager.validateSubscriptionsId:true}")
      private boolean validateSubscriptionsId;
focal_class.type: boolean
focal_class.var_name: validateSubscriptionsId
focal_class.declarator: ngsiClient
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private NgsiClient ngsiClient;
focal_class.type: NgsiClient
focal_class.var_name: ngsiClient
focal_class.declarator: taskScheduler
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private TaskScheduler taskScheduler;
focal_class.type: TaskScheduler
focal_class.var_name: taskScheduler
focal_class.declarator: eventTypeIns = Collections.emptyList()
focal_class.modifier: private
focal_class.original_string: private List<EventTypeIn> eventTypeIns = Collections.emptyList();
focal_class.type: List<EventTypeIn>
focal_class.var_name: eventTypeIns
focal_class.declarator: subscriptions = new Subscriptions()
focal_class.modifier: private
focal_class.original_string: private Subscriptions subscriptions = new Subscriptions();
focal_class.type: Subscriptions
focal_class.var_name: subscriptions
focal_class.declarator: scheduledFuture
focal_class.modifier: private
focal_class.original_string: private ScheduledFuture scheduledFuture;
focal_class.type: ScheduledFuture
focal_class.var_name: scheduledFuture
focal_class.declarator: hostURI
focal_class.modifier: private
focal_class.original_string: private URI hostURI;
focal_class.type: URI
focal_class.var_name: hostURI
focal_class.file: cepheus-cep/src/main/java/com/orange/cepheus/cep/SubscriptionManager.java
focal_class.identifier: SubscriptionManager
focal_class.class_method_signature: SubscriptionManager.setConfiguration(Configuration configuration)
focal_class.full_signature: public void setConfiguration(Configuration configuration)
focal_class.identifier: setConfiguration
focal_class.modifiers: public
focal_class.parameters: (Configuration configuration)
focal_class.return: void
focal_class.signature: void setConfiguration(Configuration configuration)
focal_class.class_method_signature: SubscriptionManager.validateSubscriptionId(String subscriptionId, String originatorUrl)
focal_class.full_signature: public boolean validateSubscriptionId(String subscriptionId, String originatorUrl)
focal_class.identifier: validateSubscriptionId
focal_class.modifiers: public
focal_class.parameters: (String subscriptionId, String originatorUrl)
focal_class.return: boolean
focal_class.signature: boolean validateSubscriptionId(String subscriptionId, String originatorUrl)
focal_class.class_method_signature: SubscriptionManager.shutdownGracefully()
focal_class.full_signature: @PreDestroy public void shutdownGracefully()
focal_class.identifier: shutdownGracefully
focal_class.modifiers: @PreDestroy public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdownGracefully()
focal_class.class_method_signature: SubscriptionManager.scheduleSubscriptionTask()
focal_class.full_signature: private void scheduleSubscriptionTask()
focal_class.identifier: scheduleSubscriptionTask
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void scheduleSubscriptionTask()
focal_class.class_method_signature: SubscriptionManager.periodicSubscriptionTask()
focal_class.full_signature: private void periodicSubscriptionTask()
focal_class.identifier: periodicSubscriptionTask
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void periodicSubscriptionTask()
focal_class.class_method_signature: SubscriptionManager.subscribeProvider(Provider provider, SubscribeContext subscribeContext, Subscriptions subscriptions)
focal_class.full_signature: private void subscribeProvider(Provider provider, SubscribeContext subscribeContext, Subscriptions subscriptions)
focal_class.identifier: subscribeProvider
focal_class.modifiers: private
focal_class.parameters: (Provider provider, SubscribeContext subscribeContext, Subscriptions subscriptions)
focal_class.return: void
focal_class.signature: void subscribeProvider(Provider provider, SubscribeContext subscribeContext, Subscriptions subscriptions)
focal_class.class_method_signature: SubscriptionManager.unsubscribeProvider(Provider provider)
focal_class.full_signature: private void unsubscribeProvider(Provider provider)
focal_class.identifier: unsubscribeProvider
focal_class.modifiers: private
focal_class.parameters: (Provider provider)
focal_class.return: void
focal_class.signature: void unsubscribeProvider(Provider provider)
focal_class.class_method_signature: SubscriptionManager.buildSubscribeContext(EventTypeIn eventType)
focal_class.full_signature: private SubscribeContext buildSubscribeContext(EventTypeIn eventType)
focal_class.identifier: buildSubscribeContext
focal_class.modifiers: private
focal_class.parameters: (EventTypeIn eventType)
focal_class.return: SubscribeContext
focal_class.signature: SubscribeContext buildSubscribeContext(EventTypeIn eventType)
focal_class.class_method_signature: SubscriptionManager.migrateSubscriptions(Configuration configuration)
focal_class.full_signature: private Subscriptions migrateSubscriptions(Configuration configuration)
focal_class.identifier: migrateSubscriptions
focal_class.modifiers: private
focal_class.parameters: (Configuration configuration)
focal_class.return: Subscriptions
focal_class.signature: Subscriptions migrateSubscriptions(Configuration configuration)
focal_class.class_method_signature: SubscriptionManager.getHeadersForProvider(Provider provider)
focal_class.full_signature: public HttpHeaders getHeadersForProvider(Provider provider)
focal_class.identifier: getHeadersForProvider
focal_class.modifiers: public
focal_class.parameters: (Provider provider)
focal_class.return: HttpHeaders
focal_class.signature: HttpHeaders getHeadersForProvider(Provider provider)
focal_method.body: public boolean validateSubscriptionId(String subscriptionId, String originatorUrl) {
          if (validateSubscriptionsId) {
              boolean isValid = subscriptions.isSubscriptionValid(subscriptionId);
              if (!isValid) {
                  logger.warn("unsubscribeContext request: clean invalid subscription id {} / {}", subscriptionId, originatorUrl);
                  //TODO: add support multi-tenant subscription
                  ngsiClient.unsubscribeContext(originatorUrl, null, subscriptionId).addCallback(
                          unsubscribeContextResponse ->
                                  logger.debug("unsubscribeContext completed for {}", originatorUrl),
                          throwable ->
                                  logger.warn("unsubscribeContext failed for {}", originatorUrl, throwable)
                  );
              }
              return isValid;
          }
          return true;
      }
focal_method.class_method_signature: SubscriptionManager.validateSubscriptionId(String subscriptionId, String originatorUrl)
focal_method.full_signature: public boolean validateSubscriptionId(String subscriptionId, String originatorUrl)
focal_method.identifier: validateSubscriptionId
focal_method.invocations: isSubscriptionValid warn addCallback unsubscribeContext debug warn
focal_method.modifiers: public
focal_method.parameters: (String subscriptionId, String originatorUrl)
focal_method.return: boolean
focal_method.signature: boolean validateSubscriptionId(String subscriptionId, String originatorUrl)