test_class.declarator: TENANT_ID = "32342342342"
test_class.modifier: private static final
test_class.original_string: private static final String TENANT_ID = "32342342342";
test_class.type: String
test_class.var_name: TENANT_ID
test_class.declarator: CONNECTION_STRING = "jdbc:hsqldb:mem:target/rules.db"
test_class.modifier: private static final
test_class.original_string: private static final String CONNECTION_STRING = "jdbc:hsqldb:mem:target/rules.db";
test_class.type: String
test_class.var_name: CONNECTION_STRING
test_class.declarator: TARGET_RULES_DB = "target/rules.db"
test_class.modifier: private static final
test_class.original_string: private static final String TARGET_RULES_DB = "target/rules.db";
test_class.type: String
test_class.var_name: TARGET_RULES_DB
test_class.declarator: emf
test_class.modifier: private static
test_class.original_string: private static EntityManagerFactory emf;
test_class.type: EntityManagerFactory
test_class.var_name: emf
test_class.declarator: em
test_class.modifier: private
test_class.original_string: private EntityManager em;
test_class.type: EntityManager
test_class.var_name: em
test_class.declarator: producer
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private KafkaProducer<String, String> producer;
test_class.type: KafkaProducer<String, String>
test_class.var_name: producer
test_class.declarator: am
test_class.modifier: @Mock
  	private
test_class.original_string: @Mock
  	private ApplicationManager am;
test_class.type: ApplicationManager
test_class.var_name: am
test_class.file: hendrix-api/src/test/java/io/symcpe/hendrix/api/dao/TestTenantManager.java
test_class.identifier: TestTenantManager
test_case.body: @Test
  	public void testDeleteTenant() throws Exception {
  		TenantManager.getInstance().deleteTenant(em, TENANT_ID, am);
  		verify(producer, times(1)).send(any());
  	}
