Skip to content

Commit

Permalink
lint(restore-indices): clean-up restore indices class
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker committed Aug 14, 2024
1 parent 66fdf29 commit 50962a0
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 50962a0

Please sign in to comment.