Refactor maven modules (#2806)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -46,6 +46,10 @@
|
||||
<groupId>com.cronutils</groupId>
|
||||
<artifactId>cron-utils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model.helper;
|
||||
package org.eclipse.hawkbit.repository.helper;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.model.helper;
|
||||
package org.eclipse.hawkbit.repository.helper;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Sort and search fields for actions.
|
||||
*/
|
||||
@Getter
|
||||
public enum ActionFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
ACTIVE("active"),
|
||||
STATUS("status"),
|
||||
LASTSTATUSCODE("lastActionStatusCode"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
WEIGHT("weight"),
|
||||
TARGET("target",
|
||||
TargetFields.ID.getJpaEntityFieldName(), TargetFields.NAME.getJpaEntityFieldName(),
|
||||
TargetFields.UPDATESTATUS.getJpaEntityFieldName(), TargetFields.IPADDRESS.getJpaEntityFieldName()),
|
||||
DISTRIBUTIONSET("distributionSet",
|
||||
DistributionSetFields.ID.getJpaEntityFieldName(),
|
||||
DistributionSetFields.NAME.getJpaEntityFieldName(), DistributionSetFields.VERSION.getJpaEntityFieldName(),
|
||||
DistributionSetFields.TYPE.getJpaEntityFieldName()),
|
||||
ROLLOUT("rollout", RolloutFields.ID.getJpaEntityFieldName(), RolloutFields.NAME.getJpaEntityFieldName()),
|
||||
ROLLOUTGROUP("rolloutGroup", RolloutGroupFields.ID.getJpaEntityFieldName(), RolloutGroupFields.NAME.getJpaEntityFieldName()),
|
||||
EXTERNALREF("externalRef");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
ActionFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Sort and search fields for action status.
|
||||
*/
|
||||
@Getter
|
||||
public enum ActionStatusFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
// search fields in sync with entity specifics (timestamp & report time)
|
||||
TIMESTAMP("timestamp"),
|
||||
REPORTEDAT("createdAt"), // same as CREATEDAT
|
||||
// fields for db records as in other fields - created at / by
|
||||
CREATEDAT("createdAt"), // same as REPORTEDAT
|
||||
CREATEDBY("createdBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
ActionStatusFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the DistributionSet model which can be used in the
|
||||
* REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum DistributionSetFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
TYPE("type",
|
||||
DistributionSetTypeFields.ID.getJpaEntityFieldName(),
|
||||
DistributionSetTypeFields.KEY.getJpaEntityFieldName(),
|
||||
DistributionSetTypeFields.NAME.getJpaEntityFieldName()),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
VERSION("version"),
|
||||
MODULE("modules", SoftwareModuleFields.ID.getJpaEntityFieldName(), SoftwareModuleFields.NAME.getJpaEntityFieldName()),
|
||||
TAG("tags", "name"),
|
||||
METADATA("metadata"),
|
||||
VALID("valid");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
DistributionSetFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultSubEntityAttribute() {
|
||||
return this == TYPE ? DistributionSetTypeFields.KEY.getJpaEntityFieldName() : QueryField.super.getDefaultSubEntityAttribute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMap() {
|
||||
return this == METADATA;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright (c) 2023 Bosch.IO GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Tag model which can be used in the REST API e.g.
|
||||
* for sorting etc.
|
||||
* Additionally, here were added fields for DistributionSet in order
|
||||
* filtering over distribution set fields also.
|
||||
*/
|
||||
@Getter
|
||||
public enum DistributionSetTagFields implements QueryField {
|
||||
|
||||
ID(TagFields.ID.getJpaEntityFieldName()),
|
||||
NAME(TagFields.NAME.getJpaEntityFieldName()),
|
||||
DESCRIPTION(TagFields.DESCRIPTION.getJpaEntityFieldName()),
|
||||
COLOUR(TagFields.COLOUR.getJpaEntityFieldName()),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
DISTRIBUTIONSET(
|
||||
"assignedToDistributionSet",
|
||||
DistributionSetFields.ID.getJpaEntityFieldName(), DistributionSetFields.NAME.getJpaEntityFieldName());
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
DistributionSetTagFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the DistributionSetType model which can be used in
|
||||
* the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum DistributionSetTypeFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
KEY("key"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
DistributionSetTypeFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* A query field interface extended by all the fields that could be used in queries.
|
||||
*/
|
||||
public interface QueryField {
|
||||
|
||||
/**
|
||||
* Separator for the sub attributes
|
||||
*/
|
||||
String SUB_ATTRIBUTE_SEPARATOR = ".";
|
||||
String SUB_ATTRIBUTE_SPLIT_REGEX = "\\" + SUB_ATTRIBUTE_SEPARATOR;
|
||||
|
||||
/**
|
||||
* @return the string representation of the underlying persistence field name e.g. in case of sorting.
|
||||
*/
|
||||
@NotNull
|
||||
String getJpaEntityFieldName();
|
||||
|
||||
/**
|
||||
* @return all sub entities attributes.
|
||||
*/
|
||||
default List<String> getSubEntityAttributes() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default sub entity attribute if available. This allows to skip that sub-attribute and call with "shortcut" - the enum name
|
||||
*
|
||||
* @return the default sub-attribute or <code>null</code>> if no default is available
|
||||
*/
|
||||
default String getDefaultSubEntityAttribute() {
|
||||
final List<String> subAttributes = getSubEntityAttributes();
|
||||
return subAttributes.size() == 1 ? subAttributes.get(0) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the field, that identifies the entity.
|
||||
*
|
||||
* @return the name of the identifier, by default 'id'
|
||||
*/
|
||||
default String getIdentifierFieldName() {
|
||||
return "id";
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the entity field a {@link Map} consisting of key-value pairs.
|
||||
*
|
||||
* @return <code>true</code> is a map <code>false</code> is not a map
|
||||
*/
|
||||
default boolean isMap() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Rollout model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum RolloutFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
STATUS("status"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
DISTRIBUTIONSET(
|
||||
"distributionSet",
|
||||
DistributionSetFields.ID.getJpaEntityFieldName(),
|
||||
DistributionSetFields.NAME.getJpaEntityFieldName(), DistributionSetFields.VERSION.getJpaEntityFieldName(),
|
||||
DistributionSetFields.TYPE.getJpaEntityFieldName());
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
RolloutFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the RolloutGroup model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum RolloutGroupFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
RolloutGroupFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the SoftwareModule model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum SoftwareModuleFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
TYPE("type",
|
||||
SoftwareModuleTypeFields.ID.getJpaEntityFieldName(),
|
||||
SoftwareModuleTypeFields.KEY.getJpaEntityFieldName(),
|
||||
SoftwareModuleTypeFields.NAME.getJpaEntityFieldName()),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
VERSION("version"),
|
||||
METADATA("metadata"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
SoftwareModuleFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDefaultSubEntityAttribute() {
|
||||
return this == TYPE ? SoftwareModuleTypeFields.KEY.getJpaEntityFieldName() : QueryField.super.getDefaultSubEntityAttribute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMap() {
|
||||
return this == METADATA;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the SoftwareModuleType model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum SoftwareModuleTypeFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
KEY("key"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
MAXASSIGNMENTS("maxAssignments"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
SoftwareModuleTypeFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Tag model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum TagFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
COLOUR("colour"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
TagFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Target model which can be used in the REST API
|
||||
* e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum TargetFields implements QueryField {
|
||||
|
||||
ID("controllerId"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
CONTROLLERID("controllerId"),
|
||||
UPDATESTATUS("updateStatus"),
|
||||
IPADDRESS("address"),
|
||||
ATTRIBUTE("controllerAttributes"),
|
||||
GROUP("group"),
|
||||
ASSIGNEDDS("assignedDistributionSet",
|
||||
DistributionSetFields.NAME.getJpaEntityFieldName(), DistributionSetFields.VERSION.getJpaEntityFieldName()),
|
||||
INSTALLEDDS("installedDistributionSet",
|
||||
DistributionSetFields.NAME.getJpaEntityFieldName(), DistributionSetFields.VERSION.getJpaEntityFieldName()),
|
||||
TAG("tags", TagFields.NAME.getJpaEntityFieldName()),
|
||||
LASTCONTROLLERREQUESTAT("lastTargetQuery"),
|
||||
METADATA("metadata"),
|
||||
TYPE("targetType",
|
||||
TargetTypeFields.ID.getJpaEntityFieldName(),
|
||||
TargetTypeFields.KEY.getJpaEntityFieldName(),
|
||||
TargetTypeFields.NAME.getJpaEntityFieldName()),
|
||||
// kept just for backward compatibility for backward compatibility
|
||||
// could be removed only if in the systems there are no active auto assignments or rollouts (dynamic or starting) with that condition
|
||||
// to be reconsidered if and when to be removed
|
||||
@Deprecated(forRemoval = true, since = "0.10.0")
|
||||
TARGETTYPE("targetType",
|
||||
TargetTypeFields.ID.getJpaEntityFieldName(),
|
||||
TargetTypeFields.KEY.getJpaEntityFieldName(),
|
||||
TargetTypeFields.NAME.getJpaEntityFieldName());
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
TargetFields(final String jpaEntityFieldName, final String... subEntityAttributes) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = List.of(subEntityAttributes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultSubEntityAttribute() {
|
||||
return this == TYPE ? TargetTypeFields.KEY.getJpaEntityFieldName() : QueryField.super.getDefaultSubEntityAttribute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMap() {
|
||||
return this == ATTRIBUTE || this == METADATA;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Target model which can be used in the REST API e.g. for sorting etc.
|
||||
*/
|
||||
@Getter
|
||||
public enum TargetFilterQueryFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
NAME("name"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy"),
|
||||
AUTOASSIGNDISTRIBUTIONSET("autoAssignDistributionSet", "name", "version");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
private final List<String> subEntityAttributes;
|
||||
|
||||
TargetFilterQueryFields(final String jpaEntityFieldName) {
|
||||
this(jpaEntityFieldName, Collections.emptyList());
|
||||
}
|
||||
|
||||
TargetFilterQueryFields(final String jpaEntityFieldName, final String... subEntityAttribues) {
|
||||
this(jpaEntityFieldName, List.of(subEntityAttribues));
|
||||
}
|
||||
|
||||
TargetFilterQueryFields(final String jpaEntityFieldName, final List<String> subEntityAttribues) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
this.subEntityAttributes = subEntityAttribues;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright (c) 2023 Bosch.IO GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the Tag model which can be used in the REST API e.g. for sorting etc.
|
||||
* Additionally, here were added fields for Target in order filtering over target fields also.
|
||||
*/
|
||||
@Getter
|
||||
public enum TargetTagFields implements QueryField {
|
||||
|
||||
ID(TagFields.ID.getJpaEntityFieldName()),
|
||||
NAME(TagFields.NAME.getJpaEntityFieldName()),
|
||||
DESCRIPTION(TagFields.DESCRIPTION.getJpaEntityFieldName()),
|
||||
COLOUR(TagFields.COLOUR.getJpaEntityFieldName()),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
TargetTagFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Bosch.IO GmbH and others
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Describing the fields of the TargetType model which can be used in the REST API
|
||||
*/
|
||||
@Getter
|
||||
public enum TargetTypeFields implements QueryField {
|
||||
|
||||
ID("id"),
|
||||
KEY("key"),
|
||||
NAME("name"),
|
||||
DESCRIPTION("description"),
|
||||
CREATEDAT("createdAt"),
|
||||
CREATEDBY("createdBy"),
|
||||
LASTMODIFIEDAT("lastModifiedAt"),
|
||||
LASTMODIFIEDBY("lastModifiedBy");
|
||||
|
||||
private final String jpaEntityFieldName;
|
||||
|
||||
TargetTypeFields(final String jpaEntityFieldName) {
|
||||
this.jpaEntityFieldName = jpaEntityFieldName;
|
||||
}
|
||||
}
|
||||
@@ -9,15 +9,17 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.rsql;
|
||||
|
||||
import static org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey.POLLING_OVERDUE_TIME;
|
||||
import static org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey.POLLING_TIME;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.apache.commons.text.StringSubstitutor;
|
||||
import org.apache.commons.text.lookup.StringLookupFactory;
|
||||
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.model.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.DurationHelper;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.PollingTime;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Adds macro capabilities to RSQL expressions that are used to filter for targets.
|
||||
@@ -69,15 +71,15 @@ public class VirtualPropertyResolver {
|
||||
*/
|
||||
public static long calculateOverdueTimestamp() {
|
||||
return calculateOverdueTimestamp(
|
||||
new PollingTime(getRawStringForKey(TenantConfigurationProperties.TenantConfigurationKey.POLLING_TIME)).getPollingInterval(),
|
||||
DurationHelper.fromString(getRawStringForKey(TenantConfigurationProperties.TenantConfigurationKey.POLLING_OVERDUE_TIME)));
|
||||
new PollingTime(getRawStringForKey(POLLING_TIME)).getPollingInterval(),
|
||||
DurationHelper.fromString(getRawStringForKey(POLLING_OVERDUE_TIME)));
|
||||
}
|
||||
|
||||
private static long calculateOverdueTimestamp(final PollingTime.PollingInterval pollingInterval, final Duration pollingOverdueTime) {
|
||||
return System.currentTimeMillis()
|
||||
- (pollingInterval.getDeviationPercent() == 0
|
||||
? pollingInterval.getInterval().toMillis()
|
||||
: pollingInterval.getInterval().toMillis() * (100 + pollingInterval.getDeviationPercent()) / 100)
|
||||
? pollingInterval.getInterval().toMillis()
|
||||
: pollingInterval.getInterval().toMillis() * (100 + pollingInterval.getDeviationPercent()) / 100)
|
||||
- pollingOverdueTime.toMillis();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) 2024 Contributors to the Eclipse Foundation
|
||||
*
|
||||
* This program and the accompanying materials are made
|
||||
* available under the terms of the Eclipse Public License 2.0
|
||||
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.qfields;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.github.classgraph.ClassGraph;
|
||||
import io.github.classgraph.ClassInfo;
|
||||
import io.github.classgraph.ScanResult;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class QueryFieldsTest {
|
||||
|
||||
/**
|
||||
* Verifies that fields classes are correctly implemented
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void repositoryManagementMethodsArePreAuthorizedAnnotated() {
|
||||
final String packageName = getClass().getPackage().getName();
|
||||
try (final ScanResult scanResult = new ClassGraph().acceptPackages(packageName).scan()) {
|
||||
final List<? extends Class<? extends QueryField>> matchingClasses = scanResult.getAllClasses()
|
||||
.stream()
|
||||
.filter(classInPackage -> classInPackage.implementsInterface(QueryField.class))
|
||||
.map(ClassInfo::loadClass)
|
||||
.map(clazz -> (Class<? extends QueryField>) clazz)
|
||||
.toList();
|
||||
assertThat(matchingClasses).isNotEmpty();
|
||||
matchingClasses.forEach(providerClass -> assertThat(providerClass.getEnumConstants()).isNotEmpty());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,6 @@
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository-jpa-api</artifactId>
|
||||
<artifactId>hawkbit-repository-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.text.StrLookup;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.exception.QueryException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
|
||||
@@ -17,7 +17,7 @@ import jakarta.persistence.TypedQuery;
|
||||
import jakarta.persistence.criteria.CriteriaBuilder;
|
||||
import jakarta.persistence.criteria.CriteriaQuery;
|
||||
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.jpa.ql.QLSupport;
|
||||
|
||||
public class HawkbitQlToSql {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
|
||||
import static org.eclipse.hawkbit.repository.QueryField.SUB_ATTRIBUTE_SEPARATOR;
|
||||
import static org.eclipse.hawkbit.repository.QueryField.SUB_ATTRIBUTE_SPLIT_REGEX;
|
||||
import static org.eclipse.hawkbit.repository.qfields.QueryField.SUB_ATTRIBUTE_SEPARATOR;
|
||||
import static org.eclipse.hawkbit.repository.qfields.QueryField.SUB_ATTRIBUTE_SPLIT_REGEX;
|
||||
import static org.eclipse.hawkbit.repository.jpa.ql.Node.Comparison.Operator.EQ;
|
||||
import static org.eclipse.hawkbit.repository.jpa.ql.Node.Comparison.Operator.GT;
|
||||
import static org.eclipse.hawkbit.repository.jpa.ql.Node.Comparison.Operator.GTE;
|
||||
@@ -39,7 +39,7 @@ import cz.jirutka.rsql.parser.ast.RSQLVisitor;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.repository.jpa.ql.Node;
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.eclipse.hawkbit.artifact.encryption.ArtifactEncryptionService;
|
||||
import org.eclipse.hawkbit.repository.AutoAssignExecutor;
|
||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||
import org.eclipse.hawkbit.repository.PropertiesQuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RepositoryConfiguration;
|
||||
import org.eclipse.hawkbit.repository.RepositoryProperties;
|
||||
@@ -86,8 +86,8 @@ import org.eclipse.hawkbit.repository.jpa.scheduler.JpaRolloutHandler;
|
||||
import org.eclipse.hawkbit.repository.jpa.utils.ExceptionMapper;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.model.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.rsql.VirtualPropertyResolver;
|
||||
import org.eclipse.hawkbit.security.HawkbitSecurityProperties;
|
||||
import org.eclipse.hawkbit.security.SecurityTokenGenerator;
|
||||
|
||||
@@ -22,12 +22,12 @@ import jakarta.persistence.metamodel.EntityType;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.exception.InsufficientPermissionException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaAction;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaAction_;
|
||||
|
||||
@@ -14,12 +14,12 @@ import java.util.Set;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTagFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetTagFields;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSet;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaSoftwareModuleType;
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.exception.InsufficientPermissionException;
|
||||
import org.eclipse.hawkbit.repository.jpa.ql.QLSupport;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
|
||||
@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.management;
|
||||
|
||||
import static org.eclipse.hawkbit.repository.jpa.configuration.Constants.TX_RT_DELAY;
|
||||
import static org.eclipse.hawkbit.repository.jpa.configuration.Constants.TX_RT_MAX;
|
||||
import static org.eclipse.hawkbit.repository.jpa.executor.AfterTransactionCommitExecutor.afterCommit;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -39,7 +38,7 @@ import jakarta.validation.constraints.NotNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.Identifiable;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.RepositoryManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.InvalidDistributionSetException;
|
||||
|
||||
@@ -26,7 +26,7 @@ import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.Identifiable;
|
||||
import org.eclipse.hawkbit.repository.MetadataSupport;
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.AbstractJpaBaseEntity;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.WithMetadata;
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||
import org.eclipse.hawkbit.repository.RepositoryProperties;
|
||||
import org.eclipse.hawkbit.repository.SecurityTokenGeneratorHolder;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
import org.eclipse.hawkbit.repository.UpdateMode;
|
||||
import org.eclipse.hawkbit.repository.event.EventPublisherHolder;
|
||||
|
||||
@@ -38,7 +38,7 @@ import jakarta.persistence.criteria.Root;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.eclipse.hawkbit.repository.ActionFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.ActionFields;
|
||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.stream.Collectors;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.management;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTagFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetTagFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSetTag;
|
||||
import org.eclipse.hawkbit.repository.jpa.repository.DistributionSetTagRepository;
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Optional;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.DistributionSetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException;
|
||||
|
||||
@@ -22,10 +22,10 @@ import jakarta.persistence.criteria.ListJoin;
|
||||
import jakarta.persistence.criteria.Predicate;
|
||||
import jakarta.persistence.criteria.Root;
|
||||
|
||||
import org.eclipse.hawkbit.repository.RolloutGroupFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.RolloutGroupFields;
|
||||
import org.eclipse.hawkbit.repository.RolloutGroupManagement;
|
||||
import org.eclipse.hawkbit.repository.RolloutStatusCache;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.jpa.JpaManagementHelper;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.AbstractJpaBaseEntity_;
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||
import org.eclipse.hawkbit.repository.RepositoryProperties;
|
||||
import org.eclipse.hawkbit.repository.RolloutApprovalStrategy;
|
||||
import org.eclipse.hawkbit.repository.RolloutFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.RolloutFields;
|
||||
import org.eclipse.hawkbit.repository.RolloutHelper;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.RolloutStatusCache;
|
||||
|
||||
@@ -26,7 +26,7 @@ import jakarta.persistence.EntityManager;
|
||||
import org.eclipse.hawkbit.artifact.encryption.ArtifactEncryptionService;
|
||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.IncompleteSoftwareModuleException;
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Optional;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaSoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.jpa.repository.DistributionSetTypeRepository;
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.eclipse.hawkbit.ContextAware;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.RepositoryProperties;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFilterQueryFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFilterQueryFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
|
||||
@@ -35,7 +35,7 @@ import jakarta.persistence.metamodel.MapAttribute;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
|
||||
@@ -9,15 +9,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.jpa.management;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetTagFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetTagFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaTargetTag;
|
||||
import org.eclipse.hawkbit.repository.jpa.repository.TargetTagRepository;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.function.ToLongFunction;
|
||||
import jakarta.persistence.EntityManager;
|
||||
|
||||
import org.eclipse.hawkbit.repository.QuotaManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.InsufficientPermissionException;
|
||||
import org.eclipse.hawkbit.repository.exception.TenantConfigurationValidatorException;
|
||||
@@ -44,7 +44,7 @@ import org.eclipse.hawkbit.repository.model.PollStatus;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfigurationValue;
|
||||
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.eclipse.hawkbit.tenancy.TenantAwareCacheManager;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.DurationHelper;
|
||||
|
||||
@@ -60,8 +60,8 @@ import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.eclipse.hawkbit.repository.model.TargetType;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.model.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import jakarta.validation.ConstraintViolationException;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.eclipse.hawkbit.repository.ActionStatusFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.ActionStatusFields;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.Identifiable;
|
||||
|
||||
@@ -12,10 +12,9 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
import org.eclipse.hawkbit.repository.ActionFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.ActionFields;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement.Create;
|
||||
import org.eclipse.hawkbit.repository.exception.QueryException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaAction;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaTarget;
|
||||
|
||||
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.eclipse.hawkbit.repository.jpa.rsql.RsqlParser.parse;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class RsqlParserTest {
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.eclipse.hawkbit.repository.RolloutFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.RolloutFields;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement.Create;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.eclipse.hawkbit.repository.RolloutGroupFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.RolloutGroupFields;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement.Create;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
|
||||
@@ -11,7 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaSoftwareModule;
|
||||
|
||||
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.eclipse.hawkbit.repository.Constants;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleTypeFields;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.eclipse.hawkbit.repository.DistributionSetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.TagFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TagFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
|
||||
@@ -15,10 +15,10 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement.Create;
|
||||
import org.eclipse.hawkbit.repository.TargetTagManagement;
|
||||
import org.eclipse.hawkbit.repository.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetTypeFields;
|
||||
import org.eclipse.hawkbit.repository.TargetTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
|
||||
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.repository.jpa.rsql;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetFilterQueryFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFilterQueryFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFilterQueryManagement;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.model.Action.ActionType;
|
||||
|
||||
@@ -14,9 +14,9 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
|
||||
import org.eclipse.hawkbit.repository.QueryField;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.QueryField;
|
||||
import org.eclipse.hawkbit.repository.qfields.SoftwareModuleFields;
|
||||
import org.eclipse.hawkbit.repository.qfields.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.jpa.JpaRepositoryConfiguration;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaTarget;
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.concurrent.Callable;
|
||||
import org.apache.commons.text.StringSubstitutor;
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfigurationValue;
|
||||
import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.model.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.SystemSecurityContextHolder;
|
||||
import org.eclipse.hawkbit.repository.helper.TenantConfigurationManagementHolder;
|
||||
import org.eclipse.hawkbit.repository.rsql.VirtualPropertyResolver;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties.TenantConfigurationKey;
|
||||
|
||||
@@ -28,7 +28,12 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-repository-api</artifactId>
|
||||
<artifactId>hawkbit-security-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-artifact-fs</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -41,16 +46,6 @@
|
||||
<artifactId>hawkbit-repository-jpa-flyway</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-security-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-artifact-fs</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- Database -->
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
|
||||
Reference in New Issue
Block a user