test_case.class_method_signature: TestTenantManager.testDeleteTenant()
test_case.full_signature: @Test public void testDeleteTenant()
test_case.identifier: testDeleteTenant
test_case.invocations: deleteTenant getInstance send verify times any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDeleteTenant()
focal_class.declarator: CREATED_APIKEY = "created_apiKey"
focal_class.modifier: public static final
focal_class.original_string: public static final String CREATED_APIKEY = "created_apiKey";
focal_class.type: String
focal_class.var_name: CREATED_APIKEY
focal_class.declarator: DISABLED_APIKEY = "disabled_apiKey"
focal_class.modifier: public static final
focal_class.original_string: public static final String DISABLED_APIKEY = "disabled_apiKey";
focal_class.type: String
focal_class.var_name: DISABLED_APIKEY
focal_class.declarator: ENABLED_APIKEY = "enabled_apiKey"
focal_class.modifier: public static final
focal_class.original_string: public static final String ENABLED_APIKEY = "enabled_apiKey";
focal_class.type: String
focal_class.var_name: ENABLED_APIKEY
focal_class.declarator: DELETED_APIKEY = "deleted_apiKey"
focal_class.modifier: public static final
focal_class.original_string: public static final String DELETED_APIKEY = "deleted_apiKey";
focal_class.type: String
focal_class.var_name: DELETED_APIKEY
focal_class.declarator: logger = Logger.getLogger(TenantManager.class.getCanonicalName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(TenantManager.class.getCanonicalName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: TENANT_MANAGER = new TenantManager()
focal_class.modifier: private static final
focal_class.original_string: private static final TenantManager TENANT_MANAGER = new TenantManager();
focal_class.type: TenantManager
focal_class.var_name: TENANT_MANAGER
focal_class.declarator: HENDRIX_APIKEY_UPDATES_TXT = "apikeyupdates.txt"
focal_class.modifier: private static final
focal_class.original_string: private static final String HENDRIX_APIKEY_UPDATES_TXT = "apikeyupdates.txt";
focal_class.type: String
focal_class.var_name: HENDRIX_APIKEY_UPDATES_TXT
focal_class.file: hendrix-api/src/main/java/io/symcpe/hendrix/api/dao/TenantManager.java
focal_class.identifier: TenantManager
focal_class.class_method_signature: TenantManager.TenantManager()
focal_class.full_signature: private  TenantManager()
focal_class.identifier: TenantManager
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TenantManager()
focal_class.class_method_signature: TenantManager.getInstance()
focal_class.full_signature: public static TenantManager getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: TenantManager
focal_class.signature: TenantManager getInstance()
focal_class.class_method_signature: TenantManager.createTenant(EntityManager em, Tenant tenant)
focal_class.full_signature: public void createTenant(EntityManager em, Tenant tenant)
focal_class.identifier: createTenant
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant)
focal_class.return: void
focal_class.signature: void createTenant(EntityManager em, Tenant tenant)
focal_class.class_method_signature: TenantManager.deleteTenant(EntityManager em, String tenantId, ApplicationManager am)
focal_class.full_signature: public Tenant deleteTenant(EntityManager em, String tenantId, ApplicationManager am)
focal_class.identifier: deleteTenant
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, ApplicationManager am)
focal_class.return: Tenant
focal_class.signature: Tenant deleteTenant(EntityManager em, String tenantId, ApplicationManager am)
focal_class.class_method_signature: TenantManager.updateTenant(EntityManager em, String tenantId, String tenantName)
focal_class.full_signature: public Tenant updateTenant(EntityManager em, String tenantId, String tenantName)
focal_class.identifier: updateTenant
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, String tenantName)
focal_class.return: Tenant
focal_class.signature: Tenant updateTenant(EntityManager em, String tenantId, String tenantName)
focal_class.class_method_signature: TenantManager.getTenants(EntityManager em, List<String> tenants)
focal_class.full_signature: public List<Tenant> getTenants(EntityManager em, List<String> tenants)
focal_class.identifier: getTenants
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, List<String> tenants)
focal_class.return: List<Tenant>
focal_class.signature: List<Tenant> getTenants(EntityManager em, List<String> tenants)
focal_class.class_method_signature: TenantManager.getTenant(EntityManager em, String tenantId)
focal_class.full_signature: public Tenant getTenant(EntityManager em, String tenantId)
focal_class.identifier: getTenant
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId)
focal_class.return: Tenant
focal_class.signature: Tenant getTenant(EntityManager em, String tenantId)
focal_class.class_method_signature: TenantManager.getTenantsByName(EntityManager em, String tenantName)
focal_class.full_signature: public List<Tenant> getTenantsByName(EntityManager em, String tenantName)
focal_class.identifier: getTenantsByName
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantName)
focal_class.return: List<Tenant>
focal_class.signature: List<Tenant> getTenantsByName(EntityManager em, String tenantName)
focal_class.class_method_signature: TenantManager.getTenants(EntityManager em)
focal_class.full_signature: public List<Tenant> getTenants(EntityManager em)
focal_class.identifier: getTenants
focal_class.modifiers: public
focal_class.parameters: (EntityManager em)
focal_class.return: List<Tenant>
focal_class.signature: List<Tenant> getTenants(EntityManager em)
focal_class.class_method_signature: TenantManager.deleteApiKey(EntityManager em, String tenantId, String apiKey, ApplicationManager am)
focal_class.full_signature: public void deleteApiKey(EntityManager em, String tenantId, String apiKey, ApplicationManager am)
focal_class.identifier: deleteApiKey
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, String apiKey, ApplicationManager am)
focal_class.return: void
focal_class.signature: void deleteApiKey(EntityManager em, String tenantId, String apiKey, ApplicationManager am)
focal_class.class_method_signature: TenantManager.getApiKeys(EntityManager em, Tenant tenant)
focal_class.full_signature: public List<ApiKey> getApiKeys(EntityManager em, Tenant tenant)
focal_class.identifier: getApiKeys
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant)
focal_class.return: List<ApiKey>
focal_class.signature: List<ApiKey> getApiKeys(EntityManager em, Tenant tenant)
focal_class.class_method_signature: TenantManager.getApiKey(EntityManager em, Tenant tenant, String apiKey)
focal_class.full_signature: public ApiKey getApiKey(EntityManager em, Tenant tenant, String apiKey)
focal_class.identifier: getApiKey
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant, String apiKey)
focal_class.return: ApiKey
focal_class.signature: ApiKey getApiKey(EntityManager em, Tenant tenant, String apiKey)
focal_class.class_method_signature: TenantManager.sendApikeyToKafka(ApplicationManager am, String operation, String tenantId, String apiKey)
focal_class.full_signature: public void sendApikeyToKafka(ApplicationManager am, String operation, String tenantId, String apiKey)
focal_class.identifier: sendApikeyToKafka
focal_class.modifiers: public
focal_class.parameters: (ApplicationManager am, String operation, String tenantId, String apiKey)
focal_class.return: void
focal_class.signature: void sendApikeyToKafka(ApplicationManager am, String operation, String tenantId, String apiKey)
focal_class.class_method_signature: TenantManager.updateApiKey(EntityManager em, Tenant tenant, ApiKey key, ApplicationManager am)
focal_class.full_signature: public ApiKey updateApiKey(EntityManager em, Tenant tenant, ApiKey key, ApplicationManager am)
focal_class.identifier: updateApiKey
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant, ApiKey key, ApplicationManager am)
focal_class.return: ApiKey
focal_class.signature: ApiKey updateApiKey(EntityManager em, Tenant tenant, ApiKey key, ApplicationManager am)
focal_class.class_method_signature: TenantManager.createApiKey(EntityManager em, String tenantId, ApplicationManager am)
focal_class.full_signature: public ApiKey createApiKey(EntityManager em, String tenantId, ApplicationManager am)
focal_class.identifier: createApiKey
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, String tenantId, ApplicationManager am)
focal_class.return: ApiKey
focal_class.signature: ApiKey createApiKey(EntityManager em, String tenantId, ApplicationManager am)
focal_class.class_method_signature: TenantManager.deleteApiKeys(EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.full_signature: public void deleteApiKeys(EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.identifier: deleteApiKeys
focal_class.modifiers: public
focal_class.parameters: (EntityManager em, Tenant tenant, ApplicationManager am)
focal_class.return: void
focal_class.signature: void deleteApiKeys(EntityManager em, Tenant tenant, ApplicationManager am)
focal_method.body: public Tenant deleteTenant(EntityManager em, String tenantId, ApplicationManager am) throws Exception {
  		Tenant tenant = getTenant(em, tenantId);
  		if (tenant != null) {
  			EntityTransaction t = em.getTransaction();
  			try {
  				RulesManager.getInstance().deleteRules(em, tenant, am);
  				TemplateManager.getInstance().deleteTemplates(em, tenant, am);
  				TenantManager.getInstance().deleteApiKeys(em, tenant, am);
  				t.begin();
  				tenant.setRulesTables(null);
  				tenant.setTemplates(null);
  				em.remove(tenant);
  				em.flush();
  				t.commit();
  				return tenant;
  			} catch (Exception e) {
  				if (t.isActive()) {
  					t.rollback();
  				}
  				logger.log(Level.SEVERE, "Failed to delete tenant:" + tenant, e);
  				throw e;
  			}
  		} else {
  			throw new EntityNotFoundException("Tenant not found");
  		}
  	}
focal_method.class_method_signature: TenantManager.deleteTenant(EntityManager em, String tenantId, ApplicationManager am)
focal_method.full_signature: public Tenant deleteTenant(EntityManager em, String tenantId, ApplicationManager am)
focal_method.identifier: deleteTenant
focal_method.invocations: getTenant getTransaction deleteRules getInstance deleteTemplates getInstance deleteApiKeys getInstance begin setRulesTables setTemplates remove flush commit isActive rollback log
focal_method.modifiers: public
focal_method.parameters: (EntityManager em, String tenantId, ApplicationManager am)
focal_method.return: Tenant
focal_method.signature: Tenant deleteTenant(EntityManager em, String tenantId, ApplicationManager am)