Skip to content

Commit

Permalink
lint(restore-indices): clean-up restore indices class (#11176)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Aug 14, 2024
1 parent 841cb5b commit a06b318
Showing 1 changed file with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,23 @@
import io.ebean.Database;
import javax.annotation.Nonnull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

@Slf4j
@Configuration
public class RestoreIndicesConfig {
@Autowired ApplicationContext applicationContext;

@Bean(name = "restoreIndices")
@DependsOn({
"ebeanServer",
"entityService",
"systemMetadataService",
"searchService",
"graphService"
})
@ConditionalOnProperty(name = "entityService.impl", havingValue = "ebean", matchIfMissing = true)
@Nonnull
public RestoreIndices createInstance() {
final Database ebeanServer = applicationContext.getBean(Database.class);
final EntityService<?> entityService = applicationContext.getBean(EntityService.class);
final SystemMetadataService systemMetadataService =
applicationContext.getBean(SystemMetadataService.class);
final EntitySearchService entitySearchService =
applicationContext.getBean(EntitySearchService.class);
final GraphService graphService = applicationContext.getBean(GraphService.class);

public RestoreIndices createInstance(
final Database ebeanServer,
final EntityService<?> entityService,
final EntitySearchService entitySearchService,
final GraphService graphService,
final SystemMetadataService systemMetadataService) {
return new RestoreIndices(
ebeanServer, entityService, systemMetadataService, entitySearchService, graphService);
}
Expand Down

0 comments on commit a06b318

Please # to comment.