Skip to content

Commit

Permalink
[ALFREDOPS-864] fix sonarqube problems
Browse files Browse the repository at this point in the history
  • Loading branch information
pvriel committed Jan 8, 2025
1 parent 3c42a29 commit 719ae10
Show file tree
Hide file tree
Showing 121 changed files with 519 additions and 655 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package eu.xenit.alfresco.healthprocessor.extensibility;

import eu.xenit.alfresco.healthprocessor.extensibility.annotations.InternalUseOnly;

import java.util.Collections;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import eu.xenit.alfresco.healthprocessor.extensibility.BaseExtension;
import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import java.util.Set;

import javax.annotation.Nonnull;
import java.util.Set;

/**
* Extension point for plugging in logic into the Health-Processor to fix unhealthy nodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@
import eu.xenit.alfresco.healthprocessor.extensibility.annotations.OnlyForUseIn;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport.PersistableData;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.Value;
import lombok.*;
import org.alfresco.service.cmr.repository.NodeRef;

import javax.annotation.Nonnull;
import java.util.*;

/**
* Attachment to a {@link NodeHealthReport} that contains attempted fixes made on a {@link NodeHealthReport}.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package eu.xenit.alfresco.healthprocessor.fixer.api;

import lombok.Getter;
import lombok.Setter;

/**
* {@link HealthFixerPlugin} that already has an <code>enabled</code> property
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

import eu.xenit.alfresco.healthprocessor.extensibility.BaseExtension;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import java.util.Set;
import javax.annotation.Nonnull;
import org.alfresco.service.cmr.repository.NodeRef;

import javax.annotation.Nonnull;
import java.util.Set;

/**
* Main extension point for plugging in (custom) logic into the Health-Processor. All implementations available in the
* Spring context (of the Health-Processor subsystem) will be registered and, {@link #isEnabled() if enabled}, triggered
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package eu.xenit.alfresco.healthprocessor.plugins.api;

import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
import lombok.extern.slf4j.Slf4j;
import org.alfresco.service.cmr.repository.NodeRef;
import org.slf4j.Logger;

import javax.annotation.Nonnull;
import java.util.HashSet;
import java.util.Set;

/**
* Health processor plugin that divides a batch into individual calls.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import eu.xenit.alfresco.healthprocessor.fixer.api.HealthFixerPlugin;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import java.util.Set;
import javax.annotation.Nonnull;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.alfresco.service.cmr.repository.NodeRef;
import org.slf4j.Logger;

import javax.annotation.Nonnull;
import java.util.Set;

/**
* {@link HealthFixerPlugin} that already has an <code>enabled</code> property
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package eu.xenit.alfresco.healthprocessor.reporter.api;

import javax.annotation.Nonnull;
import java.time.Duration;
import java.util.Optional;
import javax.annotation.Nonnull;

/**
* Progress indicator for the health processor cycle.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package eu.xenit.alfresco.healthprocessor.reporter.api;

import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;
import java.util.Set;

import javax.annotation.Nonnull;
import java.util.Set;

final class DisabledHealthReporter implements HealthReporter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import eu.xenit.alfresco.healthprocessor.extensibility.BaseExtension;
import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;

/**
* Extension point for plugging in logic into the Health-Processor to report results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@
import eu.xenit.alfresco.healthprocessor.extensibility.annotations.InternalUseOnly;
import eu.xenit.alfresco.healthprocessor.extensibility.annotations.NotForUseIn;
import eu.xenit.alfresco.healthprocessor.extensibility.annotations.OnlyForUseIn;
import lombok.*;
import org.alfresco.service.cmr.repository.NodeRef;

import javax.annotation.Nonnull;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import lombok.Value;
import org.alfresco.service.cmr.repository.NodeRef;

/**
* A health report for an Alfresco node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package eu.xenit.alfresco.healthprocessor.reporter.api;

import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;
import lombok.Value;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import lombok.Value;

/**
* End-of-cycle summary of a certain {@link HealthProcessorPlugin} for {@link HealthReporter}s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package eu.xenit.alfresco.healthprocessor.reporter.api;

import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;

import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;

/**
* Health reporter that divides a batch into individual calls.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthStatus;
import eu.xenit.alfresco.healthprocessor.util.TransactionHelper;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.*;
import java.util.Map.Entry;
import java.util.stream.Collectors;

@AllArgsConstructor
@Slf4j
public class NodeFixService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
import eu.xenit.alfresco.healthprocessor.plugins.api.HealthProcessorPlugin;
import eu.xenit.alfresco.healthprocessor.plugins.solr.NodeIndexHealthReport;
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor;
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor.SolrNodeCommand;
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor.SolrActionResponse;
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor.SolrNodeCommand;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Nonnull;
import java.util.HashSet;
import java.util.Set;

@RequiredArgsConstructor
@Slf4j
abstract class AbstractSolrNodeFixerPlugin implements ToggleableHealthFixerPlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor;
import eu.xenit.alfresco.healthprocessor.plugins.solr.SolrRequestExecutor.SolrNodeCommand;
import eu.xenit.alfresco.healthprocessor.reporter.api.NodeHealthReport;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import lombok.AllArgsConstructor;
import org.alfresco.repo.search.SearchTrackingComponent;
import org.alfresco.repo.solr.NodeParameters;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@AllArgsConstructor
public class Alfresco7TrackingComponent implements TrackingComponent {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import java.util.Map;
import javax.annotation.Nonnull;
import java.util.Map;

public interface IndexingConfiguration {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import java.util.Collection;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.AbstractFactoryBean;

import java.util.Collection;

@AllArgsConstructor
@Slf4j
public final class IndexingConfigurationFactoryBean extends AbstractFactoryBean<IndexingConfiguration> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import eu.xenit.alfresco.healthprocessor.reporter.api.CycleProgress;
import lombok.Getter;
import org.alfresco.service.cmr.repository.NodeRef;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.Getter;
import org.alfresco.service.cmr.repository.NodeRef;

/**
* Strategy used by the Health-Processor to iterate over (a subset of) Alfresco nodes. Once {@link #getNextNodeIds(int)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import eu.xenit.alfresco.healthprocessor.reporter.api.CycleProgress;

import javax.annotation.Nonnull;
import java.time.Duration;
import java.util.Optional;
import javax.annotation.Nonnull;


public final class NullCycleProgress implements CycleProgress {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import eu.xenit.alfresco.healthprocessor.reporter.api.CycleProgress;
import lombok.RequiredArgsConstructor;

import javax.annotation.Nonnull;
import java.time.Duration;
import java.time.Instant;
import java.util.Optional;
import java.util.function.LongSupplier;
import javax.annotation.Nonnull;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class SimpleCycleProgress implements CycleProgress {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package eu.xenit.alfresco.healthprocessor.indexing;

import java.util.List;
import java.util.Set;
import lombok.Value;
import org.alfresco.repo.solr.NodeParameters;
import org.alfresco.service.cmr.repository.NodeRef;

import java.util.List;
import java.util.Set;

public interface TrackingComponent {

long getMaxTxnId();
Expand Down
Loading

0 comments on commit 719ae10

Please sign in to comment.