Merge branch 'master' into fix_wrong_error_response
This commit is contained in:
@@ -93,7 +93,7 @@ public class SimulationController {
|
||||
gatewayToken));
|
||||
}
|
||||
|
||||
return ResponseEntity.ok("Updated " + amount + " DMF connected targets!");
|
||||
return ResponseEntity.ok("Updated " + amount + " " + protocol + " connected targets!");
|
||||
}
|
||||
|
||||
private boolean isDmfDisabled() {
|
||||
|
||||
@@ -120,39 +120,6 @@ public class GenerateDialog extends Window {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {// NOSONAR - as this is generated
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + ((formLayout == null) ? 0 : formLayout.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {// NOSONAR - as this is generated
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final GenerateDialog other = (GenerateDialog) obj;
|
||||
if (formLayout == null) {
|
||||
if (other.formLayout != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!formLayout.equals(other.formLayout)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback interface to retrieve the result from the dialog window.
|
||||
*
|
||||
@@ -225,19 +192,20 @@ public class GenerateDialog extends Window {
|
||||
});
|
||||
}
|
||||
|
||||
private TextField createRequiredTextfield(final String caption, final String value, final Resource icon,
|
||||
private static TextField createRequiredTextfield(final String caption, final String value, final Resource icon,
|
||||
final Validator validator) {
|
||||
final TextField textField = new TextField(caption, value);
|
||||
return addTextFieldValues(textField, icon, validator);
|
||||
}
|
||||
|
||||
private TextField createRequiredTextfield(final String caption, final Property<?> dataSource, final Resource icon,
|
||||
final Validator validator) {
|
||||
private static TextField createRequiredTextfield(final String caption, final Property<?> dataSource,
|
||||
final Resource icon, final Validator validator) {
|
||||
final TextField textField = new TextField(caption, dataSource);
|
||||
return addTextFieldValues(textField, icon, validator);
|
||||
}
|
||||
|
||||
private TextField addTextFieldValues(final TextField textField, final Resource icon, final Validator validator) {
|
||||
private static TextField addTextFieldValues(final TextField textField, final Resource icon,
|
||||
final Validator validator) {
|
||||
textField.setIcon(icon);
|
||||
textField.setRequired(true);
|
||||
if (validator != null) {
|
||||
|
||||
@@ -32,7 +32,14 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-netflix-core</artifactId>
|
||||
<version>1.0.7.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
||||
@@ -10,12 +10,14 @@ package org.eclipse.hawkbit.feign.core.client;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.netflix.feign.support.SpringMvcContract;
|
||||
|
||||
import feign.MethodMetadata;
|
||||
import feign.Param;
|
||||
|
||||
/**
|
||||
* Own implementation of the {@link SpringMvcContract} which catches the
|
||||
@@ -38,6 +40,10 @@ public class IgnoreMultipleConsumersProducersSpringMvcContract extends SpringMvc
|
||||
// multiple consumers and produces, see
|
||||
// https://github.com/spring-cloud/spring-cloud-netflix/issues/808
|
||||
LOGGER.trace(e.getMessage(), e);
|
||||
|
||||
// This line from super is mandatory to avoid that access to the
|
||||
// expander causes a nullpointer.
|
||||
data.indexToExpander(new LinkedHashMap<Integer, Param.Expander>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,6 @@
|
||||
|
||||
<name>hawkBit-example :: DDI Feign Client</name>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-netflix</artifactId>
|
||||
<version>1.0.7.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
|
||||
@@ -9,13 +9,12 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the DistributionSet resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtDistributionSetClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtDistributionSetClientResource extends MgmtDistributionSetRestApi {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the DistributionSetTag resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtDistributionSetTagClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtDistributionSetTagClientResource extends MgmtDistributionSetTagRestApi {
|
||||
}
|
||||
|
||||
@@ -9,14 +9,13 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the DistributionSetType resource of the management API.
|
||||
*
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtDistributionSetTypeClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtDistributionSetTypeClientResource extends MgmtDistributionSetTypeRestApi {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,14 +9,13 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadArtifactRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* A feign-client interface declaration which allows to build a feign-client
|
||||
* stub.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtDownloadArtifactClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtDownloadArtifactClientResource extends MgmtDownloadArtifactRestApi {
|
||||
|
||||
}
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE)
|
||||
@FeignClient(name = "MgmtDownloadClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtDownloadClientResource extends MgmtDownloadRestApi {
|
||||
}
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRolloutRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the Rollout resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtRolloutClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtRolloutClientResource extends MgmtRolloutRestApi {
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -24,7 +23,7 @@ import feign.Param;
|
||||
/**
|
||||
* Client binding for the SoftwareModule resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtSoftwareModuleClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtSoftwareModuleClientResource extends MgmtSoftwareModuleRestApi {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the SoftwareModuleType resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtSoftwareModuleTypeClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtSoftwareModuleTypeClientResource extends MgmtSoftwareModuleTypeRestApi {
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
@@ -16,6 +15,6 @@ import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
* Client binding for the {@link MgmtSystemRestApi}.
|
||||
*
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtSystemClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtSystemClientResource extends MgmtSystemRestApi {
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemManagementRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
@@ -16,7 +15,7 @@ import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
* Client binding for the {@link MgmtSystemManagementRestApi}.
|
||||
*
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.SYSTEM_ADMIN_MAPPING)
|
||||
@FeignClient(name = "MgmtSystemManagementClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtSystemManagementClientResource extends MgmtSystemManagementRestApi {
|
||||
|
||||
}
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the Target resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtTargetClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtTargetClientResource extends MgmtTargetRestApi {
|
||||
}
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.mgmt.client.resource;
|
||||
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi;
|
||||
import org.springframework.cloud.netflix.feign.FeignClient;
|
||||
|
||||
/**
|
||||
* Client binding for the TargetTag resource of the management API.
|
||||
*/
|
||||
@FeignClient(url = "${hawkbit.url:localhost:8080}" + MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING)
|
||||
@FeignClient(name = "MgmtTargetTagClient", url = "${hawkbit.url:localhost:8080}")
|
||||
public interface MgmtTargetTagClientResource extends MgmtTargetTagRestApi {
|
||||
}
|
||||
|
||||
@@ -42,40 +42,12 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-netflix</artifactId>
|
||||
<version>1.0.7.RELEASE</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.hawkbit</groupId>
|
||||
<artifactId>hawkbit-example-mgmt-feign-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
<groupId>org.hibernate</groupId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
|
||||
@@ -17,9 +17,8 @@ import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetClientResource;
|
||||
import org.eclipse.hawkbit.mgmt.client.scenarios.ConfigurableScenario;
|
||||
import org.eclipse.hawkbit.mgmt.client.scenarios.CreateStartedRolloutExample;
|
||||
import org.eclipse.hawkbit.mgmt.client.scenarios.upload.FeignMultipartEncoder;
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.Banner.Mode;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -49,9 +48,6 @@ import feign.slf4j.Slf4jLogger;
|
||||
@Import(FeignClientConfiguration.class)
|
||||
public class Application implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private ClientConfigurationProperties configuration;
|
||||
|
||||
@Autowired
|
||||
private ConfigurableScenario configuredScenario;
|
||||
|
||||
@@ -59,7 +55,7 @@ public class Application implements CommandLineRunner {
|
||||
private CreateStartedRolloutExample gettingStartedRolloutScenario;
|
||||
|
||||
public static void main(final String[] args) {
|
||||
new SpringApplicationBuilder().showBanner(false).sources(Application.class).run(args);
|
||||
new SpringApplicationBuilder().bannerMode(Mode.OFF).sources(Application.class).run(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -74,18 +70,18 @@ public class Application implements CommandLineRunner {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BasicAuthRequestInterceptor basicAuthRequestInterceptor() {
|
||||
public BasicAuthRequestInterceptor basicAuthRequestInterceptor(final ClientConfigurationProperties configuration) {
|
||||
return new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ConfigurableScenario configurableScenario(final MgmtDistributionSetClientResource distributionSetResource,
|
||||
@Qualifier("mgmtSoftwareModuleClientResource") final MgmtSoftwareModuleClientResource softwareModuleResource,
|
||||
@Qualifier("uploadSoftwareModule") final MgmtSoftwareModuleClientResource uploadSoftwareModule,
|
||||
final MgmtSoftwareModuleClientResource softwareModuleResource,
|
||||
final MgmtTargetClientResource targetResource, final MgmtRolloutClientResource rolloutResource,
|
||||
final ClientConfigurationProperties clientConfigurationProperties) {
|
||||
return new ConfigurableScenario(distributionSetResource, softwareModuleResource, uploadSoftwareModule,
|
||||
targetResource, rolloutResource, clientConfigurationProperties);
|
||||
return new ConfigurableScenario(distributionSetResource, softwareModuleResource,
|
||||
uploadSoftwareModule(clientConfigurationProperties), targetResource, rolloutResource,
|
||||
clientConfigurationProperties);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@@ -94,23 +90,21 @@ public class Application implements CommandLineRunner {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Logger.Level feignLoggerLevel() {
|
||||
return Logger.Level.FULL;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public MgmtSoftwareModuleClientResource uploadSoftwareModule() {
|
||||
public MgmtSoftwareModuleClientResource uploadSoftwareModule(final ClientConfigurationProperties configuration) {
|
||||
final ObjectMapper mapper = new ObjectMapper()
|
||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.registerModule(new Jackson2HalModule());
|
||||
|
||||
return Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract())
|
||||
.requestInterceptor(
|
||||
new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword()))
|
||||
.logger(new Slf4jLogger()).encoder(new FeignMultipartEncoder())
|
||||
.decoder(new ResponseEntityDecoder(new JacksonDecoder(mapper)))
|
||||
.target(MgmtSoftwareModuleClientResource.class,
|
||||
configuration.getUrl() + MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING);
|
||||
.target(MgmtSoftwareModuleClientResource.class, configuration.getUrl());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Logger.Level feignLoggerLevel() {
|
||||
return Logger.Level.FULL;
|
||||
}
|
||||
|
||||
private static boolean containsArg(final String containsArg, final String... args) {
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -50,18 +49,18 @@ public class ConfigurableScenario {
|
||||
|
||||
private final MgmtSoftwareModuleClientResource softwareModuleResource;
|
||||
|
||||
private final MgmtSoftwareModuleClientResource uploadSoftwareModule;
|
||||
|
||||
private final MgmtTargetClientResource targetResource;
|
||||
|
||||
private final MgmtRolloutClientResource rolloutResource;
|
||||
|
||||
private final ClientConfigurationProperties clientConfigurationProperties;
|
||||
|
||||
private final MgmtSoftwareModuleClientResource uploadSoftwareModule;
|
||||
|
||||
public ConfigurableScenario(final MgmtDistributionSetClientResource distributionSetResource,
|
||||
@Qualifier("mgmtSoftwareModuleClientResource") final MgmtSoftwareModuleClientResource softwareModuleResource,
|
||||
@Qualifier("uploadSoftwareModule") final MgmtSoftwareModuleClientResource uploadSoftwareModule,
|
||||
final MgmtTargetClientResource targetResource, final MgmtRolloutClientResource rolloutResource,
|
||||
final MgmtSoftwareModuleClientResource softwareModuleResource,
|
||||
final MgmtSoftwareModuleClientResource uploadSoftwareModule, final MgmtTargetClientResource targetResource,
|
||||
final MgmtRolloutClientResource rolloutResource,
|
||||
final ClientConfigurationProperties clientConfigurationProperties) {
|
||||
this.distributionSetResource = distributionSetResource;
|
||||
this.softwareModuleResource = softwareModuleResource;
|
||||
@@ -191,7 +190,7 @@ public class ConfigurableScenario {
|
||||
.type("application").buildAsList(scenario.getAppModulesPerDistributionSet()))
|
||||
.getBody());
|
||||
|
||||
for (int x = 0; x < scenario.getArtifactsPerSM(); x++) {
|
||||
for (int iArtifact = 0; iArtifact < scenario.getArtifactsPerSM(); iArtifact++) {
|
||||
modules.forEach(module -> {
|
||||
final ArtifactFile file = new ArtifactFile("dummyfile.dummy", null, "multipart/form-data", artifact);
|
||||
uploadSoftwareModule.uploadArtifact(module.getModuleId(), file, null, null, null);
|
||||
@@ -201,21 +200,6 @@ public class ConfigurableScenario {
|
||||
return modules;
|
||||
}
|
||||
|
||||
private static byte[] generateArtifact(final Scenario scenario) {
|
||||
|
||||
// Exception squid:S2245 - not used for cryptographic function
|
||||
@SuppressWarnings("squid:S2245")
|
||||
final Random random = new Random();
|
||||
|
||||
// create byte array
|
||||
final byte[] nbyte = new byte[parseSize(scenario.getArtifactSize())];
|
||||
|
||||
// put the next byte in the array
|
||||
random.nextBytes(nbyte);
|
||||
|
||||
return nbyte;
|
||||
}
|
||||
|
||||
private void createTargets(final Scenario scenario) {
|
||||
LOGGER.info("Creating {} targets", scenario.getTargets());
|
||||
|
||||
@@ -239,4 +223,19 @@ public class ConfigurableScenario {
|
||||
}
|
||||
return Integer.valueOf(size);
|
||||
}
|
||||
|
||||
private static byte[] generateArtifact(final Scenario scenario) {
|
||||
|
||||
// Exception squid:S2245 - not used for cryptographic function
|
||||
@SuppressWarnings("squid:S2245")
|
||||
final Random random = new Random();
|
||||
|
||||
// create byte array
|
||||
final byte[] nbyte = new byte[parseSize(scenario.getArtifactSize())];
|
||||
|
||||
// put the next byte in the array
|
||||
random.nextBytes(nbyte);
|
||||
|
||||
return nbyte;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule;
|
||||
import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
/**
|
||||
* Example for creating and starting a Rollout.
|
||||
@@ -46,7 +45,6 @@ public class CreateStartedRolloutExample {
|
||||
private MgmtDistributionSetClientResource distributionSetResource;
|
||||
|
||||
@Autowired
|
||||
@Qualifier("mgmtSoftwareModuleClientResource")
|
||||
private MgmtSoftwareModuleClientResource softwareModuleResource;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
@@ -30,31 +31,19 @@
|
||||
<module>hawkbit-example-mgmt-simulator</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<properties>
|
||||
<feign.version>8.14.2</feign.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
<!-- need to overwrite for the interface inheritance feature of feign-core -->
|
||||
<!-- <version>8.16.0</version> -->
|
||||
<version>${feign.version}</version>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Brixton.SR5</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-jackson</artifactId>
|
||||
<!-- need to overwrite for the interface inheritance feature of feign-core -->
|
||||
<!-- <version>8.16.0</version> -->
|
||||
<version>${feign.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.netflix.feign</groupId>
|
||||
<artifactId>feign-slf4j</artifactId>
|
||||
<version>${feign.version}</version>
|
||||
<version>8.16.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.net.UrlEscapers;
|
||||
|
||||
/**
|
||||
* Implementation for ArtifactUrlHandler for creating urls to download resource
|
||||
@@ -55,8 +56,8 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler {
|
||||
}
|
||||
|
||||
String urlPattern = properties.getPattern();
|
||||
final Set<Entry<String, String>> entrySet = getReplaceMap(targetId, softwareModuleId, filename, sha1Hash,
|
||||
protocolString, properties).entrySet();
|
||||
final Set<Entry<String, String>> entrySet = getReplaceMap(targetId, softwareModuleId,
|
||||
UrlEscapers.urlFragmentEscaper().escape(filename), sha1Hash, protocolString, properties).entrySet();
|
||||
for (final Entry<String, String> entry : entrySet) {
|
||||
if (entry.getKey().equals(PORT_PLACEHOLDER)) {
|
||||
urlPattern = urlPattern.replace(":{" + entry.getKey() + "}",
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -150,7 +149,7 @@ public interface DdiRootControllerRestApi {
|
||||
*/
|
||||
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/"
|
||||
+ DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||
ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid final DdiActionFeedback feedback,
|
||||
@PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId);
|
||||
|
||||
/**
|
||||
@@ -167,7 +166,7 @@ public interface DdiRootControllerRestApi {
|
||||
*/
|
||||
@RequestMapping(value = "/{targetid}/"
|
||||
+ DdiRestConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Void> putConfigData(@Valid @RequestBody final DdiConfigData configData,
|
||||
ResponseEntity<Void> putConfigData(@Valid final DdiConfigData configData,
|
||||
@PathVariable("targetid") final String targetid);
|
||||
|
||||
/**
|
||||
@@ -205,7 +204,7 @@ public interface DdiRootControllerRestApi {
|
||||
|
||||
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}/"
|
||||
+ DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
ResponseEntity<Void> postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||
ResponseEntity<Void> postCancelActionFeedback(@Valid final DdiActionFeedback feedback,
|
||||
@PathVariable("targetid") @NotEmpty final String targetid,
|
||||
@PathVariable("actionId") @NotEmpty final Long actionId);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -29,7 +30,6 @@ import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
||||
import org.eclipse.hawkbit.ddi.json.model.DdiPolling;
|
||||
import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||
@@ -108,30 +108,25 @@ public final class DataConversionHelper {
|
||||
return file;
|
||||
}
|
||||
|
||||
static DdiControllerBase fromTarget(final Target target, final List<Action> actions,
|
||||
static DdiControllerBase fromTarget(final Target target, final Optional<Action> action,
|
||||
final String defaultControllerPollTime, final TenantAware tenantAware) {
|
||||
final DdiControllerBase result = new DdiControllerBase(
|
||||
new DdiConfig(new DdiPolling(defaultControllerPollTime)));
|
||||
|
||||
boolean addedUpdate = false;
|
||||
boolean addedCancel = false;
|
||||
final long countCancelingActions = actions.stream().filter(a -> a.getStatus() == Status.CANCELING).count();
|
||||
for (final Action action : actions) {
|
||||
if (countCancelingActions <= 0 && !action.isCancelingOrCanceled() && !addedUpdate) {
|
||||
if (action.isPresent()) {
|
||||
if (action.get().isCancelingOrCanceled()) {
|
||||
result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant())
|
||||
.getControllerCancelAction(target.getControllerId(), action.get().getId()))
|
||||
.withRel(DdiRestConstants.CANCEL_ACTION));
|
||||
} else {
|
||||
// we need to add the hashcode here of the actionWithStatus
|
||||
// because the action might
|
||||
// have changed from 'soft' to 'forced' type and we need to
|
||||
// change the payload of the
|
||||
// response because of eTags.
|
||||
result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant())
|
||||
.getControllerBasedeploymentAction(target.getControllerId(), action.getId(),
|
||||
calculateEtag(action))).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION));
|
||||
addedUpdate = true;
|
||||
} else if (action.isCancelingOrCanceled() && !addedCancel) {
|
||||
result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant())
|
||||
.getControllerCancelAction(target.getControllerId(), action.getId()))
|
||||
.withRel(DdiRestConstants.CANCEL_ACTION));
|
||||
addedCancel = true;
|
||||
.getControllerBasedeploymentAction(target.getControllerId(), action.get().getId(),
|
||||
calculateEtag(action.get()))).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public class DdiRootController implements DdiRootControllerRestApi {
|
||||
}
|
||||
|
||||
return new ResponseEntity<>(
|
||||
DataConversionHelper.fromTarget(target, controllerManagement.findActionByTargetAndActive(target),
|
||||
DataConversionHelper.fromTarget(target, controllerManagement.findOldestActiveActionByTarget(target),
|
||||
controllerManagement.getPollingTime(), tenantAware),
|
||||
HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -32,6 +33,7 @@ import org.eclipse.hawkbit.dmf.json.model.ArtifactHash;
|
||||
import org.eclipse.hawkbit.dmf.json.model.DownloadResponse;
|
||||
import org.eclipse.hawkbit.dmf.json.model.TenantSecurityToken;
|
||||
import org.eclipse.hawkbit.dmf.json.model.TenantSecurityToken.FileResource;
|
||||
import org.eclipse.hawkbit.eventbus.event.CancelTargetAssignmentEvent;
|
||||
import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions;
|
||||
import org.eclipse.hawkbit.im.authentication.TenantAwareAuthenticationDetails;
|
||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||
@@ -41,7 +43,7 @@ import org.eclipse.hawkbit.repository.RepositoryConstants;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetAssignDistributionSetEvent;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.TenantNotExistException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.TooManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
@@ -155,7 +157,7 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
|
||||
return handleAuthentifiactionMessage(message);
|
||||
} catch (final IllegalArgumentException ex) {
|
||||
throw new AmqpRejectAndDontRequeueException("Invalid message!", ex);
|
||||
} catch (final TenantNotExistException | ToManyStatusEntriesException e) {
|
||||
} catch (final TenantNotExistException | TooManyStatusEntriesException e) {
|
||||
throw new AmqpRejectAndDontRequeueException(e);
|
||||
} finally {
|
||||
SecurityContextHolder.setContext(oldContext);
|
||||
@@ -196,8 +198,8 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
|
||||
}
|
||||
} catch (final IllegalArgumentException ex) {
|
||||
throw new AmqpRejectAndDontRequeueException("Invalid message!", ex);
|
||||
} catch (final TenantNotExistException teex) {
|
||||
throw new AmqpRejectAndDontRequeueException(teex);
|
||||
} catch (final TenantNotExistException | TooManyStatusEntriesException e) {
|
||||
throw new AmqpRejectAndDontRequeueException(e);
|
||||
} finally {
|
||||
SecurityContextHolder.setContext(oldContext);
|
||||
}
|
||||
@@ -344,18 +346,24 @@ public class AmqpMessageHandlerService extends BaseAmqpService {
|
||||
}
|
||||
|
||||
private void lookIfUpdateAvailable(final Target target) {
|
||||
final List<Action> actions = controllerManagement.findActionByTargetAndActive(target);
|
||||
if (actions.isEmpty()) {
|
||||
final Optional<Action> action = controllerManagement.findOldestActiveActionByTarget(target);
|
||||
if (!action.isPresent()) {
|
||||
return;
|
||||
}
|
||||
// action are ordered by ASC
|
||||
final Action action = actions.get(0);
|
||||
final DistributionSet distributionSet = action.getDistributionSet();
|
||||
|
||||
if (action.get().isCancelingOrCanceled()) {
|
||||
amqpMessageDispatcherService.targetCancelAssignmentToDistributionSet(
|
||||
new CancelTargetAssignmentEvent(target.getOptLockRevision(), target.getTenant(),
|
||||
target.getControllerId(), action.get().getId(), target.getTargetInfo().getAddress()));
|
||||
return;
|
||||
}
|
||||
|
||||
final DistributionSet distributionSet = action.get().getDistributionSet();
|
||||
final List<SoftwareModule> softwareModuleList = controllerManagement
|
||||
.findSoftwareModulesByDistributionSet(distributionSet);
|
||||
final String targetSecurityToken = systemSecurityContext.runAsSystem(() -> target.getSecurityToken());
|
||||
amqpMessageDispatcherService.targetAssignDistributionSet(new TargetAssignDistributionSetEvent(
|
||||
target.getOptLockRevision(), target.getTenant(), target.getControllerId(), action.getId(),
|
||||
target.getOptLockRevision(), target.getTenant(), target.getControllerId(), action.get().getId(),
|
||||
softwareModuleList, target.getTargetInfo().getAddress(), targetSecurityToken));
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.eclipse.hawkbit.api.HostnameResolver;
|
||||
import org.eclipse.hawkbit.artifact.repository.ArtifactRepository;
|
||||
@@ -155,6 +156,7 @@ public class AmqpMessageHandlerServiceTest {
|
||||
final ArgumentCaptor<URI> uriCaptor = ArgumentCaptor.forClass(URI.class);
|
||||
when(controllerManagementMock.findOrRegisterTargetIfItDoesNotexist(targetIdCaptor.capture(),
|
||||
uriCaptor.capture())).thenReturn(null);
|
||||
when(controllerManagementMock.findOldestActiveActionByTarget(Matchers.any())).thenReturn(Optional.empty());
|
||||
|
||||
amqpMessageHandlerService.onMessage(message, MessageType.THING_CREATED.name(), TENANT, "vHost");
|
||||
|
||||
@@ -362,9 +364,8 @@ public class AmqpMessageHandlerServiceTest {
|
||||
when(controllerManagementMock.addUpdateActionStatus(Matchers.any())).thenReturn(action);
|
||||
when(entityFactoryMock.generateActionStatus()).thenReturn(new JpaActionStatus());
|
||||
// for the test the same action can be used
|
||||
final List<Action> actionList = new ArrayList<>();
|
||||
actionList.add(action);
|
||||
when(controllerManagementMock.findActionByTargetAndActive(Matchers.any())).thenReturn(actionList);
|
||||
when(controllerManagementMock.findOldestActiveActionByTarget(Matchers.any()))
|
||||
.thenReturn(Optional.of(action));
|
||||
|
||||
final List<SoftwareModule> softwareModuleList = createSoftwareModuleList();
|
||||
when(controllerManagementMock.findSoftwareModulesByDistributionSet(Matchers.any()))
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -88,7 +87,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE,
|
||||
"application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtDistributionSet>> createDistributionSets(
|
||||
@RequestBody final List<MgmtDistributionSetRequestBodyPost> sets);
|
||||
final List<MgmtDistributionSetRequestBodyPost> sets);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request for a single DistributionSet .
|
||||
@@ -116,7 +115,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<MgmtDistributionSet> updateDistributionSet(
|
||||
@PathVariable("distributionSetId") final Long distributionSetId,
|
||||
@RequestBody final MgmtDistributionSetRequestBodyPut toUpdate);
|
||||
final MgmtDistributionSetRequestBodyPut toUpdate);
|
||||
|
||||
/**
|
||||
* Handles the GET request of retrieving assigned targets to a specific
|
||||
@@ -198,7 +197,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
|
||||
@PathVariable("distributionSetId") final Long distributionSetId,
|
||||
@RequestBody final List<MgmtTargetAssignmentRequestBody> targetIds);
|
||||
final List<MgmtTargetAssignmentRequestBody> targetIds);
|
||||
|
||||
/**
|
||||
* Gets a paged list of meta data for a distribution set.
|
||||
@@ -256,7 +255,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}/metadata/{metadataKey}", produces = {
|
||||
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<MgmtMetadata> updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId,
|
||||
@PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata);
|
||||
@PathVariable("metadataKey") final String metadataKey, final MgmtMetadata metadata);
|
||||
|
||||
/**
|
||||
* Deletes a single meta data entry from the distribution set.
|
||||
@@ -285,7 +284,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE,
|
||||
"application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<List<MgmtMetadata>> createMetadata(@PathVariable("distributionSetId") final Long distributionSetId,
|
||||
@RequestBody final List<MgmtMetadata> metadataRest);
|
||||
final List<MgmtMetadata> metadataRest);
|
||||
|
||||
/**
|
||||
* Assigns a list of software modules to a distribution set.
|
||||
@@ -301,7 +300,7 @@ public interface MgmtDistributionSetRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE,
|
||||
"application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<Void> assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId,
|
||||
@RequestBody final List<MgmtSoftwareModuleAssigment> softwareModuleIDs);
|
||||
final List<MgmtSoftwareModuleAssigment> softwareModuleIDs);
|
||||
|
||||
/**
|
||||
* Deletes the assignment of the software module form the distribution set.
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -82,7 +81,7 @@ public interface MgmtDistributionSetTagRestApi {
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtTag>> createDistributionSetTags(@RequestBody final List<MgmtTagRequestBodyPut> tags);
|
||||
ResponseEntity<List<MgmtTag>> createDistributionSetTags(final List<MgmtTagRequestBodyPut> tags);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -99,7 +98,7 @@ public interface MgmtDistributionSetTagRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtTag> updateDistributionSetTag(
|
||||
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
|
||||
@RequestBody final MgmtTagRequestBodyPut restDSTagRest);
|
||||
final MgmtTagRequestBodyPut restDSTagRest);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request for a single distribution set tag.
|
||||
@@ -142,7 +141,7 @@ public interface MgmtDistributionSetTagRestApi {
|
||||
+ "/toggleTagAssignment")
|
||||
ResponseEntity<MgmtDistributionSetTagAssigmentResult> toggleTagAssignment(
|
||||
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
|
||||
@RequestBody final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
|
||||
final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
|
||||
|
||||
/**
|
||||
* Handles the POST request to assign distribution sets to the given tag id.
|
||||
@@ -157,7 +156,7 @@ public interface MgmtDistributionSetTagRestApi {
|
||||
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING)
|
||||
ResponseEntity<List<MgmtDistributionSet>> assignDistributionSets(
|
||||
@PathVariable("distributionsetTagId") final Long distributionsetTagId,
|
||||
@RequestBody final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
|
||||
final List<MgmtAssignedDistributionSetRequestBody> assignedDSRequestBodies);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request to unassign all distribution set from the
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModule
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -99,7 +98,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtDistributionSetType> updateDistributionSetType(
|
||||
@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
|
||||
@RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType);
|
||||
final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType);
|
||||
|
||||
/**
|
||||
* Handles the POST request of creating new DistributionSetTypes. The
|
||||
@@ -115,7 +114,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtDistributionSetType>> createDistributionSetTypes(
|
||||
@RequestBody final List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes);
|
||||
final List<MgmtDistributionSetTypeRequestBodyPost> distributionSetTypes);
|
||||
|
||||
/**
|
||||
* Handles the GET request of retrieving the list of mandatory software
|
||||
@@ -229,7 +228,7 @@ public interface MgmtDistributionSetTypeRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<Void> addMandatoryModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
|
||||
@RequestBody final MgmtId smtId);
|
||||
final MgmtId smtId);
|
||||
|
||||
/**
|
||||
* Handles the POST request for adding an optional software module type to a
|
||||
@@ -247,6 +246,6 @@ public interface MgmtDistributionSetTypeRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<Void> addOptionalModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId,
|
||||
@RequestBody final MgmtId smtId);
|
||||
final MgmtId smtId);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -77,7 +76,7 @@ public interface MgmtRolloutRestApi {
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtRolloutResponseBody> create(@RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody);
|
||||
ResponseEntity<MgmtRolloutResponseBody> create(final MgmtRolloutRestRequestBody rolloutRequestBody);
|
||||
|
||||
/**
|
||||
* Handles the POST request for starting a rollout.
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequ
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -162,7 +161,7 @@ public interface MgmtSoftwareModuleRestApi {
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtSoftwareModule>> createSoftwareModules(
|
||||
@RequestBody final List<MgmtSoftwareModuleRequestBodyPost> softwareModules);
|
||||
final List<MgmtSoftwareModuleRequestBodyPost> softwareModules);
|
||||
|
||||
/**
|
||||
* Handles the PUT request of updating a software module.
|
||||
@@ -177,7 +176,7 @@ public interface MgmtSoftwareModuleRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtSoftwareModule> updateSoftwareModule(
|
||||
@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||
@RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule);
|
||||
final MgmtSoftwareModuleRequestBodyPut restSoftwareModule);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request for a single software module.
|
||||
@@ -246,7 +245,7 @@ public interface MgmtSoftwareModuleRestApi {
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = {
|
||||
MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<MgmtMetadata> updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||
@PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata);
|
||||
@PathVariable("metadataKey") final String metadataKey, final MgmtMetadata metadata);
|
||||
|
||||
/**
|
||||
* Deletes a single meta data entry from the software module.
|
||||
@@ -275,6 +274,6 @@ public interface MgmtSoftwareModuleRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE,
|
||||
"application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" })
|
||||
ResponseEntity<List<MgmtMetadata>> createMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||
@RequestBody final List<MgmtMetadata> metadataRest);
|
||||
final List<MgmtMetadata> metadataRest);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModule
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -94,7 +93,7 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtSoftwareModuleType> updateSoftwareModuleType(
|
||||
@PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId,
|
||||
@RequestBody final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
|
||||
final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType);
|
||||
|
||||
/**
|
||||
* Handles the POST request of creating new SoftwareModuleTypes. The request
|
||||
@@ -110,6 +109,6 @@ public interface MgmtSoftwareModuleTypeRestApi {
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtSoftwareModuleType>> createSoftwareModuleTypes(
|
||||
@RequestBody final List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes);
|
||||
final List<MgmtSoftwareModuleTypeRequestBodyPost> softwareModuleTypes);
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.springframework.hateoas.ResourceSupport;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@@ -83,6 +82,6 @@ public interface MgmtSystemRestApi {
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtSystemTenantConfigurationValue> updateConfigurationValue(
|
||||
@PathVariable("keyName") final String keyName,
|
||||
@RequestBody final MgmtSystemTenantConfigurationValueRequest configurationValueRest);
|
||||
final MgmtSystemTenantConfigurationValueRequest configurationValueRest);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -84,7 +83,7 @@ public interface MgmtTargetRestApi {
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtTarget>> createTargets(@RequestBody final List<MgmtTargetRequestBody> targets);
|
||||
ResponseEntity<List<MgmtTarget>> createTargets(final List<MgmtTargetRequestBody> targets);
|
||||
|
||||
/**
|
||||
* Handles the PUT request of updating a target. The ID is within the URL
|
||||
@@ -103,7 +102,7 @@ public interface MgmtTargetRestApi {
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/{controllerId}", consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtTarget> updateTarget(@PathVariable("controllerId") final String controllerId,
|
||||
@RequestBody final MgmtTargetRequestBody targetRest);
|
||||
final MgmtTargetRequestBody targetRest);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request of deleting a target.
|
||||
@@ -247,7 +246,7 @@ public interface MgmtTargetRestApi {
|
||||
"application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<Void> postAssignedDistributionSet(@PathVariable("controllerId") final String controllerId,
|
||||
@RequestBody final MgmtDistributionSetAssigment dsId);
|
||||
final MgmtDistributionSetAssigment dsId);
|
||||
|
||||
/**
|
||||
* Handles the GET request of retrieving the installed distribution set of
|
||||
|
||||
@@ -19,7 +19,6 @@ import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -81,7 +80,7 @@ public interface MgmtTargetTagRestApi {
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<List<MgmtTag>> createTargetTags(@RequestBody final List<MgmtTagRequestBodyPut> tags);
|
||||
ResponseEntity<List<MgmtTag>> createTargetTags(final List<MgmtTagRequestBodyPut> tags);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -96,7 +95,7 @@ public interface MgmtTargetTagRestApi {
|
||||
@RequestMapping(method = RequestMethod.PUT, value = "/{targetTagId}", consumes = { "application/hal+json",
|
||||
MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||
ResponseEntity<MgmtTag> updateTagretTag(@PathVariable("targetTagId") final Long targetTagId,
|
||||
@RequestBody final MgmtTagRequestBodyPut restTargetTagRest);
|
||||
final MgmtTagRequestBodyPut restTargetTagRest);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request for a single target tag.
|
||||
@@ -136,7 +135,7 @@ public interface MgmtTargetTagRestApi {
|
||||
+ "/toggleTagAssignment")
|
||||
ResponseEntity<MgmtTargetTagAssigmentResult> toggleTagAssignment(
|
||||
@PathVariable("targetTagId") final Long targetTagId,
|
||||
@RequestBody final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
|
||||
final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
|
||||
|
||||
/**
|
||||
* Handles the POST request to assign targets to the given tag id.
|
||||
@@ -150,7 +149,7 @@ public interface MgmtTargetTagRestApi {
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING)
|
||||
ResponseEntity<List<MgmtTarget>> assignTargets(@PathVariable("targetTagId") final Long targetTagId,
|
||||
@RequestBody final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
|
||||
final List<MgmtAssignedTargetRequestBody> assignedTargetRequestBodies);
|
||||
|
||||
/**
|
||||
* Handles the DELETE request to unassign all targets from the given tag id.
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.repository;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@@ -19,7 +20,7 @@ import org.eclipse.hawkbit.repository.eventbus.event.DownloadProgressEvent;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyAttributeEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.TooManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
@@ -95,7 +96,7 @@ public interface ControllerManagement {
|
||||
*
|
||||
* @throws EntityAlreadyExistsException
|
||||
* if a given entity already exists
|
||||
* @throws ToManyStatusEntriesException
|
||||
* @throws TooManyStatusEntriesException
|
||||
* if more than the allowed number of status entries are
|
||||
* inserted
|
||||
*/
|
||||
@@ -111,7 +112,18 @@ public interface ControllerManagement {
|
||||
* @return a list of actions assigned to given target which are active
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
|
||||
List<Action> findActionByTargetAndActive(@NotNull Target target);
|
||||
List<Action> findActiveActionByTarget(@NotNull Target target);
|
||||
|
||||
/**
|
||||
* Retrieves oldest {@link Action} that is active and assigned to a
|
||||
* {@link Target}.
|
||||
*
|
||||
* @param target
|
||||
* the target to retrieve the actions from
|
||||
* @return a list of actions assigned to given target which are active
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.IS_CONTROLLER)
|
||||
Optional<Action> findOldestActiveActionByTarget(@NotNull Target target);
|
||||
|
||||
/**
|
||||
* Get the {@link Action} entity for given actionId with all lazy
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.eclipse.hawkbit.exception.AbstractServerRtException;
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class ToManyStatusEntriesException extends AbstractServerRtException {
|
||||
public final class TooManyStatusEntriesException extends AbstractServerRtException {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -28,7 +28,7 @@ public final class ToManyStatusEntriesException extends AbstractServerRtExceptio
|
||||
* Creates a new FileUploadFailedException with
|
||||
* {@link SpServerError#SP_REST_BODY_NOT_READABLE} error.
|
||||
*/
|
||||
public ToManyStatusEntriesException() {
|
||||
public TooManyStatusEntriesException() {
|
||||
super(SpServerError.SP_ACTION_STATUS_TO_MANY_ENTRIES);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class ToManyStatusEntriesException extends AbstractServerRtExceptio
|
||||
* @param cause
|
||||
* for the exception
|
||||
*/
|
||||
public ToManyStatusEntriesException(final Throwable cause) {
|
||||
public TooManyStatusEntriesException(final Throwable cause) {
|
||||
super(SpServerError.SP_ACTION_STATUS_TO_MANY_ENTRIES, cause);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public final class ToManyStatusEntriesException extends AbstractServerRtExceptio
|
||||
* @param message
|
||||
* of the error
|
||||
*/
|
||||
public ToManyStatusEntriesException(final String message) {
|
||||
public TooManyStatusEntriesException(final String message) {
|
||||
super(message, SpServerError.SP_ACTION_STATUS_TO_MANY_ENTRIES);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.repository.jpa;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaAction;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaDistributionSet;
|
||||
@@ -79,21 +80,31 @@ public interface ActionRepository extends BaseEntityRepository<JpaAction, Long>,
|
||||
Slice<Action> findByTarget(Pageable pageable, JpaTarget target);
|
||||
|
||||
/**
|
||||
* Retrieves all {@link Action}s which are active and referring the given
|
||||
* {@link Target} in a specified order. Loads also the lazy
|
||||
* {@link Action#getDistributionSet()} field.
|
||||
* Retrieves all {@link Action}s which are active and referring to the given
|
||||
* {@link Target} order by ID ascending.
|
||||
*
|
||||
* @param pageable
|
||||
* page parameters
|
||||
* @param target
|
||||
* the target to find assigned actions
|
||||
* @param active
|
||||
* the action active flag
|
||||
* @return the found {@link Action}s
|
||||
*/
|
||||
@EntityGraph(value = "Action.ds", type = EntityGraphType.LOAD)
|
||||
List<Action> findByTargetAndActiveOrderByIdAsc(final JpaTarget target, boolean active);
|
||||
|
||||
/**
|
||||
* Retrieves the oldest {@link Action} that is active and referring to the
|
||||
* given {@link Target}.
|
||||
*
|
||||
* @param target
|
||||
* the target to find assigned actions
|
||||
* @param active
|
||||
* the action active flag
|
||||
*
|
||||
* @return the found {@link Action}
|
||||
*/
|
||||
@EntityGraph(value = "Action.ds", type = EntityGraphType.LOAD)
|
||||
Optional<Action> findFirstByTargetAndActiveOrderByIdAsc(final JpaTarget target, boolean active);
|
||||
|
||||
/**
|
||||
* Retrieves latest {@link UpdateAction} for given target and
|
||||
* {@link SoftwareModule}.
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
@@ -26,7 +27,7 @@ import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyAttributeEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.TooManyStatusEntriesException;
|
||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheWriteNotify;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaAction;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaActionStatus;
|
||||
@@ -156,10 +157,15 @@ public class JpaControllerManagement implements ControllerManagement {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Action> findActionByTargetAndActive(final Target target) {
|
||||
public List<Action> findActiveActionByTarget(final Target target) {
|
||||
return actionRepository.findByTargetAndActiveOrderByIdAsc((JpaTarget) target, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Action> findOldestActiveActionByTarget(final Target target) {
|
||||
return actionRepository.findFirstByTargetAndActiveOrderByIdAsc((JpaTarget) target, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SoftwareModule> findSoftwareModulesByDistributionSet(final DistributionSet distributionSet) {
|
||||
return new ArrayList<>(softwareModuleRepository.findByAssignedTo((JpaDistributionSet) distributionSet));
|
||||
@@ -326,7 +332,7 @@ public class JpaControllerManagement implements ControllerManagement {
|
||||
LOG_DOS.error(
|
||||
"Potential denial of service (DOS) attack identfied. More status entries in the system than permitted ({})!",
|
||||
securityProperties.getDos().getMaxStatusEntriesPerAction());
|
||||
throw new ToManyStatusEntriesException(
|
||||
throw new TooManyStatusEntriesException(
|
||||
String.valueOf(securityProperties.getDos().getMaxStatusEntriesPerAction()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +186,8 @@ public class JpaAction extends AbstractJpaTenantAwareBaseEntity implements Actio
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
EventBusHolder.getInstance().getEventBus().post(new ActionPropertyChangeEvent(this,
|
||||
EntityPropertyChangeHelper.getChangeSet(Action.class, descriptorEvent)));
|
||||
EventBusHolder.getInstance().getEventBus()
|
||||
.post(new ActionPropertyChangeEvent(this, EntityPropertyChangeHelper.getChangeSet(descriptorEvent)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -73,8 +73,6 @@ import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implements DistributionSet, EventAwareEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String COMPLETE_PROPERTY = "complete";
|
||||
|
||||
private static final String DELETED_PROPERTY = "deleted";
|
||||
|
||||
@Column(name = "required_migration_step")
|
||||
@@ -301,8 +299,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
|
||||
final Map<String, PropertyChange> changeSet = EntityPropertyChangeHelper.getChangeSet(JpaDistributionSet.class,
|
||||
descriptorEvent);
|
||||
final Map<String, PropertyChange> changeSet = EntityPropertyChangeHelper.getChangeSet(descriptorEvent);
|
||||
EventBusHolder.getInstance().getEventBus().post(new DistributionSetUpdateEvent(this));
|
||||
|
||||
if (changeSet.containsKey(DELETED_PROPERTY)) {
|
||||
|
||||
@@ -214,8 +214,8 @@ public class JpaRollout extends AbstractJpaNamedEntity implements Rollout, Event
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
EventBusHolder.getInstance().getEventBus().post(new RolloutPropertyChangeEvent(this,
|
||||
EntityPropertyChangeHelper.getChangeSet(Rollout.class, descriptorEvent)));
|
||||
EventBusHolder.getInstance().getEventBus()
|
||||
.post(new RolloutPropertyChangeEvent(this, EntityPropertyChangeHelper.getChangeSet(descriptorEvent)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -252,8 +252,8 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
EventBusHolder.getInstance().getEventBus().post(new RolloutGroupPropertyChangeEvent(this,
|
||||
EntityPropertyChangeHelper.getChangeSet(RolloutGroup.class, descriptorEvent)));
|
||||
EventBusHolder.getInstance().getEventBus().post(
|
||||
new RolloutGroupPropertyChangeEvent(this, EntityPropertyChangeHelper.getChangeSet(descriptorEvent)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.AbstractPropertyChangeEvent.PropertyChange;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.eclipse.persistence.internal.sessions.ObjectChangeSet;
|
||||
import org.eclipse.persistence.queries.UpdateObjectQuery;
|
||||
@@ -21,9 +20,12 @@ import org.eclipse.persistence.sessions.changesets.DirectToFieldChangeRecord;
|
||||
/**
|
||||
* Helper class to get the change set for the property changes in the Entity.
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class EntityPropertyChangeHelper<T extends TenantAwareBaseEntity> {
|
||||
public final class EntityPropertyChangeHelper {
|
||||
|
||||
private EntityPropertyChangeHelper() {
|
||||
// noop
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the map of entity property change set
|
||||
@@ -32,14 +34,11 @@ public class EntityPropertyChangeHelper<T extends TenantAwareBaseEntity> {
|
||||
* @param event
|
||||
* @return the map of the changeSet
|
||||
*/
|
||||
public static <T extends TenantAwareBaseEntity> Map<String, PropertyChange> getChangeSet(final Class<T> clazz,
|
||||
final DescriptorEvent event) {
|
||||
final T rolloutGroup = clazz.cast(event.getObject());
|
||||
public static Map<String, PropertyChange> getChangeSet(final DescriptorEvent event) {
|
||||
final ObjectChangeSet changeSet = ((UpdateObjectQuery) event.getQuery()).getObjectChangeSet();
|
||||
return changeSet.getChanges().stream().filter(record -> record instanceof DirectToFieldChangeRecord)
|
||||
.map(record -> (DirectToFieldChangeRecord) record)
|
||||
.collect(Collectors.toMap(record -> record.getAttribute(),
|
||||
record -> new PropertyChange(record.getOldValue(), record.getNewValue())));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ public class SoftwareModuleAddUpdateWindow extends CustomComponent {
|
||||
.prompt(i18n.get("textfield.description")).id(SPUIComponentIdProvider.ADD_SW_MODULE_DESCRIPTION)
|
||||
.buildTextComponent();
|
||||
|
||||
typeComboBox = SPUIComponentProvider.getComboBox(i18n.get("upload.swmodule.type"), "", "", null, null, true,
|
||||
null, i18n.get("upload.swmodule.type"));
|
||||
typeComboBox = SPUIComponentProvider.getComboBox(i18n.get("upload.swmodule.type"), "", null, null, true, null,
|
||||
i18n.get("upload.swmodule.type"));
|
||||
typeComboBox.setId(SPUIComponentIdProvider.SW_MODULE_TYPE);
|
||||
typeComboBox.setStyleName(SPUIDefinitions.COMBO_BOX_SPECIFIC_STYLE + " " + ValoTheme.COMBOBOX_TINY);
|
||||
typeComboBox.setNewItemsAllowed(Boolean.FALSE);
|
||||
|
||||
@@ -57,8 +57,6 @@ public final class SPUIComponentProvider {
|
||||
*
|
||||
* @param caption
|
||||
* caption of the combo box
|
||||
* @param height
|
||||
* combo box height
|
||||
* @param width
|
||||
* combo box width
|
||||
* @param style
|
||||
@@ -73,9 +71,9 @@ public final class SPUIComponentProvider {
|
||||
* input prompt
|
||||
* @return ComboBox
|
||||
*/
|
||||
public static ComboBox getComboBox(final String caption, final String height, final String width,
|
||||
final String style, final String styleName, final boolean required, final String data, final String promt) {
|
||||
return SPUIComboBoxDecorator.decorate(caption, height, width, style, styleName, required, data, promt);
|
||||
public static ComboBox getComboBox(final String caption, final String width, final String style,
|
||||
final String styleName, final boolean required, final String data, final String promt) {
|
||||
return SPUIComboBoxDecorator.decorate(caption, width, style, styleName, required, data, promt);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,20 +288,19 @@ public final class SPUIComponentProvider {
|
||||
* specify how the link should be open (f. e. new windows =
|
||||
* _blank)
|
||||
* @param style
|
||||
* chosen style of the link
|
||||
* @param setStyle
|
||||
* set true if the style should be used
|
||||
* chosen style of the link. Might be {@code null} if no style
|
||||
* should be used
|
||||
* @return a link UI component
|
||||
*/
|
||||
public static Link getLink(final String id, final String name, final String resource, final FontAwesome icon,
|
||||
final String targetOpen, final String style, final boolean setStyle) {
|
||||
final String targetOpen, final String style) {
|
||||
|
||||
final Link link = new Link(name, new ExternalResource(resource));
|
||||
link.setId(id);
|
||||
link.setIcon(icon);
|
||||
|
||||
link.setTargetName(targetOpen);
|
||||
if (setStyle) {
|
||||
if (style != null) {
|
||||
link.setStyleName(style);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class SPUIComboBoxDecorator {
|
||||
* as promt
|
||||
* @return ComboBox as comp
|
||||
*/
|
||||
public static ComboBox decorate(final String caption, final String height, final String width, final String style,
|
||||
public static ComboBox decorate(final String caption, final String width, final String style,
|
||||
final String styleName, final boolean required, final String data, final String prompt) {
|
||||
final ComboBox spUICombo = new ComboBox();
|
||||
// Default settings
|
||||
@@ -67,10 +67,6 @@ public final class SPUIComboBoxDecorator {
|
||||
if (StringUtils.isNotEmpty(styleName)) {
|
||||
spUICombo.addStyleName(styleName);
|
||||
}
|
||||
// Add height
|
||||
if (StringUtils.isNotEmpty(height)) {
|
||||
spUICombo.setHeight(height);
|
||||
}
|
||||
// AddWidth
|
||||
if (StringUtils.isNotEmpty(width)) {
|
||||
spUICombo.setWidth(width);
|
||||
|
||||
@@ -189,7 +189,7 @@ public abstract class AbstractCreateUpdateTagLayout<E extends NamedEntity> exten
|
||||
|
||||
tagDesc.setNullRepresentation("");
|
||||
|
||||
tagNameComboBox = SPUIComponentProvider.getComboBox(null, "", "", null, null, false, "",
|
||||
tagNameComboBox = SPUIComponentProvider.getComboBox(null, "", null, null, false, "",
|
||||
i18n.get("label.combobox.tag"));
|
||||
tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
|
||||
tagNameComboBox.setImmediate(true);
|
||||
|
||||
@@ -54,8 +54,8 @@ public abstract class CreateUpdateTypeLayout<E extends NamedEntity> extends Abst
|
||||
colorLabel = new LabelBuilder().name(i18n.get("label.choose.type.color")).buildLabel();
|
||||
colorLabel.addStyleName(SPUIDefinitions.COLOR_LABEL_STYLE);
|
||||
|
||||
tagNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", "", null, null, false,
|
||||
"", i18n.get("label.combobox.type"));
|
||||
tagNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", null, null, false, "",
|
||||
i18n.get("label.combobox.type"));
|
||||
tagNameComboBox.setId(SPUIDefinitions.NEW_DISTRIBUTION_SET_TYPE_NAME_COMBO);
|
||||
tagNameComboBox.addStyleName(SPUIDefinitions.FILTER_TYPE_COMBO_STYLE);
|
||||
tagNameComboBox.setImmediate(true);
|
||||
|
||||
@@ -266,14 +266,14 @@ public class LoginView extends VerticalLayout implements View {
|
||||
if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
|
||||
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_DOCUMENTATION,
|
||||
i18n.get("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
|
||||
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle, true);
|
||||
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle);
|
||||
links.addComponent(docuLink);
|
||||
docuLink.addStyleName(ValoTheme.LINK_SMALL);
|
||||
}
|
||||
|
||||
if (!uiProperties.getDemo().getUser().isEmpty()) {
|
||||
final Link demoLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_DEMO,
|
||||
i18n.get("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle, true);
|
||||
i18n.get("link.demo.name"), "?demo", FontAwesome.DESKTOP, "_top", linkStyle);
|
||||
links.addComponent(demoLink);
|
||||
demoLink.addStyleName(ValoTheme.LINK_SMALL);
|
||||
}
|
||||
@@ -281,7 +281,7 @@ public class LoginView extends VerticalLayout implements View {
|
||||
if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
|
||||
final Link requestAccountLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_REQUESTACCOUNT,
|
||||
i18n.get("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
|
||||
FontAwesome.SHOPPING_CART, "", linkStyle, true);
|
||||
FontAwesome.SHOPPING_CART, "", linkStyle);
|
||||
links.addComponent(requestAccountLink);
|
||||
requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ public class LoginView extends VerticalLayout implements View {
|
||||
if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
|
||||
final Link userManagementLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_USERMANAGEMENT,
|
||||
i18n.get("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
|
||||
FontAwesome.USERS, "_blank", linkStyle, true);
|
||||
FontAwesome.USERS, "_blank", linkStyle);
|
||||
links.addComponent(userManagementLink);
|
||||
userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public class DistributionAddUpdateWindowLayout extends CustomComponent {
|
||||
distNameTextField = createTextField("textfield.name", SPUIComponentIdProvider.DIST_ADD_NAME);
|
||||
distVersionTextField = createTextField("textfield.version", SPUIComponentIdProvider.DIST_ADD_VERSION);
|
||||
|
||||
distsetTypeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", "", null, "",
|
||||
distsetTypeNameComboBox = SPUIComponentProvider.getComboBox(i18n.get("label.combobox.type"), "", null, "",
|
||||
false, "", i18n.get("label.combobox.type"));
|
||||
distsetTypeNameComboBox.setImmediate(true);
|
||||
distsetTypeNameComboBox.setNullSelectionAllowed(false);
|
||||
|
||||
@@ -18,7 +18,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.hawkbit.repository.DistributionSetManagement;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionCreatedEvent;
|
||||
@@ -84,7 +83,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
private SpPermissionChecker permissionChecker;
|
||||
|
||||
@Autowired
|
||||
private UINotification notification;
|
||||
private UINotification uiNotification;
|
||||
|
||||
@Autowired
|
||||
private ManagementUIState managementUIState;
|
||||
@@ -101,9 +100,6 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
@Autowired
|
||||
private transient DistributionSetManagement distributionSetManagement;
|
||||
|
||||
@Autowired
|
||||
private transient EntityFactory entityFactory;
|
||||
|
||||
private String notAllowedMsg;
|
||||
|
||||
private Boolean isDistPinned = false;
|
||||
@@ -394,7 +390,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
final DistributionSetTagAssignmentResult result = distributionSetManagement.toggleTagAssignment(distList,
|
||||
distTagName);
|
||||
|
||||
notification.displaySuccess(HawkbitCommonUtil.createAssignmentMessage(distTagName, result, i18n));
|
||||
uiNotification.displaySuccess(HawkbitCommonUtil.createAssignmentMessage(distTagName, result, i18n));
|
||||
if (result.getAssigned() >= 1 && managementUIState.getDistributionTableFilters().isNoTagSelected()) {
|
||||
refreshFilter();
|
||||
}
|
||||
@@ -414,7 +410,8 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
.add(new TargetIdName(target.getId(), target.getControllerId(), target.getName())));
|
||||
assignTargetToDs(getItem(distItemId), targetDetailsList);
|
||||
} else {
|
||||
notification.displaySuccess(i18n.get("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
|
||||
uiNotification
|
||||
.displaySuccess(i18n.get("message.no.targets.assiged.fortag", new Object[] { targetTagName }));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,13 +458,13 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
} else if (wrapperSource.getId().startsWith(SPUIDefinitions.TARGET_TAG_ID_PREFIXS)) {
|
||||
return !isNoTagButton(tagData, SPUIDefinitions.TARGET_TAG_BUTTON);
|
||||
}
|
||||
notification.displayValidationError(notAllowedMsg);
|
||||
uiNotification.displayValidationError(notAllowedMsg);
|
||||
return false;
|
||||
}
|
||||
|
||||
private Boolean isNoTagButton(final String tagData, final String targetNoTagData) {
|
||||
if (tagData.equals(targetNoTagData)) {
|
||||
notification.displayValidationError(
|
||||
uiNotification.displayValidationError(
|
||||
i18n.get("message.tag.cannot.be.assigned", new Object[] { i18n.get("label.no.tag.assigned") }));
|
||||
return true;
|
||||
}
|
||||
@@ -505,7 +502,7 @@ public class DistributionTable extends AbstractNamedVersionTable<DistributionSet
|
||||
eventBus.publish(this, ManagementUIEvent.UPDATE_COUNT);
|
||||
}
|
||||
if (null != message) {
|
||||
notification.displayValidationError(message);
|
||||
uiNotification.displayValidationError(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,8 +204,8 @@ public class TargetBulkUpdateWindowLayout extends CustomComponent {
|
||||
|
||||
private ComboBox getDsComboField() {
|
||||
final Container container = createContainer();
|
||||
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.get("bulkupload.ds.name"), "", "", null,
|
||||
null, false, "", i18n.get("bulkupload.ds.name"));
|
||||
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.get("bulkupload.ds.name"), "", null, null,
|
||||
false, "", i18n.get("bulkupload.ds.name"));
|
||||
dsComboBox.setSizeUndefined();
|
||||
dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
|
||||
dsComboBox.setImmediate(true);
|
||||
|
||||
@@ -148,7 +148,7 @@ public final class DashboardMenu extends CustomComponent {
|
||||
if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
|
||||
final Link docuLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_DOCUMENTATION,
|
||||
i18n.get("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
|
||||
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle, true);
|
||||
FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle);
|
||||
docuLink.setDescription(i18n.get("link.documentation.name"));
|
||||
docuLink.setSizeFull();
|
||||
links.addComponent(docuLink);
|
||||
@@ -158,7 +158,7 @@ public final class DashboardMenu extends CustomComponent {
|
||||
if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
|
||||
final Link userManagementLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_USERMANAGEMENT,
|
||||
i18n.get("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
|
||||
FontAwesome.USERS, "_blank", linkStyle, true);
|
||||
FontAwesome.USERS, "_blank", linkStyle);
|
||||
userManagementLink.setDescription(i18n.get("link.usermanagement.name"));
|
||||
links.addComponent(userManagementLink);
|
||||
userManagementLink.setSizeFull();
|
||||
@@ -168,7 +168,7 @@ public final class DashboardMenu extends CustomComponent {
|
||||
if (!uiProperties.getLinks().getSupport().isEmpty()) {
|
||||
final Link supportLink = SPUIComponentProvider.getLink(SPUIComponentIdProvider.LINK_SUPPORT,
|
||||
i18n.get("link.support.name"), uiProperties.getLinks().getSupport(), FontAwesome.ENVELOPE_O, "",
|
||||
linkStyle, true);
|
||||
linkStyle);
|
||||
supportLink.setDescription(i18n.get("link.support.name"));
|
||||
supportLink.setSizeFull();
|
||||
links.addComponent(supportLink);
|
||||
|
||||
@@ -375,8 +375,8 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
}
|
||||
|
||||
private ComboBox createTargetFilterQueryCombo() {
|
||||
final ComboBox targetFilter = SPUIComponentProvider.getComboBox(null, "", "", null, ValoTheme.COMBOBOX_SMALL,
|
||||
false, "", i18n.get("prompt.target.filter"));
|
||||
final ComboBox targetFilter = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false,
|
||||
"", i18n.get("prompt.target.filter"));
|
||||
targetFilter.setImmediate(true);
|
||||
targetFilter.setPageLength(7);
|
||||
targetFilter.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
|
||||
@@ -571,8 +571,8 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
||||
}
|
||||
|
||||
private ComboBox createDistributionSetCombo() {
|
||||
final ComboBox dsSet = SPUIComponentProvider.getComboBox(null, "", "", null, ValoTheme.COMBOBOX_SMALL, false,
|
||||
"", i18n.get("prompt.distribution.set"));
|
||||
final ComboBox dsSet = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false, "",
|
||||
i18n.get("prompt.distribution.set"));
|
||||
dsSet.setImmediate(true);
|
||||
dsSet.setPageLength(7);
|
||||
dsSet.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class DefaultDistributionSetTypeLayout extends BaseConfigurationView impl
|
||||
final Iterable<DistributionSetType> distributionSetTypeCollection = distributionSetManagement
|
||||
.findDistributionSetTypesAll(pageReq);
|
||||
|
||||
combobox = SPUIComponentProvider.getComboBox(null, "", "330", null, null, false, "", "label.combobox.tag");
|
||||
combobox = SPUIComponentProvider.getComboBox(null, "330", null, null, false, "", "label.combobox.tag");
|
||||
combobox.setId(SPUIComponentIdProvider.SYSTEM_CONFIGURATION_DEFAULTDIS_COMBOBOX);
|
||||
combobox.setNullSelectionAllowed(false);
|
||||
for (final DistributionSetType distributionSetType : distributionSetTypeCollection) {
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
@@ -37,10 +35,8 @@ import org.vaadin.alump.distributionbar.DistributionBar;
|
||||
import com.google.common.base.Strings;
|
||||
import com.vaadin.data.Container;
|
||||
import com.vaadin.data.Item;
|
||||
import com.vaadin.server.Sizeable.Unit;
|
||||
import com.vaadin.shared.ui.label.ContentMode;
|
||||
import com.vaadin.ui.Button;
|
||||
import com.vaadin.ui.Component;
|
||||
import com.vaadin.ui.Label;
|
||||
import com.vaadin.ui.Table;
|
||||
import com.vaadin.ui.UI;
|
||||
@@ -174,58 +170,6 @@ public final class HawkbitCommonUtil {
|
||||
return boldStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get target label Id.
|
||||
*
|
||||
* @param controllerId
|
||||
* as String
|
||||
* @return String as label name
|
||||
*/
|
||||
public static String getTargetLabelId(final String controllerId) {
|
||||
return new StringBuilder("target").append('.').append(controllerId).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get distribution table cell id.
|
||||
*
|
||||
* @param name
|
||||
* distribution name
|
||||
* @param version
|
||||
* distribution version
|
||||
* @return String distribution label id
|
||||
*/
|
||||
public static String getDistributionLabelId(final String name, final String version) {
|
||||
return new StringBuilder("dist").append('.').append(name).append('.').append(version).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get software module label id.
|
||||
*
|
||||
* @param name
|
||||
* software module name
|
||||
* @param version
|
||||
* software module version
|
||||
* @return String software module label id
|
||||
*/
|
||||
public static String getSwModuleLabelId(final String name, final String version) {
|
||||
return new StringBuilder("swModule").append('.').append(name).append('.').append(version).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get label with software module name and description.
|
||||
*
|
||||
* @param name
|
||||
* software module name
|
||||
* @param desc
|
||||
* software module description
|
||||
* @return String
|
||||
*/
|
||||
public static String getSwModuleNameDescLabel(final String name, final String desc) {
|
||||
return new StringBuilder().append(
|
||||
DIV_DESCRIPTION_START + getBoldHTMLText(getFormattedName(name)) + "<br>" + getFormattedName(desc))
|
||||
.append(DIV_DESCRIPTION_END).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Label for Artifact Details.
|
||||
*
|
||||
@@ -294,31 +238,6 @@ public final class HawkbitCommonUtil {
|
||||
return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find extra height required to increase by all the components to utilize
|
||||
* the full height of browser for the responsive UI.
|
||||
*
|
||||
* @param newBrowserHeight
|
||||
* as current browser height.
|
||||
* @return extra height required to increase.
|
||||
*/
|
||||
public static float findRequiredExtraHeight(final float newBrowserHeight) {
|
||||
return newBrowserHeight > SPUIDefinitions.REQ_MIN_BROWSER_HEIGHT
|
||||
? (newBrowserHeight - SPUIDefinitions.REQ_MIN_BROWSER_HEIGHT) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find required extra height of software module.
|
||||
*
|
||||
* @param newBrowserHeight
|
||||
* new browser height
|
||||
* @return float heigth of software module table
|
||||
*/
|
||||
public static float findRequiredSwModuleExtraHeight(final float newBrowserHeight) {
|
||||
return newBrowserHeight > SPUIDefinitions.REQ_MIN_UPLOAD_BROWSER_HEIGHT
|
||||
? (newBrowserHeight - SPUIDefinitions.REQ_MIN_UPLOAD_BROWSER_HEIGHT) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find required extra width of software module.
|
||||
*
|
||||
@@ -363,94 +282,6 @@ public final class HawkbitCommonUtil {
|
||||
return extraWidth + minPopupHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find extra width required to increase by all the components to utilize
|
||||
* the full width of browser for the responsive UI.
|
||||
*
|
||||
* @param newBrowserWidth
|
||||
* as current browser width.
|
||||
* @return extra width required to be increased.
|
||||
*/
|
||||
public static float findRequiredExtraWidth(final float newBrowserWidth) {
|
||||
float width = 0;
|
||||
if (newBrowserWidth < SPUIDefinitions.REQ_MIN_BROWSER_WIDTH) {
|
||||
width = SPUIDefinitions.REQ_MIN_BROWSER_WIDTH - newBrowserWidth;
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find extra width required to increase by all the components to utilize
|
||||
* the full width of browser for the responsive UI.
|
||||
*
|
||||
* @param newBrowserWidth
|
||||
* as current browser width.
|
||||
* @return extra width required to be increased.
|
||||
*/
|
||||
public static float findExtraWidth(final float newBrowserWidth) {
|
||||
return newBrowserWidth > SPUIDefinitions.REQ_MIN_BROWSER_WIDTH
|
||||
? (newBrowserWidth - SPUIDefinitions.REQ_MIN_BROWSER_WIDTH) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get target table width based on screen width.
|
||||
*
|
||||
* @param newBrowserWidth
|
||||
* new browser width.
|
||||
* @param minTargetTableLength
|
||||
* minimum target table width.
|
||||
* @param minDistTableLength
|
||||
* minimum distribution table width.
|
||||
* @return float as table width
|
||||
*/
|
||||
public static float getTargetTableWidth(final float newBrowserWidth, final float minTargetTableLength,
|
||||
final float minDistTableLength) {
|
||||
float width = 0;
|
||||
final float requiredExtraWidth = findRequiredExtraWidth(newBrowserWidth);
|
||||
// adjusting the target table width if distribution table width has
|
||||
// reached the maximum width
|
||||
if (requiredExtraWidth + minDistTableLength > SPUIDefinitions.MAX_DIST_TABLE_WIDTH) {
|
||||
width = requiredExtraWidth + minDistTableLength - SPUIDefinitions.MAX_DIST_TABLE_WIDTH;
|
||||
}
|
||||
if (width + minTargetTableLength + requiredExtraWidth > SPUIDefinitions.MAX_TARGET_TABLE_WIDTH) {
|
||||
return SPUIDefinitions.MAX_TARGET_TABLE_WIDTH;
|
||||
}
|
||||
return width + minTargetTableLength + requiredExtraWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get distribution table width based on screen width.
|
||||
*
|
||||
* @param newBrowserWidth
|
||||
* new browser width.
|
||||
* @param minTableWidth
|
||||
* min distribution table width.
|
||||
* @return float as distribution table width.
|
||||
*/
|
||||
public static float getDistTableWidth(final float newBrowserWidth, final float minTableWidth) {
|
||||
final float requiredExtraWidth = findExtraWidth(newBrowserWidth);
|
||||
float expectedDistWidth = minTableWidth;
|
||||
if (requiredExtraWidth > 0) {
|
||||
expectedDistWidth = expectedDistWidth + Math.round(requiredExtraWidth * 0.5F);
|
||||
}
|
||||
return expectedDistWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get software module table width.
|
||||
*
|
||||
* @param newBrowserWidth
|
||||
* @param minTableWidth
|
||||
* @return
|
||||
*/
|
||||
public static float getSoftwareModuleTableWidth(final float newBrowserWidth, final float minTableWidth) {
|
||||
final float requiredExtraWidth = findRequiredExtraWidth(newBrowserWidth);
|
||||
if (requiredExtraWidth + minTableWidth > SPUIDefinitions.MAX_UPLOAD_SW_MODULE_TABLE_WIDTH) {
|
||||
return SPUIDefinitions.MAX_UPLOAD_SW_MODULE_TABLE_WIDTH;
|
||||
}
|
||||
return requiredExtraWidth + minTableWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the prefix from text.
|
||||
*
|
||||
@@ -514,55 +345,6 @@ public final class HawkbitCommonUtil {
|
||||
return name + ":" + version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set height of artifact details table and drop area layout.
|
||||
*
|
||||
* @param dropLayout
|
||||
* drop area layout
|
||||
* @param artifactDetailsLayout
|
||||
* artifact details table
|
||||
* @param newHeight
|
||||
* new browser height
|
||||
*/
|
||||
public static void setArtifactDetailsLayoutHeight(final Component artifactDetailsLayout, final float newHeight) {
|
||||
final float extraBrowserHeight = HawkbitCommonUtil.findRequiredSwModuleExtraHeight(newHeight);
|
||||
final float tableHeight = SPUIDefinitions.MIN_UPLOAD_ARTIFACT_TABLE_HEIGHT + extraBrowserHeight;
|
||||
artifactDetailsLayout.setHeight(tableHeight, Unit.PIXELS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set height of artifact details table and drop area layout.
|
||||
*
|
||||
* @param artifactDetailsLayout
|
||||
* artifact details table
|
||||
* @param newHeight
|
||||
* new browser height
|
||||
*/
|
||||
public static void setManageDistArtifactDetailsLayoutHeight(final Component artifactDetailsLayout,
|
||||
final float newHeight) {
|
||||
final float tableHeight = SPUIDefinitions.MIN_TARGET_DIST_TABLE_HEIGHT
|
||||
+ HawkbitCommonUtil.findRequiredExtraHeight(newHeight) + 62;
|
||||
artifactDetailsLayout.setHeight(tableHeight, Unit.PIXELS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate check - Unique Key.
|
||||
*
|
||||
* @param name
|
||||
* as string
|
||||
* @param version
|
||||
* as string
|
||||
* @param type
|
||||
* key as string
|
||||
* @return boolean as flag
|
||||
*/
|
||||
public static boolean isDuplicate(final String name, final String version, final String type) {
|
||||
final SoftwareManagement swMgmtService = SpringContextHelper.getBean(SoftwareManagement.class);
|
||||
final SoftwareModule swModule = swMgmtService.findSoftwareModuleByNameAndVersion(name, version,
|
||||
swMgmtService.findSoftwareModuleTypeByName(type));
|
||||
return swModule != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new base software module.
|
||||
*
|
||||
@@ -593,15 +375,6 @@ public final class HawkbitCommonUtil {
|
||||
return newSWModule;
|
||||
}
|
||||
|
||||
public static void setTargetVisibleColumns(final Table targTable) {
|
||||
final List<Object> targColumnIds = new ArrayList<>();
|
||||
final List<String> targColumnLabels = new ArrayList<>();
|
||||
targColumnIds.add(SPUIDefinitions.TARGET_TABLE_VISIBILE_COLUMN_NAME);
|
||||
targColumnLabels.add(SPUIDefinitions.TARGET_TABLE_VISIBILE_COLUMN_NAME);
|
||||
targTable.setVisibleColumns(targColumnIds.toArray());
|
||||
targTable.setColumnHeaders(targColumnLabels.toArray(new String[0]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param distName
|
||||
* @param distVersion
|
||||
|
||||
@@ -41,30 +41,10 @@ public final class SPUIComponentIdProvider {
|
||||
* ID-SW.DEL.
|
||||
*/
|
||||
public static final String SW_DELETE_ALL = "swmodule.delete.all";
|
||||
/*
|
||||
* ID-Targ.Detail.icon.
|
||||
*/
|
||||
public static final String TARGET_DETAILS_ICON = "target.details.icon";
|
||||
/**
|
||||
* ID-Targ.Edit.icon.
|
||||
*/
|
||||
public static final String TARGET_EDIT_ICON = "target.edit.icon";
|
||||
/**
|
||||
* ID-Targ.Edit.Name.
|
||||
*/
|
||||
public static final String TARGET_EDIT_NAME = "target.edit.name";
|
||||
/**
|
||||
* ID-Targ.Edit.desc.
|
||||
*/
|
||||
public static final String TARGET_EDIT_DESC = "target.edit.desc";
|
||||
/**
|
||||
* ID-Targ.Edit.Save.
|
||||
*/
|
||||
public static final String TARGET_EDIT_SAVE = "target.edit.save";
|
||||
/**
|
||||
* PREFIX - JVM.
|
||||
*/
|
||||
public static final String TARGET_EDIT_DISCARD = "target.edit.discard";
|
||||
/**
|
||||
* ID-Targ.PIN.
|
||||
*/
|
||||
@@ -84,10 +64,6 @@ public final class SPUIComponentIdProvider {
|
||||
* ID-Dist.
|
||||
*/
|
||||
public static final String DIST_TABLE_ID = "dist.tableId";
|
||||
/**
|
||||
* ID-Dist.Add.
|
||||
*/
|
||||
public static final String DIST_ADD_ID = "dist.add.id";
|
||||
/**
|
||||
* ID-Dist.Name.
|
||||
*/
|
||||
@@ -104,58 +80,10 @@ public final class SPUIComponentIdProvider {
|
||||
* ID-Dist.desc.
|
||||
*/
|
||||
public static final String DIST_ADD_DESC = "dist.add.desc";
|
||||
/**
|
||||
* ID-Dist.JVM.
|
||||
*/
|
||||
public static final String DIST_ADD_MODULE = "dist.add.module.";
|
||||
/**
|
||||
* ID-Dist.JVM delete icon.
|
||||
*/
|
||||
public static final String DIST_DELETE_MODULE = "dist.delete.module.";
|
||||
/**
|
||||
* /** ID-Dist.DELETE.
|
||||
*/
|
||||
public static final String DIST_DELETE_ALL = "dist.delete.all";
|
||||
/**
|
||||
* ID-Dist.Detail.iocn.
|
||||
*/
|
||||
public static final String DIST_DETAILS_ICON = "dist.details.icon";
|
||||
/**
|
||||
* ID-Dist.Edit.icon.
|
||||
*/
|
||||
public static final String DIST_EDIT_ICON = "dist.edit.icon";
|
||||
/**
|
||||
* ID-Dist.Edit.name.
|
||||
*/
|
||||
public static final String DIST_EDIT_NAME = "dist.edit.name";
|
||||
/**
|
||||
* ID-Dist.Edit.ver.
|
||||
*/
|
||||
public static final String DIST_EDIT_VERSION = "dist.edit.version";
|
||||
/**
|
||||
* ID-Dist.Edit.desc.
|
||||
*/
|
||||
public static final String DIST_EDIT_DESC = "dist.edit.desc";
|
||||
/**
|
||||
* ID-Dist.Edit.JVM.
|
||||
*/
|
||||
public static final String DIST_EDIT_JVM = "dist.edit.jvm";
|
||||
/**
|
||||
* ID-Dist.Edit.AH.
|
||||
*/
|
||||
public static final String DIST_EDIT_AGENTHUB = "dist.edit.agenthub";
|
||||
/**
|
||||
* ID-Dist.Edit.os.
|
||||
*/
|
||||
public static final String DIST_EDIT_OS = "dist.edit.os";
|
||||
/**
|
||||
* ID-Dist.Edit.save.
|
||||
*/
|
||||
public static final String DIST_EDIT_SAVE = "dist.edit.save";
|
||||
/**
|
||||
* ID-Dist.Edit.Discard.
|
||||
*/
|
||||
public static final String DIST_EDIT_DISCARD = "dist.edit.discard";
|
||||
/**
|
||||
* ID-Dist.MigCheck.
|
||||
*/
|
||||
@@ -172,10 +100,6 @@ public final class SPUIComponentIdProvider {
|
||||
* ID - Dist.Add.
|
||||
*/
|
||||
public static final String DIST_ADD_ICON = "dist.add.icon";
|
||||
/**
|
||||
* ID - Dist jvm combo.
|
||||
*/
|
||||
public static final String DIST_MODULE_COMBO = "dist.module.combo.";
|
||||
/**
|
||||
* ID for Distribution Tag ComboBox
|
||||
*/
|
||||
@@ -198,25 +122,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String SOFT_MODULE_VENDOR = "soft.module.vendor";
|
||||
|
||||
/**
|
||||
* ID - "soft.module.save.
|
||||
*/
|
||||
public static final String SOFT_MODULE_SAVE = "soft.module.save";
|
||||
|
||||
/**
|
||||
* ID - soft.module.discar.
|
||||
*/
|
||||
public static final String SOFT_MODULE_DISCARD = "soft.module.discard";
|
||||
|
||||
/** DistributionSet Components Ids ends here **/
|
||||
/**
|
||||
* ID- Action popup.
|
||||
*/
|
||||
public static final String SAVE_ACTIONS_POPUP = "save.actions.popup";
|
||||
/**
|
||||
* ID- Delete SW Module Popup.
|
||||
*/
|
||||
public static final String DELETE_SW_MODULE_ACTIONS_POPUP = "delete.sw.module.actions.popup";
|
||||
/**
|
||||
* ID - Save Assign.
|
||||
*/
|
||||
@@ -284,11 +189,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String TARGET_DROP_FILTER_ICON = "target.drop.filter.icon";
|
||||
|
||||
/**
|
||||
* DROP filter icon id.
|
||||
*/
|
||||
public static final String DROP_FILTER_ICON = "drop.filter.icon";
|
||||
|
||||
/**
|
||||
* Pending action button id.
|
||||
*/
|
||||
@@ -354,18 +254,10 @@ public final class SPUIComponentIdProvider {
|
||||
* Upload - process button id.
|
||||
*/
|
||||
public static final String UPLOAD_PROCESS_BUTTON = "upload.process.button";
|
||||
/**
|
||||
* Software module No Action Button id.
|
||||
*/
|
||||
public static final String NO_ACTION_BUTTON = "no.action.button";
|
||||
/**
|
||||
* Upload - discard button id.
|
||||
*/
|
||||
public static final String UPLOAD_DISCARD_BUTTON = "upload.discard.button";
|
||||
/**
|
||||
* Upload - delete button id.
|
||||
*/
|
||||
public static final String UPLOAD_SOFTWARE_DELETE_BUTTON = "upload.software.delete.button";
|
||||
|
||||
/**
|
||||
* Upload - artifact detail close button.
|
||||
@@ -440,18 +332,10 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String ADD_SW_MODULE_DESCRIPTION = "sw.module.description";
|
||||
|
||||
/**
|
||||
* ID-Targ.Detail.icon.
|
||||
*/
|
||||
public static final String SW_TABLE_DETAILS_ICON = "swmodule.details.icon";
|
||||
/**
|
||||
* ID-Targ.Detail.icon.
|
||||
*/
|
||||
public static final String SW_TABLE_ATRTIFACT_DETAILS_ICON = "swmodule.artifact.details.icon";
|
||||
/**
|
||||
* ID-swModule.Edit.Button.
|
||||
*/
|
||||
public static final String SW_TABLE_EDIT_DETAILS = "swmodule.edit.details";
|
||||
|
||||
/**
|
||||
* Artifact upload - sw module edit button id.
|
||||
@@ -467,35 +351,16 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String UPLOAD_ARTIFACT_DETAILS_TABLE_MAX = "upload.artifactdetails.table.max";
|
||||
|
||||
/**
|
||||
* Target tag button layout id.
|
||||
*/
|
||||
public static final String TARGET_TAG_BUTTON_LAYOUT = "target.tag.button.layout";
|
||||
|
||||
/**
|
||||
* Target tag close button.
|
||||
*/
|
||||
public static final String HIDE_TARGET_TAGS = "hide.target.tags";
|
||||
|
||||
/**
|
||||
* Distribution Type tag close button.
|
||||
*/
|
||||
public static final String HIDE_DIST_TYPE_TAGS = "hide.dist.type.tags";
|
||||
|
||||
/**
|
||||
* Show target tag layout icon.
|
||||
*/
|
||||
public static final String SHOW_TARGET_TAGS = "show.target.tags.icon";
|
||||
|
||||
/**
|
||||
* Tag name combo box in target details layout.
|
||||
*/
|
||||
public static final String TARGET_TAG_COMBO = "target.tag.names";
|
||||
|
||||
/**
|
||||
* Target details - assign button.
|
||||
*/
|
||||
public static final String TARGET_TAG_ASSIGN = "target.tag.assign";
|
||||
/**
|
||||
* ID-Target tag table.
|
||||
*/
|
||||
@@ -548,11 +413,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String SYSTEM_CONFIGURATION_CANCEL = "system.configuration.cancel";
|
||||
|
||||
/**
|
||||
* Id of the anonymous download checkbox.
|
||||
*/
|
||||
public static final String SYSTEM_CONFIGURATION_ANONYMOUS_DOWNLOAD_CHECKBOX = "system.configuration.anonymous.download.checkbox";
|
||||
|
||||
/**
|
||||
* Id of maximize/minimize icon of table - Software module table.
|
||||
*/
|
||||
@@ -690,10 +550,6 @@ public final class SPUIComponentIdProvider {
|
||||
* Bulk target upload - tag field.
|
||||
*/
|
||||
public static final String BULK_UPLOAD_TAG = "bulkupload.tag";
|
||||
/**
|
||||
* Bulk target upload - upload button.
|
||||
*/
|
||||
public static final String BULK_UPLOAD_BUTTON = "bulkupload.upload.button";
|
||||
/**
|
||||
* Bulk target upload - count label.
|
||||
*/
|
||||
@@ -758,11 +614,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String BULK_UPLOAD_STATUS_BUTTON = "bulk.upload.notification.id";
|
||||
|
||||
/**
|
||||
* Target Filter Status button id.
|
||||
*/
|
||||
public static final String TARGET_FILTER_STATUS_BUTTON = "target.filter.status.button.id";
|
||||
|
||||
/**
|
||||
* Target bulk upload minimize button id.
|
||||
*/
|
||||
@@ -804,11 +655,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_TARGETS_LIST_GRID_ID = "rollout.group.targets.grid.id";
|
||||
|
||||
/**
|
||||
* Rollout delete button id.
|
||||
*/
|
||||
public static final String ROLLOUT_DELETE_ICON = "rollout.delete.button.id";
|
||||
|
||||
/**
|
||||
* Rollout text field name id.
|
||||
*/
|
||||
@@ -836,23 +682,6 @@ public final class SPUIComponentIdProvider {
|
||||
* Rollout description field id.
|
||||
*/
|
||||
public static final String ROLLOUT_DESCRIPTION_ID = "rollout.description.id";
|
||||
/**
|
||||
* Rollout create update window - save buttopn id.
|
||||
*/
|
||||
public static final String ROLLOUT_CREATE_UPDATE_SAVE_ID = "rollout.create.update.save.id";
|
||||
|
||||
/**
|
||||
* Rollout create update - discard button id.
|
||||
*/
|
||||
public static final String ROLLOUT_CREATE_UPDATE_DISCARD_ID = "rollout.create.update.discard.id";
|
||||
/**
|
||||
* Rollout name link id.
|
||||
*/
|
||||
public static final String ROLLOUT_NAME_LINK_ID = "rollout.name.link";
|
||||
/**
|
||||
* Rollout Group name link id.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_NAME_LINK_ID = "rollout.group.name.link";
|
||||
/**
|
||||
* Rollout target filter query combo id.
|
||||
*/
|
||||
@@ -878,10 +707,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String ROLLOUT_UPDATE_BUTTON_ID = ROLLOUT_ACTION_ID + ".11";
|
||||
|
||||
/**
|
||||
* Rollout save or start option group id.
|
||||
*/
|
||||
public static final String ROLLOUT_SAVESTARTOPTION_ID = "rollout.savestartoption.id";
|
||||
/**
|
||||
* Rollout status label id.
|
||||
*/
|
||||
@@ -906,18 +731,10 @@ public final class SPUIComponentIdProvider {
|
||||
* Rollout target view- close button id.
|
||||
*/
|
||||
public static final String ROLLOUT_TARGET_VIEW_CLOSE_BUTTON_ID = "rollout.group.target.close.id";
|
||||
/**
|
||||
* Rollout status progress bar id.
|
||||
*/
|
||||
public static final String ROLLOUT_PROGRESS_BAR = "rollout.status.progress.bar.id";
|
||||
/**
|
||||
* Rollout group header caption.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_HEADER_CAPTION = "rollout.group.header.caption";
|
||||
/**
|
||||
* Rollout group target header caption.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_TARGET_HEADER_CAPTION = "rollout.group.header.target.caption";
|
||||
/**
|
||||
* Rollout group close id.
|
||||
*/
|
||||
@@ -967,7 +784,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String SW_TABLE_MANAGE_METADATA_ID = "swtable.manage.metadata.id";
|
||||
|
||||
|
||||
/**
|
||||
* Metadata key id.
|
||||
*/
|
||||
@@ -977,15 +793,6 @@ public final class SPUIComponentIdProvider {
|
||||
* Metadata value id.
|
||||
*/
|
||||
public static final String METADATA_VALUE_ID = "metadata.value.id";
|
||||
/**
|
||||
* Metadata save id.
|
||||
*/
|
||||
public static final String METADTA_SAVE_ICON_ID = "metadata.save.icon.id";
|
||||
|
||||
/**
|
||||
* Metadata discard id.
|
||||
*/
|
||||
public static final String METADTA_DISCARD_ICON_ID = "metadata.discard.icon.id";
|
||||
|
||||
/**
|
||||
* Metadata add icon id.
|
||||
@@ -1026,11 +833,6 @@ public final class SPUIComponentIdProvider {
|
||||
*/
|
||||
public static final String SW_METADATA_DETAIL_LINK = "softwaremodule.metadata.detail.link";
|
||||
|
||||
/**
|
||||
* Table multiselect for selecting DistType
|
||||
*/
|
||||
public static final String SELECT_DIST_TYPE = "select-dist-type";
|
||||
|
||||
/**
|
||||
* /* Private Constructor.
|
||||
*/
|
||||
|
||||
@@ -16,11 +16,6 @@ import org.springframework.data.domain.Sort.Direction;
|
||||
|
||||
/**
|
||||
* Class to provide the unchanged constants.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class SPUIDefinitions {
|
||||
/**
|
||||
@@ -46,11 +41,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final int DIST_TYPE_SIZE = 8;
|
||||
|
||||
/**
|
||||
* Target and Distribution set table size.
|
||||
*/
|
||||
public static final int TABLE_MIN_LENGTH = 3;
|
||||
|
||||
/**
|
||||
* Action history active column.
|
||||
*/
|
||||
@@ -133,154 +123,10 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String SCHEDULED = "scheduled";
|
||||
|
||||
/**
|
||||
* Action history lazy fetch page length.
|
||||
*/
|
||||
public static final int PAGE_LEN_ACTION_HISTORY = 5;
|
||||
|
||||
/**
|
||||
* Action history lazy fetch page length in popup.
|
||||
*/
|
||||
public static final int PAGE_LEN_ACTION_HISTORY_IN_POPUP = 4;
|
||||
|
||||
/**
|
||||
* Action history messages page length in the popup.
|
||||
*/
|
||||
public static final int PAGE_LEN_MSGS_IN_ACTION_HISTORY = 3;
|
||||
|
||||
/**
|
||||
* Target filter box style.
|
||||
*/
|
||||
public static final String TARGET_FILTER_TEXTFIELD_STYLE = "target-filter-box target-filter-box-hide";
|
||||
|
||||
/**
|
||||
* Distribution filter box style.
|
||||
*/
|
||||
public static final String DISTRIBUTION_FILTER_TEXTFIELD_STYLE = "dist-filter-box dist-filter-box-hide";
|
||||
|
||||
public static final String TARGET_TAG_BUTTON = "Target Tag";
|
||||
|
||||
public static final String DISTRIBUTION_TAG_BUTTON = "Distribution Tag";
|
||||
|
||||
public static final String SOFTWARE_MODULE_TYPE_BUTTON = "SoftwareModule Type";
|
||||
|
||||
public static final String DISTRIBUTION_SET_TYPE_BUTTON = "DistributionSet Type";
|
||||
/**
|
||||
* New jvm name field id.
|
||||
*/
|
||||
public static final String NEW_JVM_NAME = "NewJvmName";
|
||||
/**
|
||||
* New jvm version field id.
|
||||
*/
|
||||
public static final String NEW_JVM_VERSION = "NewJvmVersion";
|
||||
/**
|
||||
* New JVM vendor name field id.
|
||||
*/
|
||||
public static final String NEW_JVM_VENDOR_NAME = "NewVendorName";
|
||||
/**
|
||||
* save new jvm icon id.
|
||||
*/
|
||||
public static final String SAVE_NEW_JVM = "SaveNewJvm";
|
||||
/**
|
||||
* dicard new jvm icon id.
|
||||
*/
|
||||
public static final String DISCARD_NEW_JVM = "DiscardNewJvm";
|
||||
/**
|
||||
* New agent hub name field id.
|
||||
*/
|
||||
public static final String NEW_AGENT_HUB_NAME = "NewAgentHubName";
|
||||
/**
|
||||
* New agent hub version field id.
|
||||
*/
|
||||
public static final String NEW_AGENT_HUB_VERSION = "NewAgentHubVersion";
|
||||
/**
|
||||
* New agent hub vendor field id.
|
||||
*/
|
||||
public static final String NEW_AGENT_HUB_VENDOR = "NewAgentHubVendorName";
|
||||
/**
|
||||
* Save agent hub icon id.
|
||||
*/
|
||||
public static final String NEW_AGENT_HUB_SAVE = "SaveNewAgentHub";
|
||||
/**
|
||||
* Discard agent hub icon id.
|
||||
*/
|
||||
public static final String NEW_AGENT_HUB_DISCARD = "DiscardNewAgentHub";
|
||||
/**
|
||||
* New OS name field id.
|
||||
*/
|
||||
public static final String NEW_OS_NAME = "NewOSName";
|
||||
/**
|
||||
* New OS version field id.
|
||||
*/
|
||||
public static final String NEW_OS_VERSION = "NewOSVersion";
|
||||
/**
|
||||
* New OS vendor field id.
|
||||
*/
|
||||
public static final String NEW_OS_VENDOR = "NewOSVendorName";
|
||||
/**
|
||||
* New OS save icon id.
|
||||
*/
|
||||
public static final String NEW_OS_SAVE = "SaveNewOS";
|
||||
/**
|
||||
* New OS discard icon id.
|
||||
*/
|
||||
public static final String NEW_OS_DISCARD = "DiscardNewOS";
|
||||
/**
|
||||
* New distribution set name field id.
|
||||
*/
|
||||
public static final String NEW_DIST_NAME = "NewDistributionName";
|
||||
/**
|
||||
* New distribution set version field id.
|
||||
*/
|
||||
public static final String NEW_DIST_VERSION = "NewDistributionVersion";
|
||||
/**
|
||||
* New distribution set description field id.
|
||||
*/
|
||||
public static final String NEW_DIST_DESCRIPTION = "NewDistributionDescription";
|
||||
/**
|
||||
* New distribution set JVM combo-box id.
|
||||
*/
|
||||
public static final String NEW_DIST_JVM_COMBO = "NewDistributionJvmCombo";
|
||||
/**
|
||||
* New distribution set Agent hub combo-box id.
|
||||
*/
|
||||
public static final String NEW_DIST_AGENT_HUB_COMBO = "NewDistributionAgentHubCombo";
|
||||
/**
|
||||
* New distribution set OS combo-box id.
|
||||
*/
|
||||
public static final String NEW_DIST_OS_COMBO = "NewDistributionOSCombo";
|
||||
/**
|
||||
* New distribution set save icon id.
|
||||
*/
|
||||
public static final String NEW_DIST_SAVE = "NewDistributionSave";
|
||||
/**
|
||||
* New distribution set discard icon id.
|
||||
*/
|
||||
public static final String NEW_DIST_DISCARD = "NewDistributionSave";
|
||||
/**
|
||||
* New Target controller id field id.
|
||||
*/
|
||||
public static final String NEW_TARGET_CONTOLLERID = "NewTargetControlerId";
|
||||
/**
|
||||
* New Target name field id.
|
||||
*/
|
||||
public static final String NEW_TARGET_NAME = "NewTargetName";
|
||||
/**
|
||||
* New Target description field id.
|
||||
*/
|
||||
public static final String NEW_TARGET_DESC = "NewTargetDescription";
|
||||
/**
|
||||
* New Target save icon id.
|
||||
*/
|
||||
public static final String NEW_TARGET_SAVE = "target.add.save";
|
||||
/**
|
||||
* New Target add icon id.
|
||||
*/
|
||||
public static final String NEW_TARGET_ADD_ICON = "NewTargetAddIcon";
|
||||
/**
|
||||
* New distribution set add icon id.
|
||||
*/
|
||||
public static final String NEW_DIST_ADD_ICON = "NewDistAddIcon";
|
||||
/**
|
||||
* New Target tag name field id.
|
||||
*/
|
||||
@@ -310,15 +156,6 @@ public final class SPUIDefinitions {
|
||||
* Assign option group id(Firmware/Software).
|
||||
*/
|
||||
public static final String ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID = "assign.option.group.soft.module.type.id";
|
||||
/**
|
||||
* SW Module Source Table ID.
|
||||
*/
|
||||
public static final String SW_MODULE_TYPE_SOURCE_TABLE_ID = "sw.module.type.source.tab.id";
|
||||
|
||||
/**
|
||||
* SW Module target Table ID.
|
||||
*/
|
||||
public static final String SW_MODULE_TYPE_TARGET_TABLE_ID = "sw.module.type.target.tab.id";
|
||||
|
||||
/**
|
||||
* New Software Module desc field id.
|
||||
@@ -346,18 +183,6 @@ public final class SPUIDefinitions {
|
||||
* New Target tag desc field id.
|
||||
*/
|
||||
public static final String NEW_TARGET_TAG_DESC = "target.tag.add.desc";
|
||||
/**
|
||||
* New Target tag color lable id.
|
||||
*/
|
||||
public static final String NEW_TARGET_TAG_COLOR = "target.tag.add.color";
|
||||
/**
|
||||
* New Target tag add icon id.
|
||||
*/
|
||||
public static final String ADD_TARGET_TAG = "target.tag.add";
|
||||
/**
|
||||
* New distribution set tag add icon id.
|
||||
*/
|
||||
public static final String ADD_DISTRIBUTION_TAG = "distribution.tag.add";
|
||||
/**
|
||||
* New distribution Type set tag add icon id.
|
||||
*/
|
||||
@@ -366,23 +191,6 @@ public final class SPUIDefinitions {
|
||||
* New software module set type add icon id.
|
||||
*/
|
||||
public static final String ADD_SOFTWARE_MODULE_TYPE = "softwaremodule.type.add";
|
||||
|
||||
/**
|
||||
* New distribution set tag name field id.
|
||||
*/
|
||||
public static final String NEW_DISTRIBUTION_TAG_NAME = "distribution.add.tag.name";
|
||||
/**
|
||||
* New distribution set tag color lable id.
|
||||
*/
|
||||
public static final String NEW_DISTRIBUTION_TAG_COLOR = "NewDistributionTagColor";
|
||||
/**
|
||||
* New distribution set tag save icon id.
|
||||
*/
|
||||
public static final String NEW_DISTRIBUTION_TAG_SAVE = "distribution.tag.save";
|
||||
/**
|
||||
* New distribution set tag discard icon id.
|
||||
*/
|
||||
public static final String NEW_DISTRIBUTION_TAG_DISRACD = "NewDistributionTagDiscard";
|
||||
/**
|
||||
* No data.
|
||||
*/
|
||||
@@ -426,35 +234,11 @@ public final class SPUIDefinitions {
|
||||
* Filter by text key.
|
||||
*/
|
||||
public static final String FILTER_BY_TEXT = "FilterByText";
|
||||
/**
|
||||
* Visible column name of target table.
|
||||
*/
|
||||
public static final String TARGET_TABLE_VISIBILE_COLUMN_NAME = "nameDescLabel";
|
||||
/**
|
||||
* Visible column name of distribution table.
|
||||
*/
|
||||
public static final String DISTRIBUTION_TABLE_VISIBILE_COLUMN_NAME = "nameDescLabel";
|
||||
|
||||
/**
|
||||
* Text area style.
|
||||
*/
|
||||
public static final String TEXT_AREA_STYLE = "text-style text-area-style";
|
||||
|
||||
/**
|
||||
* Combo box style.
|
||||
*/
|
||||
public static final String COMBO_BOX_STYLE = "combo-box-style text-field-spacing";
|
||||
|
||||
/**
|
||||
* Text field style.
|
||||
*/
|
||||
public static final String TEXT_STYLE = "text-style";
|
||||
|
||||
/**
|
||||
* Message to be displayed when no data available for chosen filter.
|
||||
*/
|
||||
public static final String NO_DATA_MSG = "No data available for chosen filter";
|
||||
|
||||
/**
|
||||
* Style to highlight row in orange color.
|
||||
*/
|
||||
@@ -465,16 +249,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String HIGHTLIGHT_GREEN = "highlight-green";
|
||||
|
||||
/**
|
||||
* Action window show style.
|
||||
*/
|
||||
public static final String ACTION_WINDOW_SHOW_STYLE = "action-window" + " " + "action-window-show";
|
||||
|
||||
/**
|
||||
* Action window hide style.
|
||||
*/
|
||||
public static final String ACTION_WINDOW_HIDE_STYLE = "action-window" + " " + "action-window-hide";
|
||||
|
||||
/**
|
||||
* The Combo box specific style for Distribution set.
|
||||
*/
|
||||
@@ -488,33 +262,11 @@ public final class SPUIDefinitions {
|
||||
/**
|
||||
* Target and distribution column width in save popup window.
|
||||
*/
|
||||
public static final float TARGET_DISTRIBUTION_COLUMN_WIDTH = 2.8f;
|
||||
public static final float TARGET_DISTRIBUTION_COLUMN_WIDTH = 2.8F;
|
||||
/**
|
||||
* Discard column width in save window popup.
|
||||
*/
|
||||
public static final float DISCARD_COLUMN_WIDTH = 1.2f;
|
||||
/**
|
||||
* message hint text layout.
|
||||
*/
|
||||
public static final String MESSAGE_HINT_TEXT_LAYOUT = "message-hint-text-layout";
|
||||
|
||||
/**
|
||||
* Message hint bottom layout.
|
||||
*/
|
||||
public static final String MESSAGE_HINT_BOTTOM_LAYOUT = "message-hint-bottom-layout";
|
||||
|
||||
/**
|
||||
* The Target Tag edit icon id.
|
||||
*/
|
||||
public static final String EDIT_TARGET_TAG = "target.tag.edit";
|
||||
/**
|
||||
* The Dist Tag edit icon id.
|
||||
*/
|
||||
public static final String EDIT_DISTRIBUTION_TAG = "dist.tag.edit";
|
||||
/**
|
||||
* Target Tag color picker style.
|
||||
*/
|
||||
public static final String TARGET_COLOR_PICKER_STYLE = "target-color-picker-style";
|
||||
public static final float DISCARD_COLUMN_WIDTH = 1.2F;
|
||||
/**
|
||||
* Target tag name.
|
||||
*/
|
||||
@@ -551,11 +303,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String TYPE_KEY = "type-key";
|
||||
|
||||
/**
|
||||
* Type combo style.
|
||||
*/
|
||||
public static final String TYPE_COMBO_STYLE = "type-combo-specific-style";
|
||||
|
||||
/**
|
||||
* Tag combo style.
|
||||
*/
|
||||
@@ -565,53 +312,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String COLOR_LABEL_STYLE = "color-label-style";
|
||||
|
||||
/**
|
||||
* Text area of tag description style.
|
||||
*/
|
||||
public static final String TARGET_TAG_TEXT_AREA_STYLE = "target-tag-desc";
|
||||
|
||||
/**
|
||||
* Distribution table.
|
||||
*/
|
||||
public static final String DISTRIBUTION_TABLE = "dist-table";
|
||||
|
||||
/**
|
||||
* Target tag.
|
||||
*/
|
||||
public static final String TARGET_TAG = "target-tag";
|
||||
/**
|
||||
* Distribution tag.
|
||||
*/
|
||||
public static final String DIST_TAG = "dist-tag";
|
||||
|
||||
/**
|
||||
* Minimum height for the target tags layout. In case browser height is less
|
||||
* than this height, the vertical scroll bars get displayed. Used for
|
||||
* Responsive UI.
|
||||
*/
|
||||
public static final int MIN_TARGET_TAGS_HEIGHT = 39;
|
||||
|
||||
/**
|
||||
* Minimum height for the distribution type tags layout. In case browser
|
||||
* height is less than this height, the vertical scroll bars get displayed.
|
||||
* Used for Responsive UI.
|
||||
*/
|
||||
public static final int MIN_DISTRIBUTION_TYPE_TAGS_HEIGHT = 39;
|
||||
|
||||
/**
|
||||
* Minimum height for the distribution tags layout. In case browser height
|
||||
* is less than this height, the vertical scroll bars get displayed. Used
|
||||
* for Responsive UI.
|
||||
*/
|
||||
public static final int MIN_DIST_TAGS_HEIGHT = 109;
|
||||
|
||||
/**
|
||||
* Minimum height required for target or distribution table with minimum
|
||||
* records. This is calculated as ( no. of min rows * height of each row ).
|
||||
* Used for Responsive UI.
|
||||
*/
|
||||
public static final int MIN_TARGET_DIST_TABLE_HEIGHT = TABLE_MIN_LENGTH * 37 - 42;
|
||||
|
||||
/**
|
||||
* Minimum width required to show tags for both target and distribution
|
||||
* table without horizontal scroll. In case browser width is less than this
|
||||
@@ -620,59 +320,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final int REQ_MIN_BROWSER_WIDTH = 1200;
|
||||
|
||||
public static final int REQ_MIN_BROWSER_WIDTH_UPLOAD = 1200;
|
||||
|
||||
public static final int REQ_MIN_BROWSER_WIDTH_DIST = 1300;
|
||||
|
||||
/**
|
||||
* Target table maximum width.
|
||||
*/
|
||||
public static final int MAX_TARGET_TABLE_WIDTH = 700;
|
||||
|
||||
/**
|
||||
* Distribution table maximum width.
|
||||
*/
|
||||
public static final int MAX_DIST_TABLE_WIDTH = 425;
|
||||
|
||||
/**
|
||||
* Details layout- initial margin left value.
|
||||
*/
|
||||
public static final int DETAILS_MARGIN_LEFT = 275;
|
||||
|
||||
/**
|
||||
* Distributions table details layout- initial margin left value.
|
||||
*/
|
||||
public static final int DIST_TABALE_DETAILS_MARGIN_LEFT = 288;
|
||||
/**
|
||||
* Minimum height required to show the application without need of vertical
|
||||
* scroll. In case browser height is more than this height, the vertical
|
||||
* scroll bars get displayed. Used for Responsive UI.
|
||||
*/
|
||||
public static final int REQ_MIN_BROWSER_HEIGHT = 350;
|
||||
|
||||
public static final int MIN_TABLE_WIDTH = 300;
|
||||
|
||||
/**
|
||||
* Minimum width required to display action history.
|
||||
*/
|
||||
public static final int ACTION_HISTORY_MIN_REQ_WIDTH = 500;
|
||||
|
||||
/**
|
||||
* Minimum height required to display action history (5 rows minimum).
|
||||
*/
|
||||
public static final int ACTION_HISTORY_MIN_REQ_HEIGHT = 130;
|
||||
|
||||
/**
|
||||
* Position of the action history from top.
|
||||
*/
|
||||
public static final int ACTION_HISTORY_POSITION_Y = 160;
|
||||
|
||||
/**
|
||||
* The total amount of space ( top & bottom ) the action history to
|
||||
* maintain.
|
||||
*/
|
||||
public static final int ACTION_HISTORY_LEFTOVER_HEIGHT = 420;
|
||||
|
||||
/**
|
||||
* Target tag button id prefix.
|
||||
*/
|
||||
@@ -682,6 +329,11 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String DISTRIBUTION_TAG_ID_PREFIXS = "dist.tag.";
|
||||
|
||||
/**
|
||||
* Space.
|
||||
*/
|
||||
public static final String SPACE = " ";
|
||||
|
||||
/**
|
||||
* Distribution tag button id prefix.
|
||||
*/
|
||||
@@ -695,19 +347,10 @@ public final class SPUIDefinitions {
|
||||
* DistributionSet Type tag button id prefix.
|
||||
*/
|
||||
public static final String DISTRIBUTION_SET_TYPE_ID_PREFIXS = "dist.set.type.";
|
||||
/**
|
||||
* Target/distribution description length.
|
||||
*/
|
||||
public static final int NAME_DESCRIPTION_LENGTH = 26;
|
||||
/**
|
||||
* Target last query date format .
|
||||
*/
|
||||
public static final String LAST_QUERY_DATE_FORMAT = "EEE MMM d HH:mm:ss z yyyy";
|
||||
|
||||
/**
|
||||
* Space.
|
||||
*/
|
||||
public static final String SPACE = " ";
|
||||
/**
|
||||
* Item Id used in drop comparisons.
|
||||
*/
|
||||
@@ -716,22 +359,10 @@ public final class SPUIDefinitions {
|
||||
* Expand action history.
|
||||
*/
|
||||
public static final String EXPAND_ACTION_HISTORY = "expand.action.history";
|
||||
/**
|
||||
* Close action history.
|
||||
*/
|
||||
public static final String CLOSE_ACTION_HISTORY = "close.action.history";
|
||||
/**
|
||||
* Filter by distribution key.
|
||||
*/
|
||||
public static final String ORDER_BY_DISTRIBUTION = "OrderByDistribution";
|
||||
/**
|
||||
* Dist window width.
|
||||
*/
|
||||
public static final int DIST_WINDOW_WIDTH = 235;
|
||||
/**
|
||||
* Dist window height.
|
||||
*/
|
||||
public static final int DIST_WINDOW_HEIGHT = 380;
|
||||
|
||||
/** Artifact upload related entries - start **/
|
||||
/**
|
||||
@@ -744,13 +375,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String BY_SOFTWARE_MODULE_TYPE = "softwareModuleType";
|
||||
|
||||
/**
|
||||
* Minimum height required to show the application without need of vertical
|
||||
* scroll. In case browser height is more than this height, the vertical
|
||||
* scroll bars get displayed. Used for Responsive UI.
|
||||
*/
|
||||
public static final int REQ_MIN_UPLOAD_BROWSER_HEIGHT = 380;
|
||||
|
||||
/**
|
||||
* Minimum width required to display ui without horizontal scroll. In case
|
||||
* browser width is less than this width, the type layout will get hidden
|
||||
@@ -759,45 +383,13 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final int REQ_MIN_UPLOAD_BROWSER_WIDTH = 1250;
|
||||
|
||||
/**
|
||||
* Minimum width of software module table.
|
||||
*/
|
||||
public static final int MIN_SOFTWARE_MODULE_TABLE_WIDTH = 300;
|
||||
|
||||
/**
|
||||
* Maximum allowed width of software module table.
|
||||
*/
|
||||
public static final int MAX_UPLOAD_SW_MODULE_TABLE_WIDTH = 450;
|
||||
|
||||
/**
|
||||
* Minimum artifact table height.
|
||||
*/
|
||||
public static final int MIN_UPLOAD_ARTIFACT_TABLE_HEIGHT = 168;
|
||||
|
||||
/**
|
||||
* Maximum artifact table height.
|
||||
*/
|
||||
public static final int MAX_UPLOAD_ARTIFACT_TABLE_HEIGHT = 450;
|
||||
|
||||
/**
|
||||
* Maximum drop layout width.
|
||||
*/
|
||||
public static final int MAX_UPLOAD_DROP_LAYOUT_WIDTH = 650;
|
||||
|
||||
/**
|
||||
* Minimum drop layout width.
|
||||
*/
|
||||
public static final int MIN_UPLOAD_DROP_LAYOUT_WIDTH = 450;
|
||||
|
||||
public static final int MIN_UPLOAD_CONFIRMATION_POPUP_WIDTH = 1000;
|
||||
|
||||
public static final int MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH = 1050;
|
||||
|
||||
public static final int MIN_UPLOAD_CONFIRMATION_POPUP_HEIGHT = 310;
|
||||
|
||||
public static final int MAX_UPLOAD_CONFIRMATION_POPUP_HEIGHT = 360;
|
||||
public static final int MAX_UPLOAD_CONFIRMATION_POPUP_WIDTH = 1050;
|
||||
|
||||
public static final String SOFTWARE_MODULE_TABLE = "software-module-table";
|
||||
public static final int MAX_UPLOAD_CONFIRMATION_POPUP_HEIGHT = 360;
|
||||
|
||||
/** Artifact upload related entries - end. **/
|
||||
|
||||
@@ -805,42 +397,17 @@ public final class SPUIDefinitions {
|
||||
|
||||
public static final int MIN_DASHBOARD_WIDTH = 1100;
|
||||
|
||||
public static final int TAG_LAYOUT_WIDTH = 160;
|
||||
|
||||
public static final int MIN_SWMODULE_TABLE_HEIGHT = 160;
|
||||
|
||||
public static final int MIN_SWMODULE_TABLE_WIDTH = 150;
|
||||
|
||||
/* Target Header Filter Box */
|
||||
public static final String FILTER_BOX_SHOW = "filter-box-show";
|
||||
public static final String FILTER_BOX_HIDE = "filter-box-hide";
|
||||
public static final String FILTER_RESET_ICON = "filter-reset-icon";
|
||||
|
||||
/* Action History */
|
||||
public static final String CAPTION_ACTION_HISTORY = "caption.action.history";
|
||||
public static final String DISABLE_DISTRIBUTION = "incomplete-distribution";
|
||||
|
||||
public static final int MIN_SWTABLE_WIDTH = 448;
|
||||
|
||||
/**
|
||||
* New Target tag save icon id.
|
||||
*/
|
||||
public static final String NEW_SW_TYPE_SAVE = "swmodule.type.add.save";
|
||||
|
||||
/**
|
||||
* New DistributionSet type save icon id.
|
||||
*/
|
||||
public static final String NEW_DIST_SET_TYPE_SAVE = "dist.set.type.add.save";
|
||||
|
||||
/**
|
||||
* New distribution set type close icon id.
|
||||
*/
|
||||
public static final String NEW_DIST_SET_TYPE_COLSE = "dist.set.type.add.close";
|
||||
|
||||
/**
|
||||
* Filter by type layout width.
|
||||
*/
|
||||
public static final float FILTER_BY_TYPE_WIDTH = 150.0f;
|
||||
public static final float FILTER_BY_TYPE_WIDTH = 150.0F;
|
||||
|
||||
/**
|
||||
* Confirmation jukebox type.
|
||||
@@ -859,22 +426,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final int MAX_TABLE_ENTRIES = 5000;
|
||||
|
||||
/**
|
||||
* New software module set type add icon id.
|
||||
*/
|
||||
public static final String CONFIG_FILTER_BUTTON = "config.filter.button";
|
||||
|
||||
/**
|
||||
* label style name for assigned sw modules.
|
||||
*/
|
||||
|
||||
public static final String ASSIGN_SW_MODUE_STYLE = "assignlabelstyle";
|
||||
|
||||
/**
|
||||
* Software module add/update window height.
|
||||
*/
|
||||
public static final int SW_ADD_UPDATE_WINDOW_HEIGHT = 350;
|
||||
|
||||
/**
|
||||
* Distribution Type Twin Table selected table Id.
|
||||
*/
|
||||
@@ -910,46 +461,16 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String CUSTOM_FILTER_DELETE = "Delete";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_INSTALLED_DS.
|
||||
*/
|
||||
public static final String CUSTOM_FILTER_INSTALLED_DS = "Installed DS";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_ASSIGNED_DS.
|
||||
*/
|
||||
public static final String CUSTOM_FILTER_ASSIGNED_DS = "Assigned DS";
|
||||
|
||||
/**
|
||||
* TARGET_FILTER_MANAGEMENT - header caption .
|
||||
*/
|
||||
public static final String TARGET_FILTER_LIST_HEADER_CAPTION = "Custom Filters";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_STATUS.
|
||||
*/
|
||||
public static final String TARGET_FILTER_STATUS = "Status";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_INSTALLED_DS.
|
||||
*/
|
||||
public static final String TARGET_FILTER_TAGS = "TAGS";
|
||||
|
||||
/**
|
||||
* CUSTOM_FILTER_ID_HIDDEN.
|
||||
*/
|
||||
public static final String CUSTOM_FILTER_ID_HIDDEN = "id";
|
||||
|
||||
/**
|
||||
* Bulk upload DS combo style.
|
||||
*/
|
||||
public static final String BULK_UPLOD_DS_COMBO_STYLE = "bulk-upload-ds-combo";
|
||||
|
||||
/**
|
||||
* Bulk Targets upload window.
|
||||
*/
|
||||
public static final String BULK_UPLOAD_WINDOW = "bulk-update-window";
|
||||
|
||||
/**
|
||||
* Filter by target filter query.
|
||||
*/
|
||||
@@ -970,60 +491,6 @@ public final class SPUIDefinitions {
|
||||
*/
|
||||
public static final String ROLLOUT_LIST_HEADER_CAPTION = "Rollouts";
|
||||
|
||||
/**
|
||||
* Rollout status.
|
||||
*/
|
||||
public static final String ROLLOUT_STATUS = "rollout-status";
|
||||
|
||||
/**
|
||||
* Rollout group list view - header caption .
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_LIST_HEADER_CAPTION = "Rollout Groups";
|
||||
|
||||
/**
|
||||
* Rollout delete - column property name.
|
||||
*/
|
||||
public static final String DELETE = "delete";
|
||||
|
||||
/**
|
||||
* Rollout detail status - column property status.
|
||||
*/
|
||||
public static final String DETAIL_STATUS = "detail-status";
|
||||
|
||||
/**
|
||||
* Rollout name column property.
|
||||
*/
|
||||
public static final String ROLLOUT_NAME = "rollout-name";
|
||||
/**
|
||||
* Rollout group name column property.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_NAME = "Name";
|
||||
|
||||
/**
|
||||
* Rollout group started date column property.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_STARTED_DATE = "Started date";
|
||||
|
||||
/**
|
||||
* Rollout group status column property.
|
||||
*/
|
||||
public static final String ROLLOUT_GROUP_STATUS = "Status";
|
||||
|
||||
/**
|
||||
* Rollout action column property.
|
||||
*/
|
||||
public static final String ROLLOUT_ACTION = "rollout-action";
|
||||
|
||||
/**
|
||||
* DistributionSet Metadata tab Id
|
||||
*/
|
||||
public static final String DISTRIBUTIONSET_METADATA_TAB_ID = "distSet.metadata.tab.id";
|
||||
|
||||
/**
|
||||
* SoftwareModule Metadata tab Id
|
||||
*/
|
||||
public static final String SOFTWAREMODULE_METADATA_TAB_ID = "swModule.metadata.tab.id";
|
||||
|
||||
/**
|
||||
* /** Constructor.
|
||||
*/
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -96,7 +96,7 @@
|
||||
<org.powermock.version>1.5.4</org.powermock.version>
|
||||
<pl.pragmatists.version>1.0.2</pl.pragmatists.version>
|
||||
<guava.version>19.0</guava.version>
|
||||
<mariadb-java-client.version>1.4.3</mariadb-java-client.version>
|
||||
<mariadb-java-client.version>1.5.2</mariadb-java-client.version>
|
||||
<embedded-mongo.version>1.50.5</embedded-mongo.version>
|
||||
<javax.el-api.version>2.2.4</javax.el-api.version>
|
||||
<corn-cps.version>1.1.7</corn-cps.version>
|
||||
|
||||
Reference in New Issue
Block a user