Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,10 @@
import org.jetbrains.annotations.Nullable;

public class EdgeCoreFactoryService {
private boolean pulseActivated;

private @Nullable WritingServiceFactory writingServiceFactory;
private @Nullable DataCombiningTransformationServiceFactory dataCombiningTransformationServiceFactory;

public EdgeCoreFactoryService() {
pulseActivated = false;
}

public boolean isPulseActivated() {
return pulseActivated;
}

public void setPulseActivated(final boolean pulseActivated) {
this.pulseActivated = pulseActivated;
}

public void provideWritingServiceFactory(final @NotNull WritingServiceFactory writingServiceFactory) {
this.writingServiceFactory = writingServiceFactory;
}
Expand All @@ -52,7 +39,6 @@ public void provideDataCombiningTransformationServiceFactory(
}

public @Nullable DataCombiningTransformationServiceFactory getDataCombiningTransformationServiceFactory() {
// If Pulse is activated, external data combining service is disable.
return pulseActivated ? null : dataCombiningTransformationServiceFactory;
return dataCombiningTransformationServiceFactory;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.hivemq.pulse.status;

import com.hivemq.api.model.capabilities.Capability;
import com.hivemq.bootstrap.services.EdgeCoreFactoryService;
import com.hivemq.edge.HiveMQCapabilityService;
import org.jetbrains.annotations.NotNull;

Expand All @@ -28,14 +27,10 @@ public class PulseAgentStatusChangedListener implements StatusProvider.StatusCha
"HiveMQ Pulse Agent Asset Management",
"This enables HiveMQ Edge to be a HiveMQ Pulse Agent.");
private final @NotNull HiveMQCapabilityService capabilityService;
private final @NotNull EdgeCoreFactoryService edgeCoreFactoryService;
private @NotNull Status status;

public PulseAgentStatusChangedListener(
final @NotNull HiveMQCapabilityService capabilityService,
final @NotNull EdgeCoreFactoryService edgeCoreFactoryService) {
public PulseAgentStatusChangedListener(final @NotNull HiveMQCapabilityService capabilityService) {
this.capabilityService = capabilityService;
this.edgeCoreFactoryService = edgeCoreFactoryService;
this.status = new Status(Status.ActivationStatus.DEACTIVATED, Status.ConnectionStatus.DISCONNECTED, List.of());
}

Expand All @@ -48,10 +43,8 @@ public void onStatusChanged(@NotNull final Status status) {
this.status = status;
if (this.status.activationStatus() == Status.ActivationStatus.ACTIVATED) {
capabilityService.addCapability(CAPABILITY);
edgeCoreFactoryService.setPulseActivated(true);
} else {
capabilityService.removeCapability(CAPABILITY);
edgeCoreFactoryService.setPulseActivated(false);
}
}
}
Loading