Rename Ddi classes
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -10,7 +10,7 @@ package org.eclipse.hawkbit.app;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.RepositoryApplicationConfiguration;
|
import org.eclipse.hawkbit.RepositoryApplicationConfiguration;
|
||||||
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
|
import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration;
|
||||||
import org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi;
|
import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi;
|
||||||
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
|
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@@ -25,7 +25,7 @@ import org.springframework.context.annotation.Import;
|
|||||||
@Import({ RepositoryApplicationConfiguration.class })
|
@Import({ RepositoryApplicationConfiguration.class })
|
||||||
@EnableHawkbitManagedSecurityConfiguration
|
@EnableHawkbitManagedSecurityConfiguration
|
||||||
@EnableRestResources
|
@EnableRestResources
|
||||||
@EnableDirectDeviceApi
|
@EnableDdiApi
|
||||||
public class Start {
|
public class Start {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.autoconfigure.web;
|
package org.eclipse.hawkbit.autoconfigure.web;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi;
|
import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi;
|
||||||
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
|
import org.eclipse.hawkbit.rest.resource.EnableRestResources;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -21,8 +21,8 @@ import org.springframework.context.annotation.Import;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnClass({ EnableDirectDeviceApi.class, EnableRestResources.class })
|
@ConditionalOnClass({ EnableDdiApi.class, EnableRestResources.class })
|
||||||
@Import({ EnableDirectDeviceApi.class, EnableRestResources.class })
|
@Import({ EnableDdiApi.class, EnableRestResources.class })
|
||||||
public class ResourceControllerAutoConfiguration {
|
public class ResourceControllerAutoConfiguration {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||||
|
*
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*/
|
||||||
|
package org.eclipse.hawkbit.ddi.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Annotation to enable {@link ComponentScan} in the resource package to setup
|
||||||
|
* all {@link Controller} annotated classes and setup the Direct Device API.
|
||||||
|
*/
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
public @interface EnableDdiApi {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -35,12 +35,12 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class ActionFeedback {
|
public class DdiActionFeedback {
|
||||||
private final Long id;
|
private final Long id;
|
||||||
private final String time;
|
private final String time;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final Status status;
|
private final DdiStatus status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -53,8 +53,8 @@ public class ActionFeedback {
|
|||||||
* is the feedback itself
|
* is the feedback itself
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public ActionFeedback(@JsonProperty("id") final Long id, @JsonProperty("time") final String time,
|
public DdiActionFeedback(@JsonProperty("id") final Long id, @JsonProperty("time") final String time,
|
||||||
@JsonProperty("status") final Status status) {
|
@JsonProperty("status") final DdiStatus status) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.status = status;
|
this.status = status;
|
||||||
@@ -68,7 +68,7 @@ public class ActionFeedback {
|
|||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Status getStatus() {
|
public DdiStatus getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -16,9 +16,9 @@ import org.springframework.hateoas.ResourceSupport;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download information for all artifacts related to a specific {@link Chunk}.
|
* Download information for all artifacts related to a specific {@link DdiChunk}.
|
||||||
*/
|
*/
|
||||||
public class Artifact extends ResourceSupport {
|
public class DdiArtifact extends ResourceSupport {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@@ -6,19 +6,19 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel action to be provided to the target.
|
* Cancel action to be provided to the target.
|
||||||
*/
|
*/
|
||||||
public class Cancel {
|
public class DdiCancel {
|
||||||
|
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final CancelActionToStop cancelAction;
|
private final DdiCancelActionToStop cancelAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parameterized constructor.
|
* Parameterized constructor.
|
||||||
@@ -28,7 +28,7 @@ public class Cancel {
|
|||||||
* @param cancelAction
|
* @param cancelAction
|
||||||
* the action
|
* the action
|
||||||
*/
|
*/
|
||||||
public Cancel(final String id, final CancelActionToStop cancelAction) {
|
public DdiCancel(final String id, final DdiCancelActionToStop cancelAction) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.cancelAction = cancelAction;
|
this.cancelAction = cancelAction;
|
||||||
@@ -38,7 +38,7 @@ public class Cancel {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CancelActionToStop getCancelAction() {
|
public DdiCancelActionToStop getCancelAction() {
|
||||||
return cancelAction;
|
return cancelAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,14 +6,14 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link Action} that has to be stopped by the target.
|
* The {@link Action} that has to be stopped by the target.
|
||||||
*/
|
*/
|
||||||
public class CancelActionToStop {
|
public class DdiCancelActionToStop {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final String stopId;
|
private final String stopId;
|
||||||
@@ -24,7 +24,7 @@ public class CancelActionToStop {
|
|||||||
* @param stopId
|
* @param stopId
|
||||||
* ID of the {@link Action} to be stoppedW
|
* ID of the {@link Action} to be stoppedW
|
||||||
*/
|
*/
|
||||||
public CancelActionToStop(final String stopId) {
|
public DdiCancelActionToStop(final String stopId) {
|
||||||
super();
|
super();
|
||||||
this.stopId = stopId;
|
this.stopId = stopId;
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
/**
|
/**
|
||||||
* Deployment chunks.
|
* Deployment chunks.
|
||||||
*/
|
*/
|
||||||
public class Chunk {
|
public class DdiChunk {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final String part;
|
private final String part;
|
||||||
@@ -26,7 +26,7 @@ public class Chunk {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
private final List<Artifact> artifacts;
|
private final List<DdiArtifact> artifacts;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -40,7 +40,7 @@ public class Chunk {
|
|||||||
* @param artifacts
|
* @param artifacts
|
||||||
* download information
|
* download information
|
||||||
*/
|
*/
|
||||||
public Chunk(final String part, final String version, final String name, final List<Artifact> artifacts) {
|
public DdiChunk(final String part, final String version, final String name, final List<DdiArtifact> artifacts) {
|
||||||
super();
|
super();
|
||||||
this.part = part;
|
this.part = part;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
@@ -60,7 +60,7 @@ public class Chunk {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Artifact> getArtifacts() {
|
public List<DdiArtifact> getArtifacts() {
|
||||||
return artifacts;
|
return artifacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,14 +6,14 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard configuration for the target.
|
* Standard configuration for the target.
|
||||||
*/
|
*/
|
||||||
public class Config {
|
public class DdiConfig {
|
||||||
|
|
||||||
private final Polling polling;
|
private final DdiPolling polling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -21,12 +21,12 @@ public class Config {
|
|||||||
* @param polling
|
* @param polling
|
||||||
* configuration of the SP target
|
* configuration of the SP target
|
||||||
*/
|
*/
|
||||||
public Config(final Polling polling) {
|
public DdiConfig(final DdiPolling polling) {
|
||||||
super();
|
super();
|
||||||
this.polling = polling;
|
this.polling = polling;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Polling getPolling() {
|
public DdiPolling getPolling() {
|
||||||
return polling;
|
return polling;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
/**
|
/**
|
||||||
* Feedback channel for ConfigData action.
|
* Feedback channel for ConfigData action.
|
||||||
*/
|
*/
|
||||||
public class ConfigData extends ActionFeedback {
|
public class DdiConfigData extends DdiActionFeedback {
|
||||||
|
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private final Map<String, String> data;
|
private final Map<String, String> data;
|
||||||
@@ -36,8 +36,8 @@ public class ConfigData extends ActionFeedback {
|
|||||||
* contains the attributes.
|
* contains the attributes.
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public ConfigData(@JsonProperty(value = "id") final Long id, @JsonProperty(value = "time") final String time,
|
public DdiConfigData(@JsonProperty(value = "id") final Long id, @JsonProperty(value = "time") final String time,
|
||||||
@JsonProperty(value = "status") final Status status,
|
@JsonProperty(value = "status") final DdiStatus status,
|
||||||
@JsonProperty(value = "data") final Map<String, String> data) {
|
@JsonProperty(value = "data") final Map<String, String> data) {
|
||||||
super(id, time, status);
|
super(id, time, status);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
@@ -6,16 +6,16 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import org.springframework.hateoas.ResourceSupport;
|
import org.springframework.hateoas.ResourceSupport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link ControllerBase} resource content.
|
* {@link DdiControllerBase} resource content.
|
||||||
*/
|
*/
|
||||||
public class ControllerBase extends ResourceSupport {
|
public class DdiControllerBase extends ResourceSupport {
|
||||||
|
|
||||||
private final Config config;
|
private final DdiConfig config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -23,12 +23,12 @@ public class ControllerBase extends ResourceSupport {
|
|||||||
* @param config
|
* @param config
|
||||||
* configuration of the SP target
|
* configuration of the SP target
|
||||||
*/
|
*/
|
||||||
public ControllerBase(final Config config) {
|
public DdiControllerBase(final DdiConfig config) {
|
||||||
super();
|
super();
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Config getConfig() {
|
public DdiConfig getConfig() {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -15,13 +15,13 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
/**
|
/**
|
||||||
* Detailed {@link UpdateAction} information.
|
* Detailed {@link UpdateAction} information.
|
||||||
*/
|
*/
|
||||||
public class Deployment {
|
public class DdiDeployment {
|
||||||
|
|
||||||
private final HandlingType download;
|
private final HandlingType download;
|
||||||
|
|
||||||
private final HandlingType update;
|
private final HandlingType update;
|
||||||
|
|
||||||
private final List<Chunk> chunks;
|
private final List<DdiChunk> chunks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -33,7 +33,7 @@ public class Deployment {
|
|||||||
* @param chunks
|
* @param chunks
|
||||||
* to handle.
|
* to handle.
|
||||||
*/
|
*/
|
||||||
public Deployment(final HandlingType download, final HandlingType update, final List<Chunk> chunks) {
|
public DdiDeployment(final HandlingType download, final HandlingType update, final List<DdiChunk> chunks) {
|
||||||
super();
|
super();
|
||||||
this.download = download;
|
this.download = download;
|
||||||
this.update = update;
|
this.update = update;
|
||||||
@@ -48,7 +48,7 @@ public class Deployment {
|
|||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Chunk> getChunks() {
|
public List<DdiChunk> getChunks() {
|
||||||
return chunks;
|
return chunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -17,14 +17,14 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
/**
|
/**
|
||||||
* {@link UpdateAction} resource.
|
* {@link UpdateAction} resource.
|
||||||
*/
|
*/
|
||||||
public class DeploymentBase extends ResourceSupport {
|
public class DdiDeploymentBase extends ResourceSupport {
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
@NotNull
|
@NotNull
|
||||||
private final String deplyomentId;
|
private final String deplyomentId;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final Deployment deployment;
|
private final DdiDeployment deployment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -34,12 +34,12 @@ public class DeploymentBase extends ResourceSupport {
|
|||||||
* @param deployment
|
* @param deployment
|
||||||
* details.
|
* details.
|
||||||
*/
|
*/
|
||||||
public DeploymentBase(final String id, final Deployment deployment) {
|
public DdiDeploymentBase(final String id, final DdiDeployment deployment) {
|
||||||
deplyomentId = id;
|
deplyomentId = id;
|
||||||
this.deployment = deployment;
|
this.deployment = deployment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Deployment getDeployment() {
|
public DdiDeployment getDeployment() {
|
||||||
return deployment;
|
return deployment;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Polling interval for the SP target.
|
* Polling interval for the SP target.
|
||||||
*/
|
*/
|
||||||
public class Polling {
|
public class DdiPolling {
|
||||||
|
|
||||||
private final String sleep;
|
private final String sleep;
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ public class Polling {
|
|||||||
* @param sleep
|
* @param sleep
|
||||||
* between polls
|
* between polls
|
||||||
*/
|
*/
|
||||||
public Polling(final String sleep) {
|
public DdiPolling(final String sleep) {
|
||||||
super();
|
super();
|
||||||
this.sleep = sleep;
|
this.sleep = sleep;
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
* Action fulfillment progress by means of gives the achieved amount of maximal
|
* Action fulfillment progress by means of gives the achieved amount of maximal
|
||||||
* of possible levels.
|
* of possible levels.
|
||||||
*/
|
*/
|
||||||
public class Progress {
|
public class DdiProgress {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final Integer cnt;
|
private final Integer cnt;
|
||||||
@@ -33,7 +33,7 @@ public class Progress {
|
|||||||
* maximum levels
|
* maximum levels
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public Progress(@JsonProperty("cnt") final Integer cnt, @JsonProperty("of") final Integer of) {
|
public DdiProgress(@JsonProperty("cnt") final Integer cnt, @JsonProperty("of") final Integer of) {
|
||||||
super();
|
super();
|
||||||
this.cnt = cnt;
|
this.cnt = cnt;
|
||||||
this.of = of;
|
this.of = of;
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import org.hibernate.validator.constraints.NotEmpty;
|
import org.hibernate.validator.constraints.NotEmpty;
|
||||||
|
|
||||||
@@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
* Result information of the action progress which can by an intermediate or
|
* Result information of the action progress which can by an intermediate or
|
||||||
* final update.
|
* final update.
|
||||||
*/
|
*/
|
||||||
public class Result {
|
public class DdiResult {
|
||||||
|
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private final FinalResult finished;
|
private final FinalResult finished;
|
||||||
|
|
||||||
private final Progress progress;
|
private final DdiProgress progress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -34,8 +34,8 @@ public class Result {
|
|||||||
* if not yet finished
|
* if not yet finished
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public Result(@JsonProperty("finished") final FinalResult finished,
|
public DdiResult(@JsonProperty("finished") final FinalResult finished,
|
||||||
@JsonProperty("progress") final Progress progress) {
|
@JsonProperty("progress") final DdiProgress progress) {
|
||||||
super();
|
super();
|
||||||
this.finished = finished;
|
this.finished = finished;
|
||||||
this.progress = progress;
|
this.progress = progress;
|
||||||
@@ -45,7 +45,7 @@ public class Result {
|
|||||||
return finished;
|
return finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Progress getProgress() {
|
public DdiProgress getProgress() {
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.model;
|
package org.eclipse.hawkbit.ddi.json.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -19,13 +19,13 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
/**
|
/**
|
||||||
* Details status information concerning the action processing.
|
* Details status information concerning the action processing.
|
||||||
*/
|
*/
|
||||||
public class Status {
|
public class DdiStatus {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final ExecutionStatus execution;
|
private final ExecutionStatus execution;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final Result result;
|
private final DdiResult result;
|
||||||
|
|
||||||
private final List<String> details;
|
private final List<String> details;
|
||||||
|
|
||||||
@@ -40,8 +40,8 @@ public class Status {
|
|||||||
* as optional addition
|
* as optional addition
|
||||||
*/
|
*/
|
||||||
@JsonCreator
|
@JsonCreator
|
||||||
public Status(@JsonProperty("execution") final ExecutionStatus execution,
|
public DdiStatus(@JsonProperty("execution") final ExecutionStatus execution,
|
||||||
@JsonProperty("result") final Result result, @JsonProperty("details") final List<String> details) {
|
@JsonProperty("result") final DdiResult result, @JsonProperty("details") final List<String> details) {
|
||||||
super();
|
super();
|
||||||
this.execution = execution;
|
this.execution = execution;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
@@ -52,7 +52,7 @@ public class Status {
|
|||||||
return execution;
|
return execution;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result getResult() {
|
public DdiResult getResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,13 +6,12 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.api;
|
package org.eclipse.hawkbit.ddi.rest.api;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ddi.ControllerConstants;
|
import org.eclipse.hawkbit.ddi.json.model.DdiArtifact;
|
||||||
import org.eclipse.hawkbit.ddi.model.Artifact;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.web.bind.annotation.AuthenticationPrincipal;
|
import org.springframework.security.web.bind.annotation.AuthenticationPrincipal;
|
||||||
@@ -24,11 +23,11 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||||||
/**
|
/**
|
||||||
* REST resource handling for artifact download operations.
|
* REST resource handling for artifact download operations.
|
||||||
*/
|
*/
|
||||||
@RequestMapping(ControllerConstants.ARTIFACTS_V1_REQUEST_MAPPING)
|
@RequestMapping(DdiRestConstants.ARTIFACTS_V1_REQUEST_MAPPING)
|
||||||
public interface ArtifactStoreControllerDdiApi {
|
public interface DdiArtifactStoreControllerRestApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles GET {@link Artifact} download request. This could be full or
|
* Handles GET {@link DdiArtifact} download request. This could be full or
|
||||||
* partial download request.
|
* partial download request.
|
||||||
*
|
*
|
||||||
* @param fileName
|
* @param fileName
|
||||||
@@ -44,7 +43,7 @@ public interface ArtifactStoreControllerDdiApi {
|
|||||||
* {@link HttpStatus#OK} or in case of partial download
|
* {@link HttpStatus#OK} or in case of partial download
|
||||||
* {@link HttpStatus#PARTIAL_CONTENT}.
|
* {@link HttpStatus#PARTIAL_CONTENT}.
|
||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME
|
@RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME
|
||||||
+ "/{fileName}")
|
+ "/{fileName}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<Void> downloadArtifactByFilename(@PathVariable("fileName") final String fileName,
|
public ResponseEntity<Void> downloadArtifactByFilename(@PathVariable("fileName") final String fileName,
|
||||||
@@ -52,7 +51,7 @@ public interface ArtifactStoreControllerDdiApi {
|
|||||||
@AuthenticationPrincipal final String targetid);
|
@AuthenticationPrincipal final String targetid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles GET {@link Artifact} MD5 checksum file download request.
|
* Handles GET {@link DdiArtifact} MD5 checksum file download request.
|
||||||
*
|
*
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* to search for
|
* to search for
|
||||||
@@ -61,8 +60,8 @@ public interface ArtifactStoreControllerDdiApi {
|
|||||||
*
|
*
|
||||||
* @return response of the servlet
|
* @return response of the servlet
|
||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME
|
@RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME
|
||||||
+ "/{fileName}" + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX)
|
+ "/{fileName}" + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public ResponseEntity<Void> downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName,
|
public ResponseEntity<Void> downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName,
|
||||||
final HttpServletResponse response);
|
final HttpServletResponse response);
|
||||||
@@ -6,12 +6,12 @@
|
|||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi;
|
package org.eclipse.hawkbit.ddi.rest.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants for the direct device integration rest resources.
|
* Constants for the direct device integration rest resources.
|
||||||
*/
|
*/
|
||||||
public final class ControllerConstants {
|
public final class DdiRestConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base URL mapping of the direct device integration rest resources.
|
* The base URL mapping of the direct device integration rest resources.
|
||||||
@@ -59,7 +59,7 @@ public final class ControllerConstants {
|
|||||||
public static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM";
|
public static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM";
|
||||||
|
|
||||||
// constant class, private constructor.
|
// constant class, private constructor.
|
||||||
private ControllerConstants() {
|
private DdiRestConstants() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved.
|
* Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved.
|
||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit.ddi.api;
|
package org.eclipse.hawkbit.ddi.rest.api;
|
||||||
|
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -10,13 +10,12 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ddi.ControllerConstants;
|
import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback;
|
||||||
import org.eclipse.hawkbit.ddi.model.ActionFeedback;
|
import org.eclipse.hawkbit.ddi.json.model.DdiArtifact;
|
||||||
import org.eclipse.hawkbit.ddi.model.Artifact;
|
import org.eclipse.hawkbit.ddi.json.model.DdiCancel;
|
||||||
import org.eclipse.hawkbit.ddi.model.Cancel;
|
import org.eclipse.hawkbit.ddi.json.model.DdiConfigData;
|
||||||
import org.eclipse.hawkbit.ddi.model.ConfigData;
|
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
||||||
import org.eclipse.hawkbit.ddi.model.ControllerBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase;
|
||||||
import org.eclipse.hawkbit.ddi.model.DeploymentBase;
|
|
||||||
import org.hibernate.validator.constraints.NotEmpty;
|
import org.hibernate.validator.constraints.NotEmpty;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
/**
|
/**
|
||||||
* REST resource handling for root controller CRUD operations.
|
* REST resource handling for root controller CRUD operations.
|
||||||
*/
|
*/
|
||||||
@RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING)
|
@RequestMapping(DdiRestConstants.BASE_V1_REQUEST_MAPPING)
|
||||||
public interface RootControllerDdiApi {
|
public interface DdiRootControllerRestApi {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all artifacts of a given software module and target.
|
* Returns all artifacts of a given software module and target.
|
||||||
@@ -45,7 +44,7 @@ public interface RootControllerDdiApi {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts", produces = {
|
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts", produces = {
|
||||||
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
"application/hal+json", MediaType.APPLICATION_JSON_VALUE })
|
||||||
public ResponseEntity<List<org.eclipse.hawkbit.ddi.model.Artifact>> getSoftwareModulesArtifacts(
|
ResponseEntity<List<org.eclipse.hawkbit.ddi.json.model.DdiArtifact>> getSoftwareModulesArtifacts(
|
||||||
@PathVariable("targetid") final String targetid,
|
@PathVariable("targetid") final String targetid,
|
||||||
@PathVariable("softwareModuleId") final Long softwareModuleId);
|
@PathVariable("softwareModuleId") final Long softwareModuleId);
|
||||||
|
|
||||||
@@ -61,11 +60,11 @@ public interface RootControllerDdiApi {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json",
|
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json",
|
||||||
MediaType.APPLICATION_JSON_VALUE })
|
MediaType.APPLICATION_JSON_VALUE })
|
||||||
public ResponseEntity<ControllerBase> getControllerBase(@PathVariable("targetid") final String targetid,
|
ResponseEntity<DdiControllerBase> getControllerBase(@PathVariable("targetid") final String targetid,
|
||||||
final HttpServletRequest request);
|
final HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles GET {@link Artifact} download request. This could be full or
|
* Handles GET {@link DdiArtifact} download request. This could be full or
|
||||||
* partial (as specified by RFC7233 (Range Requests)) download request.
|
* partial (as specified by RFC7233 (Range Requests)) download request.
|
||||||
*
|
*
|
||||||
* @param targetid
|
* @param targetid
|
||||||
@@ -84,13 +83,13 @@ public interface RootControllerDdiApi {
|
|||||||
* {@link HttpStatus#PARTIAL_CONTENT}.
|
* {@link HttpStatus#PARTIAL_CONTENT}.
|
||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}")
|
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}")
|
||||||
public ResponseEntity<Void> downloadArtifact(@PathVariable("targetid") final String targetid,
|
ResponseEntity<Void> downloadArtifact(@PathVariable("targetid") final String targetid,
|
||||||
@PathVariable("softwareModuleId") final Long softwareModuleId,
|
@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||||
@PathVariable("fileName") final String fileName, final HttpServletResponse response,
|
@PathVariable("fileName") final String fileName, final HttpServletResponse response,
|
||||||
final HttpServletRequest request);
|
final HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles GET {@link Artifact} MD5 checksum file download request.
|
* Handles GET {@link DdiArtifact} MD5 checksum file download request.
|
||||||
*
|
*
|
||||||
* @param targetid
|
* @param targetid
|
||||||
* of the related
|
* of the related
|
||||||
@@ -107,8 +106,8 @@ public interface RootControllerDdiApi {
|
|||||||
* successful
|
* successful
|
||||||
*/
|
*/
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}"
|
@RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}"
|
||||||
+ ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE)
|
+ DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||||
public ResponseEntity<Void> downloadArtifactMd5(@PathVariable("targetid") final String targetid,
|
ResponseEntity<Void> downloadArtifactMd5(@PathVariable("targetid") final String targetid,
|
||||||
@PathVariable("softwareModuleId") final Long softwareModuleId,
|
@PathVariable("softwareModuleId") final Long softwareModuleId,
|
||||||
@PathVariable("fileName") final String fileName, final HttpServletResponse response,
|
@PathVariable("fileName") final String fileName, final HttpServletResponse response,
|
||||||
final HttpServletRequest request);
|
final HttpServletRequest request);
|
||||||
@@ -120,7 +119,7 @@ public interface RootControllerDdiApi {
|
|||||||
* of the {@link Target} that matches to
|
* of the {@link Target} that matches to
|
||||||
* {@link Target#getControllerId()}
|
* {@link Target#getControllerId()}
|
||||||
* @param actionId
|
* @param actionId
|
||||||
* of the {@link DeploymentBase} that matches to
|
* of the {@link DdiDeploymentBase} that matches to
|
||||||
* {@link Target#getActiveActions()}
|
* {@link Target#getActiveActions()}
|
||||||
* @param resource
|
* @param resource
|
||||||
* an hashcode of the resource which indicates if the action has
|
* an hashcode of the resource which indicates if the action has
|
||||||
@@ -130,16 +129,16 @@ public interface RootControllerDdiApi {
|
|||||||
* the HTTP request injected by spring
|
* the HTTP request injected by spring
|
||||||
* @return the response
|
* @return the response
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION
|
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION
|
||||||
+ "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
+ "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<DeploymentBase> getControllerBasedeploymentAction(
|
ResponseEntity<DdiDeploymentBase> getControllerBasedeploymentAction(
|
||||||
@PathVariable("targetid") @NotEmpty final String targetid,
|
@PathVariable("targetid") @NotEmpty final String targetid,
|
||||||
@PathVariable("actionId") @NotEmpty final Long actionId,
|
@PathVariable("actionId") @NotEmpty final Long actionId,
|
||||||
@RequestParam(value = "c", required = false, defaultValue = "-1") final int resource,
|
@RequestParam(value = "c", required = false, defaultValue = "-1") final int resource,
|
||||||
final HttpServletRequest request);
|
final HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the feedback channel for the {@link DeploymentBase} action.
|
* This is the feedback channel for the {@link DdiDeploymentBase} action.
|
||||||
*
|
*
|
||||||
* @param feedback
|
* @param feedback
|
||||||
* to provide
|
* to provide
|
||||||
@@ -153,9 +152,9 @@ public interface RootControllerDdiApi {
|
|||||||
*
|
*
|
||||||
* @return the response
|
* @return the response
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/"
|
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/"
|
||||||
+ ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
+ DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback,
|
ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||||
@PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId,
|
@PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId,
|
||||||
final HttpServletRequest request);
|
final HttpServletRequest request);
|
||||||
|
|
||||||
@@ -172,12 +171,12 @@ public interface RootControllerDdiApi {
|
|||||||
* @return status of the request
|
* @return status of the request
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{targetid}/"
|
@RequestMapping(value = "/{targetid}/"
|
||||||
+ ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
|
+ DdiRestConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<Void> putConfigData(@Valid @RequestBody final ConfigData configData,
|
ResponseEntity<Void> putConfigData(@Valid @RequestBody final DdiConfigData configData,
|
||||||
@PathVariable("targetid") final String targetid, final HttpServletRequest request);
|
@PathVariable("targetid") final String targetid, final HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RequestMethod.GET} method for the {@link Cancel} action.
|
* {@link RequestMethod.GET} method for the {@link DdiCancel} action.
|
||||||
*
|
*
|
||||||
* @param targetid
|
* @param targetid
|
||||||
* ID of the calling target
|
* ID of the calling target
|
||||||
@@ -186,19 +185,19 @@ public interface RootControllerDdiApi {
|
|||||||
* @param request
|
* @param request
|
||||||
* the HTTP request injected by spring
|
* the HTTP request injected by spring
|
||||||
*
|
*
|
||||||
* @return the {@link Cancel} response
|
* @return the {@link DdiCancel} response
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION
|
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.CANCEL_ACTION
|
||||||
+ "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
+ "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<Cancel> getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid,
|
ResponseEntity<DdiCancel> getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid,
|
||||||
@PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request);
|
@PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link RequestMethod.POST} method receiving the {@link ActionFeedback}
|
* {@link RequestMethod.POST} method receiving the {@link DdiActionFeedback}
|
||||||
* from the target.
|
* from the target.
|
||||||
*
|
*
|
||||||
* @param feedback
|
* @param feedback
|
||||||
* the {@link ActionFeedback} from the target.
|
* the {@link DdiActionFeedback} from the target.
|
||||||
* @param targetid
|
* @param targetid
|
||||||
* the ID of the calling target
|
* the ID of the calling target
|
||||||
* @param actionId
|
* @param actionId
|
||||||
@@ -206,12 +205,12 @@ public interface RootControllerDdiApi {
|
|||||||
* @param request
|
* @param request
|
||||||
* the HTTP request injected by spring
|
* the HTTP request injected by spring
|
||||||
*
|
*
|
||||||
* @return the {@link ActionFeedback} response
|
* @return the {@link DdiActionFeedback} response
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + "/{actionId}/"
|
@RequestMapping(value = "/{targetid}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}/"
|
||||||
+ ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
+ DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResponseEntity<Void> postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback,
|
ResponseEntity<Void> postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||||
@PathVariable("targetid") @NotEmpty final String targetid,
|
@PathVariable("targetid") @NotEmpty final String targetid,
|
||||||
@PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request);
|
@PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request);
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
||||||
import org.eclipse.hawkbit.cache.CacheWriteNotify;
|
import org.eclipse.hawkbit.cache.CacheWriteNotify;
|
||||||
import org.eclipse.hawkbit.ddi.api.ArtifactStoreControllerDdiApi;
|
import org.eclipse.hawkbit.ddi.rest.api.DdiArtifactStoreControllerRestApi;
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.Action;
|
import org.eclipse.hawkbit.repository.model.Action;
|
||||||
@@ -44,7 +44,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* for legacy controllers that can not be fed with a download URI at runtime.
|
* for legacy controllers that can not be fed with a download URI at runtime.
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class ArtifactStoreController implements ArtifactStoreControllerDdiApi {
|
public class ArtifactStoreController implements DdiArtifactStoreControllerRestApi {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(ArtifactStoreController.class);
|
private static final Logger LOG = LoggerFactory.getLogger(ArtifactStoreController.class);
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||||
import org.eclipse.hawkbit.api.UrlProtocol;
|
import org.eclipse.hawkbit.api.UrlProtocol;
|
||||||
import org.eclipse.hawkbit.ddi.ControllerConstants;
|
import org.eclipse.hawkbit.ddi.json.model.DdiArtifact;
|
||||||
import org.eclipse.hawkbit.ddi.model.Artifact;
|
import org.eclipse.hawkbit.ddi.json.model.DdiChunk;
|
||||||
import org.eclipse.hawkbit.ddi.model.Chunk;
|
import org.eclipse.hawkbit.ddi.json.model.DdiConfig;
|
||||||
import org.eclipse.hawkbit.ddi.model.Config;
|
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
||||||
import org.eclipse.hawkbit.ddi.model.ControllerBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiPolling;
|
||||||
import org.eclipse.hawkbit.ddi.model.Polling;
|
import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants;
|
||||||
import org.eclipse.hawkbit.repository.model.Action;
|
import org.eclipse.hawkbit.repository.model.Action;
|
||||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||||
@@ -50,10 +50,10 @@ public final class DataConversionHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<Chunk> createChunks(final String targetid, final Action uAction,
|
static List<DdiChunk> createChunks(final String targetid, final Action uAction,
|
||||||
final ArtifactUrlHandler artifactUrlHandler) {
|
final ArtifactUrlHandler artifactUrlHandler) {
|
||||||
return uAction.getDistributionSet().getModules().stream()
|
return uAction.getDistributionSet().getModules().stream()
|
||||||
.map(module -> new Chunk(mapChunkLegacyKeys(module.getType().getKey()), module.getVersion(),
|
.map(module -> new DdiChunk(mapChunkLegacyKeys(module.getType().getKey()), module.getVersion(),
|
||||||
module.getName(), createArtifacts(targetid, module, artifactUrlHandler)))
|
module.getName(), createArtifacts(targetid, module, artifactUrlHandler)))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
@@ -79,12 +79,12 @@ public final class DataConversionHelper {
|
|||||||
* the software module
|
* the software module
|
||||||
* @return a list of artifacts or a empty list. Cannot be <null>.
|
* @return a list of artifacts or a empty list. Cannot be <null>.
|
||||||
*/
|
*/
|
||||||
public static List<Artifact> createArtifacts(final String targetid,
|
public static List<DdiArtifact> createArtifacts(final String targetid,
|
||||||
final org.eclipse.hawkbit.repository.model.SoftwareModule module,
|
final org.eclipse.hawkbit.repository.model.SoftwareModule module,
|
||||||
final ArtifactUrlHandler artifactUrlHandler) {
|
final ArtifactUrlHandler artifactUrlHandler) {
|
||||||
final List<Artifact> files = new ArrayList<>();
|
final List<DdiArtifact> files = new ArrayList<>();
|
||||||
module.getLocalArtifacts().forEach(artifact -> {
|
module.getLocalArtifacts().forEach(artifact -> {
|
||||||
final Artifact file = new Artifact();
|
final DdiArtifact file = new DdiArtifact();
|
||||||
file.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash()));
|
file.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash()));
|
||||||
file.setFilename(artifact.getFilename());
|
file.setFilename(artifact.getFilename());
|
||||||
file.setSize(artifact.getSize());
|
file.setSize(artifact.getSize());
|
||||||
@@ -93,18 +93,18 @@ public final class DataConversionHelper {
|
|||||||
final String linkHttps = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(),
|
final String linkHttps = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(),
|
||||||
artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTPS);
|
artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTPS);
|
||||||
file.add(new Link(linkHttps).withRel("download"));
|
file.add(new Link(linkHttps).withRel("download"));
|
||||||
file.add(new Link(linkHttps + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum"));
|
file.add(new Link(linkHttps + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum"));
|
||||||
file.add(new Link(linkHttp).withRel("download-http"));
|
file.add(new Link(linkHttp).withRel("download-http"));
|
||||||
file.add(new Link(linkHttp + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http"));
|
file.add(new Link(linkHttp + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http"));
|
||||||
|
|
||||||
files.add(file);
|
files.add(file);
|
||||||
});
|
});
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ControllerBase fromTarget(final Target target, final List<Action> actions,
|
static DdiControllerBase fromTarget(final Target target, final List<Action> actions,
|
||||||
final String defaultControllerPollTime, final TenantAware tenantAware) {
|
final String defaultControllerPollTime, final TenantAware tenantAware) {
|
||||||
final ControllerBase result = new ControllerBase(new Config(new Polling(defaultControllerPollTime)));
|
final DdiControllerBase result = new DdiControllerBase(new DdiConfig(new DdiPolling(defaultControllerPollTime)));
|
||||||
|
|
||||||
boolean addedUpdate = false;
|
boolean addedUpdate = false;
|
||||||
boolean addedCancel = false;
|
boolean addedCancel = false;
|
||||||
@@ -118,19 +118,19 @@ public final class DataConversionHelper {
|
|||||||
// response because of eTags.
|
// response because of eTags.
|
||||||
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant())
|
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant())
|
||||||
.getControllerBasedeploymentAction(target.getControllerId(), action.getId(), actions.hashCode(),
|
.getControllerBasedeploymentAction(target.getControllerId(), action.getId(), actions.hashCode(),
|
||||||
null)).withRel(ControllerConstants.DEPLOYMENT_BASE_ACTION));
|
null)).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION));
|
||||||
addedUpdate = true;
|
addedUpdate = true;
|
||||||
} else if (action.isCancelingOrCanceled() && !addedCancel) {
|
} else if (action.isCancelingOrCanceled() && !addedCancel) {
|
||||||
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant())
|
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant())
|
||||||
.getControllerCancelAction(target.getControllerId(), action.getId(), null))
|
.getControllerCancelAction(target.getControllerId(), action.getId(), null))
|
||||||
.withRel(ControllerConstants.CANCEL_ACTION));
|
.withRel(DdiRestConstants.CANCEL_ACTION));
|
||||||
addedCancel = true;
|
addedCancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getTargetInfo().isRequestControllerAttributes()) {
|
if (target.getTargetInfo().isRequestControllerAttributes()) {
|
||||||
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()).putConfigData(null,
|
result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()).putConfigData(null,
|
||||||
target.getControllerId(), null)).withRel(ControllerConstants.CONFIG_DATA_ACTION));
|
target.getControllerId(), null)).withRel(DdiRestConstants.CONFIG_DATA_ACTION));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ public final class DataConversionHelper {
|
|||||||
final StringBuilder header = new StringBuilder();
|
final StringBuilder header = new StringBuilder();
|
||||||
header.append("attachment;filename=");
|
header.append("attachment;filename=");
|
||||||
header.append(fileName);
|
header.append(fileName);
|
||||||
header.append(ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX);
|
header.append(DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX);
|
||||||
|
|
||||||
response.setContentLength(content.length);
|
response.setContentLength(content.length);
|
||||||
response.setHeader("Content-Disposition", header.toString());
|
response.setHeader("Content-Disposition", header.toString());
|
||||||
|
|||||||
@@ -18,17 +18,17 @@ import javax.validation.Valid;
|
|||||||
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
import org.eclipse.hawkbit.api.ArtifactUrlHandler;
|
||||||
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
import org.eclipse.hawkbit.artifact.repository.model.DbArtifact;
|
||||||
import org.eclipse.hawkbit.cache.CacheWriteNotify;
|
import org.eclipse.hawkbit.cache.CacheWriteNotify;
|
||||||
import org.eclipse.hawkbit.ddi.api.RootControllerDdiApi;
|
import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback;
|
||||||
import org.eclipse.hawkbit.ddi.model.ActionFeedback;
|
import org.eclipse.hawkbit.ddi.json.model.DdiCancel;
|
||||||
import org.eclipse.hawkbit.ddi.model.Cancel;
|
import org.eclipse.hawkbit.ddi.json.model.DdiCancelActionToStop;
|
||||||
import org.eclipse.hawkbit.ddi.model.CancelActionToStop;
|
import org.eclipse.hawkbit.ddi.json.model.DdiChunk;
|
||||||
import org.eclipse.hawkbit.ddi.model.Chunk;
|
import org.eclipse.hawkbit.ddi.json.model.DdiConfigData;
|
||||||
import org.eclipse.hawkbit.ddi.model.ConfigData;
|
import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase;
|
||||||
import org.eclipse.hawkbit.ddi.model.ControllerBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiDeployment;
|
||||||
import org.eclipse.hawkbit.ddi.model.Deployment;
|
import org.eclipse.hawkbit.ddi.json.model.DdiDeployment.HandlingType;
|
||||||
import org.eclipse.hawkbit.ddi.model.Deployment.HandlingType;
|
import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase;
|
||||||
import org.eclipse.hawkbit.ddi.model.DeploymentBase;
|
import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult;
|
||||||
import org.eclipse.hawkbit.ddi.model.Result.FinalResult;
|
import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi;
|
||||||
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
import org.eclipse.hawkbit.repository.ArtifactManagement;
|
||||||
import org.eclipse.hawkbit.repository.ControllerManagement;
|
import org.eclipse.hawkbit.repository.ControllerManagement;
|
||||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||||
@@ -63,7 +63,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* Transactional (read-write) as all queries at least update the last poll time.
|
* Transactional (read-write) as all queries at least update the last poll time.
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class RootController implements RootControllerDdiApi {
|
public class RootController implements DdiRootControllerRestApi {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(RootController.class);
|
private static final Logger LOG = LoggerFactory.getLogger(RootController.class);
|
||||||
private static final String GIVEN_ACTION_IS_NOT_ASSIGNED_TO_GIVEN_TARGET = "given action ({}) is not assigned to given target ({}).";
|
private static final String GIVEN_ACTION_IS_NOT_ASSIGNED_TO_GIVEN_TARGET = "given action ({}) is not assigned to given target ({}).";
|
||||||
@@ -90,7 +90,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
private ArtifactUrlHandler artifactUrlHandler;
|
private ArtifactUrlHandler artifactUrlHandler;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<List<org.eclipse.hawkbit.ddi.model.Artifact>> getSoftwareModulesArtifacts(
|
public ResponseEntity<List<org.eclipse.hawkbit.ddi.json.model.DdiArtifact>> getSoftwareModulesArtifacts(
|
||||||
@PathVariable final String targetid, @PathVariable final Long softwareModuleId) {
|
@PathVariable final String targetid, @PathVariable final Long softwareModuleId) {
|
||||||
LOG.debug("getSoftwareModulesArtifacts({})", targetid);
|
LOG.debug("getSoftwareModulesArtifacts({})", targetid);
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<ControllerBase> getControllerBase(@PathVariable final String targetid,
|
public ResponseEntity<DdiControllerBase> getControllerBase(@PathVariable final String targetid,
|
||||||
final HttpServletRequest request) {
|
final HttpServletRequest request) {
|
||||||
LOG.debug("getControllerBase({})", targetid);
|
LOG.debug("getControllerBase({})", targetid);
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<DeploymentBase> getControllerBasedeploymentAction(
|
public ResponseEntity<DdiDeploymentBase> getControllerBasedeploymentAction(
|
||||||
@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId,
|
@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId,
|
||||||
@RequestParam(value = "c", required = false, defaultValue = "-1") final int resource,
|
@RequestParam(value = "c", required = false, defaultValue = "-1") final int resource,
|
||||||
final HttpServletRequest request) {
|
final HttpServletRequest request) {
|
||||||
@@ -223,12 +223,12 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
|
|
||||||
if (!action.isCancelingOrCanceled()) {
|
if (!action.isCancelingOrCanceled()) {
|
||||||
|
|
||||||
final List<Chunk> chunks = DataConversionHelper.createChunks(targetid, action, artifactUrlHandler);
|
final List<DdiChunk> chunks = DataConversionHelper.createChunks(targetid, action, artifactUrlHandler);
|
||||||
|
|
||||||
final HandlingType handlingType = action.isForce() ? HandlingType.FORCED : HandlingType.ATTEMPT;
|
final HandlingType handlingType = action.isForce() ? HandlingType.FORCED : HandlingType.ATTEMPT;
|
||||||
|
|
||||||
final DeploymentBase base = new DeploymentBase(Long.toString(action.getId()),
|
final DdiDeploymentBase base = new DdiDeploymentBase(Long.toString(action.getId()),
|
||||||
new Deployment(handlingType, handlingType, chunks));
|
new DdiDeployment(handlingType, handlingType, chunks));
|
||||||
|
|
||||||
LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base);
|
LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base);
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback,
|
public ResponseEntity<Void> postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||||
@PathVariable final String targetid, @PathVariable @NotEmpty final Long actionId,
|
@PathVariable final String targetid, @PathVariable @NotEmpty final Long actionId,
|
||||||
final HttpServletRequest request) {
|
final HttpServletRequest request) {
|
||||||
LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback);
|
LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback);
|
||||||
@@ -277,7 +277,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ActionStatus generateUpdateStatus(final ActionFeedback feedback, final String targetid, final Long actionid,
|
private ActionStatus generateUpdateStatus(final DdiActionFeedback feedback, final String targetid, final Long actionid,
|
||||||
final Action action) {
|
final Action action) {
|
||||||
|
|
||||||
final ActionStatus actionStatus = new ActionStatus();
|
final ActionStatus actionStatus = new ActionStatus();
|
||||||
@@ -317,7 +317,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
return actionStatus;
|
return actionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleDefaultUpdateStatus(final ActionFeedback feedback, final String targetid,
|
private static void handleDefaultUpdateStatus(final DdiActionFeedback feedback, final String targetid,
|
||||||
final Long actionid, final ActionStatus actionStatus) {
|
final Long actionid, final ActionStatus actionStatus) {
|
||||||
LOG.debug("Controller reported intermediate status (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
LOG.debug("Controller reported intermediate status (actionid: {}, targetid: {}) as we got {} report.", actionid,
|
||||||
targetid, feedback.getStatus().getExecution());
|
targetid, feedback.getStatus().getExecution());
|
||||||
@@ -325,7 +325,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
actionStatus.addMessage("Controller reported: " + feedback.getStatus().getExecution());
|
actionStatus.addMessage("Controller reported: " + feedback.getStatus().getExecution());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleClosedUpdateStatus(final ActionFeedback feedback, final String targetid,
|
private static void handleClosedUpdateStatus(final DdiActionFeedback feedback, final String targetid,
|
||||||
final Long actionid, final ActionStatus actionStatus) {
|
final Long actionid, final ActionStatus actionStatus) {
|
||||||
LOG.debug("Controller reported closed (actionid: {}, targetid: {}) as we got {} report.", actionid, targetid,
|
LOG.debug("Controller reported closed (actionid: {}, targetid: {}) as we got {} report.", actionid, targetid,
|
||||||
feedback.getStatus().getExecution());
|
feedback.getStatus().getExecution());
|
||||||
@@ -339,7 +339,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Void> putConfigData(@Valid @RequestBody final ConfigData configData,
|
public ResponseEntity<Void> putConfigData(@Valid @RequestBody final DdiConfigData configData,
|
||||||
@PathVariable final String targetid, final HttpServletRequest request) {
|
@PathVariable final String targetid, final HttpServletRequest request) {
|
||||||
controllerManagement.updateLastTargetQuery(targetid,
|
controllerManagement.updateLastTargetQuery(targetid,
|
||||||
IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader()));
|
IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader()));
|
||||||
@@ -350,7 +350,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Cancel> getControllerCancelAction(@PathVariable @NotEmpty final String targetid,
|
public ResponseEntity<DdiCancel> getControllerCancelAction(@PathVariable @NotEmpty final String targetid,
|
||||||
@PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) {
|
@PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) {
|
||||||
LOG.debug("getControllerCancelAction({})", targetid);
|
LOG.debug("getControllerCancelAction({})", targetid);
|
||||||
|
|
||||||
@@ -364,8 +364,8 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action.isCancelingOrCanceled()) {
|
if (action.isCancelingOrCanceled()) {
|
||||||
final Cancel cancel = new Cancel(String.valueOf(action.getId()),
|
final DdiCancel cancel = new DdiCancel(String.valueOf(action.getId()),
|
||||||
new CancelActionToStop(String.valueOf(action.getId())));
|
new DdiCancelActionToStop(String.valueOf(action.getId())));
|
||||||
|
|
||||||
LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel);
|
LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel);
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<Void> postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback,
|
public ResponseEntity<Void> postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback,
|
||||||
@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId,
|
@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId,
|
||||||
final HttpServletRequest request) {
|
final HttpServletRequest request) {
|
||||||
LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback);
|
LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback);
|
||||||
@@ -405,7 +405,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ActionStatus generateActionCancelStatus(final ActionFeedback feedback, final Target target,
|
private static ActionStatus generateActionCancelStatus(final DdiActionFeedback feedback, final Target target,
|
||||||
final Long actionid, final Action action) {
|
final Long actionid, final Action action) {
|
||||||
|
|
||||||
final ActionStatus actionStatus = new ActionStatus();
|
final ActionStatus actionStatus = new ActionStatus();
|
||||||
@@ -445,7 +445,7 @@ public class RootController implements RootControllerDdiApi {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleClosedCancelStatus(final ActionFeedback feedback, final ActionStatus actionStatus) {
|
private static void handleClosedCancelStatus(final DdiActionFeedback feedback, final ActionStatus actionStatus) {
|
||||||
if (feedback.getStatus().getResult().getFinished() == FinalResult.FAILURE) {
|
if (feedback.getStatus().getResult().getFinished() == FinalResult.FAILURE) {
|
||||||
actionStatus.setStatus(Status.ERROR);
|
actionStatus.setStatus(Status.ERROR);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user