Split into separate maven modules.
Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -8,31 +8,33 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.components;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.URI;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaTarget;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetInfo;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
|
||||
/**
|
||||
* Proxy for {@link Target}.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author kaizimmerm
|
||||
*
|
||||
*/
|
||||
public class ProxyTarget extends JpaTarget {
|
||||
public class ProxyTarget implements Serializable {
|
||||
private static final long serialVersionUID = -8891449133620645310L;
|
||||
private String controllerId;
|
||||
private URI address = null;
|
||||
private Long lastTargetQuery = null;
|
||||
private Long installationDate;
|
||||
|
||||
private Long id;
|
||||
|
||||
private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN;
|
||||
|
||||
private DistributionSet installedDistributionSet;
|
||||
@@ -57,11 +59,58 @@ public class ProxyTarget extends JpaTarget {
|
||||
|
||||
private Status status;
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private TargetInfo targetInfo;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(final Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public TargetInfo getTargetInfo() {
|
||||
return targetInfo;
|
||||
}
|
||||
|
||||
public void setTargetInfo(final TargetInfo targetInfo) {
|
||||
this.targetInfo = targetInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param controllerId
|
||||
*/
|
||||
public ProxyTarget() {
|
||||
super(null);
|
||||
final Integer generatedId = new SecureRandom().nextInt(Integer.MAX_VALUE) - Integer.MAX_VALUE;
|
||||
targetIdName = new TargetIdName(generatedId, generatedId.toString(), generatedId.toString());
|
||||
}
|
||||
@@ -161,7 +210,6 @@ public class ProxyTarget extends JpaTarget {
|
||||
*
|
||||
* @return String as ID.
|
||||
*/
|
||||
@Override
|
||||
public String getControllerId() {
|
||||
return controllerId;
|
||||
}
|
||||
@@ -172,7 +220,6 @@ public class ProxyTarget extends JpaTarget {
|
||||
* @param controllerId
|
||||
* as ID
|
||||
*/
|
||||
@Override
|
||||
public void setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
@@ -270,11 +317,7 @@ public class ProxyTarget extends JpaTarget {
|
||||
/**
|
||||
* @return the targetIdName
|
||||
*/
|
||||
@Override
|
||||
public TargetIdName getTargetIdName() {
|
||||
if (this.targetIdName == null) {
|
||||
return super.getTargetIdName();
|
||||
}
|
||||
return this.targetIdName;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.CustomSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.AssignedSoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.ui.common.UserDetailsFormatter;
|
||||
@@ -75,20 +75,20 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
||||
|
||||
@Override
|
||||
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
||||
final Slice<CustomSoftwareModule> swModuleBeans;
|
||||
final Slice<AssignedSoftwareModule> swModuleBeans;
|
||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
|
||||
|
||||
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderBySetAssignmentAndModuleNameAscModuleVersionAsc(
|
||||
new OffsetBasedPageRequest(startIndex, count), orderByDistId, searchText, type);
|
||||
|
||||
for (final CustomSoftwareModule swModule : swModuleBeans) {
|
||||
for (final AssignedSoftwareModule swModule : swModuleBeans) {
|
||||
proxyBeans.add(getProxyBean(swModule));
|
||||
}
|
||||
|
||||
return proxyBeans;
|
||||
}
|
||||
|
||||
private ProxyBaseSwModuleItem getProxyBean(final CustomSoftwareModule customSoftwareModule) {
|
||||
private ProxyBaseSwModuleItem getProxyBean(final AssignedSoftwareModule customSoftwareModule) {
|
||||
final SoftwareModule bean = customSoftwareModule.getSoftwareModule();
|
||||
final ProxyBaseSwModuleItem proxyItem = new ProxyBaseSwModuleItem();
|
||||
proxyItem.setSwId(bean.getId());
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.repository.TargetFields;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.rsql.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.rsql.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterSyntaxException;
|
||||
import org.eclipse.hawkbit.repository.exception.RSQLParameterUnsupportedFieldException;
|
||||
import org.eclipse.hawkbit.ui.utils.SpringContextHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -304,9 +304,9 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
||||
((Hierarchical) hierarchicalContainer).setChildrenAllowed(actionWithStatusCount.getAction().getId(), false);
|
||||
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME)
|
||||
.setValue(SPDateTimeUtil.getFormattedDate((actionWithStatusCount.getActionLastModifiedAt() != null)
|
||||
? actionWithStatusCount.getActionLastModifiedAt()
|
||||
: actionWithStatusCount.getActionCreatedAt()));
|
||||
.setValue(SPDateTimeUtil.getFormattedDate((actionWithStatusCount.getAction().getLastModifiedAt() != null)
|
||||
? actionWithStatusCount.getAction().getLastModifiedAt()
|
||||
: actionWithStatusCount.getAction().getLastModifiedAt()));
|
||||
|
||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ROLLOUT_NAME)
|
||||
.setValue(actionWithStatusCount.getRolloutName());
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.AssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
|
||||
Reference in New Issue
Block a user