Refactoring/Improving source: dmf 2 (#1612)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import jakarta.validation.constraints.Min;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
@@ -25,6 +26,7 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@ToString
|
||||
public class AutoAssignDistributionSetUpdate {
|
||||
|
||||
private final long targetFilterId;
|
||||
|
||||
@@ -9,19 +9,26 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* An base definition class for an event which contains an id.
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class RemoteIdEvent extends RemoteTenantAwareEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long entityId;
|
||||
@@ -30,13 +37,6 @@ public class RemoteIdEvent extends RemoteTenantAwareEvent {
|
||||
|
||||
private String interfaceClass;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
protected RemoteIdEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for json serialization.
|
||||
*
|
||||
|
||||
@@ -11,20 +11,25 @@ package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.event.TenantAwareEvent;
|
||||
import org.springframework.cloud.bus.event.RemoteApplicationEvent;
|
||||
|
||||
import com.cronutils.utils.StringUtils;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* A distributed tenant aware event. It's the base class of the other
|
||||
* distributed events. All the necessary information of distributing events to
|
||||
* other nodes.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class RemoteTenantAwareEvent extends RemoteApplicationEvent implements TenantAwareEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String tenant;
|
||||
|
||||
@@ -9,35 +9,32 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
|
||||
/**
|
||||
* TenantAwareEvent that gets sent when a distribution set gets assigned to a
|
||||
* target.
|
||||
* TenantAwareEvent that gets sent when a distribution set gets assigned to a target.
|
||||
*/
|
||||
@NoArgsConstructor // for serialization libs like jackson
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class TargetAssignDistributionSetEvent extends AbstractAssignmentEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private long distributionSetId;
|
||||
|
||||
private boolean maintenanceWindowAvailable;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public TargetAssignDistributionSetEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
||||
@@ -11,16 +11,23 @@ package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Defines the remote event of triggering attribute updates of a {@link Target}.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class TargetAttributesRequestedEvent extends RemoteIdEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String controllerId;
|
||||
private String targetAddress;
|
||||
|
||||
|
||||
@@ -11,18 +11,24 @@ package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.event.entity.EntityDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Defines the remote event of deleting a {@link Target}.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class TargetDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
private String controllerId;
|
||||
private String targetAddress;
|
||||
|
||||
|
||||
@@ -11,16 +11,22 @@ package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Event is send in case a target polls either through DDI or DMF.
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class TargetPollEvent extends RemoteTenantAwareEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String controllerId;
|
||||
private String targetAdress;
|
||||
|
||||
|
||||
@@ -11,17 +11,23 @@ package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import org.eclipse.hawkbit.repository.event.entity.EntityDeletedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Defines the remote event of deleting a {@link org.eclipse.hawkbit.repository.model.TenantConfiguration}.
|
||||
*/
|
||||
@NoArgsConstructor // for serialization libs like jackson
|
||||
@Getter
|
||||
@EqualsAndHashCode
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString
|
||||
public class TenantConfigurationDeletedEvent extends RemoteIdEvent implements EntityDeletedEvent {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
private String configKey;
|
||||
@@ -29,26 +35,12 @@ public class TenantConfigurationDeletedEvent extends RemoteIdEvent implements En
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public TenantConfigurationDeletedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant
|
||||
* @param entityId
|
||||
* the entity id
|
||||
* @param configKey
|
||||
* the config key
|
||||
* @param configValue
|
||||
* the config value
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
* @param tenant the tenant
|
||||
* @param entityId the entity id
|
||||
* @param configKey the config key
|
||||
* @param configValue the config value
|
||||
* @param entityClass the entity class
|
||||
* @param applicationId the origin application id
|
||||
*/
|
||||
public TenantConfigurationDeletedEvent(final String tenant, final Long entityId, final String configKey,
|
||||
final String configValue, final Class<? extends TenantAwareBaseEntity> entityClass,
|
||||
|
||||
Reference in New Issue
Block a user