test_class.declarator: dao
test_class.modifier: private
test_class.original_string: private DeploymentConfigurationDao dao;
test_class.type: DeploymentConfigurationDao
test_class.var_name: dao
test_class.declarator: localGitRepositoryPathResolver
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LocalGitRepositoryPathResolver localGitRepositoryPathResolver;
test_class.type: LocalGitRepositoryPathResolver
test_class.var_name: localGitRepositoryPathResolver
test_class.declarator: alienDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private IGenericSearchDAO alienDao;
test_class.type: IGenericSearchDAO
test_class.var_name: alienDao
test_class.file: alien4cloud-core/src/test/java/org/alien4cloud/alm/deployment/configuration/services/DeploymentConfigurationDaoTest.java
test_class.identifier: DeploymentConfigurationDaoTest
test_case.body: @Test
      public void when_no_data_in_elastic_search_and_git() throws Exception {
          assertThat(dao.findById(DeploymentInputs.class, "unknown")).isNull();
      }
test_case.class_method_signature: DeploymentConfigurationDaoTest.when_no_data_in_elastic_search_and_git()
test_case.full_signature: @Test public void when_no_data_in_elastic_search_and_git()
test_case.identifier: when_no_data_in_elastic_search_and_git
test_case.invocations: isNull assertThat findById
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void when_no_data_in_elastic_search_and_git()
focal_class.declarator: localGitRepositoryPathResolver
focal_class.modifier: private
focal_class.original_string: private LocalGitRepositoryPathResolver localGitRepositoryPathResolver;
focal_class.type: LocalGitRepositoryPathResolver
focal_class.var_name: localGitRepositoryPathResolver
focal_class.declarator: alienDao
focal_class.modifier: private
focal_class.original_string: private IGenericSearchDAO alienDao;
focal_class.type: IGenericSearchDAO
focal_class.var_name: alienDao
focal_class.file: alien4cloud-core/src/main/java/org/alien4cloud/alm/deployment/configuration/services/DeploymentConfigurationDao.java
focal_class.identifier: DeploymentConfigurationDao
focal_class.class_method_signature: DeploymentConfigurationDao.DeploymentConfigurationDao(LocalGitRepositoryPathResolver localGitRepositoryPathResolver, @Named("alien-es-dao") IGenericSearchDAO alienDao)
focal_class.full_signature: @Inject public  DeploymentConfigurationDao(LocalGitRepositoryPathResolver localGitRepositoryPathResolver, @Named("alien-es-dao") IGenericSearchDAO alienDao)
focal_class.identifier: DeploymentConfigurationDao
focal_class.modifiers: @Inject public
focal_class.parameters: (LocalGitRepositoryPathResolver localGitRepositoryPathResolver, @Named("alien-es-dao") IGenericSearchDAO alienDao)
focal_class.signature:  DeploymentConfigurationDao(LocalGitRepositoryPathResolver localGitRepositoryPathResolver, @Named("alien-es-dao") IGenericSearchDAO alienDao)
focal_class.class_method_signature: DeploymentConfigurationDao.findById(Class<T> clazz, String id)
focal_class.full_signature: @SneakyThrows public T findById(Class<T> clazz, String id)
focal_class.identifier: findById
focal_class.modifiers: @SneakyThrows public
focal_class.parameters: (Class<T> clazz, String id)
focal_class.return: T
focal_class.signature: T findById(Class<T> clazz, String id)
focal_class.class_method_signature: DeploymentConfigurationDao.save(T deploymentInputs)
focal_class.full_signature: @SneakyThrows public void save(T deploymentInputs)
focal_class.identifier: save
focal_class.modifiers: @SneakyThrows public
focal_class.parameters: (T deploymentInputs)
focal_class.return: void
focal_class.signature: void save(T deploymentInputs)
focal_class.class_method_signature: DeploymentConfigurationDao.deleteAllByTopologyVersionId(String applicationId, String versionId)
focal_class.full_signature: public void deleteAllByTopologyVersionId(String applicationId, String versionId)
focal_class.identifier: deleteAllByTopologyVersionId
focal_class.modifiers: public
focal_class.parameters: (String applicationId, String versionId)
focal_class.return: void
focal_class.signature: void deleteAllByTopologyVersionId(String applicationId, String versionId)
focal_class.class_method_signature: DeploymentConfigurationDao.deleteAllByEnvironmentId(String applicationId, String environmentId)
focal_class.full_signature: public void deleteAllByEnvironmentId(String applicationId, String environmentId)
focal_class.identifier: deleteAllByEnvironmentId
focal_class.modifiers: public
focal_class.parameters: (String applicationId, String environmentId)
focal_class.return: void
focal_class.signature: void deleteAllByEnvironmentId(String applicationId, String environmentId)
focal_class.class_method_signature: DeploymentConfigurationDao.deleteDirectory(Path path)
focal_class.full_signature: private void deleteDirectory(Path path)
focal_class.identifier: deleteDirectory
focal_class.modifiers: private
focal_class.parameters: (Path path)
focal_class.return: void
focal_class.signature: void deleteDirectory(Path path)
focal_method.body: @SneakyThrows
      public <T extends AbstractDeploymentConfig> T findById(Class<T> clazz, String id) {
          Path path = localGitRepositoryPathResolver.resolve(clazz, id);
          T config = null;
          if (Files.exists(path)) {
              byte[] bytes = Files.readAllBytes(path);
  
              if (ArrayUtils.isNotEmpty(bytes)) {
                  config = YamlParserUtil.parse(new String(bytes, StandardCharsets.UTF_8), clazz);
              }
          } else {
              // Any data to migrate?
              config = alienDao.findById(clazz, id);
              if (config != null) {
                  // migrating data from ES to Git
                  save(config);
                  alienDao.delete(clazz, id);
              }
          }
          return config;
      }
focal_method.class_method_signature: DeploymentConfigurationDao.findById(Class<T> clazz, String id)
focal_method.full_signature: @SneakyThrows public T findById(Class<T> clazz, String id)
focal_method.identifier: findById
focal_method.invocations: resolve exists readAllBytes isNotEmpty parse findById save delete
focal_method.modifiers: @SneakyThrows public
focal_method.parameters: (Class<T> clazz, String id)
focal_method.return: T
focal_method.signature: T findById(Class<T> clazz, String id)