From 0f0b9eab1f0f2b605a12ba1fb2d1ba443270f356 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Tue, 12 Apr 2016 18:09:27 +0200 Subject: [PATCH 001/124] Create filter has different layout than rollout and the other widgets --> fixed In addition I add a constant for the header caption Signed-off-by: Melanie Retter --- .../ui/filtermanagement/TargetFilterHeader.java | 15 ++++++++++----- .../hawkbit/ui/utils/SPUIComponetIdProvider.java | 5 +++++ .../eclipse/hawkbit/ui/utils/SPUIDefinitions.java | 6 +++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java index 08592f20c..12b4311f1 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java @@ -13,7 +13,6 @@ import javax.annotation.PostConstruct; import org.eclipse.hawkbit.repository.SpPermissionChecker; import org.eclipse.hawkbit.ui.components.SPUIButton; import org.eclipse.hawkbit.ui.components.SPUIComponentProvider; -import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmall; import org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorder; import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent; import org.eclipse.hawkbit.ui.filtermanagement.state.FilterManagementUIState; @@ -79,7 +78,7 @@ public class TargetFilterHeader extends VerticalLayout { } private Label createHeaderCaption() { - final Label captionLabel = SPUIComponentProvider.getLabel("Custom Filters", + final Label captionLabel = SPUIComponentProvider.getLabel(getHeaderCaption(), SPUILabelDefinitions.SP_WIDGET_CAPTION); return captionLabel; } @@ -110,10 +109,9 @@ public class TargetFilterHeader extends VerticalLayout { } private Button createAddButton() { - final Button button = SPUIComponentProvider.getButton("camp.search.add.Id", "Create Filter", "Create Filter", - "", false, null, SPUIButtonStyleSmall.class); + final Button button = SPUIComponentProvider.getButton(getAddIconId(), "", "", null, false, FontAwesome.PLUS, + SPUIButtonStyleSmallNoBorder.class); button.addClickListener(event -> addNewFilter()); - button.addStyleName("on-focus-no-border link"); return button; } @@ -187,4 +185,11 @@ public class TargetFilterHeader extends VerticalLayout { eventBus.publish(this, CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT_REMOVE); } + protected String getAddIconId() { + return SPUIComponetIdProvider.TARGET_FILTER_ADD_ICON_ID; + } + + protected String getHeaderCaption() { + return SPUIDefinitions.TARGET_FILTER_LIST_HEADER_CAPTION; + } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java index 48e501e1d..f2f94ce59 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java @@ -75,6 +75,11 @@ public final class SPUIComponetIdProvider { */ public static final String TARGET_TEXT_FIELD = "target.search.textfield"; + /** + * ID for add target filter icon + */ + public static final String TARGET_FILTER_ADD_ICON_ID = "target.filter.add.id"; + /** * ID-Dist. */ diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java index b29283ef8..75ea912a9 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java @@ -922,6 +922,11 @@ public final class SPUIDefinitions { */ 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. */ @@ -1001,7 +1006,6 @@ public final class SPUIDefinitions { */ public static final String ROLLOUT_GROUP_STARTED_DATE = "Started date"; - /** * Rollout group status column property. */ From 22f4d9ffcf9a84e6287f1be5ad8316ad1bf53638 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Fri, 15 Apr 2016 12:37:40 +0200 Subject: [PATCH 002/124] Created hawkbit-ddi-api maven module and resource interfaces for the module Signed-off-by: Jonathan Philip Knoblauch --- hawkbit-ddi-api/pom.xml | 38 +++ .../hawkbit/ddi}/ControllerConstants.java | 15 +- .../api/ArtifactStoreControllerDdiApi.java | 70 ++++++ .../hawkbit/ddi/api/RootControllerDdiApi.java | 218 ++++++++++++++++++ .../hawkbit/ddi}/model/ActionFeedback.java | 25 +- .../eclipse/hawkbit/ddi}/model/Artifact.java | 24 +- .../eclipse/hawkbit/ddi}/model/Cancel.java | 15 +- .../ddi}/model/CancelActionToStop.java | 13 +- .../org/eclipse/hawkbit/ddi}/model/Chunk.java | 10 +- .../eclipse/hawkbit/ddi}/model/Config.java | 3 +- .../hawkbit/ddi}/model/ConfigData.java | 12 +- .../hawkbit/ddi}/model/ControllerBase.java | 6 +- .../hawkbit/ddi}/model/Deployment.java | 15 +- .../hawkbit/ddi}/model/DeploymentBase.java | 8 +- .../eclipse/hawkbit/ddi}/model/Polling.java | 3 +- .../eclipse/hawkbit/ddi}/model/Progress.java | 8 +- .../eclipse/hawkbit/ddi}/model/Result.java | 13 +- .../eclipse/hawkbit/ddi}/model/Status.java | 11 +- hawkbit-rest-resource/pom.xml | 20 +- .../controller/ArtifactStoreController.java | 108 +++------ .../controller/DataConversionHelper.java | 11 +- .../controller/EnableDirectDeviceApi.java | 3 - .../FileSteamingFailedException.java | 12 +- .../hawkbit/controller/RootController.java | 198 +++------------- pom.xml | 14 +- 25 files changed, 447 insertions(+), 426 deletions(-) create mode 100644 hawkbit-ddi-api/pom.xml rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/ControllerConstants.java (80%) create mode 100644 hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java create mode 100644 hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/ActionFeedback.java (70%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Artifact.java (76%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Cancel.java (84%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/CancelActionToStop.java (80%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Chunk.java (90%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Config.java (93%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/ConfigData.java (89%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/ControllerBase.java (89%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Deployment.java (89%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/DeploymentBase.java (90%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Polling.java (93%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Progress.java (90%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Result.java (91%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi}/model/Status.java (93%) diff --git a/hawkbit-ddi-api/pom.xml b/hawkbit-ddi-api/pom.xml new file mode 100644 index 000000000..6dd30fdf9 --- /dev/null +++ b/hawkbit-ddi-api/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-ddi-api + hawkBit :: DDI API + + + + org.eclipse.hawkbit + hawkbit-rest-api + ${project.version} + + + javax.servlet + javax.servlet-api + provided + + + commons-io + commons-io + 2.4 + + + org.springframework.security + spring-security-web + + + org.hibernate + hibernate-validator + + + diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ControllerConstants.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java similarity index 80% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ControllerConstants.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java index fd7f125c5..959f8488b 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ControllerConstants.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java @@ -6,14 +6,13 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi; /** - * - * - * + * Constants for the direct device integration rest resources. */ public final class ControllerConstants { + /** * The base URL mapping of the direct device integration rest resources. */ @@ -37,7 +36,7 @@ public final class ControllerConstants { /** * Feedback channel. */ - static final String FEEDBACK = "feedback"; + public static final String FEEDBACK = "feedback"; /** * Config data action resources. @@ -47,17 +46,17 @@ public final class ControllerConstants { /** * The artifact URL mapping rest resource. */ - static final String ARTIFACT_DOWNLOAD = "artifact"; + public static final String ARTIFACT_DOWNLOAD = "artifact"; /** * The artifact by filename URL mapping rest resource. */ - static final String ARTIFACT_DOWNLOAD_BY_FILENAME = "/filename"; + public static final String ARTIFACT_DOWNLOAD_BY_FILENAME = "/filename"; /** * File suffix for MDH hash download (see Linux md5sum). */ - static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM"; + public static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM"; // constant class, private constructor. private ControllerConstants() { diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java new file mode 100644 index 000000000..5df63b1b5 --- /dev/null +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * + * 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.api; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.hawkbit.ddi.ControllerConstants; +import org.eclipse.hawkbit.ddi.model.Artifact; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * REST resource handling for artifact download operations. + */ +@RequestMapping(ControllerConstants.ARTIFACTS_V1_REQUEST_MAPPING) +public interface ArtifactStoreControllerDdiApi { + + /** + * Handles GET {@link Artifact} download request. This could be full or + * partial download request. + * + * @param fileName + * to search for + * @param response + * to write to + * @param request + * from the client + * @param targetid + * of authenticated target + * + * @return response of the servlet which in case of success is status code + * {@link HttpStatus#OK} or in case of partial download + * {@link HttpStatus#PARTIAL_CONTENT}. + */ + @RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + + "/{fileName}") + @ResponseBody + public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, + final HttpServletResponse response, final HttpServletRequest request, + @AuthenticationPrincipal final String targetid); + + /** + * Handles GET {@link Artifact} MD5 checksum file download request. + * + * @param fileName + * to search for + * @param response + * to write to + * + * @return response of the servlet + */ + @RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + + "/{fileName}" + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX) + @ResponseBody + public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, + final HttpServletResponse response); + +} diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java new file mode 100644 index 000000000..8e51e0b86 --- /dev/null +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java @@ -0,0 +1,218 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.api; + +import java.lang.annotation.Target; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.eclipse.hawkbit.ddi.ControllerConstants; +import org.eclipse.hawkbit.ddi.model.ActionFeedback; +import org.eclipse.hawkbit.ddi.model.Artifact; +import org.eclipse.hawkbit.ddi.model.Cancel; +import org.eclipse.hawkbit.ddi.model.ConfigData; +import org.eclipse.hawkbit.ddi.model.ControllerBase; +import org.eclipse.hawkbit.ddi.model.DeploymentBase; +import org.hibernate.validator.constraints.NotEmpty; +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; + +/** + * REST resource handling for root controller CRUD operations. + */ +@RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING) +public interface RootControllerDdiApi { + + /** + * Returns all artifacts of a given software module and target. + * + * @param targetid + * of the {@link Target} that matches to + * {@link Target#getControllerId()} + * @param softwareModuleId + * of the {@link SoftwareModule} + * @return the response + */ + @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts", produces = { + "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity> getSoftwareModulesArtifacts( + @PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId); + + /** + * Root resource for an individual {@link Target}. + * + * @param targetid + * of the {@link Target} that matches to + * {@link Target#getControllerId()} + * @param request + * the HTTP request injected by spring + * @return the response + */ + @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, + final HttpServletRequest request); + + /** + * Handles GET {@link Artifact} download request. This could be full or + * partial (as specified by RFC7233 (Range Requests)) download request. + * + * @param targetid + * of the related + * @param softwareModuleId + * of the parent {@link SoftwareModule} + * @param fileName + * of the related {@link LocalArtifact} + * @param response + * of the servlet + * @param request + * from the client + * + * @return response of the servlet which in case of success is status code + * {@link HttpStatus#OK} or in case of partial download + * {@link HttpStatus#PARTIAL_CONTENT}. + */ + @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") + public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("fileName") final String fileName, final HttpServletResponse response, + final HttpServletRequest request); + + /** + * Handles GET {@link Artifact} MD5 checksum file download request. + * + * @param targetid + * of the related + * @param softwareModuleId + * of the parent {@link SoftwareModule} + * @param fileName + * of the related {@link LocalArtifact} + * @param response + * of the servlet + * @param request + * the HTTP request injected by spring + * + * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if + * successful + */ + @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" + + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) + public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("fileName") final String fileName, final HttpServletResponse response, + final HttpServletRequest request); + + /** + * Resource for {@link SoftwareModule} {@link UpdateAction}s. + * + * @param targetid + * of the {@link Target} that matches to + * {@link Target#getControllerId()} + * @param actionId + * of the {@link DeploymentBase} that matches to + * {@link Target#getActiveActions()} + * @param resource + * an hashcode of the resource which indicates if the action has + * been changed, e.g. from 'soft' to 'force' and the eTag needs + * to be re-generated + * @param request + * the HTTP request injected by spring + * @return the response + */ + @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + + "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getControllerBasedeploymentAction( + @PathVariable("targetid") @NotEmpty final String targetid, + @PathVariable("actionId") @NotEmpty final Long actionId, + @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, + final HttpServletRequest request); + + /** + * This is the feedback channel for the {@link DeploymentBase} action. + * + * @param feedback + * to provide + * @param targetid + * of the {@link Target} that matches to + * {@link Target#getControllerId()} + * @param actionId + * of the action we have feedback for + * @param request + * the HTTP request injected by spring + * + * @return the response + */ + @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" + + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, + final HttpServletRequest request); + + /** + * This is the feedback channel for the config data action. + * + * @param configData + * as body + * @param targetid + * to provide data for + * @param request + * the HTTP request injected by spring + * + * @return status of the request + */ + @RequestMapping(value = "/{targetid}/" + + ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity putConfigData(@Valid @RequestBody final ConfigData configData, + @PathVariable("targetid") final String targetid, final HttpServletRequest request); + + /** + * {@link RequestMethod.GET} method for the {@link Cancel} action. + * + * @param targetid + * ID of the calling target + * @param actionId + * of the action + * @param request + * the HTTP request injected by spring + * + * @return the {@link Cancel} response + */ + @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + + "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid, + @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); + + /** + * {@link RequestMethod.POST} method receiving the {@link ActionFeedback} + * from the target. + * + * @param feedback + * the {@link ActionFeedback} from the target. + * @param targetid + * the ID of the calling target + * @param actionId + * of the action we have feedback for + * @param request + * the HTTP request injected by spring + * + * @return the {@link ActionFeedback} response + */ + + @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + "/{actionId}/" + + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + @PathVariable("targetid") @NotEmpty final String targetid, + @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); + +} diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ActionFeedback.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java similarity index 70% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ActionFeedback.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java index 3fe511e49..19ef0c0a9 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ActionFeedback.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; @@ -15,16 +15,16 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; /** - * *

- * After the SP Target has executed an action, received by a GET(URL) request it - * reports the completion of it to the SP Server with a action status message, - * i.e. with a PUT message to the feedback channel, i.e. PUT URL/feedback. This - * message could be used not only at the end of execution but also as status - * updates during a longer lasting execution period. The format of each action - * answer message is defined below at each action. But it is expected, that the - * contents of the message answers have all a similar structure: The content - * starts with a generic header and additional elements. * + * After the HawkBit Target has executed an action, received by a GET(URL) + * request it reports the completion of it to the HawkBit Server with a action + * status message, i.e. with a PUT message to the feedback channel, i.e. PUT + * URL/feedback. This message could be used not only at the end of execution but + * also as status updates during a longer lasting execution period. The format + * of each action answer message is defined below at each action. But it is + * expected, that the contents of the message answers have all a similar + * structure: The content starts with a generic header and additional elements. + * * *

* *

@@ -72,11 +72,6 @@ public class ActionFeedback { return status; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "ActionFeedback [id=" + id + ", time=" + time + ", status=" + status + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Artifact.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java similarity index 76% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Artifact.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java index b995491d9..1eac01bbe 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Artifact.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Download information for all artifacts related to a specific {@link Chunk}. - * */ public class Artifact extends ResourceSupport { @@ -31,47 +30,26 @@ public class Artifact extends ResourceSupport { @JsonProperty private Long size; - /** - * @return the hashes - */ public ArtifactHash getHashes() { return hashes; } - /** - * @param hashes - * the hashes to set - */ public void setHashes(final ArtifactHash hashes) { this.hashes = hashes; } - /** - * @return the fileName - */ public String getFilename() { return filename; } - /** - * @param fileName - * the fileName to set - */ public void setFilename(final String fileName) { filename = fileName; } - /** - * @return the size - */ public Long getSize() { return size; } - /** - * @param size - * the size to set - */ public void setSize(final Long size) { this.size = size; } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Cancel.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java similarity index 84% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Cancel.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java index 77055828f..f4312d964 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Cancel.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java @@ -6,15 +6,15 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; /** * Cancel action to be provided to the target. - * */ public class Cancel { + private final String id; @NotNull @@ -34,25 +34,14 @@ public class Cancel { this.cancelAction = cancelAction; } - /** - * @return the id - */ public String getId() { return id; } - /** - * @return the cancelAction - */ public CancelActionToStop getCancelAction() { return cancelAction; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "Cancel [id=" + id + ", cancelAction=" + cancelAction + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/CancelActionToStop.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java similarity index 80% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/CancelActionToStop.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java index 9b954aa57..c0348a210 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/CancelActionToStop.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java @@ -6,15 +6,12 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; -import org.eclipse.hawkbit.repository.model.Action; - /** * The {@link Action} that has to be stopped by the target. - * */ public class CancelActionToStop { @@ -32,18 +29,10 @@ public class CancelActionToStop { this.stopId = stopId; } - /** - * @return the stopId - */ public String getStopId() { return stopId; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "CancelAction [stopId=" + stopId + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Chunk.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java similarity index 90% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Chunk.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java index 66809bfbb..0282bc4ea 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Chunk.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import java.util.List; @@ -14,7 +14,6 @@ import javax.validation.constraints.NotNull; /** * Deployment chunks. - * */ public class Chunk { @@ -40,7 +39,6 @@ public class Chunk { * of the artifact * @param artifacts * download information - * */ public Chunk(final String part, final String version, final String name, final List artifacts) { super(); @@ -58,16 +56,10 @@ public class Chunk { return version; } - /** - * @return the name - */ public String getName() { return name; } - /** - * @return the artifacts - */ public List getArtifacts() { return artifacts; } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Config.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java similarity index 93% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Config.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java index 62907b26d..4809d2c09 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Config.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java @@ -6,11 +6,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; /** * Standard configuration for the target. - * */ public class Config { diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ConfigData.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java similarity index 89% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ConfigData.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java index b7c330167..bd9a10520 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ConfigData.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import java.util.Map; @@ -17,7 +17,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Feedback channel for ConfigData action. - * */ public class ConfigData extends ActionFeedback { @@ -35,7 +34,6 @@ public class ConfigData extends ActionFeedback { * is the feedback itself * @param data * contains the attributes. - * */ @JsonCreator public ConfigData(@JsonProperty(value = "id") final Long id, @JsonProperty(value = "time") final String time, @@ -45,18 +43,10 @@ public class ConfigData extends ActionFeedback { this.data = data; } - /** - * @return the data - */ public Map getData() { return data; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "ConfigData [data=" + data + ", toString()=" + super.toString() + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ControllerBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java similarity index 89% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ControllerBase.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java index d319bcf11..ff282935d 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/ControllerBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java @@ -6,13 +6,12 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import org.springframework.hateoas.ResourceSupport; /** * {@link ControllerBase} resource content. - * */ public class ControllerBase extends ResourceSupport { @@ -29,9 +28,6 @@ public class ControllerBase extends ResourceSupport { this.config = config; } - /** - * @return the config - */ public Config getConfig() { return config; } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Deployment.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java similarity index 89% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Deployment.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java index 57ead963c..05cd730a0 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Deployment.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java @@ -6,17 +6,14 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import java.util.List; -import org.eclipse.hawkbit.repository.model.Action; - import com.fasterxml.jackson.annotation.JsonValue; /** * Detailed {@link UpdateAction} information. - * */ public class Deployment { @@ -57,9 +54,9 @@ public class Deployment { /** * The handling type for the update {@link Action}. - * */ public enum HandlingType { + /** * Not necessary for the command. */ @@ -81,20 +78,12 @@ public class Deployment { this.name = name; } - /** - * @return the name - */ @JsonValue public String getName() { return name; } } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "Deployment [download=" + download + ", update=" + update + ", chunks=" + chunks + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/DeploymentBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java similarity index 90% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/DeploymentBase.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java index ea3e1caa5..aa30c2c63 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/DeploymentBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * {@link UpdateAction} resource. - * */ public class DeploymentBase extends ResourceSupport { @@ -44,11 +43,6 @@ public class DeploymentBase extends ResourceSupport { return deployment; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "DeploymentBase [id=" + deplyomentId + ", deployment=" + deployment + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Polling.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java similarity index 93% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Polling.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java index 4e0854d98..b0471bc21 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Polling.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java @@ -6,11 +6,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; /** * Polling interval for the SP target. - * */ public class Polling { diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Progress.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java similarity index 90% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Progress.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java index 096231c7b..a3e441f31 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Progress.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import javax.validation.constraints.NotNull; @@ -16,7 +16,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Action fulfillment progress by means of gives the achieved amount of maximal * of possible levels. - * */ public class Progress { @@ -48,11 +47,6 @@ public class Progress { return of; } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "Progress [cnt=" + cnt + ", of=" + of + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Result.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java similarity index 91% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Result.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java index b5dd22aaa..f4b790b5d 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Result.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import org.hibernate.validator.constraints.NotEmpty; @@ -17,8 +17,6 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Result information of the action progress which can by an intermediate or * final update. - * - * */ public class Result { @@ -77,21 +75,12 @@ public class Result { this.name = name; } - /** - * @return the name - */ @JsonValue public String getName() { return name; } - } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "Result [finished=" + finished + ", progress=" + progress + "]"; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Status.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java similarity index 93% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Status.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java index df1622e31..80351e41f 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/model/Status.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller.model; +package org.eclipse.hawkbit.ddi.model; import java.util.List; @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Details status information concerning the action processing. - * */ public class Status { @@ -103,20 +102,12 @@ public class Status { this.name = name; } - /** - * @return the name - */ @JsonValue public String getName() { return name; } } - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ @Override public String toString() { return "Status [execution=" + execution + ", result=" + result + ", details=" + details + "]"; diff --git a/hawkbit-rest-resource/pom.xml b/hawkbit-rest-resource/pom.xml index 0be5d20f5..45d104963 100644 --- a/hawkbit-rest-resource/pom.xml +++ b/hawkbit-rest-resource/pom.xml @@ -1,13 +1,6 @@ - + 4.0.0 @@ -26,7 +19,7 @@ hawkbit-repository ${project.version} - + org.eclipse.hawkbit hawkbit-core ${project.version} @@ -36,6 +29,11 @@ hawkbit-rest-api ${project.version} + + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + javax.servlet javax.servlet-api diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java index c2dbd3ba5..020592d60 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java @@ -16,12 +16,12 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; +import org.eclipse.hawkbit.ddi.api.ArtifactStoreControllerDdiApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.ActionStatus; -import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; @@ -32,28 +32,20 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** - * The {@link ArtifactStoreController} of the SP server controller API that is - * queried by the SP target in order to download artifacts independent of their - * own individual resource. This is offered in addition to the + * The {@link ArtifactStoreController} of the Rollouts server controller API + * that is queried by the SP target in order to download artifacts independent + * of their own individual resource. This is offered in addition to the * {@link RootController#downloadArtifact(String, Long, Long, javax.servlet.http.HttpServletResponse)} * for legacy controllers that can not be fed with a download URI at runtime. * - * - * - * - * + * TODO */ @RestController -@RequestMapping(ControllerConstants.ARTIFACTS_V1_REQUEST_MAPPING) -public class ArtifactStoreController { +public class ArtifactStoreController implements ArtifactStoreControllerDdiApi { + private static final Logger LOG = LoggerFactory.getLogger(ArtifactStoreController.class); @Autowired @@ -68,29 +60,9 @@ public class ArtifactStoreController { @Autowired private HawkbitSecurityProperties securityProperties; - /** - * Handles GET {@link Artifact} download request. This could be full or - * partial download request. - * - * @param fileName - * to search for - * @param response - * to write to - * @param request - * from the client - * @param targetid - * of authenticated target - * - * @return response of the servlet which in case of success is status code - * {@link HttpStatus#OK} or in case of partial download - * {@link HttpStatus#PARTIAL_CONTENT}. - */ - @RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME - + "/{fileName}") - @ResponseBody - public ResponseEntity downloadArtifactByFilename(@PathVariable final String fileName, - final HttpServletResponse response, final HttpServletRequest request, - @AuthenticationPrincipal final String targetid) { + @Override + public ResponseEntity downloadArtifactByFilename(final String fileName, final HttpServletResponse response, + final HttpServletRequest request, final String targetid) { ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -112,8 +84,7 @@ public class ArtifactStoreController { final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); // we set a download status only if we are aware of the - // targetid, i.e. - // authenticated and not anonymous + // targetid, i.e. authenticated and not anonymous if (targetid != null && !"anonymous".equals(targetid)) { final Action action = checkAndReportDownloadByTarget(request, targetid, artifact); result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, @@ -124,10 +95,31 @@ public class ArtifactStoreController { } } - return result; } + @Override + public ResponseEntity downloadArtifactMD5ByFilename(final String fileName, + final HttpServletResponse response) { + final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); + + if (foundArtifacts.isEmpty()) { + LOG.warn("Softeare artifact with name {} could not be found.", fileName); + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } else if (foundArtifacts.size() > 1) { + LOG.error("Softeare artifact name {} is not unique.", fileName); + } + + try { + DataConversionHelper.writeMD5FileResponse(fileName, response, foundArtifacts.get(0)); + } catch (final IOException e) { + LOG.error("Failed to stream MD5 File", e); + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + return new ResponseEntity<>(HttpStatus.OK); + } + private Action checkAndReportDownloadByTarget(final HttpServletRequest request, final String targetid, final LocalArtifact artifact) { final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -151,38 +143,4 @@ public class ArtifactStoreController { return action; } - /** - * Handles GET {@link Artifact} MD5 checksum file download request. - * - * @param fileName - * to search for - * @param response - * to write to - * - * @return response of the servlet - */ - @RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME - + "/{fileName}" + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX) - @ResponseBody - public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable final String fileName, - final HttpServletResponse response) { - final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); - - if (foundArtifacts.isEmpty()) { - LOG.warn("Softeare artifact with name {} could not be found.", fileName); - return new ResponseEntity<>(HttpStatus.NOT_FOUND); - } else if (foundArtifacts.size() > 1) { - LOG.error("Softeare artifact name {} is not unique.", fileName); - } - - try { - DataConversionHelper.writeMD5FileResponse(fileName, response, foundArtifacts.get(0)); - } catch (final IOException e) { - LOG.error("Failed to stream MD5 File", e); - return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); - } - - return new ResponseEntity<>(HttpStatus.OK); - } - } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java index e035c47ee..8c43a91ba 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java @@ -20,11 +20,12 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.UrlProtocol; -import org.eclipse.hawkbit.controller.model.Artifact; -import org.eclipse.hawkbit.controller.model.Chunk; -import org.eclipse.hawkbit.controller.model.Config; -import org.eclipse.hawkbit.controller.model.ControllerBase; -import org.eclipse.hawkbit.controller.model.Polling; +import org.eclipse.hawkbit.ddi.ControllerConstants; +import org.eclipse.hawkbit.ddi.model.Artifact; +import org.eclipse.hawkbit.ddi.model.Chunk; +import org.eclipse.hawkbit.ddi.model.Config; +import org.eclipse.hawkbit.ddi.model.ControllerBase; +import org.eclipse.hawkbit.ddi.model.Polling; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.LocalArtifact; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java index 846e1e8d2..daee203bf 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java @@ -20,9 +20,6 @@ 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) diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java index b4dae3b88..b59bd5efc 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java @@ -13,15 +13,9 @@ import org.eclipse.hawkbit.exception.SpServerRtException; /** * Thrown if artifact content streaming to client failed. - * - * - * - * */ public final class FileSteamingFailedException extends SpServerRtException { - /** - * - */ + private static final long serialVersionUID = 1L; /** @@ -33,6 +27,8 @@ public final class FileSteamingFailedException extends SpServerRtException { } /** + * Constructor with Throwable. + * * @param cause * for the exception */ @@ -41,6 +37,8 @@ public final class FileSteamingFailedException extends SpServerRtException { } /** + * Constructor with error string. + * * @param message * of the error */ diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java index f704acd5e..e630339d5 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java @@ -18,16 +18,17 @@ import javax.validation.Valid; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; -import org.eclipse.hawkbit.controller.model.ActionFeedback; -import org.eclipse.hawkbit.controller.model.Cancel; -import org.eclipse.hawkbit.controller.model.CancelActionToStop; -import org.eclipse.hawkbit.controller.model.Chunk; -import org.eclipse.hawkbit.controller.model.ConfigData; -import org.eclipse.hawkbit.controller.model.ControllerBase; -import org.eclipse.hawkbit.controller.model.Deployment; -import org.eclipse.hawkbit.controller.model.Deployment.HandlingType; -import org.eclipse.hawkbit.controller.model.DeploymentBase; -import org.eclipse.hawkbit.controller.model.Result.FinalResult; +import org.eclipse.hawkbit.ddi.api.RootControllerDdiApi; +import org.eclipse.hawkbit.ddi.model.ActionFeedback; +import org.eclipse.hawkbit.ddi.model.Cancel; +import org.eclipse.hawkbit.ddi.model.CancelActionToStop; +import org.eclipse.hawkbit.ddi.model.Chunk; +import org.eclipse.hawkbit.ddi.model.ConfigData; +import org.eclipse.hawkbit.ddi.model.ControllerBase; +import org.eclipse.hawkbit.ddi.model.Deployment; +import org.eclipse.hawkbit.ddi.model.Deployment.HandlingType; +import org.eclipse.hawkbit.ddi.model.DeploymentBase; +import org.eclipse.hawkbit.ddi.model.Result.FinalResult; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.SoftwareManagement; @@ -35,7 +36,6 @@ import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.ActionStatus; -import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; @@ -49,26 +49,23 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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; import org.springframework.web.bind.annotation.RestController; /** - * The {@link RootController} of the SP server controller API that is queried by - * the SP controller in order to pull {@link Action}s that have to be fullfilled - * and report status updates concerning the {@link Action} processing. + * The {@link RootController} of the hawkBit server controller API that is + * queried by the hawkBit controller in order to pull {@link Action}s that have + * to be fulfilled and report status updates concerning the {@link Action} + * processing. * * Transactional (read-write) as all queries at least update the last poll time. * */ @RestController -@RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING) -public class RootController { +public class RootController implements RootControllerDdiApi { 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 ({})."; @@ -94,19 +91,8 @@ public class RootController { @Autowired private ArtifactUrlHandler artifactUrlHandler; - /** - * Returns all artifacts of a given software module and target. - * - * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} - * @param softwareModuleId - * of the {@link SoftwareModule} - * @return the response - */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts", produces = { - "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getSoftwareModulesArtifacts( + @Override + public ResponseEntity> getSoftwareModulesArtifacts( @PathVariable final String targetid, @PathVariable final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); @@ -122,18 +108,7 @@ public class RootController { HttpStatus.OK); } - /** - * Root resource for an individual {@link Target}. - * - * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} - * @param request - * the HTTP request injected by spring - * @return the response - */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) + @Override public ResponseEntity getControllerBase(@PathVariable final String targetid, final HttpServletRequest request) { LOG.debug("getControllerBase({})", targetid); @@ -154,26 +129,7 @@ public class RootController { HttpStatus.OK); } - /** - * Handles GET {@link Artifact} download request. This could be full or - * partial (as specified by RFC7233 (Range Requests)) download request. - * - * @param targetid - * of the related - * @param softwareModuleId - * of the parent {@link SoftwareModule} - * @param fileName - * of the related {@link LocalArtifact} - * @param response - * of the servlet - * @param request - * from the client - * - * @return response of the servlet which in case of success is status code - * {@link HttpStatus#OK} or in case of partial download - * {@link HttpStatus#PARTIAL_CONTENT}. - */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") + @Override public ResponseEntity downloadArtifact(@PathVariable final String targetid, @PathVariable final Long softwareModuleId, @PathVariable final String fileName, final HttpServletResponse response, final HttpServletRequest request) { @@ -198,9 +154,7 @@ public class RootController { result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, cacheWriteNotify, action.getId()); } - } - return result; } @@ -228,25 +182,7 @@ public class RootController { return null == module || !module.getLocalArtifactByFilename(fileName).isPresent(); } - /** - * Handles GET {@link Artifact} MD5 checksum file download request. - * - * @param targetid - * of the related - * @param softwareModuleId - * of the parent {@link SoftwareModule} - * @param fileName - * of the related {@link LocalArtifact} - * @param response - * of the servlet - * @param request - * the HTTP request injected by spring - * - * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if - * successful - */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" - + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) + @Override public ResponseEntity downloadArtifactMd5(@PathVariable final String targetid, @PathVariable final Long softwareModuleId, @PathVariable final String fileName, final HttpServletResponse response, final HttpServletRequest request) { @@ -271,25 +207,7 @@ public class RootController { return new ResponseEntity<>(HttpStatus.OK); } - /** - * Resource for {@link SoftwareModule} {@link UpdateAction}s. - * - * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} - * @param actionId - * of the {@link DeploymentBase} that matches to - * {@link Target#getActiveActions()} - * @param resource - * an hashcode of the resource which indicates if the action has - * been changed, e.g. from 'soft' to 'force' and the eTag needs - * to be re-generated - * @param request - * the HTTP request injected by spring - * @return the response - */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION - + "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @Override public ResponseEntity getControllerBasedeploymentAction( @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, @@ -325,23 +243,7 @@ public class RootController { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - /** - * This is the feedback channel for the {@link DeploymentBase} action. - * - * @param feedback - * to provide - * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} - * @param actionId - * of the action we have feedback for - * @param request - * the HTTP request injected by spring - * - * @return the response - */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + @Override public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback, @PathVariable final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { @@ -369,8 +271,9 @@ public class RootController { return new ResponseEntity<>(HttpStatus.GONE); } - controllerManagement.addUpdateActionStatus(generateUpdateStatus(feedback, targetid, feedback.getId(), action), - action); + controllerManagement.addUpdateActionStatus( + + generateUpdateStatus(feedback, targetid, feedback.getId(), action), action); return new ResponseEntity<>(HttpStatus.OK); @@ -437,20 +340,7 @@ public class RootController { } } - /** - * This is the feedback channel for the config data action. - * - * @param configData - * as body - * @param targetid - * to provide data for - * @param request - * the HTTP request injected by spring - * - * @return status of the request - */ - @RequestMapping(value = "/{targetid}/" - + ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + @Override public ResponseEntity putConfigData(@Valid @RequestBody final ConfigData configData, @PathVariable final String targetid, final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, @@ -461,20 +351,7 @@ public class RootController { return new ResponseEntity<>(HttpStatus.OK); } - /** - * {@link RequestMethod.GET} method for the {@link Cancel} action. - * - * @param targetid - * ID of the calling target - * @param actionId - * of the action - * @param request - * the HTTP request injected by spring - * - * @return the {@link Cancel} response - */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION - + "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) + @Override public ResponseEntity getControllerCancelAction(@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { LOG.debug("getControllerCancelAction({})", targetid); @@ -503,24 +380,7 @@ public class RootController { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - /** - * {@link RequestMethod.POST} method receiving the {@link ActionFeedback} - * from the target. - * - * @param feedback - * the {@link ActionFeedback} from the target. - * @param targetid - * the ID of the calling target - * @param actionId - * of the action we have feedback for - * @param request - * the HTTP request injected by spring - * - * @return the {@link ActionFeedback} response - */ - - @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + @Override public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback, @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { diff --git a/pom.xml b/pom.xml index 0c3207c13..aad9b8976 100644 --- a/pom.xml +++ b/pom.xml @@ -1,3 +1,4 @@ + - +--> 4.0.0 @@ -27,6 +26,7 @@ hawkbit-dmf-api hawkbit-rest-api + hawkbit-ddi-api hawkbit-core hawkbit-security-core hawkbit-repository @@ -40,7 +40,7 @@ hawkbit-cache-redis hawkbit-test-report examples - + @@ -244,7 +244,7 @@ - + @@ -258,7 +258,7 @@ - + @@ -626,4 +626,4 @@ - + \ No newline at end of file From 4854888934bc048eac9f9928efea8f5768a78ef3 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Fri, 15 Apr 2016 12:53:39 +0200 Subject: [PATCH 003/124] Consitent breadcrumb usage Signed-off-by: Melanie Retter --- .../CreateOrUpdateFilterHeader.java | 35 +++++++++++++++++-- .../FilterManagementView.java | 25 ++++++------- .../event/CustomFilterUIEvent.java | 2 +- .../rolloutgroup/RolloutGroupsListHeader.java | 1 + .../themes/hawkbit/customstyles/others.scss | 4 +++ .../src/main/resources/messages.properties | 3 ++ .../src/main/resources/messages_de.properties | 3 ++ .../src/main/resources/messages_en.properties | 3 ++ 8 files changed, 61 insertions(+), 15 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index 97d2bf031..684321a2a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -93,6 +93,10 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button @Qualifier("uiExecutor") private transient Executor executor; + private HorizontalLayout breadcrumbLayout; + + private Button breadcrumbButton; + private Label headerCaption; private TextField queryTextField; @@ -201,6 +205,10 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button } private void createComponents() { + + // Breadcrumb + breadcrumbButton = createBreadcrumbButton(); + headerCaption = SPUIComponentProvider.getLabel(SPUILabelDefinitions.VAR_CREATE_FILTER, SPUILabelDefinitions.SP_WIDGET_CAPTION); @@ -221,12 +229,23 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button closeIcon = createSearchResetIcon(); } + private Button createBreadcrumbButton() { + final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, + SPUIButtonStyleSmallNoBorder.class); + createFilterViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); + createFilterViewLink.setDescription(i18n.get("breadcrumb.target.filter.custom.filters")); + createFilterViewLink.setCaption(i18n.get("breadcrumb.target.filter.custom.filters")); + createFilterViewLink.addClickListener(value -> showCustomFiltersView()); + + return createFilterViewLink; + } + private TextField createNameTextField() { final TextField nameField = SPUIComponentProvider.getTextField("", ValoTheme.TEXTFIELD_TINY, false, null, i18n.get("textfield.customfiltername"), true, SPUILabelDefinitions.TEXT_FIELD_MAX_LENGTH); nameField.setId(SPUIComponetIdProvider.CUSTOM_FILTER_ADD_NAME); nameField.setPropertyDataSource(nameLabel); - nameField.addTextChangeListener(event -> onFiterNameChange(event)); + nameField.addTextChangeListener(event -> onFilterNameChange(event)); return nameField; } @@ -256,7 +275,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button }; } - private void onFiterNameChange(final TextChangeEvent event) { + private void onFilterNameChange(final TextChangeEvent event) { if (isNameAndQueryEmpty(event.getText(), queryTextField.getValue()) || (event.getText().equals(oldFilterName) && queryTextField.getValue().equals(oldFilterQuery))) { saveButton.setEnabled(false); @@ -276,6 +295,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button titleFilterIconsLayout.addComponents(headerCaption, captionLayout); titleFilterIconsLayout.setSpacing(true); + breadcrumbLayout = new HorizontalLayout(); + breadcrumbLayout.addComponent(breadcrumbButton); + breadcrumbLayout.addComponent(new Label(">")); + headerCaption.addStyleName("breadcrumbPaddingLeft"); + breadcrumbLayout.addComponent(headerCaption); + final HorizontalLayout titleFilterLayout = new HorizontalLayout(); titleFilterLayout.setSizeFull(); titleFilterLayout.addComponents(titleFilterIconsLayout, closeIcon); @@ -302,10 +327,12 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button queryLayout.setSpacing(true); queryLayout.addComponents(searchLayout, iconLayout); + addComponent(breadcrumbLayout); addComponent(titleFilterLayout); addComponent(queryLayout); setSpacing(true); addStyleName(SPUIStyleDefinitions.WIDGET_TITLE); + addStyleName("bordered-layout"); } private void setUpCaptionLayout(final boolean isCreateView) { @@ -524,4 +551,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button } } + private void showCustomFiltersView() { + eventBus.publish(this, CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT); + } + } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java index 06cbe4d69..414dee239 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java @@ -96,7 +96,8 @@ public class FilterManagementView extends VerticalLayout implements View { } else if (custFilterUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK || custFilterUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) { this.getUI().access(() -> viewCreateTargetFilterLayout()); - } else if (custFilterUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW) { + } else if (custFilterUIEvent == CustomFilterUIEvent.EXIT_CREATE_OR_UPDATE_FILTRER_VIEW + || custFilterUIEvent == CustomFilterUIEvent.SHOW_FILTER_MANAGEMENT) { UI.getCurrent().access(() -> viewListView()); } } @@ -135,17 +136,17 @@ public class FilterManagementView extends VerticalLayout implements View { private void viewListView() { removeAllComponents(); - final VerticalLayout tableHeaderLayout = new VerticalLayout(); - tableHeaderLayout.setSizeFull(); - tableHeaderLayout.setSpacing(false); - tableHeaderLayout.setMargin(false); - tableHeaderLayout.setStyleName("table-layout"); - tableHeaderLayout.addComponent(targetFilterHeader); - tableHeaderLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER); - tableHeaderLayout.addComponent(targetFilterTable); - tableHeaderLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER); - tableHeaderLayout.setExpandRatio(targetFilterTable, 1.0f); - addComponent(tableHeaderLayout); + final VerticalLayout tableListViewLayout = new VerticalLayout(); + tableListViewLayout.setSizeFull(); + tableListViewLayout.setSpacing(false); + tableListViewLayout.setMargin(false); + tableListViewLayout.setStyleName("table-layout"); + tableListViewLayout.addComponent(targetFilterHeader); + tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER); + tableListViewLayout.addComponent(targetFilterTable); + tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER); + tableListViewLayout.setExpandRatio(targetFilterTable, 1.0f); + addComponent(tableListViewLayout); } private HorizontalLayout addTargetFilterMessageLabel() { diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java index 57de12aca..a09d3d397 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java @@ -15,5 +15,5 @@ package org.eclipse.hawkbit.ui.filtermanagement.event; * */ public enum CustomFilterUIEvent { - FILTER_TARGET_BY_QUERY, FILTER_BY_CUST_FILTER_TEXT, FILTER_BY_CUST_FILTER_TEXT_REMOVE, CREATE_NEW_FILTER_CLICK, EXIT_CREATE_OR_UPDATE_FILTRER_VIEW, TARGET_FILTER_DETAIL_VIEW, TARGET_DETAILS_VIEW, CREATE_TARGET_FILTER_QUERY, UPDATED_TARGET_FILTER_QUERY, UPDATE_TARGET_FILTER_SEARCH_ICON + FILTER_TARGET_BY_QUERY, FILTER_BY_CUST_FILTER_TEXT, FILTER_BY_CUST_FILTER_TEXT_REMOVE, CREATE_NEW_FILTER_CLICK, EXIT_CREATE_OR_UPDATE_FILTRER_VIEW, TARGET_FILTER_DETAIL_VIEW, TARGET_DETAILS_VIEW, CREATE_TARGET_FILTER_QUERY, UPDATED_TARGET_FILTER_QUERY, UPDATE_TARGET_FILTER_SEARCH_ICON, SHOW_FILTER_MANAGEMENT } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java index 45c16eeed..e85d96d7a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java @@ -161,6 +161,7 @@ public class RolloutGroupsListHeader extends AbstractGridHeader { final HorizontalLayout headerCaptionLayout = new HorizontalLayout(); headerCaptionLayout.addComponent(rolloutsListViewLink); headerCaptionLayout.addComponent(new Label(">")); + headerCaption.addStyleName("breadcrumbPaddingLeft"); headerCaptionLayout.addComponent(headerCaption); return headerCaptionLayout; diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss index 879fb8dd6..d327baa94 100644 --- a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss +++ b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss @@ -228,4 +228,8 @@ .v-tooltip{ max-width:43em; } + + .breadcrumbPaddingLeft{ + padding-left: 3px !important; + } } diff --git a/hawkbit-ui/src/main/resources/messages.properties b/hawkbit-ui/src/main/resources/messages.properties index 25dabd354..0f65ebe13 100644 --- a/hawkbit-ui/src/main/resources/messages.properties +++ b/hawkbit-ui/src/main/resources/messages.properties @@ -487,3 +487,6 @@ message.error.starting.rollout = Server error. Error starting rollout. Please co #Menu menu.title = Software Provisioning + +#Target Filter Management +breadcrumb.target.filter.custom.filters = Custom Filters diff --git a/hawkbit-ui/src/main/resources/messages_de.properties b/hawkbit-ui/src/main/resources/messages_de.properties index 39661e3c9..12f04048a 100644 --- a/hawkbit-ui/src/main/resources/messages_de.properties +++ b/hawkbit-ui/src/main/resources/messages_de.properties @@ -473,3 +473,6 @@ label.target.per.group = Targets per group : message.dist.already.assigned = Distribution {0} is already assigned to target message.error.creating.rollout = Server error. Error creating rollout. Please contact the administrator message.error.starting.rollout = Server error. Error starting rollout. Please contact the administrator + +#Target Filter Management +breadcrumb.target.filter.custom.filters = Custom Filters diff --git a/hawkbit-ui/src/main/resources/messages_en.properties b/hawkbit-ui/src/main/resources/messages_en.properties index 23df35ad2..23b8149e3 100644 --- a/hawkbit-ui/src/main/resources/messages_en.properties +++ b/hawkbit-ui/src/main/resources/messages_en.properties @@ -464,3 +464,6 @@ label.target.per.group = Targets per group : message.dist.already.assigned = Distribution {0} is already assigned to target message.error.creating.rollout = Server error. Error creating rollout. Please contact the administrator message.error.starting.rollout = Server error. Error starting rollout. Please contact the administrator + +#Target Filter Management +breadcrumb.target.filter.custom.filters = Custom Filters From 3145709824134e02bb682cf89e9636bf28354157 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Mon, 18 Apr 2016 12:39:28 +0200 Subject: [PATCH 004/124] Move DDI resources and annotation to module hawkbit-ddi-resource - created module and moved resources Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-app/pom.xml | 5 + .../java/org/eclipse/hawkbit/app/Start.java | 2 +- hawkbit-autoconfigure/pom.xml | 6 + .../ResourceControllerAutoConfiguration.java | 2 +- hawkbit-ddi-resource/pom.xml | 156 ++++++++++++++++++ .../resource}/ArtifactStoreController.java | 2 +- .../ddi/resource}/DataConversionHelper.java | 2 +- .../ddi/resource}/EnableDirectDeviceApi.java | 2 +- .../hawkbit/ddi/resource}/RootController.java | 2 +- .../ddi/resource}/ArtifactDownloadTest.java | 2 +- .../ddi/resource}/CancelActionTest.java | 2 +- .../hawkbit/ddi/resource}/ConfigDataTest.java | 2 +- .../ddi/resource}/DeploymentBaseTest.java | 2 +- .../ddi/resource}/RootControllerTest.java | 2 +- .../helper}/FileSteamingFailedException.java | 2 +- .../helper/RestResourceConversionHelper.java | 3 +- pom.xml | 3 +- 17 files changed, 182 insertions(+), 15 deletions(-) create mode 100644 hawkbit-ddi-resource/pom.xml rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource}/ArtifactStoreController.java (99%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource}/DataConversionHelper.java (99%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource}/EnableDirectDeviceApi.java (95%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource}/RootController.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource}/ArtifactDownloadTest.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource}/CancelActionTest.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource}/ConfigDataTest.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource}/DeploymentBaseTest.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource}/RootControllerTest.java (99%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/{controller => rest/resource/helper}/FileSteamingFailedException.java (96%) diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index a5c0f864d..fccd835bc 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -67,6 +67,11 @@ hawkbit-rest-resource ${project.version} + + org.eclipse.hawkbit + hawkbit-ddi-resource + ${project.version} + org.eclipse.hawkbit hawkbit-dmf-amqp diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index a517dbb08..7038e64d8 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -10,7 +10,7 @@ package org.eclipse.hawkbit.app; import org.eclipse.hawkbit.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration; -import org.eclipse.hawkbit.controller.EnableDirectDeviceApi; +import org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi; import org.eclipse.hawkbit.rest.resource.EnableRestResources; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/hawkbit-autoconfigure/pom.xml b/hawkbit-autoconfigure/pom.xml index 7670da406..dcbb95920 100644 --- a/hawkbit-autoconfigure/pom.xml +++ b/hawkbit-autoconfigure/pom.xml @@ -67,6 +67,12 @@ hawkbit-rest-resource ${project.version} true + + + org.eclipse.hawkbit + hawkbit-ddi-resource + ${project.version} + true org.springframework diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index 1d75510e4..87c4ecf98 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -8,7 +8,7 @@ */ package org.eclipse.hawkbit.autoconfigure.web; -import org.eclipse.hawkbit.controller.EnableDirectDeviceApi; +import org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi; import org.eclipse.hawkbit.rest.resource.EnableRestResources; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml new file mode 100644 index 000000000..3300cbedd --- /dev/null +++ b/hawkbit-ddi-resource/pom.xml @@ -0,0 +1,156 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-ddi-resource + hawkBit :: DDI Resources + + + + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-rest-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + + + org.eclipse.hawkbit + hawkbit-core + ${project.version} + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + test + + + org.springframework.boot + spring-boot-starter-log4j2 + test + + + com.h2database + h2 + test + + + org.mariadb.jdbc + mariadb-java-client + test + + + javax.el + javax.el-api + test + + + org.springframework.security + spring-security-config + test + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + tests + test + + + org.eclipse.hawkbit + hawkbit-http-security + ${project.version} + test + + + com.jayway.jsonpath + json-path + test + + + org.json + json + test + + + com.fasterxml.jackson.core + jackson-databind + test + + + com.fasterxml.jackson.core + jackson-core + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-aspects + test + + + org.easytesting + fest-assert-core + test + + + org.easytesting + fest-assert + test + + + de.flapdoodle.embed + de.flapdoodle.embed.mongo + test + + + ru.yandex.qatools.allure + allure-junit-adaptor + test + + + org.springframework + spring-context-support + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java similarity index 99% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java index 020592d60..5709c08d3 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/ArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import java.io.IOException; import java.util.List; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java similarity index 99% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java index 8c43a91ba..dd88e7cee 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java similarity index 95% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java index daee203bf..0d5a81e29 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/EnableDirectDeviceApi.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java similarity index 99% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java index e630339d5..baadc5c42 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import java.io.IOException; import java.util.List; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java index 6149472a7..c73eb24b5 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ArtifactDownloadTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.junit.Assert.assertTrue; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java index d7e0351cf..e4b2fa5a9 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/CancelActionTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java index a2b26c218..6dbef5674 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/ConfigDataTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java index 5dd956ad3..714866274 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/DeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java index fa2c5f6d4..26ea7c543 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/controller/RootControllerTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.ddi.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java similarity index 96% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java rename to hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java index b59bd5efc..e246bc6cd 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/FileSteamingFailedException.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.controller; +package org.eclipse.hawkbit.rest.resource.helper; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java index e7b588222..f09bd7401 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java @@ -23,7 +23,6 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; -import org.eclipse.hawkbit.controller.FileSteamingFailedException; import org.eclipse.hawkbit.repository.model.Action.ActionType; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest; @@ -286,7 +285,7 @@ public final class RestResourceConversionHelper { private static long copyStreams(final InputStream from, final OutputStream to, final CacheWriteNotify cacheWriteNotify, final Long statusId, final long start, final long length) - throws IOException { + throws IOException { checkNotNull(from); checkNotNull(to); final byte[] buf = new byte[BUFFER_SIZE]; diff --git a/pom.xml b/pom.xml index aad9b8976..11374a16d 100644 --- a/pom.xml +++ b/pom.xml @@ -34,12 +34,13 @@ hawkbit-security-integration hawkbit-http-security hawkbit-rest-resource + hawkbit-ddi-resource hawkbit-ui hawkbit-artifact-repository-mongo hawkbit-autoconfigure hawkbit-cache-redis hawkbit-test-report - examples + examples From abe6dc223f9d3c2f643142e274a9f3da0cfbf48b Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Mon, 18 Apr 2016 12:51:57 +0200 Subject: [PATCH 005/124] Created hawkbit-example-ddi-client example maven module Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 26 +++++++++++++ .../org/hawkbit/example/ddi/client/App.java | 13 +++++++ .../hawkbit/example/ddi/client/AppTest.java | 38 +++++++++++++++++++ examples/pom.xml | 8 ++-- 4 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 examples/hawkbit-example-ddi-client/pom.xml create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java create mode 100644 examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml new file mode 100644 index 000000000..7630a5a9e --- /dev/null +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-examples-parent + 0.2.0-SNAPSHOT + + org.eclipse.hawkbit + hawkbit-example-ddi-client + 0.2.0-SNAPSHOT + hawkbit-example-ddi-client + http://maven.apache.org + + UTF-8 + + + + junit + junit + 3.8.1 + test + + + diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java b/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java new file mode 100644 index 000000000..cd85d3a8b --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java @@ -0,0 +1,13 @@ +package org.hawkbit.example.ddi.client; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java new file mode 100644 index 000000000..395886a2d --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java @@ -0,0 +1,38 @@ +package org.hawkbit.example.ddi.client; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/examples/pom.xml b/examples/pom.xml index 5f1377123..ae10dac0c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -1,3 +1,4 @@ + - +--> 4.0.0 @@ -26,6 +25,7 @@ hawkbit-device-simulator hawkbit-example-app hawkbit-mgmt-api-client - + hawkbit-example-ddi-client + \ No newline at end of file From cd2db4e36eff18222503d98f052ac772a5c3555b Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Mon, 18 Apr 2016 14:01:59 +0200 Subject: [PATCH 006/124] Updated pom to receive correct dependencies Signed-off-by: Jonathan Philip Knoblauch --- hawkbit-ddi-resource/pom.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index 3300cbedd..08cd03828 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -16,23 +16,30 @@ hawkbit-ddi-api ${project.version} - + org.eclipse.hawkbit hawkbit-rest-resource ${project.version} - + org.eclipse.hawkbit hawkbit-repository ${project.version} - + + + org.eclipse.hawkbit + hawkbit-rest-resource + ${project.version} + test + tests + org.springframework.boot spring-boot-starter From 97f099d1946c493999a5794a6cd0ee6674d03d36 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 19 Apr 2016 09:10:27 +0200 Subject: [PATCH 007/124] Move DDI resources and annotation to module hawkbit-ddi-resource - added missing pathVaraible - added port to download urls and adjusted tests - extended feign management API client - fixed pom test artifacts dependencies Signed-off-by: Jonathan Philip Knoblauch --- .../builder/DistributionSetBuilder.java | 10 +++++ .../api/ArtifactUrlHandlerProperties.java | 2 +- hawkbit-ddi-resource/pom.xml | 11 ++--- .../ddi/resource/ArtifactStoreController.java | 15 ++++--- .../ddi/resource/DataConversionHelper.java | 2 +- .../hawkbit/ddi/resource/RootController.java | 8 ++-- .../ddi/resource/DeploymentBaseTest.java | 44 +++++++++---------- 7 files changed, 48 insertions(+), 44 deletions(-) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java index 358cff0db..2e2d91928 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost; +import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; import com.google.common.collect.Lists; @@ -23,6 +24,7 @@ public class DistributionSetBuilder { private String name; private String version; private String type; + private final List modules = new ArrayList<>(); /** * @param name @@ -34,6 +36,13 @@ public class DistributionSetBuilder { return this; } + public DistributionSetBuilder moduleByID(final Long id) { + final SoftwareModuleAssigmentRest softwareModuleAssigmentRest = new SoftwareModuleAssigmentRest(); + softwareModuleAssigmentRest.setId(id); + modules.add(softwareModuleAssigmentRest); + return this; + } + /** * @param version * the version of the distribution set @@ -89,6 +98,7 @@ public class DistributionSetBuilder { body.setName(prefixName); body.setVersion(version); body.setType(type); + body.setModules(modules); return body; } diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java index 33fe8651e..a1cb8bbd9 100644 --- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java +++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java @@ -17,7 +17,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("hawkbit.artifact.url") public class ArtifactUrlHandlerProperties { private static final String DEFAULT_IP_LOCALHOST = "127.0.0.1"; - private static final String LOCALHOST = "localhost"; + private static final String LOCALHOST = "localhost:8080"; private final Http http = new Http(); private final Https https = new Https(); diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index 08cd03828..bcc1b4932 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -26,11 +26,6 @@ hawkbit-repository ${project.version} - @@ -38,7 +33,7 @@ hawkbit-rest-resource ${project.version} test - tests + tests org.springframework.boot @@ -139,11 +134,11 @@ allure-junit-adaptor test - + org.springframework spring-context-support test - + diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java index 5709c08d3..ec8a994b0 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java @@ -32,16 +32,16 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** - * The {@link ArtifactStoreController} of the Rollouts server controller API - * that is queried by the SP target in order to download artifacts independent + * The {@link ArtifactStoreController} of the HawkBit server controller API that + * is queried by the HawkBit target in order to download artifacts independent * of their own individual resource. This is offered in addition to the * {@link RootController#downloadArtifact(String, Long, Long, javax.servlet.http.HttpServletResponse)} * for legacy controllers that can not be fed with a download URI at runtime. - * - * TODO */ @RestController public class ArtifactStoreController implements ArtifactStoreControllerDdiApi { @@ -61,8 +61,9 @@ public class ArtifactStoreController implements ArtifactStoreControllerDdiApi { private HawkbitSecurityProperties securityProperties; @Override - public ResponseEntity downloadArtifactByFilename(final String fileName, final HttpServletResponse response, - final HttpServletRequest request, final String targetid) { + public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, + final HttpServletResponse response, final HttpServletRequest request, + @AuthenticationPrincipal final String targetid) { ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -99,7 +100,7 @@ public class ArtifactStoreController implements ArtifactStoreControllerDdiApi { } @Override - public ResponseEntity downloadArtifactMD5ByFilename(final String fileName, + public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, final HttpServletResponse response) { final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java index dd88e7cee..75adebb45 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java @@ -38,7 +38,7 @@ import org.springframework.hateoas.Link; import com.google.common.base.Charsets; /** - * Utility class for the Controller API. + * Utility class for the DDI API. */ public final class DataConversionHelper { diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java index baadc5c42..9fb0fca1d 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java @@ -56,13 +56,11 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * The {@link RootController} of the hawkBit server controller API that is - * queried by the hawkBit controller in order to pull {@link Action}s that have - * to be fulfilled and report status updates concerning the {@link Action} - * processing. + * The {@link RootController} of the hawkBit server DDI API that is queried by + * the hawkBit controller in order to pull {@link Action}s that have to be + * fulfilled and report status updates concerning the {@link Action} processing. * * Transactional (read-write) as all queries at least update the last poll time. - * */ @RestController public class RootController implements RootControllerDdiApi { diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java index 714866274..4b985f5ba 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java @@ -170,23 +170,23 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0].hashes.sha1", equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) @@ -200,22 +200,22 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) @@ -315,12 +315,12 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0].hashes.sha1", equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) @@ -333,22 +333,22 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) @@ -445,22 +445,22 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) @@ -473,23 +473,23 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost/" + tenantAware.getCurrentTenant() + equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost/" + tenantAware.getCurrentTenant() + equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) From 12cca669fe2e5afdeeaa62d1dd7fb7e7309a1ef7 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 19 Apr 2016 09:29:55 +0200 Subject: [PATCH 008/124] Added missing javadoc to DDI resources Signed-off-by: Jonathan Philip Knoblauch --- .../org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java | 2 -- .../org/eclipse/hawkbit/ddi/resource/CancelActionTest.java | 3 +++ .../java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java | 3 +++ .../org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java | 3 +++ .../org/eclipse/hawkbit/ddi/resource/RootControllerTest.java | 3 +++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java index c73eb24b5..f7173f86e 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java @@ -56,9 +56,7 @@ import ru.yandex.qatools.allure.annotations.Stories; /** * Test artifact downloads from the controller. - * */ - @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Artifact Download Resource") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java index e4b2fa5a9..3c236c196 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java @@ -39,6 +39,9 @@ import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; +/** + * Test cancel action from the controller. + */ @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Cancel Action Resource") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java index 6dbef5674..ee40d6ded 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java @@ -34,6 +34,9 @@ import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; +/** + * Test config data from the controller. + */ @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Config Data Resource") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java index 4b985f5ba..4ba5c9cdf 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java @@ -51,6 +51,9 @@ import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; +/** + * Test deployment base from the controller. + */ @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Deployment Action Resource") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java index 26ea7c543..be390959a 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java @@ -45,6 +45,9 @@ import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; +/** + * Test the root controller resources. + */ @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Root Poll Resource") From 3c0e34ee410cbc2f282a168916a94fa1d549aa5f Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 20 Apr 2016 13:42:43 +0200 Subject: [PATCH 009/124] Rename Ddi classes Signed-off-by: SirWayne --- .../java/org/eclipse/hawkbit/app/Start.java | 4 +- .../ResourceControllerAutoConfiguration.java | 6 +- .../hawkbit/ddi/annotation/EnableDdiApi.java | 30 ++++++++ .../model/DdiActionFeedback.java} | 12 ++-- .../model/DdiArtifact.java} | 6 +- .../Cancel.java => json/model/DdiCancel.java} | 10 +-- .../model/DdiCancelActionToStop.java} | 6 +- .../Chunk.java => json/model/DdiChunk.java} | 10 +-- .../Config.java => json/model/DdiConfig.java} | 10 +-- .../model/DdiConfigData.java} | 8 +-- .../model/DdiControllerBase.java} | 12 ++-- .../model/DdiDeployment.java} | 10 +-- .../model/DdiDeploymentBase.java} | 10 +-- .../model/DdiPolling.java} | 6 +- .../model/DdiProgress.java} | 6 +- .../Result.java => json/model/DdiResult.java} | 12 ++-- .../Status.java => json/model/DdiStatus.java} | 12 ++-- .../DdiArtifactStoreControllerRestApi.java} | 19 +++-- .../api/DdiRestConstants.java} | 6 +- .../api/DdiRootControllerRestApi.java} | 71 +++++++++---------- .../ddi/resource/ArtifactStoreController.java | 4 +- .../ddi/resource/DataConversionHelper.java | 38 +++++----- .../hawkbit/ddi/resource/RootController.java | 58 +++++++-------- 23 files changed, 197 insertions(+), 169 deletions(-) create mode 100644 hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/ActionFeedback.java => json/model/DdiActionFeedback.java} (87%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Artifact.java => json/model/DdiArtifact.java} (91%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Cancel.java => json/model/DdiCancel.java} (78%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/CancelActionToStop.java => json/model/DdiCancelActionToStop.java} (86%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Chunk.java => json/model/DdiChunk.java} (81%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Config.java => json/model/DdiConfig.java} (75%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/ConfigData.java => json/model/DdiConfigData.java} (81%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/ControllerBase.java => json/model/DdiControllerBase.java} (68%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Deployment.java => json/model/DdiDeployment.java} (87%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/DeploymentBase.java => json/model/DdiDeploymentBase.java} (79%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Polling.java => json/model/DdiPolling.java} (84%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Progress.java => json/model/DdiProgress.java} (86%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Result.java => json/model/DdiResult.java} (86%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{model/Status.java => json/model/DdiStatus.java} (87%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{api/ArtifactStoreControllerDdiApi.java => rest/api/DdiArtifactStoreControllerRestApi.java} (75%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{ControllerConstants.java => rest/api/DdiRestConstants.java} (93%) rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/{api/RootControllerDdiApi.java => rest/api/DdiRootControllerRestApi.java} (70%) diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index 7038e64d8..382d90c20 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -10,7 +10,7 @@ package org.eclipse.hawkbit.app; import org.eclipse.hawkbit.RepositoryApplicationConfiguration; 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.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -25,7 +25,7 @@ import org.springframework.context.annotation.Import; @Import({ RepositoryApplicationConfiguration.class }) @EnableHawkbitManagedSecurityConfiguration @EnableRestResources -@EnableDirectDeviceApi +@EnableDdiApi public class Start { /** diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index 87c4ecf98..ef489049f 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -8,7 +8,7 @@ */ 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.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; @@ -21,8 +21,8 @@ import org.springframework.context.annotation.Import; * */ @Configuration -@ConditionalOnClass({ EnableDirectDeviceApi.class, EnableRestResources.class }) -@Import({ EnableDirectDeviceApi.class, EnableRestResources.class }) +@ConditionalOnClass({ EnableDdiApi.class, EnableRestResources.class }) +@Import({ EnableDdiApi.class, EnableRestResources.class }) public class ResourceControllerAutoConfiguration { } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java new file mode 100644 index 000000000..1c41debc7 --- /dev/null +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java @@ -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 { + +} diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java similarity index 87% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java index 19ef0c0a9..cbb45b788 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ActionFeedback.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiActionFeedback.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -35,12 +35,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; * */ @JsonIgnoreProperties(ignoreUnknown = true) -public class ActionFeedback { +public class DdiActionFeedback { private final Long id; private final String time; @NotNull - private final Status status; + private final DdiStatus status; /** * Constructor. @@ -53,8 +53,8 @@ public class ActionFeedback { * is the feedback itself */ @JsonCreator - public ActionFeedback(@JsonProperty("id") final Long id, @JsonProperty("time") final String time, - @JsonProperty("status") final Status status) { + public DdiActionFeedback(@JsonProperty("id") final Long id, @JsonProperty("time") final String time, + @JsonProperty("status") final DdiStatus status) { this.id = id; this.time = time; this.status = status; @@ -68,7 +68,7 @@ public class ActionFeedback { return time; } - public Status getStatus() { + public DdiStatus getStatus() { return status; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java similarity index 91% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java index 1eac01bbe..d39a44daa 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Artifact.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -16,9 +16,9 @@ import org.springframework.hateoas.ResourceSupport; 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 @JsonProperty diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java similarity index 78% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java index f4312d964..9167ae73c 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Cancel.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java @@ -6,19 +6,19 @@ * which accompanies this distribution, and is available at * 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; /** * Cancel action to be provided to the target. */ -public class Cancel { +public class DdiCancel { private final String id; @NotNull - private final CancelActionToStop cancelAction; + private final DdiCancelActionToStop cancelAction; /** * Parameterized constructor. @@ -28,7 +28,7 @@ public class Cancel { * @param cancelAction * the action */ - public Cancel(final String id, final CancelActionToStop cancelAction) { + public DdiCancel(final String id, final DdiCancelActionToStop cancelAction) { super(); this.id = id; this.cancelAction = cancelAction; @@ -38,7 +38,7 @@ public class Cancel { return id; } - public CancelActionToStop getCancelAction() { + public DdiCancelActionToStop getCancelAction() { return cancelAction; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java similarity index 86% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java index c0348a210..e7b946a87 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/CancelActionToStop.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java @@ -6,14 +6,14 @@ * which accompanies this distribution, and is available at * 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; /** * The {@link Action} that has to be stopped by the target. */ -public class CancelActionToStop { +public class DdiCancelActionToStop { @NotNull private final String stopId; @@ -24,7 +24,7 @@ public class CancelActionToStop { * @param stopId * ID of the {@link Action} to be stoppedW */ - public CancelActionToStop(final String stopId) { + public DdiCancelActionToStop(final String stopId) { super(); this.stopId = stopId; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java similarity index 81% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java index 0282bc4ea..4ff9debe4 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Chunk.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -15,7 +15,7 @@ import javax.validation.constraints.NotNull; /** * Deployment chunks. */ -public class Chunk { +public class DdiChunk { @NotNull private final String part; @@ -26,7 +26,7 @@ public class Chunk { @NotNull private final String name; - private final List artifacts; + private final List artifacts; /** * Constructor. @@ -40,7 +40,7 @@ public class Chunk { * @param artifacts * download information */ - public Chunk(final String part, final String version, final String name, final List artifacts) { + public DdiChunk(final String part, final String version, final String name, final List artifacts) { super(); this.part = part; this.version = version; @@ -60,7 +60,7 @@ public class Chunk { return name; } - public List getArtifacts() { + public List getArtifacts() { return artifacts; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java similarity index 75% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java index 4809d2c09..fa4f19882 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Config.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java @@ -6,14 +6,14 @@ * which accompanies this distribution, and is available at * 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. */ -public class Config { +public class DdiConfig { - private final Polling polling; + private final DdiPolling polling; /** * Constructor. @@ -21,12 +21,12 @@ public class Config { * @param polling * configuration of the SP target */ - public Config(final Polling polling) { + public DdiConfig(final DdiPolling polling) { super(); this.polling = polling; } - public Polling getPolling() { + public DdiPolling getPolling() { return polling; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java similarity index 81% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java index bd9a10520..a16ddf064 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ConfigData.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfigData.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Feedback channel for ConfigData action. */ -public class ConfigData extends ActionFeedback { +public class DdiConfigData extends DdiActionFeedback { @NotEmpty private final Map data; @@ -36,8 +36,8 @@ public class ConfigData extends ActionFeedback { * contains the attributes. */ @JsonCreator - public ConfigData(@JsonProperty(value = "id") final Long id, @JsonProperty(value = "time") final String time, - @JsonProperty(value = "status") final Status status, + public DdiConfigData(@JsonProperty(value = "id") final Long id, @JsonProperty(value = "time") final String time, + @JsonProperty(value = "status") final DdiStatus status, @JsonProperty(value = "data") final Map data) { super(id, time, status); this.data = data; diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java similarity index 68% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java index ff282935d..b044c3537 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/ControllerBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java @@ -6,16 +6,16 @@ * which accompanies this distribution, and is available at * 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; /** - * {@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. @@ -23,12 +23,12 @@ public class ControllerBase extends ResourceSupport { * @param config * configuration of the SP target */ - public ControllerBase(final Config config) { + public DdiControllerBase(final DdiConfig config) { super(); this.config = config; } - public Config getConfig() { + public DdiConfig getConfig() { return config; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java similarity index 87% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java index 05cd730a0..55538f8e2 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Deployment.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -15,13 +15,13 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Detailed {@link UpdateAction} information. */ -public class Deployment { +public class DdiDeployment { private final HandlingType download; private final HandlingType update; - private final List chunks; + private final List chunks; /** * Constructor. @@ -33,7 +33,7 @@ public class Deployment { * @param chunks * to handle. */ - public Deployment(final HandlingType download, final HandlingType update, final List chunks) { + public DdiDeployment(final HandlingType download, final HandlingType update, final List chunks) { super(); this.download = download; this.update = update; @@ -48,7 +48,7 @@ public class Deployment { return update; } - public List getChunks() { + public List getChunks() { return chunks; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java similarity index 79% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java index aa30c2c63..25c7a62ed 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/DeploymentBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -17,14 +17,14 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * {@link UpdateAction} resource. */ -public class DeploymentBase extends ResourceSupport { +public class DdiDeploymentBase extends ResourceSupport { @JsonProperty("id") @NotNull private final String deplyomentId; @NotNull - private final Deployment deployment; + private final DdiDeployment deployment; /** * Constructor. @@ -34,12 +34,12 @@ public class DeploymentBase extends ResourceSupport { * @param deployment * details. */ - public DeploymentBase(final String id, final Deployment deployment) { + public DdiDeploymentBase(final String id, final DdiDeployment deployment) { deplyomentId = id; this.deployment = deployment; } - public Deployment getDeployment() { + public DdiDeployment getDeployment() { return deployment; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java similarity index 84% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java index b0471bc21..4ad67d340 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Polling.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java @@ -6,12 +6,12 @@ * which accompanies this distribution, and is available at * 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. */ -public class Polling { +public class DdiPolling { private final String sleep; @@ -21,7 +21,7 @@ public class Polling { * @param sleep * between polls */ - public Polling(final String sleep) { + public DdiPolling(final String sleep) { super(); this.sleep = sleep; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java similarity index 86% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java index a3e441f31..cf73fc5c0 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Progress.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiProgress.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Action fulfillment progress by means of gives the achieved amount of maximal * of possible levels. */ -public class Progress { +public class DdiProgress { @NotNull private final Integer cnt; @@ -33,7 +33,7 @@ public class Progress { * maximum levels */ @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(); this.cnt = cnt; this.of = of; diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java similarity index 86% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java index f4b790b5d..36f0d134c 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Result.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiResult.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -18,12 +18,12 @@ import com.fasterxml.jackson.annotation.JsonValue; * Result information of the action progress which can by an intermediate or * final update. */ -public class Result { +public class DdiResult { @NotEmpty private final FinalResult finished; - private final Progress progress; + private final DdiProgress progress; /** * Constructor. @@ -34,8 +34,8 @@ public class Result { * if not yet finished */ @JsonCreator - public Result(@JsonProperty("finished") final FinalResult finished, - @JsonProperty("progress") final Progress progress) { + public DdiResult(@JsonProperty("finished") final FinalResult finished, + @JsonProperty("progress") final DdiProgress progress) { super(); this.finished = finished; this.progress = progress; @@ -45,7 +45,7 @@ public class Result { return finished; } - public Progress getProgress() { + public DdiProgress getProgress() { return progress; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java similarity index 87% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java index 80351e41f..cb9b57187 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/model/Status.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiStatus.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * 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; @@ -19,13 +19,13 @@ import com.fasterxml.jackson.annotation.JsonValue; /** * Details status information concerning the action processing. */ -public class Status { +public class DdiStatus { @NotNull private final ExecutionStatus execution; @NotNull - private final Result result; + private final DdiResult result; private final List details; @@ -40,8 +40,8 @@ public class Status { * as optional addition */ @JsonCreator - public Status(@JsonProperty("execution") final ExecutionStatus execution, - @JsonProperty("result") final Result result, @JsonProperty("details") final List details) { + public DdiStatus(@JsonProperty("execution") final ExecutionStatus execution, + @JsonProperty("result") final DdiResult result, @JsonProperty("details") final List details) { super(); this.execution = execution; this.result = result; @@ -52,7 +52,7 @@ public class Status { return execution; } - public Result getResult() { + public DdiResult getResult() { return result; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java similarity index 75% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java index 5df63b1b5..ffeef732f 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/ArtifactStoreControllerDdiApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java @@ -6,13 +6,12 @@ * which accompanies this distribution, and is available at * 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.HttpServletResponse; -import org.eclipse.hawkbit.ddi.ControllerConstants; -import org.eclipse.hawkbit.ddi.model.Artifact; +import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; 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. */ -@RequestMapping(ControllerConstants.ARTIFACTS_V1_REQUEST_MAPPING) -public interface ArtifactStoreControllerDdiApi { +@RequestMapping(DdiRestConstants.ARTIFACTS_V1_REQUEST_MAPPING) +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. * * @param fileName @@ -44,7 +43,7 @@ public interface ArtifactStoreControllerDdiApi { * {@link HttpStatus#OK} or in case of partial download * {@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}") @ResponseBody public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, @@ -52,7 +51,7 @@ public interface ArtifactStoreControllerDdiApi { @AuthenticationPrincipal final String targetid); /** - * Handles GET {@link Artifact} MD5 checksum file download request. + * Handles GET {@link DdiArtifact} MD5 checksum file download request. * * @param fileName * to search for @@ -61,8 +60,8 @@ public interface ArtifactStoreControllerDdiApi { * * @return response of the servlet */ - @RequestMapping(method = RequestMethod.GET, value = ControllerConstants.ARTIFACT_DOWNLOAD_BY_FILENAME - + "/{fileName}" + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX) + @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + + "/{fileName}" + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX) @ResponseBody public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, final HttpServletResponse response); diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java similarity index 93% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java index 959f8488b..f6356c466 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/ControllerConstants.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java @@ -6,12 +6,12 @@ * which accompanies this distribution, and is available at * 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. */ -public final class ControllerConstants { +public final class DdiRestConstants { /** * 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"; // constant class, private constructor. - private ControllerConstants() { + private DdiRestConstants() { } } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java similarity index 70% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java rename to hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index 8e51e0b86..febdaa6b4 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -1,7 +1,7 @@ /** * 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.util.List; @@ -10,13 +10,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import org.eclipse.hawkbit.ddi.ControllerConstants; -import org.eclipse.hawkbit.ddi.model.ActionFeedback; -import org.eclipse.hawkbit.ddi.model.Artifact; -import org.eclipse.hawkbit.ddi.model.Cancel; -import org.eclipse.hawkbit.ddi.model.ConfigData; -import org.eclipse.hawkbit.ddi.model.ControllerBase; -import org.eclipse.hawkbit.ddi.model.DeploymentBase; +import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; +import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; +import org.eclipse.hawkbit.ddi.json.model.DdiCancel; +import org.eclipse.hawkbit.ddi.json.model.DdiConfigData; +import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; +import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase; import org.hibernate.validator.constraints.NotEmpty; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam; /** * REST resource handling for root controller CRUD operations. */ -@RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING) -public interface RootControllerDdiApi { +@RequestMapping(DdiRestConstants.BASE_V1_REQUEST_MAPPING) +public interface DdiRootControllerRestApi { /** * 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 = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getSoftwareModulesArtifacts( + ResponseEntity> getSoftwareModulesArtifacts( @PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId); @@ -61,11 +60,11 @@ public interface RootControllerDdiApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, + ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, 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. * * @param targetid @@ -84,13 +83,13 @@ public interface RootControllerDdiApi { * {@link HttpStatus#PARTIAL_CONTENT}. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") - public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, + ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("fileName") final String fileName, final HttpServletResponse response, final HttpServletRequest request); /** - * Handles GET {@link Artifact} MD5 checksum file download request. + * Handles GET {@link DdiArtifact} MD5 checksum file download request. * * @param targetid * of the related @@ -107,8 +106,8 @@ public interface RootControllerDdiApi { * successful */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" - + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) - public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, + + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) + ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("fileName") final String fileName, final HttpServletResponse response, final HttpServletRequest request); @@ -120,7 +119,7 @@ public interface RootControllerDdiApi { * of the {@link Target} that matches to * {@link Target#getControllerId()} * @param actionId - * of the {@link DeploymentBase} that matches to + * of the {@link DdiDeploymentBase} that matches to * {@link Target#getActiveActions()} * @param resource * an hashcode of the resource which indicates if the action has @@ -130,16 +129,16 @@ public interface RootControllerDdiApi { * the HTTP request injected by spring * @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) - public ResponseEntity getControllerBasedeploymentAction( + ResponseEntity getControllerBasedeploymentAction( @PathVariable("targetid") @NotEmpty final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, 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 * to provide @@ -153,9 +152,9 @@ public interface RootControllerDdiApi { * * @return the response */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + @RequestMapping(value = "/{targetid}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" + + DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); @@ -172,12 +171,12 @@ public interface RootControllerDdiApi { * @return status of the request */ @RequestMapping(value = "/{targetid}/" - + ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity putConfigData(@Valid @RequestBody final ConfigData configData, + + DdiRestConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, @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 * ID of the calling target @@ -186,19 +185,19 @@ public interface RootControllerDdiApi { * @param request * 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) - public ResponseEntity getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid, + ResponseEntity getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid, @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. * * @param feedback - * the {@link ActionFeedback} from the target. + * the {@link DdiActionFeedback} from the target. * @param targetid * the ID of the calling target * @param actionId @@ -206,12 +205,12 @@ public interface RootControllerDdiApi { * @param request * the HTTP request injected by spring * - * @return the {@link ActionFeedback} response + * @return the {@link DdiActionFeedback} response */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + @RequestMapping(value = "/{targetid}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}/" + + DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + ResponseEntity postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable("targetid") @NotEmpty final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java index ec8a994b0..61f3fd465 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java @@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; 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.ControllerManagement; 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. */ @RestController -public class ArtifactStoreController implements ArtifactStoreControllerDdiApi { +public class ArtifactStoreController implements DdiArtifactStoreControllerRestApi { private static final Logger LOG = LoggerFactory.getLogger(ArtifactStoreController.class); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java index 75adebb45..8533c6eac 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java @@ -20,12 +20,12 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.UrlProtocol; -import org.eclipse.hawkbit.ddi.ControllerConstants; -import org.eclipse.hawkbit.ddi.model.Artifact; -import org.eclipse.hawkbit.ddi.model.Chunk; -import org.eclipse.hawkbit.ddi.model.Config; -import org.eclipse.hawkbit.ddi.model.ControllerBase; -import org.eclipse.hawkbit.ddi.model.Polling; +import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; +import org.eclipse.hawkbit.ddi.json.model.DdiChunk; +import org.eclipse.hawkbit.ddi.json.model.DdiConfig; +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; @@ -50,10 +50,10 @@ public final class DataConversionHelper { } - static List createChunks(final String targetid, final Action uAction, + static List createChunks(final String targetid, final Action uAction, final ArtifactUrlHandler artifactUrlHandler) { 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))) .collect(Collectors.toList()); @@ -79,12 +79,12 @@ public final class DataConversionHelper { * the software module * @return a list of artifacts or a empty list. Cannot be . */ - public static List createArtifacts(final String targetid, + public static List createArtifacts(final String targetid, final org.eclipse.hawkbit.repository.model.SoftwareModule module, final ArtifactUrlHandler artifactUrlHandler) { - final List files = new ArrayList<>(); + final List files = new ArrayList<>(); module.getLocalArtifacts().forEach(artifact -> { - final Artifact file = new Artifact(); + final DdiArtifact file = new DdiArtifact(); file.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); file.setFilename(artifact.getFilename()); file.setSize(artifact.getSize()); @@ -93,18 +93,18 @@ public final class DataConversionHelper { final String linkHttps = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(), artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTPS); 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 + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); + file.add(new Link(linkHttp + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); files.add(file); }); return files; } - static ControllerBase fromTarget(final Target target, final List actions, + static DdiControllerBase fromTarget(final Target target, final List actions, 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 addedCancel = false; @@ -118,19 +118,19 @@ public final class DataConversionHelper { // response because of eTags. result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()) .getControllerBasedeploymentAction(target.getControllerId(), action.getId(), actions.hashCode(), - null)).withRel(ControllerConstants.DEPLOYMENT_BASE_ACTION)); + null)).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION)); addedUpdate = true; } else if (action.isCancelingOrCanceled() && !addedCancel) { result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()) .getControllerCancelAction(target.getControllerId(), action.getId(), null)) - .withRel(ControllerConstants.CANCEL_ACTION)); + .withRel(DdiRestConstants.CANCEL_ACTION)); addedCancel = true; } } if (target.getTargetInfo().isRequestControllerAttributes()) { 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; } @@ -146,7 +146,7 @@ public final class DataConversionHelper { final StringBuilder header = new StringBuilder(); header.append("attachment;filename="); header.append(fileName); - header.append(ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX); + header.append(DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX); response.setContentLength(content.length); response.setHeader("Content-Disposition", header.toString()); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java index 9fb0fca1d..e48e2ec5f 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java @@ -18,17 +18,17 @@ import javax.validation.Valid; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; -import org.eclipse.hawkbit.ddi.api.RootControllerDdiApi; -import org.eclipse.hawkbit.ddi.model.ActionFeedback; -import org.eclipse.hawkbit.ddi.model.Cancel; -import org.eclipse.hawkbit.ddi.model.CancelActionToStop; -import org.eclipse.hawkbit.ddi.model.Chunk; -import org.eclipse.hawkbit.ddi.model.ConfigData; -import org.eclipse.hawkbit.ddi.model.ControllerBase; -import org.eclipse.hawkbit.ddi.model.Deployment; -import org.eclipse.hawkbit.ddi.model.Deployment.HandlingType; -import org.eclipse.hawkbit.ddi.model.DeploymentBase; -import org.eclipse.hawkbit.ddi.model.Result.FinalResult; +import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; +import org.eclipse.hawkbit.ddi.json.model.DdiCancel; +import org.eclipse.hawkbit.ddi.json.model.DdiCancelActionToStop; +import org.eclipse.hawkbit.ddi.json.model.DdiChunk; +import org.eclipse.hawkbit.ddi.json.model.DdiConfigData; +import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; +import org.eclipse.hawkbit.ddi.json.model.DdiDeployment; +import org.eclipse.hawkbit.ddi.json.model.DdiDeployment.HandlingType; +import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase; +import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult; +import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.ControllerManagement; 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. */ @RestController -public class RootController implements RootControllerDdiApi { +public class RootController implements DdiRootControllerRestApi { 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 ({})."; @@ -90,7 +90,7 @@ public class RootController implements RootControllerDdiApi { private ArtifactUrlHandler artifactUrlHandler; @Override - public ResponseEntity> getSoftwareModulesArtifacts( + public ResponseEntity> getSoftwareModulesArtifacts( @PathVariable final String targetid, @PathVariable final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); @@ -107,7 +107,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity getControllerBase(@PathVariable final String targetid, + public ResponseEntity getControllerBase(@PathVariable final String targetid, final HttpServletRequest request) { LOG.debug("getControllerBase({})", targetid); @@ -206,7 +206,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity getControllerBasedeploymentAction( + public ResponseEntity getControllerBasedeploymentAction( @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, final HttpServletRequest request) { @@ -223,12 +223,12 @@ public class RootController implements RootControllerDdiApi { if (!action.isCancelingOrCanceled()) { - final List chunks = DataConversionHelper.createChunks(targetid, action, artifactUrlHandler); + final List chunks = DataConversionHelper.createChunks(targetid, action, artifactUrlHandler); final HandlingType handlingType = action.isForce() ? HandlingType.FORCED : HandlingType.ATTEMPT; - final DeploymentBase base = new DeploymentBase(Long.toString(action.getId()), - new Deployment(handlingType, handlingType, chunks)); + final DdiDeploymentBase base = new DdiDeploymentBase(Long.toString(action.getId()), + new DdiDeployment(handlingType, handlingType, chunks)); LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base); @@ -242,7 +242,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { 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 ActionStatus actionStatus = new ActionStatus(); @@ -317,7 +317,7 @@ public class RootController implements RootControllerDdiApi { 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) { LOG.debug("Controller reported intermediate status (actionid: {}, targetid: {}) as we got {} report.", actionid, targetid, feedback.getStatus().getExecution()); @@ -325,7 +325,7 @@ public class RootController implements RootControllerDdiApi { 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) { LOG.debug("Controller reported closed (actionid: {}, targetid: {}) as we got {} report.", actionid, targetid, feedback.getStatus().getExecution()); @@ -339,7 +339,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity putConfigData(@Valid @RequestBody final ConfigData configData, + public ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, @PathVariable final String targetid, final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); @@ -350,7 +350,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity getControllerCancelAction(@PathVariable @NotEmpty final String targetid, + public ResponseEntity getControllerCancelAction(@PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { LOG.debug("getControllerCancelAction({})", targetid); @@ -364,8 +364,8 @@ public class RootController implements RootControllerDdiApi { } if (action.isCancelingOrCanceled()) { - final Cancel cancel = new Cancel(String.valueOf(action.getId()), - new CancelActionToStop(String.valueOf(action.getId()))); + final DdiCancel cancel = new DdiCancel(String.valueOf(action.getId()), + new DdiCancelActionToStop(String.valueOf(action.getId()))); LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel); @@ -379,7 +379,7 @@ public class RootController implements RootControllerDdiApi { } @Override - public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback, + public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback); @@ -405,7 +405,7 @@ public class RootController implements RootControllerDdiApi { 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 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) { actionStatus.setStatus(Status.ERROR); } else { From 8a22ea3df3d47d121d89ae658330f6ce07c60625 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 20 Apr 2016 13:47:09 +0200 Subject: [PATCH 010/124] Rename Ddi classes Signed-off-by: SirWayne --- .../ddi/resource/EnableDirectDeviceApi.java | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java deleted file mode 100644 index 0d5a81e29..000000000 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/EnableDirectDeviceApi.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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.resource; - -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 EnableDirectDeviceApi { - -} From 8d341705151a7e5300b4c7c855b50ba17541c8cc Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 20 Apr 2016 15:02:44 +0200 Subject: [PATCH 011/124] DDI client implementation validation Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 52 +++++++-- .../hawkbit/ddi/client/Application.java | 22 ++++ ...plicationJsonRequestHeaderInterceptor.java | 28 +++++ .../eclipse/hawkbit/ddi/client/DdiClient.java | 85 ++++++++++++++ ...leConsumersProducersSpringMvcContract.java | 43 +++++++ .../RootControllerResourceClient.java | 15 +++ .../org/hawkbit/example/ddi/client/App.java | 13 --- .../hawkbit/example/ddi/client/AppTest.java | 18 +++ .../hawkbit/example/ddi/client/AppTest.java | 38 ------- .../hawkbit/ddi/api/RootControllerDdiApi.java | 105 ++++++++++-------- 10 files changed, 312 insertions(+), 107 deletions(-) create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java delete mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java create mode 100644 examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java delete mode 100644 examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 7630a5a9e..8ce1749dd 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -7,20 +7,54 @@ hawkbit-examples-parent 0.2.0-SNAPSHOT - org.eclipse.hawkbit hawkbit-example-ddi-client - 0.2.0-SNAPSHOT + hawkbit-example-ddi-client - http://maven.apache.org - - UTF-8 - + + + + + org.springframework.cloud + spring-cloud-netflix + 1.0.7.RELEASE + pom + import + + + + - + + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + + + org.springframework.cloud + spring-cloud-starter-feign + + + com.netflix.feign + feign-core + + 8.16.0 + + + com.netflix.feign + feign-jackson + + 8.16.0 + + + javax.servlet + javax.servlet-api + + + + junit junit - 3.8.1 test - + diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java new file mode 100644 index 000000000..e230a77da --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.netflix.feign.EnableFeignClients; + +/** + * @author Jonathan Knoblauch + * + */ +@SpringBootApplication +@EnableFeignClients +public class Application { + + public static void main(final String[] args) { + new SpringApplicationBuilder().showBanner(false).sources(Application.class).run(args); + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java new file mode 100644 index 000000000..680da74f1 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java @@ -0,0 +1,28 @@ +/** + * 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.client; + +import org.springframework.http.MediaType; + +import feign.RequestInterceptor; +import feign.RequestTemplate; + +/** + * An feign request interceptor to set the defined {@code Accept} and + * {@code Content-Type} headers for each request to {@code application/json}. + */ +public class ApplicationJsonRequestHeaderInterceptor implements RequestInterceptor { + + @Override + public void apply(final RequestTemplate template) { + template.header("Accept", MediaType.APPLICATION_JSON_VALUE); + template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java new file mode 100644 index 000000000..7673f1a41 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.hawkbit.ddi.ControllerConstants; +import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; +import org.eclipse.hawkbit.ddi.model.ControllerBase; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; +import org.springframework.http.ResponseEntity; + +import feign.Feign; +import feign.Logger; +import feign.Logger.Level; +import feign.jackson.JacksonDecoder; +import feign.jackson.JacksonEncoder; + +public class DdiClient { + + @Autowired + private HttpServletRequest request; + + @Autowired + private HttpServletResponse response; + + private final String controllerId; + private final String name; + private final String description; + private RootControllerResourceClient rootControllerResourceClient; + private String rootControllerResourcePath; + + public DdiClient(final String rolloutsUrl, final String controllerId, final String name, final String description, + final String tenant) { + super(); + this.controllerId = controllerId; + this.name = name; + this.description = description; + rootControllerResourcePath = rolloutsUrl + ControllerConstants.BASE_V1_REQUEST_MAPPING; + rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); + + createFeignClient(); + } + + private void createFeignClient() { + + // BasicAuthRequestInterceptor TODO + + final Feign.Builder feignBuilder = Feign.builder() + .contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) + .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) + .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) + .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + // TODO implement feign client encoder to handle MultiPartFile + // .requestInterceptor(new BasicAuthRequestInterceptor(tenant + "\\" + + // user, password)) + + rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, + rootControllerResourcePath); + + } + + public void startDdiClient() { + + // final HttpServletRequest request; + + // final HttpSession mySession = request.getSession(); + + // final HttpServletRequest request = new; + + final ResponseEntity response = rootControllerResourceClient.getControllerBase("test", request); + final ControllerBase controllerBase = response.getBody(); + + // TODO notify every 10 seconds on the rollout server + + // TODO if new update available -> start download and installation + // process + // report status messages + + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java new file mode 100644 index 000000000..c1c24b9ec --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java @@ -0,0 +1,43 @@ +/** + * 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.client; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.netflix.feign.support.SpringMvcContract; + +import feign.MethodMetadata; + +/** + * Own implementation of the {@link SpringMvcContract} which catches the + * {@link IllegalStateException} which occurs due multiple produces and consumes + * values in the request-mapping + * annoation.https://github.com/spring-cloud/spring-cloud-netflix/issues/808 + */ +public class IgnoreMultipleConsumersProducersSpringMvcContract extends SpringMvcContract { + + private static final Logger LOGGER = LoggerFactory + .getLogger(IgnoreMultipleConsumersProducersSpringMvcContract.class); + + @Override + protected void processAnnotationOnMethod(final MethodMetadata data, final Annotation methodAnnotation, + final Method method) { + try { + super.processAnnotationOnMethod(data, methodAnnotation, method); + } catch (final IllegalStateException e) { + // ignore illegalstateexception here because it's thrown because of + // multiple consumers and produces, see + // https://github.com/spring-cloud/spring-cloud-netflix/issues/808 + LOGGER.trace(e.getMessage(), e); + } + } +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java new file mode 100644 index 000000000..2d531963f --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client.resource; + +import org.eclipse.hawkbit.ddi.api.RootControllerDdiApi; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * Client binding for the Rootcontroller resource of the DDI API. + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/{tenant}/controller/v1") +public interface RootControllerResourceClient extends RootControllerDdiApi { + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java b/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java deleted file mode 100644 index cd85d3a8b..000000000 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/hawkbit/example/ddi/client/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.hawkbit.example.ddi.client; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java new file mode 100644 index 000000000..64f34c8ff --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -0,0 +1,18 @@ +package org.eclipse.hawkbit.example.ddi.client; + +import org.eclipse.hawkbit.ddi.client.DdiClient; +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest { + + @Test + public void AppTest() { + + final DdiClient ddiClient = new DdiClient("localhost:8080", "mytest", "mytest", "desc", "DEFAULT"); + ddiClient.startDdiClient(); + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java deleted file mode 100644 index 395886a2d..000000000 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/hawkbit/example/ddi/client/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.hawkbit.example.ddi.client; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java index 8e51e0b86..548f35d72 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/api/RootControllerDdiApi.java @@ -7,22 +7,15 @@ import java.lang.annotation.Target; import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import org.eclipse.hawkbit.ddi.ControllerConstants; -import org.eclipse.hawkbit.ddi.model.ActionFeedback; -import org.eclipse.hawkbit.ddi.model.Artifact; import org.eclipse.hawkbit.ddi.model.Cancel; -import org.eclipse.hawkbit.ddi.model.ConfigData; import org.eclipse.hawkbit.ddi.model.ControllerBase; import org.eclipse.hawkbit.ddi.model.DeploymentBase; import org.hibernate.validator.constraints.NotEmpty; -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; @@ -33,6 +26,21 @@ import org.springframework.web.bind.annotation.RequestParam; @RequestMapping(ControllerConstants.BASE_V1_REQUEST_MAPPING) public interface RootControllerDdiApi { + /** + * Root resource for an individual {@link Target}. + * + * @param targetid + * of the {@link Target} that matches to + * {@link Target#getControllerId()} + * @param request + * the HTTP request injected by spring + * @return the response + */ + @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, + final HttpServletRequest request); + /** * Returns all artifacts of a given software module and target. * @@ -49,21 +57,6 @@ public interface RootControllerDdiApi { @PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId); - /** - * Root resource for an individual {@link Target}. - * - * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} - * @param request - * the HTTP request injected by spring - * @return the response - */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, - final HttpServletRequest request); - /** * Handles GET {@link Artifact} download request. This could be full or * partial (as specified by RFC7233 (Range Requests)) download request. @@ -83,11 +76,14 @@ public interface RootControllerDdiApi { * {@link HttpStatus#OK} or in case of partial download * {@link HttpStatus#PARTIAL_CONTENT}. */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") - public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, - @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request); + // @RequestMapping(method = RequestMethod.GET, value = + // "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") + // public ResponseEntity downloadArtifact(@PathVariable("targetid") + // final String targetid, + // @PathVariable("softwareModuleId") final Long softwareModuleId, + // @PathVariable("fileName") final String fileName, final + // HttpServletResponse response, + // final HttpServletRequest request); /** * Handles GET {@link Artifact} MD5 checksum file download request. @@ -106,12 +102,16 @@ public interface RootControllerDdiApi { * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if * successful */ - @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" - + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) - public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, - @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request); + // @RequestMapping(method = RequestMethod.GET, value = + // "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}" + // + ControllerConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = + // MediaType.TEXT_PLAIN_VALUE) + // public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") + // final String targetid, + // @PathVariable("softwareModuleId") final Long softwareModuleId, + // @PathVariable("fileName") final String fileName, final + // HttpServletResponse response, + // final HttpServletRequest request); /** * Resource for {@link SoftwareModule} {@link UpdateAction}s. @@ -153,11 +153,15 @@ public interface RootControllerDdiApi { * * @return the response */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final ActionFeedback feedback, - @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, - final HttpServletRequest request); + // @RequestMapping(value = "/{targetid}/" + + // ControllerConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" + // + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = + // MediaType.APPLICATION_JSON_VALUE) + // public ResponseEntity postBasedeploymentActionFeedback(@Valid + // @RequestBody final ActionFeedback feedback, + // @PathVariable("targetid") final String targetid, + // @PathVariable("actionId") @NotEmpty final Long actionId, + // final HttpServletRequest request); /** * This is the feedback channel for the config data action. @@ -171,10 +175,13 @@ public interface RootControllerDdiApi { * * @return status of the request */ - @RequestMapping(value = "/{targetid}/" - + ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity putConfigData(@Valid @RequestBody final ConfigData configData, - @PathVariable("targetid") final String targetid, final HttpServletRequest request); + // @RequestMapping(value = "/{targetid}/" + // + ControllerConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, + // consumes = MediaType.APPLICATION_JSON_VALUE) + // public ResponseEntity putConfigData(@Valid @RequestBody final + // ConfigData configData, + // @PathVariable("targetid") final String targetid, final HttpServletRequest + // request); /** * {@link RequestMethod.GET} method for the {@link Cancel} action. @@ -209,10 +216,14 @@ public interface RootControllerDdiApi { * @return the {@link ActionFeedback} response */ - @RequestMapping(value = "/{targetid}/" + ControllerConstants.CANCEL_ACTION + "/{actionId}/" - + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final ActionFeedback feedback, - @PathVariable("targetid") @NotEmpty final String targetid, - @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); + // @RequestMapping(value = "/{targetid}/" + + // ControllerConstants.CANCEL_ACTION + "/{actionId}/" + // + ControllerConstants.FEEDBACK, method = RequestMethod.POST, consumes = + // MediaType.APPLICATION_JSON_VALUE) + // public ResponseEntity postCancelActionFeedback(@Valid @RequestBody + // final ActionFeedback feedback, + // @PathVariable("targetid") @NotEmpty final String targetid, + // @PathVariable("actionId") @NotEmpty final Long actionId, final + // HttpServletRequest request); } From c3c405c986dd85b156aa8161e87a300231cc318b Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 20 Apr 2016 17:33:03 +0200 Subject: [PATCH 012/124] Rename and split rest resources ddi, mgmt and system Signed-off-by: SirWayne --- 3rd-dependencies/listDeps.sh | 0 examples/hawkbit-example-app/pom.xml | 7 +- .../java/org/eclipse/hawkbit/app/Start.java | 6 +- examples/hawkbit-mgmt-api-client/pom.xml | 2 +- .../DistributionSetResourceClient.java | 4 +- .../DistributionSetTagResourceClient.java | 4 +- .../DistributionSetTypeResourceClient.java | 4 +- .../resource/RolloutResourceClient.java | 4 +- .../SoftwareModuleResourceClient.java | 4 +- .../SoftwareModuleTypeResourceClient.java | 4 +- .../client/resource/TargetResourceClient.java | 4 +- .../resource/TargetTagResourceClient.java | 4 +- .../builder/DistributionSetBuilder.java | 28 +- .../builder/DistributionSetTypeBuilder.java | 32 +- .../resource/builder/RolloutBuilder.java | 18 +- .../SoftwareModuleAssigmentBuilder.java | 14 +- .../builder/SoftwareModuleBuilder.java | 24 +- .../builder/SoftwareModuleTypeBuilder.java | 24 +- .../client/resource/builder/TagBuilder.java | 22 +- .../resource/builder/TargetBuilder.java | 24 +- .../CreateStartedRolloutExample.java | 16 +- .../GettingStartedDefaultScenario.java | 20 +- hawkbit-autoconfigure/pom.xml | 10 +- .../SecurityManagedConfiguration.java | 7 +- .../ResourceControllerAutoConfiguration.java | 9 +- hawkbit-ddi-api/pom.xml | 40 +- .../hawkbit/ddi/json/model/DdiArtifact.java | 10 +- .../ddi/json/model/DdiArtifactHash.java | 57 +++ hawkbit-ddi-resource/pom.xml | 33 +- .../hawkbit/ddi/annotation/EnableDdiApi.java | 0 .../resource/ArtifactStoreController.java | 4 +- .../resource/DataConversionHelper.java | 9 +- .../{ => rest}/resource/RootController.java | 4 +- .../resource/DdiArtifactDownloadTest.java} | 8 +- .../resource/DdiCancelActionTest.java} | 6 +- .../resource/DdiConfigDataTest.java} | 6 +- .../resource/DdiDeploymentBaseTest.java} | 6 +- .../resource/DdiRootControllerTest.java} | 6 +- .../ddi}/rest/resource/JsonBuilder.java | 2 +- .../rest/resource}/MockMvcResultPrinter.java | 2 +- hawkbit-mgmt-api/pom.xml | 53 ++ .../mgmt/json}/model/MetadataRest.java | 2 +- .../mgmt/json/model/MgmtBaseEntity.java | 4 +- .../hawkbit/mgmt/json/model/MgmtId.java | 4 +- .../mgmt/json/model/MgmtNamedEntity.java | 4 +- .../mgmt/json/model/MgmtPollStatus.java | 4 +- .../hawkbit/mgmt/json}/model/PagedList.java | 2 +- .../mgmt/json/model/action/MgmtAction.java | 6 +- .../json/model/action/MgmtActionStatus.java | 4 +- .../json/model/artifact/MgmtArtifact.java | 13 +- .../json/model/artifact/MgmtArtifactHash.java | 8 +- .../model/distributionset/MgmtActionType.java | 6 +- .../distributionset/MgmtDistributionSet.java | 14 +- .../MgmtDistributionSetRequestBodyPost.java | 34 +- .../MgmtDistributionSetRequestBodyPut.java | 10 +- .../MgmtTargetAssignmentRequestBody.java | 10 +- .../MgmtTargetAssignmentResponseBody.java | 4 +- ...gmtDistributionSetTypeRequestBodyPost.java | 28 +- ...MgmtDistributionSetTypeRequestBodyPut.java | 6 +- .../MgmtDistributionSetTypeRest.java | 6 +- .../model/rollout/MgmtRolloutCondition.java | 9 +- .../model/rollout/MgmtRolloutErrorAction.java | 4 +- .../rollout/MgmtRolloutResponseBody.java | 6 +- .../rollout/MgmtRolloutRestRequestBody.java | 38 +- .../rollout/MgmtRolloutSuccessAction.java | 9 +- .../MgmtRolloutGroupResponseBody.java | 6 +- .../softwaremodule/MgmtSoftwareModule.java | 6 +- .../MgmtSoftwareModuleAssigment.java | 9 +- .../MgmtSoftwareModuleRequestBodyPost.java | 14 +- .../MgmtSoftwareModuleRequestBodyPut.java | 8 +- .../MgmtSoftwareModuleType.java | 6 +- .../MgmtSoftwareModuleTypeAssigment.java | 6 +- ...MgmtSoftwareModuleTypeRequestBodyPost.java | 12 +- .../MgmtSoftwareModuleTypeRequestBodyPut.java | 6 +- ...gmtAssignedDistributionSetRequestBody.java | 6 +- .../tag/MgmtAssignedTargetRequestBody.java | 6 +- ...MgmtDistributionSetTagAssigmentResult.java | 18 +- .../hawkbit/mgmt/json/model/tag/MgmtTag.java | 6 +- .../json/model/tag/MgmtTagRequestBodyPut.java | 10 +- .../tag/MgmtTargetTagAssigmentResult.java | 18 +- .../target/MgmtDistributionSetAssigment.java | 14 +- .../mgmt/json/model/target/MgmtTarget.java | 14 +- .../model/target/MgmtTargetAttributes.java | 4 +- .../model/target/MgmtTargetRequestBody.java | 10 +- .../rest/api/MgmtDistributionSetRestApi.java | 89 ++-- .../api/MgmtDistributionSetTagRestApi.java | 66 ++- .../api/MgmtDistributionSetTypeRestApi.java | 81 ++- .../rest/api/MgmtDownloadArtifactRestApi.java | 46 ++ .../mgmt/rest/api/MgmtDownloadRestApi.java | 42 ++ .../mgmt/rest/api/MgmtRestConstants.java | 133 +++-- .../mgmt/rest/api/MgmtRolloutRestApi.java | 65 ++- .../rest/api/MgmtSoftwareModuleRestAPI.java | 73 ++- .../api/MgmtSoftwareModuleTypeRestApi.java | 39 +- .../mgmt/rest/api/MgmtTargetRestApi.java | 81 ++- .../mgmt/rest/api/MgmtTargetTagRestApi.java | 65 ++- .../mgmt/json}/model/PagedListTest.java | 2 +- .../pom.xml | 35 +- .../mgmt/annotation/EnableMgmtApi.java | 4 +- .../resource/MgmtDistributionSetMapper.java | 61 +-- .../resource/MgmtDistributionSetResource.java | 91 ++-- .../MgmtDistributionSetTagResource.java | 65 +-- .../MgmtDistributionSetTypeMapper.java | 43 +- .../MgmtDistributionSetTypeResource.java | 70 +-- .../MgmtDownloadArtifactResource.java | 19 +- .../rest/resource/MgmtDownloadResource.java | 17 +- .../rest/resource/MgmtRestModelMapper.java | 81 +++ .../mgmt/rest/resource/MgmtRolloutMapper.java | 64 +-- .../rest/resource/MgmtRolloutResource.java | 55 ++- .../resource/MgmtSoftwareModuleMapper.java | 81 +-- .../resource/MgmtSoftwareModuleResource.java | 82 +-- .../MgmtSoftwareModuleTypeMapper.java | 34 +- .../MgmtSoftwareModuleTypeResource.java | 37 +- .../mgmt/rest/resource/MgmtTagMapper.java | 56 +-- .../mgmt/rest/resource/MgmtTargetMapper.java | 112 ++--- .../rest/resource/MgmtTargetResource.java | 103 ++-- .../rest/resource/MgmtTargetTagResource.java | 63 +-- .../mgmt}/rest/resource/PagingUtility.java | 12 +- .../mgmt/rest/resource/JsonBuilder.java | 466 ++++++++++++++++++ .../MgmtDistributionSetResourceTest.java | 101 ++-- .../MgmtDistributionSetTypeResourceTest.java | 42 +- .../resource/MgmtDownloadResourceTest.java | 12 +- .../resource/MgmtRolloutResourceTest.java | 23 +- .../MgmtSoftwareModuleResourceTest.java | 44 +- .../MgmtSoftwareModuleTypeResourceTest.java | 42 +- .../rest/resource/MgmtTargetResourceTest.java | 261 +++++----- .../rest/resource/MockMvcResultPrinter.java | 55 +++ .../mgmt}/rest/resource/ResourceUtility.java | 12 +- ...MRessourceMisingMongoDbConnectionTest.java | 8 +- .../mgmt}/rest/resource/SuccessCondition.java | 2 +- .../resources/application-test.properties | 0 .../src/test/resources/log4j2.xml | 0 hawkbit-rest-core/pom.xml | 59 +++ .../hawkbit/rest/data}/SortDirection.java | 4 +- .../MessageNotReadableException.java | 2 +- .../exception}/ResponseExceptionHandler.java | 7 +- .../SortParameterSyntaxErrorException.java | 2 +- ...arameterUnsupportedDirectionException.java | 2 +- ...ortParameterUnsupportedFieldException.java | 2 +- .../rest/json}/model/ExceptionInfo.java | 2 +- .../eclipse/hawkbit/rest/util}/ByteRange.java | 2 +- .../util}/FileSteamingFailedException.java | 2 +- .../util}/RestResourceConversionHelper.java | 31 +- .../hawkbit/rest/util}/SortUtility.java | 5 +- .../rest/json}/model/ExceptionInfoTest.java | 3 +- .../hawkbit/rest/util}/SortUtilityTest.java | 7 +- .../resources/application-test.properties | 63 +++ .../src/test/resources/log4j2.xml | 26 + .../rest/resource/OffsetBasedPageRequest.java | 69 --- .../rest/resource/RestModelMapper.java | 48 -- .../pom.xml | 8 +- .../SystemTenantConfigurationValue.java | 4 +- ...SystemTenantConfigurationValueRequest.java | 8 +- .../model/systemmanagement/SystemCache.java | 11 +- .../SystemStatisticsRest.java | 8 +- .../SystemTenantServiceUsage.java | 6 +- .../rest/api/SystemManagementRestApi.java | 64 +++ .../system/rest/api/SystemRestApi.java | 86 ++++ .../system/rest/api/SystemRestConstant.java | 41 ++ hawkbit-system-resource/pom.xml | 62 +++ .../system/annotation/EnableSystemApi.java | 30 ++ .../resource/SystemManagementResource.java | 49 +- .../system}/rest/resource/SystemMapper.java | 14 +- .../system}/rest/resource/SystemResource.java | 39 +- .../rest/resource/MockMvcResultPrinter.java | 55 +++ .../system/rest/resource/ResourceUtility.java | 32 ++ .../SystemManagementResourceTest.java | 5 +- .../rest/resource/SystemResourceTest.java | 22 +- .../resources/application-test.properties | 63 +++ pom.xml | 19 +- 169 files changed, 3081 insertions(+), 1871 deletions(-) mode change 100755 => 100644 3rd-dependencies/listDeps.sh create mode 100644 hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java rename {hawkbit-ddi-api => hawkbit-ddi-resource}/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java (100%) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/{ => rest}/resource/ArtifactStoreController.java (98%) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/{ => rest}/resource/DataConversionHelper.java (95%) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/{ => rest}/resource/RootController.java (99%) rename hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/{resource/ArtifactDownloadTest.java => rest/resource/DdiArtifactDownloadTest.java} (99%) rename hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/{resource/CancelActionTest.java => rest/resource/DdiCancelActionTest.java} (99%) rename hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/{resource/ConfigDataTest.java => rest/resource/DdiConfigDataTest.java} (97%) rename hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/{resource/DeploymentBaseTest.java => rest/resource/DdiDeploymentBaseTest.java} (99%) rename hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/{resource/RootControllerTest.java => rest/resource/DdiRootControllerTest.java} (98%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi}/rest/resource/JsonBuilder.java (99%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource}/MockMvcResultPrinter.java (97%) create mode 100644 hawkbit-mgmt-api/pom.xml rename {hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json}/model/MetadataRest.java (96%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java (94%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java (92%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java (91%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java (95%) rename {hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json}/model/PagedList.java (97%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java (92%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java (97%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java (90%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java (83%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java (85%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java (86%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPost.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java (67%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPut.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java (82%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentRequestBody.java (85%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java (93%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPost.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java (68%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPut.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java (79%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java (87%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutCondition.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java (84%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutErrorAction.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java (93%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutResponseBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java (94%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutRestRequestBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java (72%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutSuccessAction.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutSuccessAction.java (84%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rolloutgroup/RolloutGroupResponseBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java (88%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java (93%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleAssigment.java (73%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java (80%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java (80%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java (90%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeAssigment.java (73%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java (79%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java (79%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedDistributionSetRequestBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java (81%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedTargetRequestBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java (83%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/DistributionSetTagAssigmentResultRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtDistributionSetTagAssigmentResult.java (61%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java (87%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRequestBodyPut.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java (80%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TargetTagAssigmentResultRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTargetTagAssigmentResult.java (67%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssigment.java (64%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java (90%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAttributes.java (63%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java (78%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java (76%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTagRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java (72%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTypeRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java (72%) create mode 100644 hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java create mode 100644 hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/RestConstants.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java (92%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/RolloutRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java (69%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleRestAPI.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java (74%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleTypeRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java (70%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java (72%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetTagRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java (67%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource => hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json}/model/PagedListTest.java (97%) rename {hawkbit-rest-resource => hawkbit-mgmt-resource}/pom.xml (82%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/EnableRestResources.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java (91%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java (75%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java (79%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTagResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java (72%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java (60%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java (74%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadArtifactResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java (79%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java (83%) create mode 100644 hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRestModelMapper.java rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutMapper.java (67%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java (81%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java (63%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java (71%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java (62%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java (73%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TagMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTagMapper.java (61%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetMapper.java (65%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java (73%) rename hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetTagResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java (69%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt}/rest/resource/PagingUtility.java (91%) create mode 100644 hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java (92%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java (94%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DownloadResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java (84%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java (96%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java (96%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java (91%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/TargetResourceTest.java => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java (84%) create mode 100644 hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt}/rest/resource/ResourceUtility.java (77%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt}/rest/resource/SMRessourceMisingMongoDbConnectionTest.java (93%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt}/rest/resource/SuccessCondition.java (91%) rename {hawkbit-rest-resource => hawkbit-mgmt-resource}/src/test/resources/application-test.properties (100%) rename {hawkbit-rest-resource => hawkbit-mgmt-resource}/src/test/resources/log4j2.xml (100%) create mode 100644 hawkbit-rest-core/pom.xml rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/data}/SortDirection.java (89%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception}/MessageNotReadableException.java (95%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception}/ResponseExceptionHandler.java (98%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception}/SortParameterSyntaxErrorException.java (95%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception}/SortParameterUnsupportedDirectionException.java (97%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception}/SortParameterUnsupportedFieldException.java (97%) rename {hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/json}/model/ExceptionInfo.java (97%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util}/ByteRange.java (98%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util}/FileSteamingFailedException.java (96%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util}/RestResourceConversionHelper.java (94%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util}/SortUtility.java (94%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json}/model/ExceptionInfoTest.java (95%) rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource => hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util}/SortUtilityTest.java (91%) create mode 100644 hawkbit-rest-core/src/test/resources/application-test.properties create mode 100644 hawkbit-rest-core/src/test/resources/log4j2.xml delete mode 100644 hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/OffsetBasedPageRequest.java delete mode 100644 hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RestModelMapper.java rename {hawkbit-rest-api => hawkbit-system-api}/pom.xml (83%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRest.java => hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java (94%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRequest.java => hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java (80%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/CacheRest.java => hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java (84%) rename {hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource => hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json}/model/systemmanagement/SystemStatisticsRest.java (89%) rename hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/TenantSystemUsageRest.java => hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java (91%) create mode 100644 hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java create mode 100644 hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java create mode 100644 hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java create mode 100644 hawkbit-system-resource/pom.xml create mode 100644 hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit => hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system}/rest/resource/SystemManagementResource.java (71%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit => hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system}/rest/resource/SystemMapper.java (81%) rename {hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit => hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system}/rest/resource/SystemResource.java (67%) create mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java create mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java rename {hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit => hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system}/rest/resource/SystemManagementResourceTest.java (98%) rename hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ConfigurationResourceTest.java => hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java (87%) create mode 100644 hawkbit-system-resource/src/test/resources/application-test.properties diff --git a/3rd-dependencies/listDeps.sh b/3rd-dependencies/listDeps.sh old mode 100755 new mode 100644 diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index fccd835bc..86ce5d9eb 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -64,7 +64,12 @@ org.eclipse.hawkbit - hawkbit-rest-resource + hawkbit-mgmt-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-system-resource ${project.version} diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index 382d90c20..76d89af33 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -11,7 +11,8 @@ package org.eclipse.hawkbit.app; import org.eclipse.hawkbit.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration; import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi; -import org.eclipse.hawkbit.rest.resource.EnableRestResources; +import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; +import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @@ -24,8 +25,9 @@ import org.springframework.context.annotation.Import; @SpringBootApplication @Import({ RepositoryApplicationConfiguration.class }) @EnableHawkbitManagedSecurityConfiguration -@EnableRestResources +@EnableMgmtApi @EnableDdiApi +@EnableSystemApi public class Start { /** diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index 9aaf53dc6..051252d12 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -57,7 +57,7 @@ org.eclipse.hawkbit - hawkbit-rest-api + hawkbit-mgmt-api ${project.version} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java index 5ac11e012..11df8c323 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the DistributionSet resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsets") -public interface DistributionSetResourceClient extends DistributionSetRestApi { +public interface DistributionSetResourceClient extends MgmtDistributionSetRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java index 5fbdaf857..628304e26 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTagRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the DistributionSetTag resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettags") -public interface DistributionSetTagResourceClient extends DistributionSetTagRestApi { +public interface DistributionSetTagResourceClient extends MgmtDistributionSetTagRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java index 300f8ddcb..871f79beb 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java @@ -8,7 +8,7 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** @@ -16,6 +16,6 @@ import org.springframework.cloud.netflix.feign.FeignClient; * */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettypes") -public interface DistributionSetTypeResourceClient extends DistributionSetTypeRestApi { +public interface DistributionSetTypeResourceClient extends MgmtDistributionSetTypeRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java index aed3af7a2..0a40ab107 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.RolloutRestApi; +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}/rest/v1/rollouts") -public interface RolloutResourceClient extends RolloutRestApi { +public interface RolloutResourceClient extends MgmtRolloutRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java index 8610643ef..aaf589779 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleRestAPI; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the SoftwareModule resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremodules") -public interface SoftwareModuleResourceClient extends SoftwareModuleRestAPI { +public interface SoftwareModuleResourceClient extends MgmtSoftwareModuleRestAPI { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java index 46410dd6c..5fe0012f6 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleTypeRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the oftwareModuleType resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremoduletypes") -public interface SoftwareModuleTypeResourceClient extends SoftwareModuleTypeRestApi { +public interface SoftwareModuleTypeResourceClient extends MgmtSoftwareModuleTypeRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java index 79385fea4..920666dd1 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.TargetRestApi; +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}/rest/v1/targets") -public interface TargetResourceClient extends TargetRestApi { +public interface TargetResourceClient extends MgmtTargetRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java index 930931a87..ad6a1dab9 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.rest.resource.api.TargetTagRestApi; +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}/rest/v1/targettags") -public interface TargetTagResourceClient extends TargetTagRestApi { +public interface TargetTagResourceClient extends MgmtTargetTagRestApi { } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java index 2e2d91928..56c0ddbf8 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java @@ -11,20 +11,20 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; import com.google.common.collect.Lists; /** - * Builder pattern for building {@link DistributionSetRequestBodyPost}. + * Builder pattern for building {@link MgmtDistributionSetRequestBodyPost}. */ public class DistributionSetBuilder { private String name; private String version; private String type; - private final List modules = new ArrayList<>(); + private final List modules = new ArrayList<>(); /** * @param name @@ -37,7 +37,7 @@ public class DistributionSetBuilder { } public DistributionSetBuilder moduleByID(final Long id) { - final SoftwareModuleAssigmentRest softwareModuleAssigmentRest = new SoftwareModuleAssigmentRest(); + final MgmtSoftwareModuleAssigment softwareModuleAssigmentRest = new MgmtSoftwareModuleAssigment(); softwareModuleAssigmentRest.setId(id); modules.add(softwareModuleAssigmentRest); return this; @@ -65,27 +65,27 @@ public class DistributionSetBuilder { /** * Builds a list with a single entry of - * {@link DistributionSetRequestBodyPost} which can directly be used to post + * {@link MgmtDistributionSetRequestBodyPost} which can directly be used to post * on the RESTful-API. * - * @return a single entry list of {@link DistributionSetRequestBodyPost} + * @return a single entry list of {@link MgmtDistributionSetRequestBodyPost} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(name)); } /** - * Builds a list of multiple {@link DistributionSetRequestBodyPost} to + * Builds a list of multiple {@link MgmtDistributionSetRequestBodyPost} to * create multiple distribution sets at once. An increasing number will be * added to the name of the distribution set. The version and type will * remain the same. * * @param count * the amount of distribution sets body which should be created - * @return a list of {@link DistributionSetRequestBodyPost} + * @return a list of {@link MgmtDistributionSetRequestBodyPost} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(name + index)); } @@ -93,8 +93,8 @@ public class DistributionSetBuilder { return bodyList; } - private DistributionSetRequestBodyPost doBuild(final String prefixName) { - final DistributionSetRequestBodyPost body = new DistributionSetRequestBodyPost(); + private MgmtDistributionSetRequestBodyPost doBuild(final String prefixName) { + final MgmtDistributionSetRequestBodyPost body = new MgmtDistributionSetRequestBodyPost(); body.setName(prefixName); body.setVersion(version); body.setType(type); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java index 752834c7d..909e08470 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java @@ -11,22 +11,22 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeAssigmentRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment; import com.google.common.collect.Lists; /** * - * Builder pattern for building {@link DistributionSetTypeRequestBodyPost}. + * Builder pattern for building {@link MgmtDistributionSetTypeRequestBodyPost}. * */ public class DistributionSetTypeBuilder { private String key; private String name; - private final List mandatorymodules = Lists.newArrayList(); - private final List optionalmodules = Lists.newArrayList(); + private final List mandatorymodules = Lists.newArrayList(); + private final List optionalmodules = Lists.newArrayList(); /** * @param key @@ -56,7 +56,7 @@ public class DistributionSetTypeBuilder { */ public DistributionSetTypeBuilder mandatorymodules(final Long... softwareModuleTypeIds) { for (final Long id : softwareModuleTypeIds) { - final SoftwareModuleTypeAssigmentRest softwareModuleTypeAssigmentRest = new SoftwareModuleTypeAssigmentRest(); + final MgmtSoftwareModuleTypeAssigment softwareModuleTypeAssigmentRest = new MgmtSoftwareModuleTypeAssigment(); softwareModuleTypeAssigmentRest.setId(id); this.mandatorymodules.add(softwareModuleTypeAssigmentRest); } @@ -72,7 +72,7 @@ public class DistributionSetTypeBuilder { */ public DistributionSetTypeBuilder optionalmodules(final Long... softwareModuleTypeIds) { for (final Long id : softwareModuleTypeIds) { - final SoftwareModuleTypeAssigmentRest softwareModuleTypeAssigmentRest = new SoftwareModuleTypeAssigmentRest(); + final MgmtSoftwareModuleTypeAssigment softwareModuleTypeAssigmentRest = new MgmtSoftwareModuleTypeAssigment(); softwareModuleTypeAssigmentRest.setId(id); this.optionalmodules.add(softwareModuleTypeAssigmentRest); } @@ -81,17 +81,17 @@ public class DistributionSetTypeBuilder { /** * Builds a list with a single entry of - * {@link DistributionSetTypeRequestBodyPost} which can directly be used in + * {@link MgmtDistributionSetTypeRequestBodyPost} which can directly be used in * the RESTful-API. * - * @return a single entry list of {@link DistributionSetTypeRequestBodyPost} + * @return a single entry list of {@link MgmtDistributionSetTypeRequestBodyPost} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(name, key)); } /** - * Builds a list of multiple {@link DistributionSetTypeRequestBodyPost} to + * Builds a list of multiple {@link MgmtDistributionSetTypeRequestBodyPost} to * create multiple distribution set types at once. An increasing number will * be added to the name and key of the distribution set type. The optional * and mandatory software module types will remain the same. @@ -99,10 +99,10 @@ public class DistributionSetTypeBuilder { * @param count * the amount of distribution sets type body which should be * created - * @return a list of {@link DistributionSetTypeRequestBodyPost} + * @return a list of {@link MgmtDistributionSetTypeRequestBodyPost} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(name + index, key + index)); } @@ -110,8 +110,8 @@ public class DistributionSetTypeBuilder { } - private DistributionSetTypeRequestBodyPost doBuild(final String prefixName, final String prefixKey) { - final DistributionSetTypeRequestBodyPost body = new DistributionSetTypeRequestBodyPost(); + private MgmtDistributionSetTypeRequestBodyPost doBuild(final String prefixName, final String prefixKey) { + final MgmtDistributionSetTypeRequestBodyPost body = new MgmtDistributionSetTypeRequestBodyPost(); body.setKey(prefixKey); body.setName(prefixName); body.setMandatorymodules(mandatorymodules); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java index 2e01e0ba2..e9f8431d8 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource.builder; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutCondition; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutCondition.Condition; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition.Condition; /** * - * Builder pattern for building {@link RolloutRestRequestBody}. + * Builder pattern for building {@link MgmtRolloutRestRequestBody}. * */ public class RolloutBuilder { @@ -95,18 +95,18 @@ public class RolloutBuilder { * * @return the rest request body for creating a rollout */ - public RolloutRestRequestBody build() { + public MgmtRolloutRestRequestBody build() { return doBuild(); } - private RolloutRestRequestBody doBuild() { - final RolloutRestRequestBody body = new RolloutRestRequestBody(); + private MgmtRolloutRestRequestBody doBuild() { + final MgmtRolloutRestRequestBody body = new MgmtRolloutRestRequestBody(); body.setName(name); body.setAmountGroups(groupSize); body.setTargetFilterQuery(targetFilterQuery); body.setDistributionSetId(distributionSetId); - body.setSuccessCondition(new RolloutCondition(Condition.THRESHOLD, successThreshold)); - body.setErrorCondition(new RolloutCondition(Condition.THRESHOLD, errorThreshold)); + body.setSuccessCondition(new MgmtRolloutCondition(Condition.THRESHOLD, successThreshold)); + body.setErrorCondition(new MgmtRolloutCondition(Condition.THRESHOLD, errorThreshold)); return body; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java index 8d69db619..a6003e2c5 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java @@ -11,11 +11,11 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; /** * - * Builder pattern for building {@link SoftwareModuleAssigmentRest}. + * Builder pattern for building {@link MgmtSoftwareModuleAssigment}. * */ public class SoftwareModuleAssigmentBuilder { @@ -37,15 +37,15 @@ public class SoftwareModuleAssigmentBuilder { } /** - * Builds a list with a single entry of {@link SoftwareModuleAssigmentRest} + * Builds a list with a single entry of {@link MgmtSoftwareModuleAssigment} * which can directly be used in the RESTful-API. * - * @return a single entry list of {@link SoftwareModuleAssigmentRest} + * @return a single entry list of {@link MgmtSoftwareModuleAssigment} */ - public List build() { - final List softwareModuleAssigmentRestList = new ArrayList<>(); + public List build() { + final List softwareModuleAssigmentRestList = new ArrayList<>(); for (final Long id : ids) { - final SoftwareModuleAssigmentRest softwareModuleAssigmentRest = new SoftwareModuleAssigmentRest(); + final MgmtSoftwareModuleAssigment softwareModuleAssigmentRest = new MgmtSoftwareModuleAssigment(); softwareModuleAssigmentRest.setId(id); softwareModuleAssigmentRestList.add(softwareModuleAssigmentRest); } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java index 4bbfd92b4..d1b38b2b6 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java @@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; import com.google.common.collect.Lists; /** * - * Builder pattern for building {@link SoftwareModuleRequestBodyPost}. + * Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}. * */ public class SoftwareModuleBuilder { @@ -60,27 +60,27 @@ public class SoftwareModuleBuilder { /** * Builds a list with a single entry of - * {@link SoftwareModuleRequestBodyPost} which can directly be used in the + * {@link MgmtSoftwareModuleRequestBodyPost} which can directly be used in the * RESTful-API. * - * @return a single entry list of {@link SoftwareModuleRequestBodyPost} + * @return a single entry list of {@link MgmtSoftwareModuleRequestBodyPost} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(name)); } /** - * Builds a list of multiple {@link SoftwareModuleRequestBodyPost} to create + * Builds a list of multiple {@link MgmtSoftwareModuleRequestBodyPost} to create * multiple software module at once. An increasing number will be added to * the name of the software module. The version and type will remain the * same. * * @param count * the amount of software module body which should be created - * @return a list of {@link DistributionSetTypeRequestBodyPost} + * @return a list of {@link MgmtDistributionSetTypeRequestBodyPost} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(name + index)); } @@ -88,8 +88,8 @@ public class SoftwareModuleBuilder { return bodyList; } - private SoftwareModuleRequestBodyPost doBuild(final String prefixName) { - final SoftwareModuleRequestBodyPost body = new SoftwareModuleRequestBodyPost(); + private MgmtSoftwareModuleRequestBodyPost doBuild(final String prefixName) { + final MgmtSoftwareModuleRequestBodyPost body = new MgmtSoftwareModuleRequestBodyPost(); body.setName(prefixName); body.setVersion(version); body.setType(type); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java index a6472f0a0..749546442 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java @@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; import com.google.common.collect.Lists; /** * - * Builder pattern for building {@link SoftwareModuleRequestBodyPost}. + * Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}. * */ public class SoftwareModuleTypeBuilder { @@ -60,35 +60,35 @@ public class SoftwareModuleTypeBuilder { /** * Builds a list with a single entry of - * {@link SoftwareModuleTypeRequestBodyPost} which can directly be used in + * {@link MgmtSoftwareModuleTypeRequestBodyPost} which can directly be used in * the RESTful-API. * - * @return a single entry list of {@link SoftwareModuleTypeRequestBodyPost} + * @return a single entry list of {@link MgmtSoftwareModuleTypeRequestBodyPost} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(key, name)); } /** - * Builds a list of multiple {@link SoftwareModuleTypeRequestBodyPost} to + * Builds a list of multiple {@link MgmtSoftwareModuleTypeRequestBodyPost} to * create multiple software module types at once. An increasing number will * be added to the name and key of the software module type. * * @param count * the amount of software module type bodies which should be * created - * @return a list of {@link SoftwareModuleTypeRequestBodyPost} + * @return a list of {@link MgmtSoftwareModuleTypeRequestBodyPost} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(key + index, name + index)); } return bodyList; } - private SoftwareModuleTypeRequestBodyPost doBuild(final String prefixKey, final String prefixName) { - final SoftwareModuleTypeRequestBodyPost body = new SoftwareModuleTypeRequestBodyPost(); + private MgmtSoftwareModuleTypeRequestBodyPost doBuild(final String prefixKey, final String prefixName) { + final MgmtSoftwareModuleTypeRequestBodyPost body = new MgmtSoftwareModuleTypeRequestBodyPost(); body.setKey(prefixKey); body.setName(prefixName); body.setDescription(description); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java index 6f2eb3248..6718e631e 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java @@ -11,12 +11,12 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; import com.google.common.collect.Lists; /** - * Builder pattern for building {@link TagRequestBodyPut}. + * Builder pattern for building {@link MgmtTagRequestBodyPut}. * */ public class TagBuilder { @@ -56,26 +56,26 @@ public class TagBuilder { } /** - * Builds a list with a single entry of {@link TagRequestBodyPut} which can + * Builds a list with a single entry of {@link MgmtTagRequestBodyPut} which can * directly be used in the RESTful-API. * - * @return a single entry list of {@link TagRequestBodyPut} + * @return a single entry list of {@link MgmtTagRequestBodyPut} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(name)); } /** - * Builds a list of multiple {@link TagRequestBodyPut} to create multiple + * Builds a list of multiple {@link MgmtTagRequestBodyPut} to create multiple * tags at once. An increasing number will be added to the name of the tag. * The color and description will remain the same. * * @param count * the amount of distribution sets body which should be created - * @return a list of {@link TagRequestBodyPut} + * @return a list of {@link MgmtTagRequestBodyPut} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(name + index)); } @@ -83,8 +83,8 @@ public class TagBuilder { return bodyList; } - private TagRequestBodyPut doBuild(final String prefixName) { - final TagRequestBodyPut body = new TagRequestBodyPut(); + private MgmtTagRequestBodyPut doBuild(final String prefixName) { + final MgmtTagRequestBodyPut body = new MgmtTagRequestBodyPut(); body.setName(prefixName); body.setDescription(description); body.setColour(color); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java index e496407e1..09b20339b 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java @@ -11,14 +11,14 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody; import com.google.common.collect.Lists; /** * - * Builder pattern for building {@link TargetRequestBody}. + * Builder pattern for building {@link MgmtTargetRequestBody}. * */ public class TargetBuilder { @@ -58,35 +58,35 @@ public class TargetBuilder { } /** - * Builds a list with a single entry of {@link TargetRequestBody} which can + * Builds a list with a single entry of {@link MgmtTargetRequestBody} which can * directly be used in the RESTful-API. * - * @return a single entry list of {@link TargetRequestBody} + * @return a single entry list of {@link MgmtTargetRequestBody} */ - public List build() { + public List build() { return Lists.newArrayList(doBuild(controllerId)); } /** - * Builds a list of multiple {@link TargetRequestBody} to create multiple + * Builds a list of multiple {@link MgmtTargetRequestBody} to create multiple * targets at once. An increasing number will be added to the controllerId * of the target. The name and description will remain. * * @param count * the amount of software module type bodies which should be * created - * @return a list of {@link SoftwareModuleTypeRequestBodyPost} + * @return a list of {@link MgmtSoftwareModuleTypeRequestBodyPost} */ - public List buildAsList(final int count) { - final ArrayList bodyList = Lists.newArrayList(); + public List buildAsList(final int count) { + final ArrayList bodyList = Lists.newArrayList(); for (int index = 0; index < count; index++) { bodyList.add(doBuild(controllerId + index)); } return bodyList; } - private TargetRequestBody doBuild(final String prefixControllerId) { - final TargetRequestBody body = new TargetRequestBody(); + private MgmtTargetRequestBody doBuild(final String prefixControllerId) { + final MgmtTargetRequestBody body = new MgmtTargetRequestBody(); body.setControllerId(prefixControllerId); body.setName(name); body.setDescription(description); diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java index cd74c0474..0e1093f1d 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java @@ -23,10 +23,10 @@ import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleAssigmentB import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleTypeBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.TargetBuilder; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +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.stereotype.Component; @@ -67,7 +67,7 @@ public class CreateStartedRolloutExample { public void run() { // create three SoftwareModuleTypes - final List createdSoftwareModuleTypes = softwareModuleTypeResource + final List createdSoftwareModuleTypes = softwareModuleTypeResource .createSoftwareModuleTypes(new SoftwareModuleTypeBuilder().key(SM_MODULE_TYPE).name(SM_MODULE_TYPE) .maxAssignments(1).build()) .getBody(); @@ -78,12 +78,12 @@ public class CreateStartedRolloutExample { .getBody(); // create one DistributionSet - final List distributionSetsRest = distributionSetResource.createDistributionSets( + final List distributionSetsRest = distributionSetResource.createDistributionSets( new DistributionSetBuilder().name("rollout-example").version("1.0.0").type(DS_MODULE_TYPE).build()) .getBody(); // create three SoftwareModules - final List softwareModulesRest = softwareModuleResource + final List softwareModulesRest = softwareModuleResource .createSoftwareModules( new SoftwareModuleBuilder().name("firmware").version("1.0.0").type(SM_MODULE_TYPE).build()) .getBody(); @@ -97,7 +97,7 @@ public class CreateStartedRolloutExample { .description("Targets used for rollout example").buildAsList(10)); // create a Rollout - final RolloutResponseBody rolloutResponseBody = rolloutResource + final MgmtRolloutResponseBody rolloutResponseBody = rolloutResource .create(new RolloutBuilder().name("MyRollout").groupSize(2).targetFilterQuery("name==00-FF-AA-0*") .distributionSetId(distributionSetsRest.get(0).getDsId()).successThreshold("80") .errorThreshold("50").build()) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java index 5873403f0..43a98aff4 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java @@ -19,9 +19,9 @@ import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetTypeBuild import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleAssigmentBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleTypeBuilder; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -70,7 +70,7 @@ public class GettingStartedDefaultScenario { // create one SoftwareModuleTypes LOGGER.info("Creating software module type {}", SM_MODULE_TYPE); - final List createdSoftwareModuleTypes = softwareModuleTypeResource + final List createdSoftwareModuleTypes = softwareModuleTypeResource .createSoftwareModuleTypes(new SoftwareModuleTypeBuilder().key(SM_MODULE_TYPE).name(SM_MODULE_TYPE) .maxAssignments(1).build()) .getBody(); @@ -86,17 +86,17 @@ public class GettingStartedDefaultScenario { final String dsVersion3 = "2.1.0"; LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion1); - final List distributionSetsRest1 = distributionSetResource.createDistributionSets( + final List distributionSetsRest1 = distributionSetResource.createDistributionSets( new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion1).type(DS_MODULE_TYPE).build()) .getBody(); LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion2); - final List distributionSetsRest2 = distributionSetResource.createDistributionSets( + final List distributionSetsRest2 = distributionSetResource.createDistributionSets( new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion2).type(DS_MODULE_TYPE).build()) .getBody(); LOGGER.info("Creating distribution set {}:{}", DS_EXAMPLE_NAME, dsVersion3); - final List distributionSetsRest3 = distributionSetResource.createDistributionSets( + final List distributionSetsRest3 = distributionSetResource.createDistributionSets( new DistributionSetBuilder().name(DS_EXAMPLE_NAME).version(dsVersion3).type(DS_MODULE_TYPE).build()) .getBody(); @@ -106,15 +106,15 @@ public class GettingStartedDefaultScenario { final String swVersion3 = "3"; LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion1); - final List softwareModulesRest1 = softwareModuleResource.createSoftwareModules( + final List softwareModulesRest1 = softwareModuleResource.createSoftwareModules( new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion1).type(SM_MODULE_TYPE).build()) .getBody(); LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion2); - final List softwareModulesRest2 = softwareModuleResource.createSoftwareModules( + final List softwareModulesRest2 = softwareModuleResource.createSoftwareModules( new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion2).type(SM_MODULE_TYPE).build()) .getBody(); LOGGER.info("Creating distribution set {}:{}", SM_EXAMPLE_NAME, swVersion3); - final List softwareModulesRest3 = softwareModuleResource.createSoftwareModules( + final List softwareModulesRest3 = softwareModuleResource.createSoftwareModules( new SoftwareModuleBuilder().name(SM_EXAMPLE_NAME).version(swVersion3).type(SM_MODULE_TYPE).build()) .getBody(); diff --git a/hawkbit-autoconfigure/pom.xml b/hawkbit-autoconfigure/pom.xml index dcbb95920..3fb623978 100644 --- a/hawkbit-autoconfigure/pom.xml +++ b/hawkbit-autoconfigure/pom.xml @@ -64,13 +64,19 @@ org.eclipse.hawkbit - hawkbit-rest-resource + hawkbit-ddi-resource ${project.version} true org.eclipse.hawkbit - hawkbit-ddi-resource + hawkbit-system-resource + ${project.version} + true + + + org.eclipse.hawkbit + hawkbit-mgmt-resource ${project.version} true diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java index 9638377eb..d337658b8 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java @@ -29,7 +29,6 @@ import org.eclipse.hawkbit.im.authentication.UserAuthenticationFilter; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.SystemManagement; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; -import org.eclipse.hawkbit.rest.resource.RestConstants; import org.eclipse.hawkbit.security.ControllerTenantAwareAuthenticationDetailsSource; import org.eclipse.hawkbit.security.DdiSecurityProperties; import org.eclipse.hawkbit.security.DosFilter; @@ -41,6 +40,7 @@ import org.eclipse.hawkbit.security.HttpControllerPreAuthenticatedSecurityHeader import org.eclipse.hawkbit.security.HttpDownloadAuthenticationFilter; import org.eclipse.hawkbit.security.PreAuthTokenSourceTrustAuthenticationProvider; import org.eclipse.hawkbit.security.SystemSecurityContext; +import org.eclipse.hawkbit.system.rest.api.SystemRestConstant; import org.eclipse.hawkbit.tenancy.TenantAware; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -292,8 +292,9 @@ public class SecurityManagedConfiguration { new AuthenticationSuccessTenantMetadataCreationFilter(tenantAware, systemManagement), RequestHeaderAuthenticationFilter.class) .authorizeRequests().anyRequest().authenticated() - .antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/admin/**") - .hasAnyAuthority(SpPermission.SYSTEM_ADMIN).antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/**") + .antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/admin/**") + .hasAnyAuthority(SpPermission.SYSTEM_ADMIN) + .antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/**") .hasAnyAuthority(SpPermission.SYSTEM_DIAG); } } diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index ef489049f..34ed5ddcd 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -9,20 +9,19 @@ package org.eclipse.hawkbit.autoconfigure.web; import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi; -import org.eclipse.hawkbit.rest.resource.EnableRestResources; +import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; +import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; /** * Auto-Configuration for enabling the REST-Resources. - * - * * */ @Configuration -@ConditionalOnClass({ EnableDdiApi.class, EnableRestResources.class }) -@Import({ EnableDdiApi.class, EnableRestResources.class }) +@ConditionalOnClass({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) +@Import({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) public class ResourceControllerAutoConfiguration { } diff --git a/hawkbit-ddi-api/pom.xml b/hawkbit-ddi-api/pom.xml index 6dd30fdf9..e91053fc5 100644 --- a/hawkbit-ddi-api/pom.xml +++ b/hawkbit-ddi-api/pom.xml @@ -1,4 +1,14 @@ - + + 4.0.0 @@ -9,12 +19,19 @@ hawkbit-ddi-api hawkBit :: DDI API - - + + - org.eclipse.hawkbit - hawkbit-rest-api - ${project.version} + org.springframework.hateoas + spring-hateoas + + + com.fasterxml.jackson.core + jackson-annotations + + + javax.validation + validation-api javax.servlet @@ -22,17 +39,12 @@ provided - commons-io - commons-io - 2.4 + org.hibernate + hibernate-validator org.springframework.security spring-security-web - - org.hibernate - hibernate-validator - - + diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java index d39a44daa..5fc911946 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifact.java @@ -10,13 +10,13 @@ package org.eclipse.hawkbit.ddi.json.model; import javax.validation.constraints.NotNull; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactHash; import org.springframework.hateoas.ResourceSupport; import com.fasterxml.jackson.annotation.JsonProperty; /** - * Download information for all artifacts related to a specific {@link DdiChunk}. + * Download information for all artifacts related to a specific {@link DdiChunk} + * . */ public class DdiArtifact extends ResourceSupport { @@ -25,16 +25,16 @@ public class DdiArtifact extends ResourceSupport { private String filename; @JsonProperty - private ArtifactHash hashes; + private DdiArtifactHash hashes; @JsonProperty private Long size; - public ArtifactHash getHashes() { + public DdiArtifactHash getHashes() { return hashes; } - public void setHashes(final ArtifactHash hashes) { + public void setHashes(final DdiArtifactHash hashes) { this.hashes = hashes; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java new file mode 100644 index 000000000..9541055f8 --- /dev/null +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiArtifactHash.java @@ -0,0 +1,57 @@ +/** + * 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.json.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Hashes for given Artifact. + * + * + */ +public class DdiArtifactHash { + + @JsonProperty + private String sha1; + + @JsonProperty + private String md5; + + /** + * Default constructor. + */ + public DdiArtifactHash() { + } + + /** + * Public constructor. + * + * @param sha1 + * @param md5 + */ + public DdiArtifactHash(final String sha1, final String md5) { + this.sha1 = sha1; + this.md5 = md5; + } + + /** + * @return the sha1 + */ + public String getSha1() { + return sha1; + } + + /** + * @return the md5 + */ + public String getMd5() { + return md5; + } + +} diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index bcc1b4932..cafcfdf70 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -1,4 +1,14 @@ - + + 4.0.0 @@ -10,31 +20,26 @@ hawkbit-ddi-resource hawkBit :: DDI Resources - - + + org.eclipse.hawkbit hawkbit-ddi-api ${project.version} - + org.eclipse.hawkbit - hawkbit-rest-resource + hawkbit-rest-core ${project.version} - - + + org.eclipse.hawkbit hawkbit-repository ${project.version} + + - - org.eclipse.hawkbit - hawkbit-rest-resource - ${project.version} - test - tests - org.springframework.boot spring-boot-starter diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java similarity index 100% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java similarity index 98% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java index 61f3fd465..2a6d544ab 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/ArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import java.io.IOException; import java.util.List; @@ -24,7 +24,7 @@ import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; +import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.util.IpUtil; import org.slf4j.Logger; diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java similarity index 95% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index 8533c6eac..2fd151f6e 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.UrlProtocol; import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; +import org.eclipse.hawkbit.ddi.json.model.DdiArtifactHash; import org.eclipse.hawkbit.ddi.json.model.DdiChunk; import org.eclipse.hawkbit.ddi.json.model.DdiConfig; import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; @@ -30,7 +31,6 @@ 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.rest.resource.model.artifact.ArtifactHash; import org.eclipse.hawkbit.tenancy.TenantAware; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.Link; @@ -85,7 +85,7 @@ public final class DataConversionHelper { final List files = new ArrayList<>(); module.getLocalArtifacts().forEach(artifact -> { final DdiArtifact file = new DdiArtifact(); - file.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); + file.setHashes(new DdiArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); file.setFilename(artifact.getFilename()); file.setSize(artifact.getSize()); final String linkHttp = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(), @@ -104,7 +104,8 @@ public final class DataConversionHelper { static DdiControllerBase fromTarget(final Target target, final List actions, final String defaultControllerPollTime, final TenantAware tenantAware) { - final DdiControllerBase result = new DdiControllerBase(new DdiConfig(new DdiPolling(defaultControllerPollTime))); + final DdiControllerBase result = new DdiControllerBase( + new DdiConfig(new DdiPolling(defaultControllerPollTime))); boolean addedUpdate = false; boolean addedCancel = false; diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java similarity index 99% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java index e48e2ec5f..4f485984b 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/resource/RootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import java.io.IOException; import java.util.List; @@ -40,7 +40,7 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; +import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.tenancy.TenantAware; import org.eclipse.hawkbit.util.IpUtil; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java similarity index 99% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java index f7173f86e..af65b1351 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ArtifactDownloadTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.junit.Assert.assertTrue; @@ -60,10 +60,10 @@ import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Artifact Download Resource") -public class ArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB { +public class DdiArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB { - public ArtifactDownloadTest() { - LOG = LoggerFactory.getLogger(ArtifactDownloadTest.class); + public DdiArtifactDownloadTest() { + LOG = LoggerFactory.getLogger(DdiArtifactDownloadTest.class); } private volatile int downLoadProgress = 0; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java similarity index 99% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java index 3c236c196..27a7e7f1f 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/CancelActionTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -23,13 +23,11 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; -import org.eclipse.hawkbit.rest.resource.JsonBuilder; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; @@ -45,7 +43,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Cancel Action Resource") -public class CancelActionTest extends AbstractIntegrationTest { +public class DdiCancelActionTest extends AbstractIntegrationTest { @Test @Description("Test of the controller can continue a started update even after a cancel command if it so desires.") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java similarity index 97% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java index ee40d6ded..b757f1f1a 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/ConfigDataTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -22,9 +22,7 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.repository.model.Target; -import org.eclipse.hawkbit.rest.resource.JsonBuilder; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; @@ -40,7 +38,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Config Data Resource") -public class ConfigDataTest extends AbstractIntegrationTest { +public class DdiConfigDataTest extends AbstractIntegrationTest { @Test @Description("We verify that the config data (i.e. device attributes like serial number, hardware revision etc.) " diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java similarity index 99% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java index 4ba5c9cdf..dd2f66a04 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/DeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -26,7 +26,6 @@ import java.util.List; import org.apache.commons.lang3.RandomUtils; import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.ActionType; @@ -36,7 +35,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; -import org.eclipse.hawkbit.rest.resource.JsonBuilder; import org.fest.assertions.core.Condition; import org.junit.Test; import org.springframework.data.domain.PageRequest; @@ -57,7 +55,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Deployment Action Resource") -public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { +public class DdiDeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { @Test() @Description("Ensures that artifacts are not found, when softare module does not exists.") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java similarity index 98% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java index be390959a..f291393b9 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/resource/RootControllerTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithSpringAuthorityRule; import org.eclipse.hawkbit.WithUser; @@ -33,7 +32,6 @@ import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; -import org.eclipse.hawkbit.rest.resource.JsonBuilder; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.eclipse.hawkbit.util.IpUtil; import org.junit.Test; @@ -51,7 +49,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Root Poll Resource") -public class RootControllerTest extends AbstractIntegrationTestWithMongoDB { +public class DdiRootControllerTest extends AbstractIntegrationTestWithMongoDB { @Test @Description("Ensures that targets cannot be created e.g. in plug'n play scenarios when tenant does not exists but can be created if the tenant exists.") diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/JsonBuilder.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java similarity index 99% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/JsonBuilder.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java index dec0bb070..cf791bcf8 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/JsonBuilder.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.ddi.rest.resource; import java.util.ArrayList; import java.util.List; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/MockMvcResultPrinter.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java similarity index 97% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/MockMvcResultPrinter.java rename to hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java index b01bb4e9f..ba5020c58 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/MockMvcResultPrinter.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit; +package org.eclipse.hawkbit.ddi.rest.resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hawkbit-mgmt-api/pom.xml b/hawkbit-mgmt-api/pom.xml new file mode 100644 index 000000000..4c99cd7bc --- /dev/null +++ b/hawkbit-mgmt-api/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-mgmt-api + hawkBit :: Mgmt REST API + + + + org.springframework.hateoas + spring-hateoas + + + com.fasterxml.jackson.core + jackson-annotations + + + javax.validation + validation-api + + + javax.servlet + javax.servlet-api + provided + + + + + org.easytesting + fest-assert + test + + + ru.yandex.qatools.allure + allure-junit-adaptor + test + + + \ No newline at end of file diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java similarity index 96% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java index a5c24c4a9..70cfff0d0 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java similarity index 94% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java index 6d80a407c..728734050 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtBaseEntity.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import org.springframework.hateoas.ResourceSupport; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * A json annotated rest model for BaseEntity to RESTful API representation. * */ -public abstract class BaseEntityRest extends ResourceSupport { +public abstract class MgmtBaseEntity extends ResourceSupport { @JsonProperty private String createdBy; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java similarity index 92% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java index d15114d4e..e83c43d52 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtId.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * */ @JsonIgnoreProperties(ignoreUnknown = true) -public class IdRest { +public class MgmtId { @JsonProperty private Long id; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java similarity index 91% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java index d82d14f75..d335261ad 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtNamedEntity.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * A json annotated rest model for NamedEntity to RESTful API representation. * */ -public abstract class NamedEntityRest extends BaseEntityRest { +public abstract class MgmtNamedEntity extends MgmtBaseEntity { @JsonProperty(required = true) private String name; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java similarity index 95% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java index d66d02512..5e5163a6a 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtPollStatus.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class PollStatusRest { +public class MgmtPollStatus { @JsonProperty private Long lastRequestAt; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PagedList.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/PagedList.java similarity index 97% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PagedList.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/PagedList.java index 9d5cc458c..173f3ce31 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PagedList.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/PagedList.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import java.util.List; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java similarity index 92% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java index 630bcb993..5b63b5f69 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.action; +package org.eclipse.hawkbit.mgmt.json.model.action; -import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ActionRest extends BaseEntityRest { +public class MgmtAction extends MgmtBaseEntity { /** * API definition for {@link UpdateAction}. diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java similarity index 97% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java index e5af39bac..26120d2d5 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtActionStatus.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.action; +package org.eclipse.hawkbit.mgmt.json.model.action; import java.util.List; @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ActionStatusRest { +public class MgmtActionStatus { /** * Action is finished successfully for this target. diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java similarity index 90% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java index f32a32ed8..35ad382e7 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.artifact; +package org.eclipse.hawkbit.mgmt.json.model.artifact; -import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -22,7 +22,8 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ArtifactRest extends BaseEntityRest { +public class MgmtArtifact extends MgmtBaseEntity { + @JsonProperty(required = true) private ArtifactType type; @@ -30,7 +31,7 @@ public class ArtifactRest extends BaseEntityRest { private Long artifactId; @JsonProperty - private ArtifactHash hashes; + private MgmtArtifactHash hashes; @JsonProperty private String providedFilename; @@ -51,7 +52,7 @@ public class ArtifactRest extends BaseEntityRest { * the hashes to set */ @JsonIgnore - public void setHashes(final ArtifactHash hashes) { + public void setHashes(final MgmtArtifactHash hashes) { this.hashes = hashes; } @@ -81,7 +82,7 @@ public class ArtifactRest extends BaseEntityRest { /** * @return the hashes */ - public ArtifactHash getHashes() { + public MgmtArtifactHash getHashes() { return hashes; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java similarity index 83% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java index 58b81d8fd..d43ae4339 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifactHash.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.artifact; +package org.eclipse.hawkbit.mgmt.json.model.artifact; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * * */ -public class ArtifactHash { +public class MgmtArtifactHash { @JsonProperty private String sha1; @@ -26,7 +26,7 @@ public class ArtifactHash { /** * Default constructor. */ - public ArtifactHash() { + public MgmtArtifactHash() { } /** @@ -35,7 +35,7 @@ public class ArtifactHash { * @param sha1 * @param md5 */ - public ArtifactHash(final String sha1, final String md5) { + public MgmtArtifactHash(final String sha1, final String md5) { super(); this.sha1 = sha1; this.md5 = md5; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java similarity index 85% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java index bf6a649a0..98017d18a 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import com.fasterxml.jackson.annotation.JsonValue; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonValue; * * */ -public enum ActionTypeRest { +public enum MgmtActionType { /** * The soft action type. */ @@ -35,7 +35,7 @@ public enum ActionTypeRest { private final String name; - private ActionTypeRest(final String name) { + private MgmtActionType(final String name) { this.name = name; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java similarity index 86% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java index 2ff764eba..7caaf4cdd 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSet.java @@ -6,13 +6,13 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class DistributionSetRest extends NamedEntityRest { +public class MgmtDistributionSet extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long dsId; @@ -39,7 +39,7 @@ public class DistributionSetRest extends NamedEntityRest { private String version; @JsonProperty - private List modules = new ArrayList<>(); + private List modules = new ArrayList<>(); @JsonProperty private boolean requiredMigrationStep; @@ -99,7 +99,7 @@ public class DistributionSetRest extends NamedEntityRest { /** * @return the modules */ - public List getModules() { + public List getModules() { return modules; } @@ -107,7 +107,7 @@ public class DistributionSetRest extends NamedEntityRest { * @param modules * the modules to set */ - public void setModules(final List modules) { + public void setModules(final List modules) { this.modules = modules; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPost.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java similarity index 67% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPost.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java index bf5470d72..a56b5aaba 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPost.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPost.java @@ -6,11 +6,11 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -23,22 +23,22 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPut { +public class MgmtDistributionSetRequestBodyPost extends MgmtDistributionSetRequestBodyPut { // deprecated format from the time where os, application and runtime where // statically defined @JsonProperty - private SoftwareModuleAssigmentRest os; + private MgmtSoftwareModuleAssigment os; @JsonProperty - private SoftwareModuleAssigmentRest runtime; + private MgmtSoftwareModuleAssigment runtime; @JsonProperty - private SoftwareModuleAssigmentRest application; + private MgmtSoftwareModuleAssigment application; // deprecated format - END @JsonProperty - private List modules; + private List modules; @JsonProperty private boolean requiredMigrationStep; @@ -49,7 +49,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu /** * @return the os */ - public SoftwareModuleAssigmentRest getOs() { + public MgmtSoftwareModuleAssigment getOs() { return os; } @@ -59,7 +59,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setOs(final SoftwareModuleAssigmentRest os) { + public MgmtDistributionSetRequestBodyPost setOs(final MgmtSoftwareModuleAssigment os) { this.os = os; return this; } @@ -67,7 +67,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu /** * @return the runtime */ - public SoftwareModuleAssigmentRest getRuntime() { + public MgmtSoftwareModuleAssigment getRuntime() { return runtime; } @@ -77,7 +77,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setRuntime(final SoftwareModuleAssigmentRest runtime) { + public MgmtDistributionSetRequestBodyPost setRuntime(final MgmtSoftwareModuleAssigment runtime) { this.runtime = runtime; return this; @@ -86,7 +86,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu /** * @return the application */ - public SoftwareModuleAssigmentRest getApplication() { + public MgmtSoftwareModuleAssigment getApplication() { return application; } @@ -96,7 +96,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setApplication(final SoftwareModuleAssigmentRest application) { + public MgmtDistributionSetRequestBodyPost setApplication(final MgmtSoftwareModuleAssigment application) { this.application = application; return this; @@ -115,7 +115,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) { + public MgmtDistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) { this.requiredMigrationStep = requiredMigrationStep; return this; @@ -124,7 +124,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu /** * @return the modules */ - public List getModules() { + public List getModules() { return modules; } @@ -134,7 +134,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setModules(final List modules) { + public MgmtDistributionSetRequestBodyPost setModules(final List modules) { this.modules = modules; return this; @@ -153,7 +153,7 @@ public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPu * * @return updated body */ - public DistributionSetRequestBodyPost setType(final String type) { + public MgmtDistributionSetRequestBodyPost setType(final String type) { this.type = type; return this; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPut.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java similarity index 82% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPut.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java index 2f19625f3..4494dd8a8 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRequestBodyPut.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtDistributionSetRequestBodyPut.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class DistributionSetRequestBodyPut { +public class MgmtDistributionSetRequestBodyPut { @JsonProperty private String name; @@ -43,7 +43,7 @@ public class DistributionSetRequestBodyPut { * * @return updated body */ - public DistributionSetRequestBodyPut setName(final String name) { + public MgmtDistributionSetRequestBodyPut setName(final String name) { this.name = name; return this; } @@ -61,7 +61,7 @@ public class DistributionSetRequestBodyPut { * * @return updated body */ - public DistributionSetRequestBodyPut setDescription(final String description) { + public MgmtDistributionSetRequestBodyPut setDescription(final String description) { this.description = description; return this; @@ -80,7 +80,7 @@ public class DistributionSetRequestBodyPut { * * @return updated body */ - public DistributionSetRequestBodyPut setVersion(final String version) { + public MgmtDistributionSetRequestBodyPut setVersion(final String version) { this.version = version; return this; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentRequestBody.java similarity index 85% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentRequestBody.java index 5135a977c..46c43ac8b 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentRequestBody.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,14 +16,14 @@ import com.fasterxml.jackson.annotation.JsonProperty; * */ @JsonIgnoreProperties(ignoreUnknown = true) -public class TargetAssignmentRequestBody { +public class MgmtTargetAssignmentRequestBody { @JsonProperty private String id; private long forcetime; - private ActionTypeRest type; + private MgmtActionType type; /** * @return the id @@ -43,7 +43,7 @@ public class TargetAssignmentRequestBody { /** * @return the type */ - public ActionTypeRest getType() { + public MgmtActionType getType() { return type; } @@ -51,7 +51,7 @@ public class TargetAssignmentRequestBody { * @param type * the type to set */ - public void setType(final ActionTypeRest type) { + public void setType(final MgmtActionType type) { this.type = type; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java similarity index 93% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java index 77676f844..d5247c577 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtTargetAssignmentResponseBody.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionset; +package org.eclipse.hawkbit.mgmt.json.model.distributionset; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TargetAssignmentResponseBody { +public class MgmtTargetAssignmentResponseBody { private int assigned; private int alreadyAssigned; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPost.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java similarity index 68% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPost.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java index ba0f548f6..82ecb2cc5 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPost.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPost.java @@ -6,11 +6,11 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionsettype; +package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeAssigmentRest; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeAssigment; import com.fasterxml.jackson.annotation.JsonProperty; @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for DistributionSetType POST. * */ -public class DistributionSetTypeRequestBodyPost { +public class MgmtDistributionSetTypeRequestBodyPost { @JsonProperty(required = true) private String name; @@ -30,10 +30,10 @@ public class DistributionSetTypeRequestBodyPost { private String key; @JsonProperty - private List mandatorymodules; + private List mandatorymodules; @JsonProperty - private List optionalmodules; + private List optionalmodules; /** * @return the name @@ -48,7 +48,7 @@ public class DistributionSetTypeRequestBodyPost { * * @return updated body */ - public DistributionSetTypeRequestBodyPost setName(final String name) { + public MgmtDistributionSetTypeRequestBodyPost setName(final String name) { this.name = name; return this; } @@ -66,7 +66,7 @@ public class DistributionSetTypeRequestBodyPost { * * @return updated body */ - public DistributionSetTypeRequestBodyPost setDescription(final String description) { + public MgmtDistributionSetTypeRequestBodyPost setDescription(final String description) { this.description = description; return this; } @@ -84,7 +84,7 @@ public class DistributionSetTypeRequestBodyPost { * * @return updated body */ - public DistributionSetTypeRequestBodyPost setKey(final String key) { + public MgmtDistributionSetTypeRequestBodyPost setKey(final String key) { this.key = key; return this; } @@ -92,7 +92,7 @@ public class DistributionSetTypeRequestBodyPost { /** * @return the mandatory modules */ - public List getMandatorymodules() { + public List getMandatorymodules() { return mandatorymodules; } @@ -102,8 +102,8 @@ public class DistributionSetTypeRequestBodyPost { * * @return updated body */ - public DistributionSetTypeRequestBodyPost setMandatorymodules( - final List mandatorymodules) { + public MgmtDistributionSetTypeRequestBodyPost setMandatorymodules( + final List mandatorymodules) { this.mandatorymodules = mandatorymodules; return this; } @@ -111,7 +111,7 @@ public class DistributionSetTypeRequestBodyPost { /** * @return the optional modules */ - public List getOptionalmodules() { + public List getOptionalmodules() { return optionalmodules; } @@ -121,8 +121,8 @@ public class DistributionSetTypeRequestBodyPost { * * @return updated body */ - public DistributionSetTypeRequestBodyPost setOptionalmodules( - final List optionalmodules) { + public MgmtDistributionSetTypeRequestBodyPost setOptionalmodules( + final List optionalmodules) { this.optionalmodules = optionalmodules; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPut.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java similarity index 79% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPut.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java index 6bf21b93f..220f58e4d 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRequestBodyPut.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRequestBodyPut.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionsettype; +package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for DistributionSetType PUT, i.e. update. * */ -public class DistributionSetTypeRequestBodyPut { +public class MgmtDistributionSetTypeRequestBodyPut { @JsonProperty private String description; @@ -32,7 +32,7 @@ public class DistributionSetTypeRequestBodyPut { * * @return updated body */ - public DistributionSetTypeRequestBodyPut setDescription(final String description) { + public MgmtDistributionSetTypeRequestBodyPut setDescription(final String description) { this.description = description; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java similarity index 87% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java index e282b2924..5717863d1 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.distributionsettype; +package org.eclipse.hawkbit.mgmt.json.model.distributionsettype; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class DistributionSetTypeRest extends NamedEntityRest { +public class MgmtDistributionSetTypeRest extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long moduleId; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutCondition.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java similarity index 84% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutCondition.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java index 914a5d5c2..d83585415 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutCondition.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutCondition.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rollout; +package org.eclipse.hawkbit.mgmt.json.model.rollout; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutCondition { +public class MgmtRolloutCondition { private Condition condition = Condition.THRESHOLD; private String expression = "100"; @@ -25,10 +25,11 @@ public class RolloutCondition { /** * */ - public RolloutCondition() { + public MgmtRolloutCondition() { + // needed for jackson json creator. } - public RolloutCondition(final Condition condition, final String expression) { + public MgmtRolloutCondition(final Condition condition, final String expression) { this.condition = condition; this.expression = expression; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutErrorAction.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java similarity index 93% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutErrorAction.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java index 2ed6077e6..71fdf3ac9 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutErrorAction.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutErrorAction.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rollout; +package org.eclipse.hawkbit.mgmt.json.model.rollout; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutErrorAction { +public class MgmtRolloutErrorAction { private ErrorAction action = ErrorAction.PAUSE; private String expression = null; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutResponseBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java similarity index 94% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutResponseBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java index dd1296cfd..79455f501 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutResponseBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutResponseBody.java @@ -6,12 +6,12 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rollout; +package org.eclipse.hawkbit.mgmt.json.model.rollout; import java.util.HashMap; import java.util.Map; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutResponseBody extends NamedEntityRest { +public class MgmtRolloutResponseBody extends MgmtNamedEntity { private String targetFilterQuery; private Long distributionSetId; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutRestRequestBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java similarity index 72% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutRestRequestBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java index 0b83948ff..f3bdb2665 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutRestRequestBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutRestRequestBody.java @@ -6,10 +6,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rollout; +package org.eclipse.hawkbit.mgmt.json.model.rollout; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,26 +21,26 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutRestRequestBody extends NamedEntityRest { +public class MgmtRolloutRestRequestBody extends MgmtNamedEntity { private String targetFilterQuery; private long distributionSetId; private int amountGroups = 1; - private RolloutCondition successCondition = new RolloutCondition(); - private RolloutSuccessAction successAction = new RolloutSuccessAction(); - private RolloutCondition errorCondition = null; - private RolloutErrorAction errorAction = null; + private MgmtRolloutCondition successCondition = new MgmtRolloutCondition(); + private MgmtRolloutSuccessAction successAction = new MgmtRolloutSuccessAction(); + private MgmtRolloutCondition errorCondition = null; + private MgmtRolloutErrorAction errorAction = null; private Long forcetime; - private ActionTypeRest type; + private MgmtActionType type; /** * @return the finishCondition */ - public RolloutCondition getSuccessCondition() { + public MgmtRolloutCondition getSuccessCondition() { return successCondition; } @@ -48,14 +48,14 @@ public class RolloutRestRequestBody extends NamedEntityRest { * @param successCondition * the finishCondition to set */ - public void setSuccessCondition(final RolloutCondition successCondition) { + public void setSuccessCondition(final MgmtRolloutCondition successCondition) { this.successCondition = successCondition; } /** * @return the successAction */ - public RolloutSuccessAction getSuccessAction() { + public MgmtRolloutSuccessAction getSuccessAction() { return successAction; } @@ -63,14 +63,14 @@ public class RolloutRestRequestBody extends NamedEntityRest { * @param successAction * the successAction to set */ - public void setSuccessAction(final RolloutSuccessAction successAction) { + public void setSuccessAction(final MgmtRolloutSuccessAction successAction) { this.successAction = successAction; } /** * @return the errorCondition */ - public RolloutCondition getErrorCondition() { + public MgmtRolloutCondition getErrorCondition() { return errorCondition; } @@ -78,7 +78,7 @@ public class RolloutRestRequestBody extends NamedEntityRest { * @param errorCondition * the errorCondition to set */ - public void setErrorCondition(final RolloutCondition errorCondition) { + public void setErrorCondition(final MgmtRolloutCondition errorCondition) { this.errorCondition = errorCondition; } @@ -145,7 +145,7 @@ public class RolloutRestRequestBody extends NamedEntityRest { /** * @return the type */ - public ActionTypeRest getType() { + public MgmtActionType getType() { return type; } @@ -153,14 +153,14 @@ public class RolloutRestRequestBody extends NamedEntityRest { * @param type * the type to set */ - public void setType(final ActionTypeRest type) { + public void setType(final MgmtActionType type) { this.type = type; } /** * @return the errorAction */ - public RolloutErrorAction getErrorAction() { + public MgmtRolloutErrorAction getErrorAction() { return errorAction; } @@ -168,7 +168,7 @@ public class RolloutRestRequestBody extends NamedEntityRest { * @param errorAction * the errorAction to set */ - public void setErrorAction(final RolloutErrorAction errorAction) { + public void setErrorAction(final MgmtRolloutErrorAction errorAction) { this.errorAction = errorAction; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutSuccessAction.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutSuccessAction.java similarity index 84% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutSuccessAction.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutSuccessAction.java index f14e9a8bf..174aa63fa 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rollout/RolloutSuccessAction.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rollout/MgmtRolloutSuccessAction.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rollout; +package org.eclipse.hawkbit.mgmt.json.model.rollout; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutSuccessAction { +public class MgmtRolloutSuccessAction { private SuccessAction action = SuccessAction.NEXTGROUP; private String expression = null; @@ -25,10 +25,11 @@ public class RolloutSuccessAction { /** * */ - public RolloutSuccessAction() { + public MgmtRolloutSuccessAction() { + // needed for json creator } - public RolloutSuccessAction(final SuccessAction action, final String expression) { + public MgmtRolloutSuccessAction(final SuccessAction action, final String expression) { this.action = action; this.expression = expression; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rolloutgroup/RolloutGroupResponseBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java similarity index 88% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rolloutgroup/RolloutGroupResponseBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java index bb1b0116e..5e740a1fb 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/rolloutgroup/RolloutGroupResponseBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/rolloutgroup/MgmtRolloutGroupResponseBody.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.rolloutgroup; +package org.eclipse.hawkbit.mgmt.json.model.rolloutgroup; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class RolloutGroupResponseBody extends NamedEntityRest { +public class MgmtRolloutGroupResponseBody extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long rolloutGroupId; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java similarity index 93% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java index a5ab41c8b..fe47347a9 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremodule; +package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SoftwareModuleRest extends NamedEntityRest { +public class MgmtSoftwareModule extends MgmtNamedEntity { /** * API definition for {@link SoftwareModule.Type#RUNTIME}. */ diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleAssigment.java similarity index 73% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleAssigment.java index 3c866dca6..79bc31ad3 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleAssigment.java @@ -6,20 +6,17 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremodule; +package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; -import org.eclipse.hawkbit.rest.resource.model.IdRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; /** * Request Body of SoftwareModule for assignment operations (ID only). * - * - * - * */ @JsonIgnoreProperties(ignoreUnknown = true) -public class SoftwareModuleAssigmentRest extends IdRest { +public class MgmtSoftwareModuleAssigment extends MgmtId { } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java similarity index 80% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java index 08638c10f..e39413915 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPost.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremodule; +package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for SoftwareModule POST. * */ -public class SoftwareModuleRequestBodyPost { +public class MgmtSoftwareModuleRequestBodyPost { @JsonProperty(required = true) private String name; @@ -44,7 +44,7 @@ public class SoftwareModuleRequestBodyPost { * * @return updated body */ - public SoftwareModuleRequestBodyPost setName(final String name) { + public MgmtSoftwareModuleRequestBodyPost setName(final String name) { this.name = name; return this; } @@ -62,7 +62,7 @@ public class SoftwareModuleRequestBodyPost { * * @return updated body */ - public SoftwareModuleRequestBodyPost setVersion(final String version) { + public MgmtSoftwareModuleRequestBodyPost setVersion(final String version) { this.version = version; return this; } @@ -80,7 +80,7 @@ public class SoftwareModuleRequestBodyPost { * * @return updated body */ - public SoftwareModuleRequestBodyPost setType(final String type) { + public MgmtSoftwareModuleRequestBodyPost setType(final String type) { this.type = type; return this; } @@ -98,7 +98,7 @@ public class SoftwareModuleRequestBodyPost { * * @return updated body */ - public SoftwareModuleRequestBodyPost setDescription(final String description) { + public MgmtSoftwareModuleRequestBodyPost setDescription(final String description) { this.description = description; return this; } @@ -116,7 +116,7 @@ public class SoftwareModuleRequestBodyPost { * * @return updated body */ - public SoftwareModuleRequestBodyPost setVendor(final String vendor) { + public MgmtSoftwareModuleRequestBodyPost setVendor(final String vendor) { this.vendor = vendor; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java similarity index 80% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java index 1ee547886..52c097e39 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModuleRequestBodyPut.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremodule; +package org.eclipse.hawkbit.mgmt.json.model.softwaremodule; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for SoftwareModule PUT. * */ -public class SoftwareModuleRequestBodyPut { +public class MgmtSoftwareModuleRequestBodyPut { @JsonProperty private String description; @@ -35,7 +35,7 @@ public class SoftwareModuleRequestBodyPut { * * @return updated body */ - public SoftwareModuleRequestBodyPut setDescription(final String description) { + public MgmtSoftwareModuleRequestBodyPut setDescription(final String description) { this.description = description; return this; } @@ -53,7 +53,7 @@ public class SoftwareModuleRequestBodyPut { * * @return updated body */ - public SoftwareModuleRequestBodyPut setVendor(final String vendor) { + public MgmtSoftwareModuleRequestBodyPut setVendor(final String vendor) { this.vendor = vendor; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java similarity index 90% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java index ed05c1ee4..c0cda4994 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleType.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype; +package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SoftwareModuleTypeRest extends NamedEntityRest { +public class MgmtSoftwareModuleType extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long moduleId; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeAssigment.java similarity index 73% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeAssigment.java index 68709650b..43bdc157e 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeAssigment.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype; +package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; -import org.eclipse.hawkbit.rest.resource.model.IdRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -17,6 +17,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; * */ @JsonIgnoreProperties(ignoreUnknown = true) -public class SoftwareModuleTypeAssigmentRest extends IdRest { +public class MgmtSoftwareModuleTypeAssigment extends MgmtId { } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java similarity index 79% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java index 3528f6b98..836c39d19 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPost.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype; +package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for SoftwareModuleType POST. * */ -public class SoftwareModuleTypeRequestBodyPost { +public class MgmtSoftwareModuleTypeRequestBodyPost { @JsonProperty(required = true) private String name; @@ -41,7 +41,7 @@ public class SoftwareModuleTypeRequestBodyPost { * * @return updated body */ - public SoftwareModuleTypeRequestBodyPost setName(final String name) { + public MgmtSoftwareModuleTypeRequestBodyPost setName(final String name) { this.name = name; return this; } @@ -59,7 +59,7 @@ public class SoftwareModuleTypeRequestBodyPost { * * @return updated body */ - public SoftwareModuleTypeRequestBodyPost setDescription(final String description) { + public MgmtSoftwareModuleTypeRequestBodyPost setDescription(final String description) { this.description = description; return this; } @@ -76,7 +76,7 @@ public class SoftwareModuleTypeRequestBodyPost { * the key to set * @return updated body */ - public SoftwareModuleTypeRequestBodyPost setKey(final String key) { + public MgmtSoftwareModuleTypeRequestBodyPost setKey(final String key) { this.key = key; return this; } @@ -94,7 +94,7 @@ public class SoftwareModuleTypeRequestBodyPost { * * @return updated body */ - public SoftwareModuleTypeRequestBodyPost setMaxAssignments(final int maxAssignments) { + public MgmtSoftwareModuleTypeRequestBodyPost setMaxAssignments(final int maxAssignments) { this.maxAssignments = maxAssignments; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java similarity index 79% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java index 107a3cd2b..ecc8c9f65 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremoduletype/MgmtSoftwareModuleTypeRequestBodyPut.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype; +package org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request Body for SoftwareModuleType PUT. * */ -public class SoftwareModuleTypeRequestBodyPut { +public class MgmtSoftwareModuleTypeRequestBodyPut { @JsonProperty private String description; @@ -32,7 +32,7 @@ public class SoftwareModuleTypeRequestBodyPut { * * @return updated body */ - public SoftwareModuleTypeRequestBodyPut setDescription(final String description) { + public MgmtSoftwareModuleTypeRequestBodyPut setDescription(final String description) { this.description = description; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedDistributionSetRequestBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java similarity index 81% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedDistributionSetRequestBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java index 2bfd6cbf8..469780abf 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedDistributionSetRequestBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedDistributionSetRequestBody.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class AssignedDistributionSetRequestBody { +public class MgmtAssignedDistributionSetRequestBody { @JsonProperty(value = "id", required = true) private Long distributionSetId; @@ -28,7 +28,7 @@ public class AssignedDistributionSetRequestBody { return distributionSetId; } - public AssignedDistributionSetRequestBody setDistributionSetId(final Long distributionSetId) { + public MgmtAssignedDistributionSetRequestBody setDistributionSetId(final Long distributionSetId) { this.distributionSetId = distributionSetId; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedTargetRequestBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java similarity index 83% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedTargetRequestBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java index 2147c2697..6df1d10d7 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/AssignedTargetRequestBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtAssignedTargetRequestBody.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class AssignedTargetRequestBody { +public class MgmtAssignedTargetRequestBody { @JsonProperty(required = true) private String controllerId; @@ -28,7 +28,7 @@ public class AssignedTargetRequestBody { return controllerId; } - public AssignedTargetRequestBody setControllerId(final String controllerId) { + public MgmtAssignedTargetRequestBody setControllerId(final String controllerId) { this.controllerId = controllerId; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/DistributionSetTagAssigmentResultRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtDistributionSetTagAssigmentResult.java similarity index 61% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/DistributionSetTagAssigmentResultRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtDistributionSetTagAssigmentResult.java index 2078fe891..892bac453 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/DistributionSetTagAssigmentResultRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtDistributionSetTagAssigmentResult.java @@ -6,11 +6,11 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -24,27 +24,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class DistributionSetTagAssigmentResultRest { +public class MgmtDistributionSetTagAssigmentResult { @JsonProperty - private List assignedDistributionSets; + private List assignedDistributionSets; @JsonProperty - private List unassignedDistributionSets; + private List unassignedDistributionSets; - public List getAssignedDistributionSets() { + public List getAssignedDistributionSets() { return assignedDistributionSets; } - public List getUnassignedDistributionSets() { + public List getUnassignedDistributionSets() { return unassignedDistributionSets; } - public void setAssignedDistributionSets(final List assignedDistributionSets) { + public void setAssignedDistributionSets(final List assignedDistributionSets) { this.assignedDistributionSets = assignedDistributionSets; } - public void setUnassignedDistributionSets(final List unassignedDistributionSets) { + public void setUnassignedDistributionSets(final List unassignedDistributionSets) { this.unassignedDistributionSets = unassignedDistributionSets; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java similarity index 87% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java index 54d3c5064..82c33b434 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTag.java @@ -6,9 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TagRest extends NamedEntityRest { +public class MgmtTag extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long tagId; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRequestBodyPut.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java similarity index 80% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRequestBodyPut.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java index 2165bcfc0..e7037af2b 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TagRequestBodyPut.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTagRequestBodyPut.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TagRequestBodyPut { +public class MgmtTagRequestBodyPut { @JsonProperty private String colour; @@ -34,7 +34,7 @@ public class TagRequestBodyPut { return name; } - public TagRequestBodyPut setName(final String name) { + public MgmtTagRequestBodyPut setName(final String name) { this.name = name; return this; } @@ -43,12 +43,12 @@ public class TagRequestBodyPut { return description; } - public TagRequestBodyPut setDescription(final String description) { + public MgmtTagRequestBodyPut setDescription(final String description) { this.description = description; return this; } - public TagRequestBodyPut setColour(final String colour) { + public MgmtTagRequestBodyPut setColour(final String colour) { this.colour = colour; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TargetTagAssigmentResultRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTargetTagAssigmentResult.java similarity index 67% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TargetTagAssigmentResultRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTargetTagAssigmentResult.java index 30d47cc90..61625e59d 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/tag/TargetTagAssigmentResultRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/tag/MgmtTargetTagAssigmentResult.java @@ -6,11 +6,11 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.tag; +package org.eclipse.hawkbit.mgmt.json.model.tag; import java.util.List; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -24,27 +24,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TargetTagAssigmentResultRest { +public class MgmtTargetTagAssigmentResult { @JsonProperty - private List assignedTargets; + private List assignedTargets; @JsonProperty - private List unassignedTargets; + private List unassignedTargets; - public void setAssignedTargets(final List assignedTargets) { + public void setAssignedTargets(final List assignedTargets) { this.assignedTargets = assignedTargets; } - public List getAssignedTargets() { + public List getAssignedTargets() { return assignedTargets; } - public void setUnassignedTargets(final List unassignedTargets) { + public void setUnassignedTargets(final List unassignedTargets) { this.unassignedTargets = unassignedTargets; } - public List getUnassignedTargets() { + public List getUnassignedTargets() { return unassignedTargets; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssigment.java similarity index 64% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssigment.java index c2dc7f4a9..edfcc5687 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtDistributionSetAssigment.java @@ -1,23 +1,23 @@ /** * Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved. */ -package org.eclipse.hawkbit.rest.resource.model.target; +package org.eclipse.hawkbit.mgmt.json.model.target; -import org.eclipse.hawkbit.rest.resource.model.IdRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtId; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; /** * Request Body of DistributionSet for assignment operations (ID only). * */ -public class DistributionSetAssigmentRest extends IdRest { +public class MgmtDistributionSetAssigment extends MgmtId { private long forcetime; - private ActionTypeRest type; + private MgmtActionType type; /** * @return the type */ - public ActionTypeRest getType() { + public MgmtActionType getType() { return type; } @@ -25,7 +25,7 @@ public class DistributionSetAssigmentRest extends IdRest { * @param type * the type to set */ - public void setType(final ActionTypeRest type) { + public void setType(final MgmtActionType type) { this.type = type; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java similarity index 90% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java index 37baeeec9..40dd553a5 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java @@ -1,12 +1,12 @@ /** * Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved. */ -package org.eclipse.hawkbit.rest.resource.model.target; +package org.eclipse.hawkbit.mgmt.json.model.target; import java.net.URI; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; -import org.eclipse.hawkbit.rest.resource.model.PollStatusRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; +import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TargetRest extends NamedEntityRest { +public class MgmtTarget extends MgmtNamedEntity { @JsonProperty(required = true) private String controllerId; @@ -41,7 +41,7 @@ public class TargetRest extends NamedEntityRest { private String address; @JsonProperty - private PollStatusRest pollStatus; + private MgmtPollStatus pollStatus; @JsonProperty private String securityToken; @@ -111,7 +111,7 @@ public class TargetRest extends NamedEntityRest { /** * @return the pollStatus */ - public PollStatusRest getPollStatus() { + public MgmtPollStatus getPollStatus() { return pollStatus; } @@ -120,7 +120,7 @@ public class TargetRest extends NamedEntityRest { * the pollStatus to set */ @JsonIgnore - public void setPollStatus(final PollStatusRest pollStatus) { + public void setPollStatus(final MgmtPollStatus pollStatus) { this.pollStatus = pollStatus; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAttributes.java similarity index 63% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAttributes.java index 821be6b45..dad8e868f 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetAttributes.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved. */ -package org.eclipse.hawkbit.rest.resource.model.target; +package org.eclipse.hawkbit.mgmt.json.model.target; import java.util.HashMap; import java.util.Map; @@ -10,6 +10,6 @@ import java.util.Map; * {@link Map} with attributes of SP Target. * */ -public class TargetAttributes extends HashMap { +public class MgmtTargetAttributes extends HashMap { } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java similarity index 78% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java index bc1ca8a63..bc40326e4 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTargetRequestBody.java @@ -1,7 +1,7 @@ /** * Copyright (c) 2011-2015 Bosch Software Innovations GmbH, Germany. All rights reserved. */ -package org.eclipse.hawkbit.rest.resource.model.target; +package org.eclipse.hawkbit.mgmt.json.model.target; import com.fasterxml.jackson.annotation.JsonProperty; @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; * Request body for target PUT/POST commands. * */ -public class TargetRequestBody { +public class MgmtTargetRequestBody { @JsonProperty(required = true) private String name; @@ -43,7 +43,7 @@ public class TargetRequestBody { * @param name * the name to set */ - public TargetRequestBody setName(final String name) { + public MgmtTargetRequestBody setName(final String name) { this.name = name; return this; } @@ -52,7 +52,7 @@ public class TargetRequestBody { * @param description * the description to set */ - public TargetRequestBody setDescription(final String description) { + public MgmtTargetRequestBody setDescription(final String description) { this.description = description; return this; } @@ -61,7 +61,7 @@ public class TargetRequestBody { * @param controllerId * the controllerId to set */ - public TargetRequestBody setControllerId(final String controllerId) { + public MgmtTargetRequestBody setControllerId(final String controllerId) { this.controllerId = controllerId; return this; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java similarity index 76% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index 80caefc94..26788760e 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -7,21 +7,20 @@ * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentRequestBody; -import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; +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; @@ -33,8 +32,8 @@ import org.springframework.web.bind.annotation.RequestParam; /** * REST Resource handling for DistributionSet CRUD operations. */ -@RequestMapping(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) -public interface DistributionSetRestApi { +@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) +public interface MgmtDistributionSetRestApi { /** * Handles the GET request of retrieving all DistributionSets . @@ -56,11 +55,11 @@ public interface DistributionSetRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getDistributionSets( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + public ResponseEntity> getDistributionSets( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single DistributionSet . @@ -75,7 +74,7 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getDistributionSet( + public ResponseEntity getDistributionSet( @PathVariable("distributionSetId") final Long distributionSetId); /** @@ -91,8 +90,8 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createDistributionSets( - @RequestBody final List sets); + public ResponseEntity> createDistributionSets( + @RequestBody final List sets); /** * Handles the DELETE request for a single DistributionSet . @@ -118,9 +117,9 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity updateDistributionSet( + public ResponseEntity updateDistributionSet( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestBody final DistributionSetRequestBodyPut toUpdate); + @RequestBody final MgmtDistributionSetRequestBodyPut toUpdate); /** * Handles the GET request of retrieving assigned targets to a specific @@ -146,12 +145,12 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedTargets", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getAssignedTargets( + public ResponseEntity> getAssignedTargets( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving installed targets to a specific @@ -177,12 +176,12 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/installedTargets", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getInstalledTargets( + public ResponseEntity> getInstalledTargets( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the POST request of assigning multiple targets to a single @@ -200,9 +199,9 @@ public interface DistributionSetRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/assignedTargets", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity createAssignedTarget( + public ResponseEntity createAssignedTarget( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestBody final List targetIds); + @RequestBody final List targetIds); /** * Gets a paged list of meta data for a distribution set. @@ -228,10 +227,10 @@ public interface DistributionSetRestApi { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) public ResponseEntity> getMetadata( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Gets a single meta data value for a specific key of a distribution set. @@ -311,7 +310,7 @@ public interface DistributionSetRestApi { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) public ResponseEntity assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, - @RequestBody final List softwareModuleIDs); + @RequestBody final List softwareModuleIDs); /** * Deletes the assignment of the software module form the distribution set. @@ -355,9 +354,9 @@ public interface DistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedSM", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getAssignedSoftwareModules( + public ResponseEntity> getAssignedSoftwareModules( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam); } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java similarity index 72% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTagRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java index 83f29bb17..316f2a56e 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java @@ -2,21 +2,20 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.tag.AssignedDistributionSetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.tag.DistributionSetTagAssigmentResultRest; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedDistributionSetRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtDistributionSetTagAssigmentResult; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; +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; @@ -29,8 +28,8 @@ import org.springframework.web.bind.annotation.RequestParam; * REST Resource handling for DistributionSetTag CRUD operations. * */ -@RequestMapping(RestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING) -public interface DistributionSetTagRestApi { +@RequestMapping(MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING) +public interface MgmtDistributionSetTagRestApi { /** * Handles the GET request of retrieving all DistributionSet tags. * @@ -52,11 +51,11 @@ public interface DistributionSetTagRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getDistributionSetTags( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getDistributionSetTags( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single distribution set tag. @@ -71,7 +70,7 @@ public interface DistributionSetTagRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionsetTagId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getDistributionSetTag( + ResponseEntity getDistributionSetTag( @PathVariable("distributionsetTagId") final Long distributionsetTagId); /** @@ -86,7 +85,7 @@ public interface DistributionSetTagRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createDistributionSetTags(@RequestBody final List tags); + ResponseEntity> createDistributionSetTags(@RequestBody final List tags); /** * @@ -104,9 +103,9 @@ public interface DistributionSetTagRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionsetTagId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateDistributionSetTag( + ResponseEntity updateDistributionSetTag( @PathVariable("distributionsetTagId") final Long distributionsetTagId, - @RequestBody final TagRequestBodyPut restDSTagRest); + @RequestBody final MgmtTagRequestBodyPut restDSTagRest); /** * Handles the DELETE request for a single distribution set tag. @@ -120,7 +119,7 @@ public interface DistributionSetTagRestApi { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionsetTagId}") - public ResponseEntity deleteDistributionSetTag( + ResponseEntity deleteDistributionSetTag( @PathVariable("distributionsetTagId") final Long distributionsetTagId); /** @@ -135,8 +134,8 @@ public interface DistributionSetTagRestApi { * in case the given {@code distributionsetTagId} doesn't * exists. */ - @RequestMapping(method = RequestMethod.GET, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) - public ResponseEntity> getAssignedDistributionSets( + @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) + ResponseEntity> getAssignedDistributionSets( @PathVariable("distributionsetTagId") final Long distributionsetTagId); /** @@ -154,11 +153,11 @@ public interface DistributionSetTagRestApi { * in case the given {@code distributionsetTagId} doesn't * exists. */ - @RequestMapping(method = RequestMethod.POST, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + "/toggleTagAssignment") - public ResponseEntity toggleTagAssignment( + ResponseEntity toggleTagAssignment( @PathVariable("distributionsetTagId") final Long distributionsetTagId, - @RequestBody final List assignedDSRequestBodies); + @RequestBody final List assignedDSRequestBodies); /** * Handles the POST request to assign distribution sets to the given tag id. @@ -173,10 +172,10 @@ public interface DistributionSetTagRestApi { * in case the given {@code distributionsetTagId} doesn't * exists. */ - @RequestMapping(method = RequestMethod.POST, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) - public ResponseEntity> assignDistributionSets( + @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) + ResponseEntity> assignDistributionSets( @PathVariable("distributionsetTagId") final Long distributionsetTagId, - @RequestBody final List assignedDSRequestBodies); + @RequestBody final List assignedDSRequestBodies); /** * Handles the DELETE request to unassign all distribution set from the @@ -189,8 +188,8 @@ public interface DistributionSetTagRestApi { * in case the given {@code distributionsetTagId} doesn't * exists. */ - @RequestMapping(method = RequestMethod.DELETE, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) - public ResponseEntity unassignDistributionSets( + @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) + ResponseEntity unassignDistributionSets( @PathVariable("distributionsetTagId") final Long distributionsetTagId); /** @@ -206,9 +205,8 @@ public interface DistributionSetTagRestApi { * in case the given {@code distributionsetTagId} doesn't * exists. */ - @RequestMapping(method = RequestMethod.DELETE, value = RestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + "/{distributionsetId}") - public ResponseEntity unassignDistributionSet( - @PathVariable("distributionsetTagId") final Long distributionsetTagId, + ResponseEntity unassignDistributionSet(@PathVariable("distributionsetTagId") final Long distributionsetTagId, @PathVariable("distributionsetId") final Long distributionsetId); } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java similarity index 72% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTypeRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index 1900d8d7d..28af107f7 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/DistributionSetTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -2,21 +2,20 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.IdRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtId; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam; * operations. * */ -@RequestMapping(RestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) -public interface DistributionSetTypeRestApi { +@RequestMapping(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) +public interface MgmtDistributionSetTypeRestApi { /** * Handles the GET request of retrieving all DistributionSetTypes. @@ -55,11 +54,11 @@ public interface DistributionSetTypeRestApi { * response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getDistributionSetTypes( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getDistributionSetTypes( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single DistributionSetType @@ -74,7 +73,7 @@ public interface DistributionSetTypeRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getDistributionSetType( + ResponseEntity getDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId); /** @@ -86,7 +85,7 @@ public interface DistributionSetTypeRestApi { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}") - public ResponseEntity deleteDistributionSetType( + ResponseEntity deleteDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId); /** @@ -100,9 +99,9 @@ public interface DistributionSetTypeRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetTypeId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateDistributionSetType( + ResponseEntity updateDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, - @RequestBody final DistributionSetTypeRequestBodyPut restDistributionSetType); + @RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType); /** * Handles the POST request of creating new DistributionSetTypes. The @@ -117,8 +116,8 @@ public interface DistributionSetTypeRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createDistributionSetTypes( - @RequestBody final List distributionSetTypes); + ResponseEntity> createDistributionSetTypes( + @RequestBody final List distributionSetTypes); /** * Handles the GET request of retrieving the list of mandatory software @@ -129,9 +128,9 @@ public interface DistributionSetTypeRestApi { * @return Unpaged list of module types and OK in case of success. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { "application/hal+json", + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getMandatoryModules( + ResponseEntity> getMandatoryModules( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId); /** @@ -145,9 +144,9 @@ public interface DistributionSetTypeRestApi { * @return Unpaged list of module types and OK in case of success. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getMandatoryModule( + ResponseEntity getMandatoryModule( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); @@ -162,9 +161,9 @@ public interface DistributionSetTypeRestApi { * @return Unpaged list of module types and OK in case of success. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getOptionalModule( + ResponseEntity getOptionalModule( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); @@ -177,9 +176,9 @@ public interface DistributionSetTypeRestApi { * @return Unpaged list of module types and OK in case of success. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { "application/hal+json", + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getOptionalModules( + ResponseEntity> getOptionalModules( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId); /** @@ -194,10 +193,9 @@ public interface DistributionSetTypeRestApi { * @return OK if the request was successful */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES + "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity removeMandatoryModule( - @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + ResponseEntity removeMandatoryModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); /** @@ -212,10 +210,9 @@ public interface DistributionSetTypeRestApi { * @return OK if the request was successful */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES + "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity removeOptionalModule( - @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + ResponseEntity removeOptionalModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); /** @@ -230,11 +227,11 @@ public interface DistributionSetTypeRestApi { * @return OK if the request was successful */ @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { "application/hal+json", + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity addMandatoryModule( - @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final IdRest smtId); + ResponseEntity addMandatoryModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @RequestBody final MgmtId smtId); /** * Handles the POST request for adding an optional software module type to a @@ -248,10 +245,10 @@ public interface DistributionSetTypeRestApi { * @return OK if the request was successful */ @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetTypeId}/" - + RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { "application/hal+json", + + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity addOptionalModule( - @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final IdRest smtId); + ResponseEntity addOptionalModule(@PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @RequestBody final MgmtId smtId); } diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java new file mode 100644 index 000000000..e07d77f2f --- /dev/null +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java @@ -0,0 +1,46 @@ +/** + * 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.mgmt.rest.api; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * + */ +@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) +public interface MgmtDownloadArtifactRestApi { + + /** + * Handles the GET request for downloading an artifact. + * + * @param softwareModuleId + * of the parent SoftwareModule + * @param artifactId + * of the related LocalArtifact + * @param servletResponse + * of the servlet + * @param request + * of the client + * + * @return responseEntity with status ok if successful + */ + @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}/download") + @ResponseBody + ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse, + final HttpServletRequest request); + +} diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java new file mode 100644 index 000000000..c7caed01b --- /dev/null +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java @@ -0,0 +1,42 @@ +/** + * 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.mgmt.rest.api; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * A resource for download artifacts. + * + */ +@RequestMapping(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE) +public interface MgmtDownloadRestApi { + + /** + * Handles the GET request for downloading an artifact. + * + * @param downloadId + * the generated download id + * @param response + * of the servlet + * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if + * successful + */ + @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING) + @ResponseBody + ResponseEntity downloadArtifactByDownloadId(@PathVariable final String downloadId, + final HttpServletResponse response); + +} diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/RestConstants.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java similarity index 92% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/RestConstants.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java index bde96f7a8..d8f395568 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/RestConstants.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.api; /** * Constants for RESTful API. @@ -14,23 +14,13 @@ package org.eclipse.hawkbit.rest.resource; * * */ -public final class RestConstants { +public final class MgmtRestConstants { /** * API version definition. We are using only major versions. */ public static final String API_VERSION = "v1"; - /** - * The base URL mapping for the spring acuator management context path. - */ - public static final String BASE_SYSTEM_MAPPING = "/system"; - - /** - * URL mapping for system admin operations. - */ - public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin"; - /** * The base URL mapping of the SP rest resources. */ @@ -50,6 +40,64 @@ public final class RestConstants { */ public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50"; + /** + * The software module URL mapping rest resource. + */ + public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules"; + + public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/"; + public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}"; + + /** + * The target URL mapping, href link for assigned distribution set. + */ + public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS"; + /** + * The target URL mapping, href link for installed distribution set. + */ + public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS"; + /** + * The target URL mapping, href link for target attributes. + */ + public static final String TARGET_V1_ATTRIBUTES = "attributes"; + /** + * The target URL mapping, href link for target actions. + */ + public static final String TARGET_V1_ACTIONS = "actions"; + /** + * The target URL mapping, href link for canceled actions. + */ + public static final String TARGET_V1_CANCELED_ACTION = "canceledaction"; + /** + * The target URL mapping, href link for canceled actions. + */ + public static final String TARGET_V1_ACTION_STATUS = "status"; + + /** + * The target URL mapping rest resource. + */ + public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets"; + + /** + * The tag URL mapping rest resource. + */ + public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags"; + /** + * The tag URL mapping rest resource. + */ + public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets"; + + /** + * The tag URL mapping rest resource. + */ + public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + + "/distributionsettags"; + + /** + * The tag URL mapping rest resource. + */ + public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets"; + /** * The default offset parameter in case the offset parameter is not present * in the request. @@ -87,62 +135,6 @@ public final class RestConstants { */ public static final String REQUEST_PARAMETER_SEARCH = "q"; - /** - * The target URL mapping, href link for assigned distribution set. - */ - public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS"; - /** - * The target URL mapping, href link for installed distribution set. - */ - public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS"; - /** - * The target URL mapping, href link for target attributes. - */ - public static final String TARGET_V1_ATTRIBUTES = "attributes"; - /** - * The target URL mapping, href link for target actions. - */ - public static final String TARGET_V1_ACTIONS = "actions"; - /** - * The target URL mapping, href link for canceled actions. - */ - public static final String TARGET_V1_CANCELED_ACTION = "canceledaction"; - /** - * The target URL mapping, href link for canceled actions. - */ - public static final String TARGET_V1_ACTION_STATUS = "status"; - - /** - * The target URL mapping rest resource. - */ - public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets"; - - public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/system"; - /** - * The software module URL mapping rest resource. - */ - public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules"; - - /** - * The tag URL mapping rest resource. - */ - public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags"; - /** - * The tag URL mapping rest resource. - */ - public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets"; - - /** - * The tag URL mapping rest resource. - */ - public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING - + "/distributionsettags"; - - /** - * The tag URL mapping rest resource. - */ - public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets"; - /** * The software module type URL mapping rest resource. */ @@ -184,11 +176,8 @@ public final class RestConstants { public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes"; - public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/"; - public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}"; - // constant class, private constructor. - private RestConstants() { + private MgmtRestConstants() { } } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/RolloutRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java similarity index 69% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/RolloutRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java index 9f76b6bce..ea4578cad 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/RolloutRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java @@ -2,18 +2,17 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody; -import org.eclipse.hawkbit.rest.resource.model.rolloutgroup.RolloutGroupResponseBody; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody; +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; @@ -26,8 +25,8 @@ import org.springframework.web.bind.annotation.RequestParam; * REST Resource handling rollout CRUD operations. * */ -@RequestMapping(RestConstants.ROLLOUT_V1_REQUEST_MAPPING) -public interface RolloutRestApi { +@RequestMapping(MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING) +public interface MgmtRolloutRestApi { /** * Handles the GET request of retrieving all rollouts. @@ -49,11 +48,11 @@ public interface RolloutRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getRollouts( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getRollouts( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single rollout. @@ -66,7 +65,7 @@ public interface RolloutRestApi { */ @RequestMapping(value = "/{rolloutId}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity getRollout(@PathVariable("rolloutId") final Long rolloutId); + ResponseEntity getRollout(@PathVariable("rolloutId") final Long rolloutId); /** * Handles the POST request for creating rollout. @@ -81,7 +80,7 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity create(@RequestBody final RolloutRestRequestBody rolloutRequestBody); + ResponseEntity create(@RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody); /** * Handles the POST request for starting a rollout. @@ -96,8 +95,8 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/start", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity start(@PathVariable("rolloutId") final Long rolloutId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_ASYNC, defaultValue = "false") final boolean startAsync); + ResponseEntity start(@PathVariable("rolloutId") final Long rolloutId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_ASYNC, defaultValue = "false") final boolean startAsync); /** * Handles the POST request for pausing a rollout. @@ -112,7 +111,7 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/pause", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity pause(@PathVariable("rolloutId") final Long rolloutId); + ResponseEntity pause(@PathVariable("rolloutId") final Long rolloutId); /** * Handles the POST request for resuming a rollout. @@ -127,7 +126,7 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/resume", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity resume(@PathVariable("rolloutId") final Long rolloutId); + ResponseEntity resume(@PathVariable("rolloutId") final Long rolloutId); /** * Handles the GET request of retrieving all rollout groups referred to a @@ -153,12 +152,12 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getRolloutGroups( + ResponseEntity> getRolloutGroups( @PathVariable("rolloutId") final Long rolloutId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request for retrieving a single rollout group. @@ -167,12 +166,12 @@ public interface RolloutRestApi { * the rolloutId to retrieve the group from * @param groupId * the groupId to retrieve the rollout group - * @return the OK response containing the RolloutGroupResponseBody + * @return the OK response containing the MgmtRolloutGroupResponseBody * @throws EntityNotFoundException */ @RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups/{groupId}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity getRolloutGroup(@PathVariable("rolloutId") final Long rolloutId, + ResponseEntity getRolloutGroup(@PathVariable("rolloutId") final Long rolloutId, @PathVariable("groupId") final Long groupId); /** @@ -200,10 +199,10 @@ public interface RolloutRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups/{groupId}/targets", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getRolloutGroupTargets(@PathVariable("rolloutId") final Long rolloutId, + ResponseEntity> getRolloutGroupTargets(@PathVariable("rolloutId") final Long rolloutId, @PathVariable("groupId") final Long groupId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleRestAPI.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java similarity index 74% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleRestAPI.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java index 0eb874489..e452eb9a3 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleRestAPI.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java @@ -2,21 +2,20 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -32,8 +31,8 @@ import org.springframework.web.multipart.MultipartFile; * operations. * */ -@RequestMapping(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) -public interface SoftwareModuleRestAPI { +@RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) +public interface MgmtSoftwareModuleRestAPI { /** * Handles POST request for artifact upload. @@ -56,7 +55,7 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam("file") final MultipartFile file, @RequestParam(value = "filename", required = false) final String optionalFileName, @RequestParam(value = "md5sum", required = false) final String md5Sum, @@ -76,8 +75,7 @@ public interface SoftwareModuleRestAPI { @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @ResponseBody - public ResponseEntity> getArtifacts( - @PathVariable("softwareModuleId") final Long softwareModuleId); + ResponseEntity> getArtifacts(@PathVariable("softwareModuleId") final Long softwareModuleId); /** * Handles the GET request of retrieving a single Artifact meta data @@ -93,7 +91,7 @@ public interface SoftwareModuleRestAPI { @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @ResponseBody - public ResponseEntity getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("artifactId") final Long artifactId); /** @@ -108,7 +106,7 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}/artifacts/{artifactId}") @ResponseBody - public ResponseEntity deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("artifactId") final Long artifactId); /** @@ -132,11 +130,11 @@ public interface SoftwareModuleRestAPI { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getSoftwareModules( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getSoftwareModules( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single software module. @@ -150,8 +148,7 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getSoftwareModule( - @PathVariable("softwareModuleId") final Long softwareModuleId); + ResponseEntity getSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId); /** * Handles the POST request of creating new softwaremodules. The request @@ -166,8 +163,8 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createSoftwareModules( - @RequestBody final List softwareModules); + ResponseEntity> createSoftwareModules( + @RequestBody final List softwareModules); /** * Handles the PUT request of updating a software module. @@ -180,9 +177,9 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateSoftwareModule( + ResponseEntity updateSoftwareModule( @PathVariable("softwareModuleId") final Long softwareModuleId, - @RequestBody final SoftwareModuleRequestBodyPut restSoftwareModule); + @RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule); /** * Handles the DELETE request for a single software module. @@ -193,7 +190,7 @@ public interface SoftwareModuleRestAPI { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}") - public ResponseEntity deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId); + ResponseEntity deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId); /** * Gets a paged list of meta data for a software module. @@ -217,12 +214,11 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getMetadata( - @PathVariable("softwareModuleId") final Long softwareModuleId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Gets a single meta data value for a specific key of a software module. @@ -236,7 +232,7 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("metadataKey") final String metadataKey); /** @@ -251,7 +247,7 @@ public interface SoftwareModuleRestAPI { */ @RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata); /** @@ -264,7 +260,7 @@ public interface SoftwareModuleRestAPI { * @return status OK if the delete request is successful */ @RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleId}/metadata/{metadataKey}") - public ResponseEntity deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("metadataKey") final String metadataKey); /** @@ -280,8 +276,7 @@ public interface SoftwareModuleRestAPI { @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> createMetadata( - @PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity> createMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestBody final List metadataRest); } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java similarity index 70% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleTypeRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java index a98e35a32..6c7252d62 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/SoftwareModuleTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java @@ -2,19 +2,18 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -28,8 +27,8 @@ import org.springframework.web.bind.annotation.RequestParam; * operations. * */ -@RequestMapping(RestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) -public interface SoftwareModuleTypeRestApi { +@RequestMapping(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) +public interface MgmtSoftwareModuleTypeRestApi { /** * Handles the GET request of retrieving all SoftwareModuleTypes . * @@ -51,11 +50,11 @@ public interface SoftwareModuleTypeRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getTypes( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getTypes( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single software module type . @@ -69,7 +68,7 @@ public interface SoftwareModuleTypeRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getSoftwareModuleType( + ResponseEntity getSoftwareModuleType( @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); /** @@ -81,7 +80,7 @@ public interface SoftwareModuleTypeRestApi { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{softwareModuleTypeId}") - public ResponseEntity deleteSoftwareModuleType( + ResponseEntity deleteSoftwareModuleType( @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId); /** @@ -95,9 +94,9 @@ public interface SoftwareModuleTypeRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleTypeId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateSoftwareModuleType( + ResponseEntity updateSoftwareModuleType( @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId, - @RequestBody final SoftwareModuleTypeRequestBodyPut restSoftwareModuleType); + @RequestBody final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType); /** * Handles the POST request of creating new SoftwareModuleTypes. The request @@ -112,7 +111,7 @@ public interface SoftwareModuleTypeRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createSoftwareModuleTypes( - @RequestBody final List softwareModuleTypes); + ResponseEntity> createSoftwareModuleTypes( + @RequestBody final List softwareModuleTypes); } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java similarity index 72% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java index 48e242f81..572dcf500 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java @@ -2,23 +2,22 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.action.ActionRest; -import org.eclipse.hawkbit.rest.resource.model.action.ActionStatusRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.target.DistributionSetAssigmentRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetAttributes; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtActionStatus; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtDistributionSetAssigment; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAttributes; +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; @@ -30,8 +29,8 @@ import org.springframework.web.bind.annotation.RequestParam; /** * Api for handling target operations. */ -@RequestMapping(RestConstants.TARGET_V1_REQUEST_MAPPING) -public interface TargetRestApi { +@RequestMapping(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING) +public interface MgmtTargetRestApi { /** * Handles the GET request of retrieving a single target. @@ -45,7 +44,7 @@ public interface TargetRestApi { @RequestMapping(method = RequestMethod.GET, value = "/{targetId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getTarget(@PathVariable("targetId") final String targetId); + ResponseEntity getTarget(@PathVariable("targetId") final String targetId); /** * Handles the GET request of retrieving all targets. @@ -68,11 +67,11 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getTargets( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getTargets( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the POST request of creating new targets. The request body must @@ -87,7 +86,7 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createTargets(@RequestBody final List targets); + ResponseEntity> createTargets(@RequestBody final List targets); /** * Handles the PUT request of updating a target. The ID is within the URL @@ -105,8 +104,8 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{targetId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateTarget(@PathVariable("targetId") final String targetId, - @RequestBody final TargetRequestBody targetRest); + ResponseEntity updateTarget(@PathVariable("targetId") final String targetId, + @RequestBody final MgmtTargetRequestBody targetRest); /** * Handles the DELETE request of deleting a target. @@ -119,7 +118,7 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.DELETE, value = "/{targetId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity deleteTarget(@PathVariable("targetId") final String targetId); + ResponseEntity deleteTarget(@PathVariable("targetId") final String targetId); /** * Handles the GET request of retrieving the attributes of a specific @@ -133,7 +132,7 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/attributes", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getAttributes(@PathVariable("targetId") final String targetId); + ResponseEntity getAttributes(@PathVariable("targetId") final String targetId); /** * Handles the GET request of retrieving the Actions of a specific target. @@ -158,11 +157,11 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getActionHistory(@PathVariable("targetId") final String targetId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getActionHistory(@PathVariable("targetId") final String targetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a specific Actions of a specific @@ -176,7 +175,7 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions/{actionId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getAction(@PathVariable("targetId") final String targetId, + ResponseEntity getAction(@PathVariable("targetId") final String targetId, @PathVariable("actionId") final Long actionId); /** @@ -196,7 +195,7 @@ public interface TargetRestApi { * if the target or the action is not found */ @RequestMapping(method = RequestMethod.DELETE, value = "/{targetId}/actions/{actionId}") - public ResponseEntity cancelAction(@PathVariable("targetId") final String targetId, + ResponseEntity cancelAction(@PathVariable("targetId") final String targetId, @PathVariable("actionId") final Long actionId, @RequestParam(value = "force", required = false, defaultValue = "false") final boolean force); @@ -223,11 +222,11 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/actions/{actionId}/status", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getActionStatusList( - @PathVariable("targetId") final String targetId, @PathVariable("actionId") final Long actionId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam); + ResponseEntity> getActionStatusList(@PathVariable("targetId") final String targetId, + @PathVariable("actionId") final Long actionId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam); /** * Handles the GET request of retrieving the assigned distribution set of an @@ -242,8 +241,7 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/assignedDS", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getAssignedDistributionSet( - @PathVariable("targetId") final String targetId); + ResponseEntity getAssignedDistributionSet(@PathVariable("targetId") final String targetId); /** * Changes the assigned distribution set of a target. @@ -260,8 +258,8 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.POST, value = "/{targetId}/assignedDS", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity postAssignedDistributionSet(@PathVariable("targetId") final String targetId, - @RequestBody final DistributionSetAssigmentRest dsId); + ResponseEntity postAssignedDistributionSet(@PathVariable("targetId") final String targetId, + @RequestBody final MgmtDistributionSetAssigment dsId); /** * Handles the GET request of retrieving the installed distribution set of @@ -276,7 +274,6 @@ public interface TargetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/installedDS", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getInstalledDistributionSet( - @PathVariable("targetId") final String targetId); + ResponseEntity getInstalledDistributionSet(@PathVariable("targetId") final String targetId); } \ No newline at end of file diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java similarity index 67% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetTagRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java index 940b578d4..90646a562 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/api/TargetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java @@ -2,21 +2,20 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.rest.resource.RestConstants; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.tag.AssignedTargetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRest; -import org.eclipse.hawkbit.rest.resource.model.tag.TargetTagAssigmentResultRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedTargetRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTargetTagAssigmentResult; +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; @@ -29,8 +28,8 @@ import org.springframework.web.bind.annotation.RequestParam; * REST Resource handling for TargetTag CRUD operations. * */ -@RequestMapping(RestConstants.TARGET_TAG_V1_REQUEST_MAPPING) -public interface TargetTagRestApi { +@RequestMapping(MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING) +public interface MgmtTargetTagRestApi { /** * Handles the GET request of retrieving all target tags. @@ -52,11 +51,11 @@ public interface TargetTagRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getTargetTags( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); + ResponseEntity> getTargetTags( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam); /** * Handles the GET request of retrieving a single target tag. @@ -70,7 +69,7 @@ public interface TargetTagRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetTagId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getTargetTag(@PathVariable("targetTagId") final Long targetTagId); + ResponseEntity getTargetTag(@PathVariable("targetTagId") final Long targetTagId); /** * Handles the POST request of creating new target tag. The request body @@ -84,7 +83,7 @@ public interface TargetTagRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createTargetTags(@RequestBody final List tags); + ResponseEntity> createTargetTags(@RequestBody final List tags); /** * @@ -100,8 +99,8 @@ public interface TargetTagRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{targetTagId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateTagretTag(@PathVariable("targetTagId") final Long targetTagId, - @RequestBody final TagRequestBodyPut restTargetTagRest); + ResponseEntity updateTagretTag(@PathVariable("targetTagId") final Long targetTagId, + @RequestBody final MgmtTagRequestBodyPut restTargetTagRest); /** * Handles the DELETE request for a single target tag. @@ -114,7 +113,7 @@ public interface TargetTagRestApi { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{targetTagId}") - public ResponseEntity deleteTargetTag(@PathVariable("targetTagId") final Long targetTagId); + ResponseEntity deleteTargetTag(@PathVariable("targetTagId") final Long targetTagId); /** * Handles the GET request of retrieving all assigned targets by the given @@ -127,8 +126,8 @@ public interface TargetTagRestApi { * @throws EntityNotFoundException * in case the given {@code targetTagId} doesn't exists. */ - @RequestMapping(method = RequestMethod.GET, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) - public ResponseEntity> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId); + @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) + ResponseEntity> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId); /** * Handles the POST request to toggle the assignment of targets by the given @@ -143,11 +142,11 @@ public interface TargetTagRestApi { * @throws EntityNotFoundException * in case the given {@code targetTagId} doesn't exists. */ - @RequestMapping(method = RequestMethod.POST, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + "/toggleTagAssignment") - public ResponseEntity toggleTagAssignment( + ResponseEntity toggleTagAssignment( @PathVariable("targetTagId") final Long targetTagId, - @RequestBody final List assignedTargetRequestBodies); + @RequestBody final List assignedTargetRequestBodies); /** * Handles the POST request to assign targets to the given tag id. @@ -161,9 +160,9 @@ public interface TargetTagRestApi { * @throws EntityNotFoundException * in case the given {@code targetTagId} doesn't exists. */ - @RequestMapping(method = RequestMethod.POST, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) - public ResponseEntity> assignTargets(@PathVariable("targetTagId") final Long targetTagId, - @RequestBody final List assignedTargetRequestBodies); + @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) + ResponseEntity> assignTargets(@PathVariable("targetTagId") final Long targetTagId, + @RequestBody final List assignedTargetRequestBodies); /** * Handles the DELETE request to unassign all targets from the given tag id. @@ -174,8 +173,8 @@ public interface TargetTagRestApi { * @throws EntityNotFoundException * in case the given {@code targetTagId} doesn't exists. */ - @RequestMapping(method = RequestMethod.DELETE, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) - public ResponseEntity unassignTargets(@PathVariable("targetTagId") final Long targetTagId); + @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) + ResponseEntity unassignTargets(@PathVariable("targetTagId") final Long targetTagId); /** * Handles the DELETE request to unassign one target from the given tag id. @@ -188,8 +187,8 @@ public interface TargetTagRestApi { * @throws EntityNotFoundException * in case the given {@code targetTagId} doesn't exists. */ - @RequestMapping(method = RequestMethod.DELETE, value = RestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + "/{controllerId}") - public ResponseEntity unassignTarget(@PathVariable("targetTagId") final Long targetTagId, + ResponseEntity unassignTarget(@PathVariable("targetTagId") final Long targetTagId, @PathVariable("controllerId") final String controllerId); } diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/PagedListTest.java b/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java similarity index 97% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/PagedListTest.java rename to hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java index 68ce570a1..c17acb3b1 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/PagedListTest.java +++ b/hawkbit-mgmt-api/src/test/java/org/eclipse/hawkbit/mgmt/json/model/PagedListTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.mgmt.json.model; import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.fail; diff --git a/hawkbit-rest-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml similarity index 82% rename from hawkbit-rest-resource/pom.xml rename to hawkbit-mgmt-resource/pom.xml index 45d104963..311cbae76 100644 --- a/hawkbit-rest-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -9,7 +9,7 @@ hawkbit-parent 0.2.0-SNAPSHOT - hawkbit-rest-resource + hawkbit-mgmt-resource hawkBit :: REST Resources @@ -21,43 +21,14 @@ org.eclipse.hawkbit - hawkbit-core + hawkbit-mgmt-api ${project.version} org.eclipse.hawkbit - hawkbit-rest-api + hawkbit-rest-core ${project.version} - - org.eclipse.hawkbit - hawkbit-ddi-api - ${project.version} - - - javax.servlet - javax.servlet-api - provided - - - org.apache.tomcat.embed - tomcat-embed-core - provided - - - io.springfox - springfox-core - 2.0.3 - - - commons-io - commons-io - 2.4 - - - org.springframework.security - spring-security-web - diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/EnableRestResources.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java similarity index 91% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/EnableRestResources.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java index 8f9952054..ee34a3988 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/EnableRestResources.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -29,6 +29,6 @@ import org.springframework.stereotype.Controller; @Retention(RetentionPolicy.RUNTIME) @Configuration @ComponentScan -public @interface EnableRestResources { +public @interface EnableMgmtApi { } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java similarity index 75% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java index 8051146a1..111ba00ae 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,6 +14,13 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.SoftwareManagement; @@ -22,12 +29,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetMetadata; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModule; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody; /** * A mapper which maps repository model to RESTful model representation and @@ -37,8 +38,8 @@ import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentR * * */ -public final class DistributionSetMapper { - private DistributionSetMapper() { +public final class MgmtDistributionSetMapper { + private MgmtDistributionSetMapper() { // Utility class } @@ -65,7 +66,7 @@ public final class DistributionSetMapper { } /** - * {@link DistributionSetRequestBodyPost}s to {@link DistributionSet}s. + * {@link MgmtDistributionSetRequestBodyPost}s to {@link DistributionSet}s. * * @param sets * to convert @@ -73,11 +74,11 @@ public final class DistributionSetMapper { * to use for conversion * @return converted list of {@link DistributionSet}s */ - static List dsFromRequest(final Iterable sets, + static List dsFromRequest(final Iterable sets, final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) { final List mappedList = new ArrayList<>(); - for (final DistributionSetRequestBodyPost dsRest : sets) { + for (final MgmtDistributionSetRequestBodyPost dsRest : sets) { mappedList.add(fromRequest(dsRest, softwareManagement, distributionSetManagement)); } return mappedList; @@ -85,7 +86,7 @@ public final class DistributionSetMapper { } /** - * {@link DistributionSetRequestBodyPost} to {@link DistributionSet}. + * {@link MgmtDistributionSetRequestBodyPost} to {@link DistributionSet}. * * @param dsRest * to convert @@ -93,7 +94,7 @@ public final class DistributionSetMapper { * to use for conversion * @return converted {@link DistributionSet} */ - static DistributionSet fromRequest(final DistributionSetRequestBodyPost dsRest, + static DistributionSet fromRequest(final MgmtDistributionSetRequestBodyPost dsRest, final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) { final DistributionSet result = new DistributionSet(); @@ -152,12 +153,12 @@ public final class DistributionSetMapper { * the ds set * @return the response */ - public static DistributionSetRest toResponse(final DistributionSet distributionSet) { + public static MgmtDistributionSet toResponse(final DistributionSet distributionSet) { if (distributionSet == null) { return null; } - final DistributionSetRest response = new DistributionSetRest(); - RestModelMapper.mapNamedToNamed(response, distributionSet); + final MgmtDistributionSet response = new MgmtDistributionSet(); + MgmtRestModelMapper.mapNamedToNamed(response, distributionSet); response.setDsId(distributionSet.getId()); response.setVersion(distributionSet.getVersion()); @@ -165,35 +166,35 @@ public final class DistributionSetMapper { response.setType(distributionSet.getType().getKey()); distributionSet.getModules() - .forEach(module -> response.getModules().add(SoftwareModuleMapper.toResponse(module))); + .forEach(module -> response.getModules().add(MgmtSoftwareModuleMapper.toResponse(module))); response.setRequiredMigrationStep(distributionSet.isRequiredMigrationStep()); response.add( - linkTo(methodOn(DistributionSetRestApi.class).getDistributionSet(response.getDsId())).withRel("self")); + linkTo(methodOn(MgmtDistributionSetRestApi.class).getDistributionSet(response.getDsId())).withRel("self")); response.add(linkTo( - methodOn(DistributionSetTypeRestApi.class).getDistributionSetType(distributionSet.getType().getId())) + methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(distributionSet.getType().getId())) .withRel("type")); - response.add(linkTo(methodOn(DistributionSetRestApi.class).getMetadata(response.getDsId(), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)) + response.add(linkTo(methodOn(MgmtDistributionSetRestApi.class).getMetadata(response.getDsId(), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)) .withRel("metadata")); return response; } - static TargetAssignmentResponseBody toResponse(final DistributionSetAssignmentResult dsAssignmentResult) { - final TargetAssignmentResponseBody result = new TargetAssignmentResponseBody(); + static MgmtTargetAssignmentResponseBody toResponse(final DistributionSetAssignmentResult dsAssignmentResult) { + final MgmtTargetAssignmentResponseBody result = new MgmtTargetAssignmentResponseBody(); result.setAssigned(dsAssignmentResult.getAssigned()); result.setAlreadyAssigned(dsAssignmentResult.getAlreadyAssigned()); result.setTotal(dsAssignmentResult.getTotal()); return result; } - static List toResponseDistributionSets(final Iterable sets) { - final List response = new ArrayList<>(); + static List toResponseDistributionSets(final Iterable sets) { + final List response = new ArrayList<>(); if (sets != null) { for (final DistributionSet set : sets) { @@ -219,11 +220,11 @@ public final class DistributionSetMapper { return mappedList; } - static List toResponseFromDsList(final List sets) { - final List mappedList = new ArrayList<>(); + static List toResponseFromDsList(final List sets) { + final List mappedList = new ArrayList<>(); if (sets != null) { for (final DistributionSet set : sets) { - final DistributionSetRest response = toResponse(set); + final MgmtDistributionSet response = toResponse(set); mappedList.add(response); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java similarity index 79% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java index 27231308b..2db11f489 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java @@ -6,18 +6,30 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.stream.Collectors; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi; import org.eclipse.hawkbit.repository.DeploymentManagement; import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult; import org.eclipse.hawkbit.repository.DistributionSetFields; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.DistributionSetMetadataFields; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SystemManagement; import org.eclipse.hawkbit.repository.TargetFields; @@ -30,18 +42,6 @@ import org.eclipse.hawkbit.repository.model.DsMetadataCompositeKey; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentRequestBody; -import org.eclipse.hawkbit.rest.resource.model.distributionset.TargetAssignmentResponseBody; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; import org.eclipse.hawkbit.tenancy.TenantAware; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,8 +57,8 @@ import org.springframework.web.bind.annotation.RestController; * REST Resource handling for {@link DistributionSet} CRUD operations. */ @RestController -public class DistributionSetResource implements DistributionSetRestApi { - private static final Logger LOG = LoggerFactory.getLogger(DistributionSetResource.class); +public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { + private static final Logger LOG = LoggerFactory.getLogger(MgmtDistributionSetResource.class); @Autowired private SoftwareManagement softwareManagement; @@ -79,7 +79,7 @@ public class DistributionSetResource implements DistributionSetRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSets(final int pagingOffsetParam, + public ResponseEntity> getDistributionSets(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -95,20 +95,20 @@ public class DistributionSetResource implements DistributionSetRestApi { findDsPage = this.distributionSetManagement.findDistributionSetsAll(pageable, false, null); } - final List rest = DistributionSetMapper.toResponseFromDsList(findDsPage.getContent()); + final List rest = MgmtDistributionSetMapper.toResponseFromDsList(findDsPage.getContent()); return new ResponseEntity<>(new PagedList<>(rest, findDsPage.getTotalElements()), HttpStatus.OK); } @Override - public ResponseEntity getDistributionSet(final Long distributionSetId) { + public ResponseEntity getDistributionSet(final Long distributionSetId) { final DistributionSet foundDs = findDistributionSetWithExceptionIfNotFound(distributionSetId); - return new ResponseEntity<>(DistributionSetMapper.toResponse(foundDs), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetMapper.toResponse(foundDs), HttpStatus.OK); } @Override - public ResponseEntity> createDistributionSets( - final List sets) { + public ResponseEntity> createDistributionSets( + final List sets) { LOG.debug("creating {} distribution sets", sets.size()); // set default Ds type if ds type is null @@ -116,10 +116,11 @@ public class DistributionSetResource implements DistributionSetRestApi { .getTenantMetadata(this.currentTenant.getCurrentTenant()).getDefaultDsType().getKey())); final Iterable createdDSets = this.distributionSetManagement.createDistributionSets( - DistributionSetMapper.dsFromRequest(sets, this.softwareManagement, this.distributionSetManagement)); + MgmtDistributionSetMapper.dsFromRequest(sets, this.softwareManagement, this.distributionSetManagement)); LOG.debug("{} distribution sets created, return status {}", sets.size(), HttpStatus.CREATED); - return new ResponseEntity<>(DistributionSetMapper.toResponseDistributionSets(createdDSets), HttpStatus.CREATED); + return new ResponseEntity<>(MgmtDistributionSetMapper.toResponseDistributionSets(createdDSets), + HttpStatus.CREATED); } @Override @@ -132,8 +133,8 @@ public class DistributionSetResource implements DistributionSetRestApi { } @Override - public ResponseEntity updateDistributionSet(final Long distributionSetId, - final DistributionSetRequestBodyPut toUpdate) { + public ResponseEntity updateDistributionSet(final Long distributionSetId, + final MgmtDistributionSetRequestBodyPut toUpdate) { final DistributionSet set = findDistributionSetWithExceptionIfNotFound(distributionSetId); if (toUpdate.getDescription() != null) { @@ -148,12 +149,12 @@ public class DistributionSetResource implements DistributionSetRestApi { set.setVersion(toUpdate.getVersion()); } return new ResponseEntity<>( - DistributionSetMapper.toResponse(this.distributionSetManagement.updateDistributionSet(set)), + MgmtDistributionSetMapper.toResponse(this.distributionSetManagement.updateDistributionSet(set)), HttpStatus.OK); } @Override - public ResponseEntity> getAssignedTargets(final Long distributionSetId, + public ResponseEntity> getAssignedTargets(final Long distributionSetId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { // check if distribution set exists otherwise throw exception @@ -173,12 +174,12 @@ public class DistributionSetResource implements DistributionSetRestApi { targetsAssignedDS = this.targetManagement.findTargetByAssignedDistributionSet(distributionSetId, pageable); } - return new ResponseEntity<>(new PagedList<>(TargetMapper.toResponse(targetsAssignedDS.getContent()), + return new ResponseEntity<>(new PagedList<>(MgmtTargetMapper.toResponse(targetsAssignedDS.getContent()), targetsAssignedDS.getTotalElements()), HttpStatus.OK); } @Override - public ResponseEntity> getInstalledTargets(final Long distributionSetId, + public ResponseEntity> getInstalledTargets(final Long distributionSetId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { // check if distribution set exists otherwise throw exception // immediately @@ -198,22 +199,24 @@ public class DistributionSetResource implements DistributionSetRestApi { pageable); } - return new ResponseEntity<>(new PagedList(TargetMapper.toResponse(targetsInstalledDS.getContent()), - targetsInstalledDS.getTotalElements()), HttpStatus.OK); + return new ResponseEntity<>( + new PagedList(MgmtTargetMapper.toResponse(targetsInstalledDS.getContent()), + targetsInstalledDS.getTotalElements()), + HttpStatus.OK); } @Override - public ResponseEntity createAssignedTarget(final Long distributionSetId, - final List targetIds) { + public ResponseEntity createAssignedTarget(final Long distributionSetId, + final List targetIds) { final DistributionSetAssignmentResult assignDistributionSet = this.deployManagament.assignDistributionSet( distributionSetId, targetIds.stream() .map(t -> new TargetWithActionType(t.getId(), - RestResourceConversionHelper.convertActionType(t.getType()), t.getForcetime())) + MgmtRestModelMapper.convertActionType(t.getType()), t.getForcetime())) .collect(Collectors.toList())); - return new ResponseEntity<>(DistributionSetMapper.toResponse(assignDistributionSet), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetMapper.toResponse(assignDistributionSet), HttpStatus.OK); } @Override @@ -240,7 +243,7 @@ public class DistributionSetResource implements DistributionSetRestApi { } return new ResponseEntity<>( - new PagedList<>(DistributionSetMapper.toResponseDsMetadata(metaDataPage.getContent()), + new PagedList<>(MgmtDistributionSetMapper.toResponseDsMetadata(metaDataPage.getContent()), metaDataPage.getTotalElements()), HttpStatus.OK); @@ -253,7 +256,7 @@ public class DistributionSetResource implements DistributionSetRestApi { final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); final DistributionSetMetadata findOne = this.distributionSetManagement .findOne(new DsMetadataCompositeKey(ds, metadataKey)); - return ResponseEntity. ok(DistributionSetMapper.toResponseDsMetadata(findOne)); + return ResponseEntity. ok(MgmtDistributionSetMapper.toResponseDsMetadata(findOne)); } @Override @@ -264,7 +267,7 @@ public class DistributionSetResource implements DistributionSetRestApi { final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); final DistributionSetMetadata updated = this.distributionSetManagement .updateDistributionSetMetadata(new DistributionSetMetadata(metadataKey, ds, metadata.getValue())); - return ResponseEntity.ok(DistributionSetMapper.toResponseDsMetadata(updated)); + return ResponseEntity.ok(MgmtDistributionSetMapper.toResponseDsMetadata(updated)); } @Override @@ -284,20 +287,20 @@ public class DistributionSetResource implements DistributionSetRestApi { final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); final List created = this.distributionSetManagement - .createDistributionSetMetadata(DistributionSetMapper.fromRequestDsMetadata(ds, metadataRest)); - return new ResponseEntity<>(DistributionSetMapper.toResponseDsMetadata(created), HttpStatus.CREATED); + .createDistributionSetMetadata(MgmtDistributionSetMapper.fromRequestDsMetadata(ds, metadataRest)); + return new ResponseEntity<>(MgmtDistributionSetMapper.toResponseDsMetadata(created), HttpStatus.CREATED); } @Override public ResponseEntity assignSoftwareModules(final Long distributionSetId, - final List softwareModuleIDs) { + final List softwareModuleIDs) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); final Set softwareModuleToBeAssigned = new HashSet<>(); - for (final SoftwareModuleAssigmentRest sm : softwareModuleIDs) { + for (final MgmtSoftwareModuleAssigment sm : softwareModuleIDs) { final SoftwareModule softwareModule = this.softwareManagement.findSoftwareModuleById(sm.getId()); if (softwareModule != null) { softwareModuleToBeAssigned.add(softwareModule); @@ -321,7 +324,7 @@ public class DistributionSetResource implements DistributionSetRestApi { } @Override - public ResponseEntity> getAssignedSoftwareModules(final Long distributionSetId, + public ResponseEntity> getAssignedSoftwareModules(final Long distributionSetId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) { // check if distribution set exists otherwise throw exception // immediately @@ -332,7 +335,7 @@ public class DistributionSetResource implements DistributionSetRestApi { final Pageable pageable = new OffsetBasedPageRequest(sanitizedOffsetParam, sanitizedLimitParam, sorting); final Page softwaremodules = this.softwareManagement.findSoftwareModuleByAssignedTo(pageable, foundDs); - return new ResponseEntity<>(new PagedList<>(SoftwareModuleMapper.toResponse(softwaremodules.getContent()), + return new ResponseEntity<>(new PagedList<>(MgmtSoftwareModuleMapper.toResponse(softwaremodules.getContent()), softwaremodules.getTotalElements()), HttpStatus.OK); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTagResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java similarity index 72% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTagResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java index eaa0fec28..5d0131fec 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTagResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java @@ -6,12 +6,20 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.List; import java.util.stream.Collectors; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedDistributionSetRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtDistributionSetTagAssigmentResult; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi; import org.eclipse.hawkbit.repository.DistributionSetManagement; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.TagFields; import org.eclipse.hawkbit.repository.TagManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; @@ -19,13 +27,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.DistributionSetTagAssignmentResult; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTagRestApi; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.tag.AssignedDistributionSetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.tag.DistributionSetTagAssigmentResultRest; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -42,8 +43,8 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class DistributionSetTagResource implements DistributionSetTagRestApi { - private static final Logger LOG = LoggerFactory.getLogger(DistributionSetTagResource.class); +public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRestApi { + private static final Logger LOG = LoggerFactory.getLogger(MgmtDistributionSetTagResource.class); @Autowired private TagManagement tagManagement; @@ -52,7 +53,7 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSetTags(final int pagingOffsetParam, + public ResponseEntity> getDistributionSetTags(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -74,39 +75,39 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { } - final List rest = TagMapper.toResponseDistributionSetTag(findTargetsAll.getContent()); + final List rest = MgmtTagMapper.toResponseDistributionSetTag(findTargetsAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countTargetsAll), HttpStatus.OK); } @Override - public ResponseEntity getDistributionSetTag(final Long distributionsetTagId) { + public ResponseEntity getDistributionSetTag(final Long distributionsetTagId) { final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); - return new ResponseEntity<>(TagMapper.toResponse(tag), HttpStatus.OK); + return new ResponseEntity<>(MgmtTagMapper.toResponse(tag), HttpStatus.OK); } @Override - public ResponseEntity> createDistributionSetTags(final List tags) { + public ResponseEntity> createDistributionSetTags(final List tags) { LOG.debug("creating {} ds tags", tags.size()); final List createdTags = this.tagManagement - .createDistributionSetTags(TagMapper.mapDistributionSetTagFromRequest(tags)); + .createDistributionSetTags(MgmtTagMapper.mapDistributionSetTagFromRequest(tags)); - return new ResponseEntity<>(TagMapper.toResponseDistributionSetTag(createdTags), HttpStatus.CREATED); + return new ResponseEntity<>(MgmtTagMapper.toResponseDistributionSetTag(createdTags), HttpStatus.CREATED); } @Override - public ResponseEntity updateDistributionSetTag(final Long distributionsetTagId, - final TagRequestBodyPut restDSTagRest) { + public ResponseEntity updateDistributionSetTag(final Long distributionsetTagId, + final MgmtTagRequestBodyPut restDSTagRest) { LOG.debug("update {} ds tag", restDSTagRest); final DistributionSetTag distributionSetTag = findDistributionTagById(distributionsetTagId); - TagMapper.updateTag(restDSTagRest, distributionSetTag); + MgmtTagMapper.updateTag(restDSTagRest, distributionSetTag); final DistributionSetTag updateDistributionSetTag = this.tagManagement .updateDistributionSetTag(distributionSetTag); LOG.debug("ds tag updated"); - return new ResponseEntity<>(TagMapper.toResponse(updateDistributionSetTag), HttpStatus.OK); + return new ResponseEntity<>(MgmtTagMapper.toResponse(updateDistributionSetTag), HttpStatus.OK); } @Override @@ -120,15 +121,15 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { } @Override - public ResponseEntity> getAssignedDistributionSets(final Long distributionsetTagId) { + public ResponseEntity> getAssignedDistributionSets(final Long distributionsetTagId) { final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); return new ResponseEntity<>( - DistributionSetMapper.toResponseDistributionSets(tag.getAssignedToDistributionSet()), HttpStatus.OK); + MgmtDistributionSetMapper.toResponseDistributionSets(tag.getAssignedToDistributionSet()), HttpStatus.OK); } @Override - public ResponseEntity toggleTagAssignment(final Long distributionsetTagId, - final List assignedDSRequestBodies) { + public ResponseEntity toggleTagAssignment(final Long distributionsetTagId, + final List assignedDSRequestBodies) { LOG.debug("Toggle distribution set assignment {} for ds tag {}", assignedDSRequestBodies.size(), distributionsetTagId); @@ -137,11 +138,11 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { final DistributionSetTagAssignmentResult assigmentResult = this.distributionSetManagement .toggleTagAssignment(findDistributionSetIds(assignedDSRequestBodies), tag.getName()); - final DistributionSetTagAssigmentResultRest tagAssigmentResultRest = new DistributionSetTagAssigmentResultRest(); + final MgmtDistributionSetTagAssigmentResult tagAssigmentResultRest = new MgmtDistributionSetTagAssigmentResult(); tagAssigmentResultRest.setAssignedDistributionSets( - DistributionSetMapper.toResponseDistributionSets(assigmentResult.getAssignedEntity())); + MgmtDistributionSetMapper.toResponseDistributionSets(assigmentResult.getAssignedEntity())); tagAssigmentResultRest.setUnassignedDistributionSets( - DistributionSetMapper.toResponseDistributionSets(assigmentResult.getUnassignedEntity())); + MgmtDistributionSetMapper.toResponseDistributionSets(assigmentResult.getUnassignedEntity())); LOG.debug("Toggled assignedDS {} and unassignedDS{}", assigmentResult.getAssigned(), assigmentResult.getUnassigned()); @@ -150,15 +151,15 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { } @Override - public ResponseEntity> assignDistributionSets(final Long distributionsetTagId, - final List assignedDSRequestBodies) { + public ResponseEntity> assignDistributionSets(final Long distributionsetTagId, + final List assignedDSRequestBodies) { LOG.debug("Assign DistributionSet {} for ds tag {}", assignedDSRequestBodies.size(), distributionsetTagId); final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); final List assignedDs = this.distributionSetManagement .assignTag(findDistributionSetIds(assignedDSRequestBodies), tag); LOG.debug("Assignd DistributionSet {}", assignedDs.size()); - return new ResponseEntity<>(DistributionSetMapper.toResponseDistributionSets(assignedDs), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetMapper.toResponseDistributionSets(assignedDs), HttpStatus.OK); } @Override @@ -193,7 +194,7 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi { } private List findDistributionSetIds( - final List assignedDistributionSetRequestBodies) { + final List assignedDistributionSetRequestBodies) { return assignedDistributionSetRequestBodies.stream().map(request -> request.getDistributionSetId()) .collect(Collectors.toList()); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java similarity index 60% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java index 409caf01d..244f07095 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,38 +14,39 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRest; /** * A mapper which maps repository model to RESTful model representation and * back. * */ -final class DistributionSetTypeMapper { +final class MgmtDistributionSetTypeMapper { // private constructor, utility class - private DistributionSetTypeMapper() { + private MgmtDistributionSetTypeMapper() { } static List smFromRequest(final SoftwareManagement softwareManagement, - final Iterable smTypesRest) { + final Iterable smTypesRest) { final List mappedList = new ArrayList<>(); - for (final DistributionSetTypeRequestBodyPost smRest : smTypesRest) { + for (final MgmtDistributionSetTypeRequestBodyPost smRest : smTypesRest) { mappedList.add(fromRequest(softwareManagement, smRest)); } return mappedList; } static DistributionSetType fromRequest(final SoftwareManagement softwareManagement, - final DistributionSetTypeRequestBodyPost smsRest) { + final MgmtDistributionSetTypeRequestBodyPost smsRest) { final DistributionSetType result = new DistributionSetType(smsRest.getKey(), smsRest.getName(), smsRest.getDescription()); @@ -75,37 +76,37 @@ final class DistributionSetTypeMapper { return result; } - static List toTypesResponse(final List types) { - final List response = new ArrayList<>(); + static List toTypesResponse(final List types) { + final List response = new ArrayList<>(); for (final DistributionSetType dsType : types) { response.add(toResponse(dsType)); } return response; } - static List toListResponse(final List types) { - final List response = new ArrayList<>(); + static List toListResponse(final List types) { + final List response = new ArrayList<>(); for (final DistributionSetType dsType : types) { response.add(toResponse(dsType)); } return response; } - static DistributionSetTypeRest toResponse(final DistributionSetType type) { - final DistributionSetTypeRest result = new DistributionSetTypeRest(); + static MgmtDistributionSetTypeRest toResponse(final DistributionSetType type) { + final MgmtDistributionSetTypeRest result = new MgmtDistributionSetTypeRest(); - RestModelMapper.mapNamedToNamed(result, type); + MgmtRestModelMapper.mapNamedToNamed(result, type); result.setKey(type.getKey()); result.setModuleId(type.getId()); - result.add(linkTo(methodOn(DistributionSetTypeRestApi.class).getDistributionSetType(result.getModuleId())) + result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(result.getModuleId())) .withRel("self")); - result.add(linkTo(methodOn(DistributionSetTypeRestApi.class).getMandatoryModules(result.getModuleId())) - .withRel(RestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES)); + result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getMandatoryModules(result.getModuleId())) + .withRel(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES)); - result.add(linkTo(methodOn(DistributionSetTypeRestApi.class).getOptionalModules(result.getModuleId())) - .withRel(RestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES)); + result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getOptionalModules(result.getModuleId())) + .withRel(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES)); return result; } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java similarity index 74% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java index f7346a6ff..0e5adccdc 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java @@ -6,12 +6,21 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.MgmtId; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.DistributionSetTypeFields; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.Artifact; @@ -19,13 +28,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.IdRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.distributionsettype.DistributionSetTypeRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -45,7 +47,7 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class DistributionSetTypeResource implements DistributionSetTypeRestApi { +public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeRestApi { @Autowired private SoftwareManagement softwareManagement; @@ -54,11 +56,11 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSetTypes( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { + public ResponseEntity> getDistributionSetTypes( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -77,17 +79,17 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { countModulesAll = distributionSetManagement.countDistributionSetTypesAll(); } - final List rest = DistributionSetTypeMapper + final List rest = MgmtDistributionSetTypeMapper .toListResponse(findModuleTypessAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countModulesAll), HttpStatus.OK); } @Override - public ResponseEntity getDistributionSetType( + public ResponseEntity getDistributionSetType( @PathVariable final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); - return new ResponseEntity<>(DistributionSetTypeMapper.toResponse(foundType), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toResponse(foundType), HttpStatus.OK); } @Override @@ -100,9 +102,9 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { } @Override - public ResponseEntity updateDistributionSetType( + public ResponseEntity updateDistributionSetType( @PathVariable final Long distributionSetTypeId, - @RequestBody final DistributionSetTypeRequestBodyPut restDistributionSetType) { + @RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType) { final DistributionSetType type = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); // only description can be modified @@ -113,17 +115,17 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { final DistributionSetType updatedDistributionSetType = distributionSetManagement .updateDistributionSetType(type); - return new ResponseEntity<>(DistributionSetTypeMapper.toResponse(updatedDistributionSetType), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toResponse(updatedDistributionSetType), HttpStatus.OK); } @Override - public ResponseEntity> createDistributionSetTypes( - @RequestBody final List distributionSetTypes) { + public ResponseEntity> createDistributionSetTypes( + @RequestBody final List distributionSetTypes) { final List createdSoftwareModules = distributionSetManagement.createDistributionSetTypes( - DistributionSetTypeMapper.smFromRequest(softwareManagement, distributionSetTypes)); + MgmtDistributionSetTypeMapper.smFromRequest(softwareManagement, distributionSetTypes)); - return new ResponseEntity<>(DistributionSetTypeMapper.toTypesResponse(createdSoftwareModules), + return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toTypesResponse(createdSoftwareModules), HttpStatus.CREATED); } @@ -137,16 +139,16 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { } @Override - public ResponseEntity> getMandatoryModules( + public ResponseEntity> getMandatoryModules( @PathVariable final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); - return new ResponseEntity<>(SoftwareModuleTypeMapper.toListResponse(foundType.getMandatoryModuleTypes()), + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toListResponse(foundType.getMandatoryModuleTypes()), HttpStatus.OK); } @Override - public ResponseEntity getMandatoryModule(@PathVariable final Long distributionSetTypeId, + public ResponseEntity getMandatoryModule(@PathVariable final Long distributionSetTypeId, @PathVariable final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -158,11 +160,11 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { "Software module with given ID is not part of this distribution set type!"); } - return new ResponseEntity<>(SoftwareModuleTypeMapper.toResponse(foundSmType), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toResponse(foundSmType), HttpStatus.OK); } @Override - public ResponseEntity getOptionalModule(@PathVariable final Long distributionSetTypeId, + public ResponseEntity getOptionalModule(@PathVariable final Long distributionSetTypeId, @PathVariable final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -174,16 +176,16 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { "Software module with given ID is not part of this distribution set type!"); } - return new ResponseEntity<>(SoftwareModuleTypeMapper.toResponse(foundSmType), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toResponse(foundSmType), HttpStatus.OK); } @Override - public ResponseEntity> getOptionalModules( + public ResponseEntity> getOptionalModules( @PathVariable final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); - return new ResponseEntity<>(SoftwareModuleTypeMapper.toListResponse(foundType.getOptionalModuleTypes()), + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toListResponse(foundType.getOptionalModuleTypes()), HttpStatus.OK); } @@ -228,7 +230,7 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { @Override public ResponseEntity addMandatoryModule(@PathVariable final Long distributionSetTypeId, - @RequestBody final IdRest smtId) { + @RequestBody final MgmtId smtId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -243,7 +245,7 @@ public class DistributionSetTypeResource implements DistributionSetTypeRestApi { @Override public ResponseEntity addOptionalModule(@PathVariable final Long distributionSetTypeId, - @RequestBody final IdRest smtId) { + @RequestBody final MgmtId smtId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java similarity index 79% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadArtifactResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index 00f8f4756..ec06c3c8a 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -6,34 +6,30 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadArtifactRestApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; +import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** - * @author Jonathan Knoblauch * */ @RestController -@RequestMapping(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) -public class DownloadArtifactResource { +public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi { @Autowired private SoftwareManagement softwareManagement; @@ -55,11 +51,10 @@ public class DownloadArtifactResource { * * @return responseEntity with status ok if successful */ - @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}/download") + @Override @ResponseBody - public ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse, - final HttpServletRequest request) { + public ResponseEntity downloadArtifact(final Long softwareModuleId, final Long artifactId, + final HttpServletResponse servletResponse, final HttpServletRequest request) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); if (null == module || !module.getLocalArtifact(artifactId).isPresent()) { diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java similarity index 83% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java index 14b1dcbc6..ec2eced90 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/DownloadResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.io.IOException; @@ -17,6 +17,7 @@ import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheConstants; import org.eclipse.hawkbit.cache.DownloadArtifactCache; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadRestApi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -25,10 +26,6 @@ import org.springframework.cache.Cache; import org.springframework.cache.Cache.ValueWrapper; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** @@ -37,11 +34,10 @@ import org.springframework.web.bind.annotation.RestController; * * */ -@RequestMapping(RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE) @RestController -public class DownloadResource { +public class MgmtDownloadResource implements MgmtDownloadRestApi { - private static final Logger LOGGER = LoggerFactory.getLogger(DownloadResource.class); + private static final Logger LOGGER = LoggerFactory.getLogger(MgmtDownloadResource.class); @Autowired private ArtifactRepository artifactRepository; @@ -60,9 +56,8 @@ public class DownloadResource { * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if * successful */ - @RequestMapping(method = RequestMethod.GET, value = RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING) - @ResponseBody - public ResponseEntity downloadArtifactByDownloadId(@PathVariable final String downloadId, + @Override + public ResponseEntity downloadArtifactByDownloadId(final String downloadId, final HttpServletResponse response) { try { final ValueWrapper cacheWrapper = cache.get(downloadId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRestModelMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRestModelMapper.java new file mode 100644 index 000000000..deee0e461 --- /dev/null +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRestModelMapper.java @@ -0,0 +1,81 @@ +/** + * 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.mgmt.rest.resource; + +import org.eclipse.hawkbit.mgmt.json.model.MgmtBaseEntity; +import org.eclipse.hawkbit.mgmt.json.model.MgmtNamedEntity; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType; +import org.eclipse.hawkbit.repository.model.Action.ActionType; +import org.eclipse.hawkbit.repository.model.NamedEntity; +import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity; + +/** + * A mapper which maps repository model to RESTful model representation and + * back. + * + * + * + * + */ +final class MgmtRestModelMapper { + + // private constructor, utility class + private MgmtRestModelMapper() { + + } + + static void mapBaseToBase(final MgmtBaseEntity response, final TenantAwareBaseEntity base) { + response.setCreatedBy(base.getCreatedBy()); + response.setLastModifiedBy(base.getLastModifiedBy()); + if (base.getCreatedAt() != null) { + response.setCreatedAt(base.getCreatedAt()); + } + if (base.getLastModifiedAt() != null) { + response.setLastModifiedAt(base.getLastModifiedAt()); + } + } + + static void mapNamedToNamed(final MgmtNamedEntity response, final NamedEntity base) { + mapBaseToBase(response, base); + + response.setName(base.getName()); + response.setDescription(base.getDescription()); + } + + /** + * Convert a action rest type to a action repository type. + * + * @param actionTypeRest + * the rest type + * @return or the action repository type + */ + /** + * Convert a action rest type to a action repository type. + * + * @param actionTypeRest + * the rest type + * @return or the action repository type + */ + public static ActionType convertActionType(final MgmtActionType actionTypeRest) { + if (actionTypeRest == null) { + return null; + } + + switch (actionTypeRest) { + case SOFT: + return ActionType.SOFT; + case FORCED: + return ActionType.FORCED; + case TIMEFORCED: + return ActionType.TIMEFORCED; + default: + throw new IllegalStateException("Action Type is not supported"); + } + } +} diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutMapper.java similarity index 67% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutMapper.java index c6be219ba..4dcaf0bf1 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,6 +14,14 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition.Condition; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutErrorAction.ErrorAction; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutSuccessAction.SuccessAction; +import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRolloutRestApi; import org.eclipse.hawkbit.repository.model.Action.ActionType; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Rollout; @@ -23,14 +31,6 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupErrorCondit import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessAction; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus; -import org.eclipse.hawkbit.rest.resource.api.RolloutRestApi; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutCondition.Condition; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutErrorAction.ErrorAction; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutSuccessAction.SuccessAction; -import org.eclipse.hawkbit.rest.resource.model.rolloutgroup.RolloutGroupResponseBody; /** * A mapper which maps repository model to RESTful model representation and @@ -38,22 +38,22 @@ import org.eclipse.hawkbit.rest.resource.model.rolloutgroup.RolloutGroupResponse * * */ -final class RolloutMapper { +final class MgmtRolloutMapper { private static final String NOT_SUPPORTED = " is not supported"; - private RolloutMapper() { + private MgmtRolloutMapper() { // Utility class } - static List toResponseRollout(final List rollouts) { - final List result = new ArrayList<>(rollouts.size()); + static List toResponseRollout(final List rollouts) { + final List result = new ArrayList<>(rollouts.size()); rollouts.forEach(r -> result.add(toResponseRollout(r))); return result; } - static RolloutResponseBody toResponseRollout(final Rollout rollout) { - final RolloutResponseBody body = new RolloutResponseBody(); + static MgmtRolloutResponseBody toResponseRollout(final Rollout rollout) { + final MgmtRolloutResponseBody body = new MgmtRolloutResponseBody(); body.setCreatedAt(rollout.getCreatedAt()); body.setCreatedBy(rollout.getCreatedBy()); body.setDescription(rollout.getDescription()); @@ -71,25 +71,26 @@ final class RolloutMapper { rollout.getTotalTargetCountStatus().getTotalTargetCountByStatus(status)); } - body.add(linkTo(methodOn(RolloutRestApi.class).getRollout(rollout.getId())).withRel("self")); - body.add(linkTo(methodOn(RolloutRestApi.class).start(rollout.getId(), false)).withRel("start")); - body.add(linkTo(methodOn(RolloutRestApi.class).start(rollout.getId(), true)).withRel("startAsync")); - body.add(linkTo(methodOn(RolloutRestApi.class).pause(rollout.getId())).withRel("pause")); - body.add(linkTo(methodOn(RolloutRestApi.class).resume(rollout.getId())).withRel("resume")); - body.add(linkTo(methodOn(RolloutRestApi.class).getRolloutGroups(rollout.getId(), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)).withRel("groups")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).getRollout(rollout.getId())).withRel("self")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).start(rollout.getId(), false)).withRel("start")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).start(rollout.getId(), true)).withRel("startAsync")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).pause(rollout.getId())).withRel("pause")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).resume(rollout.getId())).withRel("resume")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).getRolloutGroups(rollout.getId(), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)) + .withRel("groups")); return body; } - static Rollout fromRequest(final RolloutRestRequestBody restRequest, final DistributionSet distributionSet, + static Rollout fromRequest(final MgmtRolloutRestRequestBody restRequest, final DistributionSet distributionSet, final String filterQuery) { final Rollout rollout = new Rollout(); rollout.setName(restRequest.getName()); rollout.setDescription(restRequest.getDescription()); rollout.setDistributionSet(distributionSet); rollout.setTargetFilterQuery(filterQuery); - final ActionType convertActionType = RestResourceConversionHelper.convertActionType(restRequest.getType()); + final ActionType convertActionType = MgmtRestModelMapper.convertActionType(restRequest.getType()); if (convertActionType != null) { rollout.setActionType(convertActionType); } @@ -100,14 +101,14 @@ final class RolloutMapper { return rollout; } - static List toResponseRolloutGroup(final List rollouts) { - final List result = new ArrayList<>(rollouts.size()); + static List toResponseRolloutGroup(final List rollouts) { + final List result = new ArrayList<>(rollouts.size()); rollouts.forEach(r -> result.add(toResponseRolloutGroup(r))); return result; } - static RolloutGroupResponseBody toResponseRolloutGroup(final RolloutGroup rolloutGroup) { - final RolloutGroupResponseBody body = new RolloutGroupResponseBody(); + static MgmtRolloutGroupResponseBody toResponseRolloutGroup(final RolloutGroup rolloutGroup) { + final MgmtRolloutGroupResponseBody body = new MgmtRolloutGroupResponseBody(); body.setCreatedAt(rolloutGroup.getCreatedAt()); body.setCreatedBy(rolloutGroup.getCreatedBy()); body.setDescription(rolloutGroup.getDescription()); @@ -116,9 +117,8 @@ final class RolloutMapper { body.setName(rolloutGroup.getName()); body.setRolloutGroupId(rolloutGroup.getId()); body.setStatus(rolloutGroup.getStatus().toString().toLowerCase()); - body.add(linkTo( - methodOn(RolloutRestApi.class).getRolloutGroup(rolloutGroup.getRollout().getId(), rolloutGroup.getId())) - .withRel("self")); + body.add(linkTo(methodOn(MgmtRolloutRestApi.class).getRolloutGroup(rolloutGroup.getRollout().getId(), + rolloutGroup.getId())).withRel("self")); return body; } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java similarity index 81% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java index 78cfefa0d..ba1017cf3 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RolloutResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java @@ -6,11 +6,18 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRolloutRestApi; import org.eclipse.hawkbit.repository.DistributionSetManagement; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.RolloutFields; import org.eclipse.hawkbit.repository.RolloutGroupFields; import org.eclipse.hawkbit.repository.RolloutGroupManagement; @@ -27,12 +34,6 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessActi import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.RolloutRestApi; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutResponseBody; -import org.eclipse.hawkbit.rest.resource.model.rollout.RolloutRestRequestBody; -import org.eclipse.hawkbit.rest.resource.model.rolloutgroup.RolloutGroupResponseBody; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -48,7 +49,7 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class RolloutResource implements RolloutRestApi { +public class MgmtRolloutResource implements MgmtRolloutRestApi { private static final String DOES_NOT_EXIST = "} does not exist"; @@ -62,7 +63,7 @@ public class RolloutResource implements RolloutRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getRollouts(final int pagingOffsetParam, + public ResponseEntity> getRollouts(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -79,18 +80,18 @@ public class RolloutResource implements RolloutRestApi { findModulesAll = this.rolloutManagement.findAll(pageable); } - final List rest = RolloutMapper.toResponseRollout(findModulesAll.getContent()); + final List rest = MgmtRolloutMapper.toResponseRollout(findModulesAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, findModulesAll.getTotalElements()), HttpStatus.OK); } @Override - public ResponseEntity getRollout(final Long rolloutId) { + public ResponseEntity getRollout(final Long rolloutId) { final Rollout findRolloutById = findRolloutOrThrowException(rolloutId); - return new ResponseEntity<>(RolloutMapper.toResponseRollout(findRolloutById), HttpStatus.OK); + return new ResponseEntity<>(MgmtRolloutMapper.toResponseRollout(findRolloutById), HttpStatus.OK); } @Override - public ResponseEntity create(@RequestBody final RolloutRestRequestBody rolloutRequestBody) { + public ResponseEntity create(@RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody) { // first check the given RSQL query if it's well formed, otherwise and // exception is thrown @@ -111,20 +112,20 @@ public class RolloutResource implements RolloutRestApi { RolloutGroupErrorAction errorAction = null; String errorActionExpr = null; if (rolloutRequestBody.getSuccessCondition() != null) { - successCondition = RolloutMapper + successCondition = MgmtRolloutMapper .mapFinishCondition(rolloutRequestBody.getSuccessCondition().getCondition()); successConditionExpr = rolloutRequestBody.getSuccessCondition().getExpression(); } if (rolloutRequestBody.getSuccessAction() != null) { - successAction = RolloutMapper.map(rolloutRequestBody.getSuccessAction().getAction()); + successAction = MgmtRolloutMapper.map(rolloutRequestBody.getSuccessAction().getAction()); successActionExpr = rolloutRequestBody.getSuccessAction().getExpression(); } if (rolloutRequestBody.getErrorCondition() != null) { - errorCondition = RolloutMapper.mapErrorCondition(rolloutRequestBody.getErrorCondition().getCondition()); + errorCondition = MgmtRolloutMapper.mapErrorCondition(rolloutRequestBody.getErrorCondition().getCondition()); errorConditionExpr = rolloutRequestBody.getErrorCondition().getExpression(); } if (rolloutRequestBody.getErrorAction() != null) { - errorAction = RolloutMapper.map(rolloutRequestBody.getErrorAction().getAction()); + errorAction = MgmtRolloutMapper.map(rolloutRequestBody.getErrorAction().getAction()); errorActionExpr = rolloutRequestBody.getErrorAction().getExpression(); } @@ -133,11 +134,11 @@ public class RolloutResource implements RolloutRestApi { .successAction(successAction, successActionExpr).errorCondition(errorCondition, errorConditionExpr) .errorAction(errorAction, errorActionExpr).build(); final Rollout rollout = this.rolloutManagement.createRollout( - RolloutMapper.fromRequest(rolloutRequestBody, distributionSet, + MgmtRolloutMapper.fromRequest(rolloutRequestBody, distributionSet, rolloutRequestBody.getTargetFilterQuery()), rolloutRequestBody.getAmountGroups(), rolloutGroupConditions); - return ResponseEntity.status(HttpStatus.CREATED).body(RolloutMapper.toResponseRollout(rollout)); + return ResponseEntity.status(HttpStatus.CREATED).body(MgmtRolloutMapper.toResponseRollout(rollout)); } @Override @@ -166,7 +167,7 @@ public class RolloutResource implements RolloutRestApi { } @Override - public ResponseEntity> getRolloutGroups(final Long rolloutId, + public ResponseEntity> getRolloutGroups(final Long rolloutId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final Rollout rollout = findRolloutOrThrowException(rolloutId); @@ -184,20 +185,20 @@ public class RolloutResource implements RolloutRestApi { findRolloutGroupsAll = this.rolloutGroupManagement.findRolloutGroupsByRolloutId(rolloutId, pageable); } - final List rest = RolloutMapper + final List rest = MgmtRolloutMapper .toResponseRolloutGroup(findRolloutGroupsAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, findRolloutGroupsAll.getTotalElements()), HttpStatus.OK); } @Override - public ResponseEntity getRolloutGroup(final Long rolloutId, final Long groupId) { + public ResponseEntity getRolloutGroup(final Long rolloutId, final Long groupId) { findRolloutOrThrowException(rolloutId); final RolloutGroup rolloutGroup = findRolloutGroupOrThrowException(groupId); - return ResponseEntity.ok(RolloutMapper.toResponseRolloutGroup(rolloutGroup)); + return ResponseEntity.ok(MgmtRolloutMapper.toResponseRolloutGroup(rolloutGroup)); } @Override - public ResponseEntity> getRolloutGroupTargets(final Long rolloutId, final Long groupId, + public ResponseEntity> getRolloutGroupTargets(final Long rolloutId, final Long groupId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { findRolloutOrThrowException(rolloutId); final RolloutGroup rolloutGroup = findRolloutGroupOrThrowException(groupId); @@ -218,8 +219,8 @@ public class RolloutResource implements RolloutRestApi { pageable); rolloutGroupTargets = pageTargets; } - final List rest = TargetMapper.toResponse(rolloutGroupTargets.getContent()); - return new ResponseEntity<>(new PagedList(rest, rolloutGroupTargets.getTotalElements()), + final List rest = MgmtTargetMapper.toResponse(rolloutGroupTargets.getContent()); + return new ResponseEntity<>(new PagedList(rest, rolloutGroupTargets.getTotalElements()), HttpStatus.OK); } @@ -239,7 +240,7 @@ public class RolloutResource implements RolloutRestApi { return rolloutGroup; } - private DistributionSet findDistributionSetOrThrowException(final RolloutRestRequestBody rolloutRequestBody) { + private DistributionSet findDistributionSetOrThrowException(final MgmtRolloutRestRequestBody rolloutRequestBody) { final DistributionSet ds = this.distributionSetManagement .findDistributionSetById(rolloutRequestBody.getDistributionSetId()); if (ds == null) { diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java similarity index 63% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java index 01dfae9cd..b31fe068a 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,6 +14,14 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifactHash; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.Artifact; @@ -21,21 +29,14 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleRestAPI; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactHash; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; /** * A mapper which maps repository model to RESTful model representation and * back. * */ -public final class SoftwareModuleMapper { - private SoftwareModuleMapper() { +public final class MgmtSoftwareModuleMapper { + private MgmtSoftwareModuleMapper() { // Utility class } @@ -51,7 +52,7 @@ public final class SoftwareModuleMapper { return smType; } - static SoftwareModule fromRequest(final SoftwareModuleRequestBodyPost smsRest, + static SoftwareModule fromRequest(final MgmtSoftwareModuleRequestBodyPost smsRest, final SoftwareManagement softwareManagement) { return new SoftwareModule(getSoftwareModuleTypeFromKeyString(smsRest.getType(), softwareManagement), smsRest.getName(), smsRest.getVersion(), smsRest.getDescription(), smsRest.getVendor()); @@ -69,10 +70,10 @@ public final class SoftwareModuleMapper { return mappedList; } - static List smFromRequest(final Iterable smsRest, + static List smFromRequest(final Iterable smsRest, final SoftwareManagement softwareManagement) { final List mappedList = new ArrayList<>(); - for (final SoftwareModuleRequestBodyPost smRest : smsRest) { + for (final MgmtSoftwareModuleRequestBodyPost smRest : smsRest) { mappedList.add(fromRequest(smRest, softwareManagement)); } return mappedList; @@ -85,11 +86,11 @@ public final class SoftwareModuleMapper { * the modules * @return the response */ - public static List toResponse(final List baseSoftareModules) { - final List mappedList = new ArrayList<>(); + public static List toResponse(final List baseSoftareModules) { + final List mappedList = new ArrayList<>(); if (baseSoftareModules != null) { for (final SoftwareModule target : baseSoftareModules) { - final SoftwareModuleRest response = toResponse(target); + final MgmtSoftwareModule response = toResponse(target); mappedList.add(response); } @@ -97,8 +98,8 @@ public final class SoftwareModuleMapper { return mappedList; } - static List toResponseSoftwareModules(final Iterable softwareModules) { - final List response = new ArrayList<>(); + static List toResponseSoftwareModules(final Iterable softwareModules) { + final List response = new ArrayList<>(); for (final SoftwareModule softwareModule : softwareModules) { response.add(toResponse(softwareModule)); } @@ -127,30 +128,30 @@ public final class SoftwareModuleMapper { * the sw module * @return the response */ - public static SoftwareModuleRest toResponse(final SoftwareModule baseSofwareModule) { + public static MgmtSoftwareModule toResponse(final SoftwareModule baseSofwareModule) { if (baseSofwareModule == null) { return null; } - final SoftwareModuleRest response = new SoftwareModuleRest(); - RestModelMapper.mapNamedToNamed(response, baseSofwareModule); + final MgmtSoftwareModule response = new MgmtSoftwareModule(); + MgmtRestModelMapper.mapNamedToNamed(response, baseSofwareModule); response.setModuleId(baseSofwareModule.getId()); response.setVersion(baseSofwareModule.getVersion()); response.setType(baseSofwareModule.getType().getKey()); response.setVendor(baseSofwareModule.getVendor()); - response.add(linkTo(methodOn(SoftwareModuleRestAPI.class).getArtifacts(response.getModuleId())) - .withRel(RestConstants.SOFTWAREMODULE_V1_ARTIFACT)); - response.add(linkTo(methodOn(SoftwareModuleRestAPI.class).getSoftwareModule(response.getModuleId())) + response.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getArtifacts(response.getModuleId())) + .withRel(MgmtRestConstants.SOFTWAREMODULE_V1_ARTIFACT)); + response.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getSoftwareModule(response.getModuleId())) .withRel("self")); response.add(linkTo( - methodOn(SoftwareModuleTypeRestApi.class).getSoftwareModuleType(baseSofwareModule.getType().getId())) - .withRel(RestConstants.SOFTWAREMODULE_V1_TYPE)); + methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(baseSofwareModule.getType().getId())) + .withRel(MgmtRestConstants.SOFTWAREMODULE_V1_TYPE)); - response.add(linkTo(methodOn(SoftwareModuleResource.class).getMetadata(response.getModuleId(), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), - Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)) + response.add(linkTo(methodOn(MgmtSoftwareModuleResource.class).getMetadata(response.getModuleId(), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET), + Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null, null)) .withRel("metadata")); return response; } @@ -159,27 +160,27 @@ public final class SoftwareModuleMapper { * @param artifact * @return */ - static ArtifactRest toResponse(final Artifact artifact) { - final ArtifactRest.ArtifactType type = artifact instanceof LocalArtifact ? ArtifactRest.ArtifactType.LOCAL - : ArtifactRest.ArtifactType.EXTERNAL; + static MgmtArtifact toResponse(final Artifact artifact) { + final MgmtArtifact.ArtifactType type = artifact instanceof LocalArtifact ? MgmtArtifact.ArtifactType.LOCAL + : MgmtArtifact.ArtifactType.EXTERNAL; - final ArtifactRest artifactRest = new ArtifactRest(); + final MgmtArtifact artifactRest = new MgmtArtifact(); artifactRest.setType(type); artifactRest.setArtifactId(artifact.getId()); artifactRest.setSize(artifact.getSize()); - artifactRest.setHashes(new ArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); + artifactRest.setHashes(new MgmtArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); if (artifact instanceof LocalArtifact) { artifactRest.setProvidedFilename(((LocalArtifact) artifact).getFilename()); } - RestModelMapper.mapBaseToBase(artifactRest, artifact); + MgmtRestModelMapper.mapBaseToBase(artifactRest, artifact); - artifactRest.add(linkTo(methodOn(SoftwareModuleRestAPI.class).getArtifact(artifact.getSoftwareModule().getId(), + artifactRest.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getArtifact(artifact.getSoftwareModule().getId(), artifact.getId())).withRel("self")); if (artifact instanceof LocalArtifact) { - artifactRest.add(linkTo(methodOn(DownloadArtifactResource.class) + artifactRest.add(linkTo(methodOn(MgmtDownloadArtifactResource.class) .downloadArtifact(artifact.getSoftwareModule().getId(), artifact.getId(), null, null)) .withRel("download")); } @@ -187,12 +188,12 @@ public final class SoftwareModuleMapper { return artifactRest; } - static List artifactsToResponse(final List artifacts) { - final List mappedList = new ArrayList<>(); + static List artifactsToResponse(final List artifacts) { + final List mappedList = new ArrayList<>(); if (artifacts != null) { for (final Artifact artifact : artifacts) { - final ArtifactRest response = toResponse(artifact); + final MgmtArtifact response = toResponse(artifact); mappedList.add(response); } } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java similarity index 71% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java index 830443cbd..f4135744b 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java @@ -6,12 +6,21 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.io.IOException; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; import org.eclipse.hawkbit.repository.ArtifactManagement; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SoftwareModuleFields; import org.eclipse.hawkbit.repository.SoftwareModuleMetadataFields; @@ -21,13 +30,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata; import org.eclipse.hawkbit.repository.model.SwMetadataCompositeKey; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleRestAPI; -import org.eclipse.hawkbit.rest.resource.model.MetadataRest; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -49,8 +51,8 @@ import org.springframework.web.multipart.MultipartFile; * */ @RestController -public class SoftwareModuleResource implements SoftwareModuleRestAPI { - private static final Logger LOG = LoggerFactory.getLogger(SoftwareModuleResource.class); +public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestAPI { + private static final Logger LOG = LoggerFactory.getLogger(MgmtSoftwareModuleResource.class); @Autowired private ArtifactManagement artifactManagement; @@ -59,7 +61,7 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { private SoftwareManagement softwareManagement; @Override - public ResponseEntity uploadArtifact(@PathVariable final Long softwareModuleId, + public ResponseEntity uploadArtifact(@PathVariable final Long softwareModuleId, @RequestParam("file") final MultipartFile file, @RequestParam(value = "filename", required = false) final String optionalFileName, @RequestParam(value = "md5sum", required = false) final String md5Sum, @@ -85,23 +87,23 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } - return new ResponseEntity<>(SoftwareModuleMapper.toResponse(result), HttpStatus.CREATED); + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(result), HttpStatus.CREATED); } @Override - public ResponseEntity> getArtifacts(@PathVariable final Long softwareModuleId) { + public ResponseEntity> getArtifacts(@PathVariable final Long softwareModuleId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); - return new ResponseEntity<>(SoftwareModuleMapper.artifactsToResponse(module.getArtifacts()), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleMapper.artifactsToResponse(module.getArtifacts()), HttpStatus.OK); } @Override - public ResponseEntity getArtifact(@PathVariable final Long softwareModuleId, + public ResponseEntity getArtifact(@PathVariable final Long softwareModuleId, @PathVariable final Long artifactId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); - return new ResponseEntity<>(SoftwareModuleMapper.toResponse(module.getLocalArtifact(artifactId).get()), + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(module.getLocalArtifact(artifactId).get()), HttpStatus.OK); } @@ -117,11 +119,11 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { } @Override - public ResponseEntity> getSoftwareModules( - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { + public ResponseEntity> getSoftwareModules( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -140,32 +142,32 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { countModulesAll = softwareManagement.countSoftwareModulesAll(); } - final List rest = SoftwareModuleMapper.toResponse(findModulesAll.getContent()); + final List rest = MgmtSoftwareModuleMapper.toResponse(findModulesAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countModulesAll), HttpStatus.OK); } @Override - public ResponseEntity getSoftwareModule(@PathVariable final Long softwareModuleId) { + public ResponseEntity getSoftwareModule(@PathVariable final Long softwareModuleId) { final SoftwareModule findBaseSoftareModule = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); - return new ResponseEntity<>(SoftwareModuleMapper.toResponse(findBaseSoftareModule), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(findBaseSoftareModule), HttpStatus.OK); } @Override - public ResponseEntity> createSoftwareModules( - @RequestBody final List softwareModules) { + public ResponseEntity> createSoftwareModules( + @RequestBody final List softwareModules) { LOG.debug("creating {} softwareModules", softwareModules.size()); final Iterable createdSoftwareModules = softwareManagement - .createSoftwareModule(SoftwareModuleMapper.smFromRequest(softwareModules, softwareManagement)); + .createSoftwareModule(MgmtSoftwareModuleMapper.smFromRequest(softwareModules, softwareManagement)); LOG.debug("{} softwareModules created, return status {}", softwareModules.size(), HttpStatus.CREATED); - return new ResponseEntity<>(SoftwareModuleMapper.toResponseSoftwareModules(createdSoftwareModules), + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponseSoftwareModules(createdSoftwareModules), HttpStatus.CREATED); } @Override - public ResponseEntity updateSoftwareModule(@PathVariable final Long softwareModuleId, - @RequestBody final SoftwareModuleRequestBodyPut restSoftwareModule) { + public ResponseEntity updateSoftwareModule(@PathVariable final Long softwareModuleId, + @RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); // only description and vendor can be modified @@ -177,7 +179,7 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { } final SoftwareModule updateSoftwareModule = softwareManagement.updateSoftwareModule(module); - return new ResponseEntity<>(SoftwareModuleMapper.toResponse(updateSoftwareModule), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(updateSoftwareModule), HttpStatus.OK); } @Override @@ -191,10 +193,10 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { @Override public ResponseEntity> getMetadata(@PathVariable final Long softwareModuleId, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, - @RequestParam(value = RestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { // check if software module exists otherwise throw exception immediately findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); @@ -214,7 +216,7 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { } return new ResponseEntity<>( - new PagedList<>(SoftwareModuleMapper.toResponseSwMetadata(metaDataPage.getContent()), + new PagedList<>(MgmtSoftwareModuleMapper.toResponseSwMetadata(metaDataPage.getContent()), metaDataPage.getTotalElements()), HttpStatus.OK); } @@ -226,7 +228,7 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { // immediately final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final SoftwareModuleMetadata findOne = softwareManagement.findSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey)); - return ResponseEntity. ok(SoftwareModuleMapper.toResponseSwMetadata(findOne)); + return ResponseEntity. ok(MgmtSoftwareModuleMapper.toResponseSwMetadata(findOne)); } @Override @@ -236,7 +238,7 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final SoftwareModuleMetadata updated = softwareManagement .updateSoftwareModuleMetadata(new SoftwareModuleMetadata(metadataKey, sw, metadata.getValue())); - return ResponseEntity.ok(SoftwareModuleMapper.toResponseSwMetadata(updated)); + return ResponseEntity.ok(MgmtSoftwareModuleMapper.toResponseSwMetadata(updated)); } @Override @@ -255,9 +257,9 @@ public class SoftwareModuleResource implements SoftwareModuleRestAPI { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final List created = softwareManagement - .createSoftwareModuleMetadata(SoftwareModuleMapper.fromRequestSwMetadata(sw, metadataRest)); + .createSoftwareModuleMetadata(MgmtSoftwareModuleMapper.fromRequestSwMetadata(sw, metadataRest)); - return new ResponseEntity<>(SoftwareModuleMapper.toResponseSwMetadata(created), HttpStatus.CREATED); + return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponseSwMetadata(created), HttpStatus.CREATED); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java similarity index 62% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java index b6525948c..5b16436a9 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -15,10 +15,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; /** * A mapper which maps repository model to RESTful model representation and @@ -28,52 +28,52 @@ import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModule * * */ -final class SoftwareModuleTypeMapper { +final class MgmtSoftwareModuleTypeMapper { // private constructor, utility class - private SoftwareModuleTypeMapper() { + private MgmtSoftwareModuleTypeMapper() { } - static List smFromRequest(final Iterable smTypesRest) { + static List smFromRequest(final Iterable smTypesRest) { final List mappedList = new ArrayList<>(); - for (final SoftwareModuleTypeRequestBodyPost smRest : smTypesRest) { + for (final MgmtSoftwareModuleTypeRequestBodyPost smRest : smTypesRest) { mappedList.add(fromRequest(smRest)); } return mappedList; } - static SoftwareModuleType fromRequest(final SoftwareModuleTypeRequestBodyPost smsRest) { + static SoftwareModuleType fromRequest(final MgmtSoftwareModuleTypeRequestBodyPost smsRest) { return new SoftwareModuleType(smsRest.getKey(), smsRest.getName(), smsRest.getDescription(), smsRest.getMaxAssignments()); } - static List toTypesResponse(final List types) { - final List response = new ArrayList<>(); + static List toTypesResponse(final List types) { + final List response = new ArrayList<>(); for (final SoftwareModuleType softwareModule : types) { response.add(toResponse(softwareModule)); } return response; } - static List toListResponse(final Collection types) { - final List response = new ArrayList<>(); + static List toListResponse(final Collection types) { + final List response = new ArrayList<>(); for (final SoftwareModuleType softwareModule : types) { response.add(toResponse(softwareModule)); } return response; } - static SoftwareModuleTypeRest toResponse(final SoftwareModuleType type) { - final SoftwareModuleTypeRest result = new SoftwareModuleTypeRest(); + static MgmtSoftwareModuleType toResponse(final SoftwareModuleType type) { + final MgmtSoftwareModuleType result = new MgmtSoftwareModuleType(); - RestModelMapper.mapNamedToNamed(result, type); + MgmtRestModelMapper.mapNamedToNamed(result, type); result.setKey(type.getKey()); result.setMaxAssignments(type.getMaxAssignments()); result.setModuleId(type.getId()); - result.add(linkTo(methodOn(SoftwareModuleTypeRestApi.class).getSoftwareModuleType(result.getModuleId())) + result.add(linkTo(methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(result.getModuleId())) .withRel("self")); return result; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java similarity index 73% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java index e3498f141..ab23046b3 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java @@ -6,10 +6,16 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; +import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; @@ -17,11 +23,6 @@ import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.SoftwareModuleTypeRestApi; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPost; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeRest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -37,12 +38,12 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class SoftwareModuleTypeResource implements SoftwareModuleTypeRestApi { +public class MgmtSoftwareModuleTypeResource implements MgmtSoftwareModuleTypeRestApi { @Autowired private SoftwareManagement softwareManagement; @Override - public ResponseEntity> getTypes(final int pagingOffsetParam, + public ResponseEntity> getTypes(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -62,16 +63,16 @@ public class SoftwareModuleTypeResource implements SoftwareModuleTypeRestApi { countModulesAll = this.softwareManagement.countSoftwareModuleTypesAll(); } - final List rest = SoftwareModuleTypeMapper + final List rest = MgmtSoftwareModuleTypeMapper .toListResponse(findModuleTypessAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countModulesAll), HttpStatus.OK); } @Override - public ResponseEntity getSoftwareModuleType(final Long softwareModuleTypeId) { + public ResponseEntity getSoftwareModuleType(final Long softwareModuleTypeId) { final SoftwareModuleType foundType = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); - return new ResponseEntity<>(SoftwareModuleTypeMapper.toResponse(foundType), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toResponse(foundType), HttpStatus.OK); } @Override @@ -84,8 +85,8 @@ public class SoftwareModuleTypeResource implements SoftwareModuleTypeRestApi { } @Override - public ResponseEntity updateSoftwareModuleType(final Long softwareModuleTypeId, - final SoftwareModuleTypeRequestBodyPut restSoftwareModuleType) { + public ResponseEntity updateSoftwareModuleType(final Long softwareModuleTypeId, + final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType) { final SoftwareModuleType type = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); // only description can be modified @@ -94,17 +95,17 @@ public class SoftwareModuleTypeResource implements SoftwareModuleTypeRestApi { } final SoftwareModuleType updatedSoftwareModuleType = this.softwareManagement.updateSoftwareModuleType(type); - return new ResponseEntity<>(SoftwareModuleTypeMapper.toResponse(updatedSoftwareModuleType), HttpStatus.OK); + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toResponse(updatedSoftwareModuleType), HttpStatus.OK); } @Override - public ResponseEntity> createSoftwareModuleTypes( - final List softwareModuleTypes) { + public ResponseEntity> createSoftwareModuleTypes( + final List softwareModuleTypes) { final List createdSoftwareModules = this.softwareManagement - .createSoftwareModuleType(SoftwareModuleTypeMapper.smFromRequest(softwareModuleTypes)); + .createSoftwareModuleType(MgmtSoftwareModuleTypeMapper.smFromRequest(softwareModuleTypes)); - return new ResponseEntity<>(SoftwareModuleTypeMapper.toTypesResponse(createdSoftwareModules), + return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toTypesResponse(createdSoftwareModules), HttpStatus.CREATED); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TagMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTagMapper.java similarity index 61% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TagMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTagMapper.java index f9f0caba0..3ab2016ec 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TagMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTagMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,111 +14,111 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.Tag; import org.eclipse.hawkbit.repository.model.TargetTag; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetTagRestApi; -import org.eclipse.hawkbit.rest.resource.api.TargetTagRestApi; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRest; /** * A mapper which maps repository model to RESTful model representation and * back. * */ -final class TagMapper { - private TagMapper() { +final class MgmtTagMapper { + private MgmtTagMapper() { // Utility class } - static List toResponse(final List targetTags) { - final List tagsRest = new ArrayList<>(); + static List toResponse(final List targetTags) { + final List tagsRest = new ArrayList<>(); if (targetTags == null) { return tagsRest; } for (final TargetTag target : targetTags) { - final TagRest response = toResponse(target); + final MgmtTag response = toResponse(target); tagsRest.add(response); } return tagsRest; } - static TagRest toResponse(final TargetTag targetTag) { - final TagRest response = new TagRest(); + static MgmtTag toResponse(final TargetTag targetTag) { + final MgmtTag response = new MgmtTag(); if (targetTag == null) { return response; } mapTag(response, targetTag); - response.add(linkTo(methodOn(TargetTagRestApi.class).getTargetTag(targetTag.getId())).withRel("self")); + response.add(linkTo(methodOn(MgmtTargetTagRestApi.class).getTargetTag(targetTag.getId())).withRel("self")); - response.add(linkTo(methodOn(TargetTagRestApi.class).getAssignedTargets(targetTag.getId())) + response.add(linkTo(methodOn(MgmtTargetTagRestApi.class).getAssignedTargets(targetTag.getId())) .withRel("assignedTargets")); return response; } - static List toResponseDistributionSetTag(final List distributionSetTags) { - final List tagsRest = new ArrayList<>(); + static List toResponseDistributionSetTag(final List distributionSetTags) { + final List tagsRest = new ArrayList<>(); if (distributionSetTags == null) { return tagsRest; } for (final DistributionSetTag distributionSetTag : distributionSetTags) { - final TagRest response = toResponse(distributionSetTag); + final MgmtTag response = toResponse(distributionSetTag); tagsRest.add(response); } return tagsRest; } - static TagRest toResponse(final DistributionSetTag distributionSetTag) { - final TagRest response = new TagRest(); + static MgmtTag toResponse(final DistributionSetTag distributionSetTag) { + final MgmtTag response = new MgmtTag(); if (distributionSetTag == null) { return null; } mapTag(response, distributionSetTag); - response.add(linkTo(methodOn(DistributionSetTagRestApi.class).getDistributionSetTag(distributionSetTag.getId())) + response.add(linkTo(methodOn(MgmtDistributionSetTagRestApi.class).getDistributionSetTag(distributionSetTag.getId())) .withRel("self")); response.add(linkTo( - methodOn(DistributionSetTagRestApi.class).getAssignedDistributionSets(distributionSetTag.getId())) + methodOn(MgmtDistributionSetTagRestApi.class).getAssignedDistributionSets(distributionSetTag.getId())) .withRel("assignedDistributionSets")); return response; } - static List mapTargeTagFromRequest(final Iterable tags) { + static List mapTargeTagFromRequest(final Iterable tags) { final List mappedList = new ArrayList<>(); - for (final TagRequestBodyPut targetTagRest : tags) { + for (final MgmtTagRequestBodyPut targetTagRest : tags) { mappedList.add( new TargetTag(targetTagRest.getName(), targetTagRest.getDescription(), targetTagRest.getColour())); } return mappedList; } - static List mapDistributionSetTagFromRequest(final Iterable tags) { + static List mapDistributionSetTagFromRequest(final Iterable tags) { final List mappedList = new ArrayList<>(); - for (final TagRequestBodyPut targetTagRest : tags) { + for (final MgmtTagRequestBodyPut targetTagRest : tags) { mappedList.add(new DistributionSetTag(targetTagRest.getName(), targetTagRest.getDescription(), targetTagRest.getColour())); } return mappedList; } - private static void mapTag(final TagRest response, final Tag tag) { - RestModelMapper.mapNamedToNamed(response, tag); + private static void mapTag(final MgmtTag response, final Tag tag) { + MgmtRestModelMapper.mapNamedToNamed(response, tag); response.setTagId(tag.getId()); response.setColour(tag.getColour()); } - static void updateTag(final TagRequestBodyPut response, final Tag tag) { + static void updateTag(final MgmtTagRequestBodyPut response, final Tag tag) { if (response.getDescription() != null) { tag.setDescription(response.getDescription()); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetMapper.java similarity index 65% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetMapper.java index c8a39a2f3..afb941bc1 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -17,27 +17,29 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import org.eclipse.hawkbit.mgmt.json.model.MgmtPollStatus; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtActionStatus; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi; import org.eclipse.hawkbit.repository.ActionFields; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetInfo.PollStatus; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; -import org.eclipse.hawkbit.rest.resource.api.TargetRestApi; -import org.eclipse.hawkbit.rest.resource.model.PollStatusRest; -import org.eclipse.hawkbit.rest.resource.model.action.ActionRest; -import org.eclipse.hawkbit.rest.resource.model.action.ActionStatusRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.rest.data.SortDirection; /** * A mapper which maps repository model to RESTful model representation and * back. * */ -public final class TargetMapper { +public final class MgmtTargetMapper { - private TargetMapper() { + private MgmtTargetMapper() { // Utility class } @@ -47,17 +49,17 @@ public final class TargetMapper { * @param response * the target response */ - public static void addTargetLinks(final TargetRest response) { - response.add(linkTo(methodOn(TargetRestApi.class).getAssignedDistributionSet(response.getControllerId())) - .withRel(RestConstants.TARGET_V1_ASSIGNED_DISTRIBUTION_SET)); - response.add(linkTo(methodOn(TargetRestApi.class).getInstalledDistributionSet(response.getControllerId())) - .withRel(RestConstants.TARGET_V1_INSTALLED_DISTRIBUTION_SET)); - response.add(linkTo(methodOn(TargetRestApi.class).getAttributes(response.getControllerId())) - .withRel(RestConstants.TARGET_V1_ATTRIBUTES)); - response.add(linkTo(methodOn(TargetRestApi.class).getActionHistory(response.getControllerId(), 0, - RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, + public static void addTargetLinks(final MgmtTarget response) { + response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAssignedDistributionSet(response.getControllerId())) + .withRel(MgmtRestConstants.TARGET_V1_ASSIGNED_DISTRIBUTION_SET)); + response.add(linkTo(methodOn(MgmtTargetRestApi.class).getInstalledDistributionSet(response.getControllerId())) + .withRel(MgmtRestConstants.TARGET_V1_INSTALLED_DISTRIBUTION_SET)); + response.add(linkTo(methodOn(MgmtTargetRestApi.class).getAttributes(response.getControllerId())) + .withRel(MgmtRestConstants.TARGET_V1_ATTRIBUTES)); + response.add(linkTo(methodOn(MgmtTargetRestApi.class).getActionHistory(response.getControllerId(), 0, + MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, ActionFields.ID.getFieldName() + ":" + SortDirection.DESC, null)) - .withRel(RestConstants.TARGET_V1_ACTIONS)); + .withRel(MgmtRestConstants.TARGET_V1_ACTIONS)); } /** @@ -68,10 +70,10 @@ public final class TargetMapper { * @param targetRest * the response */ - public static void addPollStatus(final Target target, final TargetRest targetRest) { + public static void addPollStatus(final Target target, final MgmtTarget targetRest) { final PollStatus pollStatus = target.getTargetInfo().getPollStatus(); if (pollStatus != null) { - final PollStatusRest pollStatusRest = new PollStatusRest(); + final MgmtPollStatus pollStatusRest = new MgmtPollStatus(); pollStatusRest.setLastRequestAt( Date.from(pollStatus.getLastPollDate().atZone(ZoneId.systemDefault()).toInstant()).getTime()); pollStatusRest.setNextExpectedRequestAt( @@ -88,11 +90,11 @@ public final class TargetMapper { * the targets * @return the response */ - public static List toResponseWithLinksAndPollStatus(final Iterable targets) { - final List mappedList = new ArrayList<>(); + public static List toResponseWithLinksAndPollStatus(final Iterable targets) { + final List mappedList = new ArrayList<>(); if (targets != null) { for (final Target target : targets) { - final TargetRest response = toResponse(target); + final MgmtTarget response = toResponse(target); addPollStatus(target, response); addTargetLinks(response); mappedList.add(response); @@ -108,11 +110,11 @@ public final class TargetMapper { * list of targets * @return the response */ - public static List toResponse(final Iterable targets) { - final List mappedList = new ArrayList<>(); + public static List toResponse(final Iterable targets) { + final List mappedList = new ArrayList<>(); if (targets != null) { for (final Target target : targets) { - final TargetRest response = toResponse(target); + final MgmtTarget response = toResponse(target); mappedList.add(response); } } @@ -126,11 +128,11 @@ public final class TargetMapper { * the target * @return the response */ - public static TargetRest toResponse(final Target target) { + public static MgmtTarget toResponse(final Target target) { if (target == null) { return null; } - final TargetRest targetRest = new TargetRest(); + final MgmtTarget targetRest = new MgmtTarget(); targetRest.setControllerId(target.getControllerId()); targetRest.setDescription(target.getDescription()); targetRest.setName(target.getName()); @@ -161,32 +163,32 @@ public final class TargetMapper { targetRest.setInstalledAt(installationDate); } - targetRest.add(linkTo(methodOn(TargetRestApi.class).getTarget(target.getControllerId())).withRel("self")); + targetRest.add(linkTo(methodOn(MgmtTargetRestApi.class).getTarget(target.getControllerId())).withRel("self")); return targetRest; } - static List fromRequest(final Iterable targetsRest) { + static List fromRequest(final Iterable targetsRest) { final List mappedList = new ArrayList<>(); - for (final TargetRequestBody targetRest : targetsRest) { + for (final MgmtTargetRequestBody targetRest : targetsRest) { mappedList.add(fromRequest(targetRest)); } return mappedList; } - static Target fromRequest(final TargetRequestBody targetRest) { + static Target fromRequest(final MgmtTargetRequestBody targetRest) { final Target target = new Target(targetRest.getControllerId()); target.setDescription(targetRest.getDescription()); target.setName(targetRest.getName()); return target; } - static List toActionStatusRestResponse(final List actionStatus) { - final List mappedList = new ArrayList<>(); + static List toActionStatusRestResponse(final List actionStatus) { + final List mappedList = new ArrayList<>(); if (actionStatus != null) { for (final ActionStatus status : actionStatus) { - final ActionStatusRest response = toResponse(status); + final MgmtActionStatus response = toResponse(status); mappedList.add(response); } } @@ -194,30 +196,30 @@ public final class TargetMapper { return mappedList; } - static ActionRest toResponse(final String targetId, final Action action, final boolean isActive) { - final ActionRest result = new ActionRest(); + static MgmtAction toResponse(final String targetId, final Action action, final boolean isActive) { + final MgmtAction result = new MgmtAction(); result.setActionId(action.getId()); result.setType(getType(action)); if (isActive) { - result.setStatus(ActionRest.ACTION_PENDING); + result.setStatus(MgmtAction.ACTION_PENDING); } else { - result.setStatus(ActionRest.ACTION_FINISHED); + result.setStatus(MgmtAction.ACTION_FINISHED); } - RestModelMapper.mapBaseToBase(result, action); + MgmtRestModelMapper.mapBaseToBase(result, action); - result.add(linkTo(methodOn(TargetRestApi.class).getAction(targetId, action.getId())).withRel("self")); + result.add(linkTo(methodOn(MgmtTargetRestApi.class).getAction(targetId, action.getId())).withRel("self")); return result; } - static List toResponse(final String targetId, final List actions) { - final List mappedList = new ArrayList<>(); + static List toResponse(final String targetId, final List actions) { + final List mappedList = new ArrayList<>(); for (final Action action : actions) { - final ActionRest response = toResponse(targetId, action, action.isActive()); + final MgmtAction response = toResponse(targetId, action, action.isActive()); mappedList.add(response); } return mappedList; @@ -228,22 +230,22 @@ public final class TargetMapper { switch (type) { case CANCELED: - result = ActionStatusRest.AS_CANCELED; + result = MgmtActionStatus.AS_CANCELED; break; case ERROR: - result = ActionStatusRest.AS_ERROR; + result = MgmtActionStatus.AS_ERROR; break; case FINISHED: - result = ActionStatusRest.AS_FINISHED; + result = MgmtActionStatus.AS_FINISHED; break; case RETRIEVED: - result = ActionStatusRest.AS_RETRIEVED; + result = MgmtActionStatus.AS_RETRIEVED; break; case RUNNING: - result = ActionStatusRest.AS_RUNNING; + result = MgmtActionStatus.AS_RUNNING; break; case WARNING: - result = ActionStatusRest.AS_WARNING; + result = MgmtActionStatus.AS_WARNING; break; default: return type.name().toLowerCase(); @@ -256,9 +258,9 @@ public final class TargetMapper { private static String getType(final Action action) { if (!action.isCancelingOrCanceled()) { - return ActionRest.ACTION_UPDATE; + return MgmtAction.ACTION_UPDATE; } else if (action.isCancelingOrCanceled()) { - return ActionRest.ACTION_CANCEL; + return MgmtAction.ACTION_CANCEL; } return null; @@ -290,8 +292,8 @@ public final class TargetMapper { return result; } - private static ActionStatusRest toResponse(final ActionStatus actionStatus) { - final ActionStatusRest result = new ActionStatusRest(); + private static MgmtActionStatus toResponse(final ActionStatus actionStatus) { + final MgmtActionStatus result = new MgmtActionStatus(); result.setMessages(actionStatus.getMessages()); result.setReportedAt(actionStatus.getCreatedAt()); diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java similarity index 73% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java index 4b068a41e..449c57362 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -15,9 +15,21 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtAction; +import org.eclipse.hawkbit.mgmt.json.model.action.MgmtActionStatus; +import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtDistributionSetAssigment; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetAttributes; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTargetRequestBody; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetRestApi; import org.eclipse.hawkbit.repository.ActionFields; import org.eclipse.hawkbit.repository.ActionStatusFields; import org.eclipse.hawkbit.repository.DeploymentManagement; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.TargetFields; import org.eclipse.hawkbit.repository.TargetManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; @@ -26,17 +38,7 @@ import org.eclipse.hawkbit.repository.model.Action.ActionType; import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.DistributionSetRestApi; -import org.eclipse.hawkbit.rest.resource.api.TargetRestApi; -import org.eclipse.hawkbit.rest.resource.helper.RestResourceConversionHelper; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.action.ActionRest; -import org.eclipse.hawkbit.rest.resource.model.action.ActionStatusRest; -import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetRest; -import org.eclipse.hawkbit.rest.resource.model.target.DistributionSetAssigmentRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetAttributes; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; +import org.eclipse.hawkbit.rest.data.SortDirection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -54,8 +56,8 @@ import org.springframework.web.bind.annotation.RestController; * REST Resource handling target CRUD operations. */ @RestController -public class TargetResource implements TargetRestApi { - private static final Logger LOG = LoggerFactory.getLogger(TargetResource.class); +public class MgmtTargetResource implements MgmtTargetRestApi { + private static final Logger LOG = LoggerFactory.getLogger(MgmtTargetResource.class); @Autowired private TargetManagement targetManagement; @@ -64,18 +66,18 @@ public class TargetResource implements TargetRestApi { private DeploymentManagement deploymentManagement; @Override - public ResponseEntity getTarget(final String targetId) { + public ResponseEntity getTarget(final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); // to single response include poll status - final TargetRest response = TargetMapper.toResponse(findTarget); - TargetMapper.addPollStatus(findTarget, response); - TargetMapper.addTargetLinks(response); + final MgmtTarget response = MgmtTargetMapper.toResponse(findTarget); + MgmtTargetMapper.addPollStatus(findTarget, response); + MgmtTargetMapper.addTargetLinks(response); return new ResponseEntity<>(response, HttpStatus.OK); } @Override - public ResponseEntity> getTargets(final int pagingOffsetParam, final int pagingLimitParam, + public ResponseEntity> getTargets(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -95,20 +97,21 @@ public class TargetResource implements TargetRestApi { countTargetsAll = this.targetManagement.countTargetsAll(); } - final List rest = TargetMapper.toResponse(findTargetsAll.getContent()); - return new ResponseEntity<>(new PagedList(rest, countTargetsAll), HttpStatus.OK); + final List rest = MgmtTargetMapper.toResponse(findTargetsAll.getContent()); + return new ResponseEntity<>(new PagedList(rest, countTargetsAll), HttpStatus.OK); } @Override - public ResponseEntity> createTargets(final List targets) { + public ResponseEntity> createTargets(final List targets) { LOG.debug("creating {} targets", targets.size()); - final Iterable createdTargets = this.targetManagement.createTargets(TargetMapper.fromRequest(targets)); + final Iterable createdTargets = this.targetManagement + .createTargets(MgmtTargetMapper.fromRequest(targets)); LOG.debug("{} targets created, return status {}", targets.size(), HttpStatus.CREATED); - return new ResponseEntity<>(TargetMapper.toResponse(createdTargets), HttpStatus.CREATED); + return new ResponseEntity<>(MgmtTargetMapper.toResponse(createdTargets), HttpStatus.CREATED); } @Override - public ResponseEntity updateTarget(final String targetId, final TargetRequestBody targetRest) { + public ResponseEntity updateTarget(final String targetId, final MgmtTargetRequestBody targetRest) { final Target existingTarget = findTargetWithExceptionIfNotFound(targetId); LOG.debug("updating target {}", existingTarget.getId()); if (targetRest.getDescription() != null) { @@ -119,7 +122,7 @@ public class TargetResource implements TargetRestApi { } final Target updateTarget = this.targetManagement.updateTarget(existingTarget); - return new ResponseEntity<>(TargetMapper.toResponse(updateTarget), HttpStatus.OK); + return new ResponseEntity<>(MgmtTargetMapper.toResponse(updateTarget), HttpStatus.OK); } @Override @@ -131,21 +134,21 @@ public class TargetResource implements TargetRestApi { } @Override - public ResponseEntity getAttributes(final String targetId) { + public ResponseEntity getAttributes(final String targetId) { final Target foundTarget = findTargetWithExceptionIfNotFound(targetId); final Map controllerAttributes = foundTarget.getTargetInfo().getControllerAttributes(); if (controllerAttributes.isEmpty()) { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } - final TargetAttributes result = new TargetAttributes(); + final MgmtTargetAttributes result = new MgmtTargetAttributes(); result.putAll(controllerAttributes); return new ResponseEntity<>(result, HttpStatus.OK); } @Override - public ResponseEntity> getActionHistory(final String targetId, final int pagingOffsetParam, + public ResponseEntity> getActionHistory(final String targetId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final Target foundTarget = findTargetWithExceptionIfNotFound(targetId); @@ -167,12 +170,12 @@ public class TargetResource implements TargetRestApi { } return new ResponseEntity<>( - new PagedList<>(TargetMapper.toResponse(targetId, activeActions.getContent()), totalActionCount), + new PagedList<>(MgmtTargetMapper.toResponse(targetId, activeActions.getContent()), totalActionCount), HttpStatus.OK); } @Override - public ResponseEntity getAction(final String targetId, final Long actionId) { + public ResponseEntity getAction(final String targetId, final Long actionId) { final Target target = findTargetWithExceptionIfNotFound(targetId); final Action action = findActionWithExceptionIfNotFound(actionId); @@ -181,21 +184,21 @@ public class TargetResource implements TargetRestApi { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - final ActionRest result = TargetMapper.toResponse(targetId, action, action.isActive()); + final MgmtAction result = MgmtTargetMapper.toResponse(targetId, action, action.isActive()); if (!action.isCancelingOrCanceled()) { result.add(linkTo( - methodOn(DistributionSetRestApi.class).getDistributionSet(action.getDistributionSet().getId())) + methodOn(MgmtDistributionSetRestApi.class).getDistributionSet(action.getDistributionSet().getId())) .withRel("distributionset")); } else if (action.isCancelingOrCanceled()) { - result.add(linkTo(methodOn(TargetRestApi.class).getAction(targetId, action.getId())) - .withRel(RestConstants.TARGET_V1_CANCELED_ACTION)); + result.add(linkTo(methodOn(MgmtTargetRestApi.class).getAction(targetId, action.getId())) + .withRel(MgmtRestConstants.TARGET_V1_CANCELED_ACTION)); } - result.add(linkTo(methodOn(TargetRestApi.class).getActionStatusList(targetId, action.getId(), 0, - RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, + result.add(linkTo(methodOn(MgmtTargetRestApi.class).getActionStatusList(targetId, action.getId(), 0, + MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, ActionStatusFields.ID.getFieldName() + ":" + SortDirection.DESC)) - .withRel(RestConstants.TARGET_V1_ACTION_STATUS)); + .withRel(MgmtRestConstants.TARGET_V1_ACTION_STATUS)); return new ResponseEntity<>(result, HttpStatus.OK); } @@ -212,13 +215,13 @@ public class TargetResource implements TargetRestApi { this.deploymentManagement.cancelAction(action, target); } // both functions will throw an exception, when action is in wrong - // state, which is mapped by ResponseExceptionHandler. + // state, which is mapped by MgmtResponseExceptionHandler. return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Override - public ResponseEntity> getActionStatusList(final String targetId, final Long actionId, + public ResponseEntity> getActionStatusList(final String targetId, final Long actionId, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) { final Target target = findTargetWithExceptionIfNotFound(targetId); @@ -236,15 +239,17 @@ public class TargetResource implements TargetRestApi { final Page statusList = this.deploymentManagement.findActionStatusByAction( new OffsetBasedPageRequest(sanitizedOffsetParam, sanitizedLimitParam, sorting), action, true); - return new ResponseEntity<>(new PagedList<>(TargetMapper.toActionStatusRestResponse(statusList.getContent()), - statusList.getTotalElements()), HttpStatus.OK); + return new ResponseEntity<>( + new PagedList<>(MgmtTargetMapper.toActionStatusRestResponse(statusList.getContent()), + statusList.getTotalElements()), + HttpStatus.OK); } @Override - public ResponseEntity getAssignedDistributionSet(final String targetId) { + public ResponseEntity getAssignedDistributionSet(final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); - final DistributionSetRest distributionSetRest = DistributionSetMapper + final MgmtDistributionSet distributionSetRest = MgmtDistributionSetMapper .toResponse(findTarget.getAssignedDistributionSet()); final HttpStatus retStatus; if (distributionSetRest == null) { @@ -257,11 +262,11 @@ public class TargetResource implements TargetRestApi { @Override public ResponseEntity postAssignedDistributionSet(final String targetId, - final DistributionSetAssigmentRest dsId) { + final MgmtDistributionSetAssigment dsId) { findTargetWithExceptionIfNotFound(targetId); - final ActionType type = (dsId.getType() != null) - ? RestResourceConversionHelper.convertActionType(dsId.getType()) : ActionType.FORCED; + final ActionType type = (dsId.getType() != null) ? MgmtRestModelMapper.convertActionType(dsId.getType()) + : ActionType.FORCED; final Iterator changed = this.deploymentManagement .assignDistributionSet(dsId.getId(), type, dsId.getForcetime(), targetId).getAssignedEntity() .iterator(); @@ -276,9 +281,9 @@ public class TargetResource implements TargetRestApi { } @Override - public ResponseEntity getInstalledDistributionSet(final String targetId) { + public ResponseEntity getInstalledDistributionSet(final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); - final DistributionSetRest distributionSetRest = DistributionSetMapper + final MgmtDistributionSet distributionSetRest = MgmtDistributionSetMapper .toResponse(findTarget.getTargetInfo().getInstalledDistributionSet()); final HttpStatus retStatus; if (distributionSetRest == null) { diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetTagResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java similarity index 69% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetTagResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java index 1a9155828..d98518208 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/TargetTagResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java @@ -6,11 +6,19 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.List; import java.util.stream.Collectors; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtAssignedTargetRequestBody; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; +import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTargetTagAssigmentResult; +import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi; +import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.TagFields; import org.eclipse.hawkbit.repository.TagManagement; import org.eclipse.hawkbit.repository.TargetManagement; @@ -19,13 +27,6 @@ import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetTag; import org.eclipse.hawkbit.repository.model.TargetTagAssignmentResult; import org.eclipse.hawkbit.repository.rsql.RSQLUtility; -import org.eclipse.hawkbit.rest.resource.api.TargetTagRestApi; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.tag.AssignedTargetRequestBody; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRequestBodyPut; -import org.eclipse.hawkbit.rest.resource.model.tag.TagRest; -import org.eclipse.hawkbit.rest.resource.model.tag.TargetTagAssigmentResultRest; -import org.eclipse.hawkbit.rest.resource.model.target.TargetRest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -43,8 +44,8 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class TargetTagResource implements TargetTagRestApi { - private static final Logger LOG = LoggerFactory.getLogger(TargetTagResource.class); +public class MgmtTargetTagResource implements MgmtTargetTagRestApi { + private static final Logger LOG = LoggerFactory.getLogger(MgmtTargetTagResource.class); @Autowired private TagManagement tagManagement; @@ -53,7 +54,7 @@ public class TargetTagResource implements TargetTagRestApi { private TargetManagement targetManagement; @Override - public ResponseEntity> getTargetTags(final int pagingOffsetParam, final int pagingLimitParam, + public ResponseEntity> getTargetTags(final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -75,35 +76,35 @@ public class TargetTagResource implements TargetTagRestApi { } - final List rest = TagMapper.toResponse(findTargetsAll.getContent()); + final List rest = MgmtTagMapper.toResponse(findTargetsAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countTargetsAll), HttpStatus.OK); } @Override - public ResponseEntity getTargetTag(final Long targetTagId) { + public ResponseEntity getTargetTag(final Long targetTagId) { final TargetTag tag = findTargetTagById(targetTagId); - return new ResponseEntity<>(TagMapper.toResponse(tag), HttpStatus.OK); + return new ResponseEntity<>(MgmtTagMapper.toResponse(tag), HttpStatus.OK); } @Override - public ResponseEntity> createTargetTags(@RequestBody final List tags) { + public ResponseEntity> createTargetTags(@RequestBody final List tags) { LOG.debug("creating {} target tags", tags.size()); final List createdTargetTags = this.tagManagement - .createTargetTags(TagMapper.mapTargeTagFromRequest(tags)); - return new ResponseEntity<>(TagMapper.toResponse(createdTargetTags), HttpStatus.CREATED); + .createTargetTags(MgmtTagMapper.mapTargeTagFromRequest(tags)); + return new ResponseEntity<>(MgmtTagMapper.toResponse(createdTargetTags), HttpStatus.CREATED); } @Override - public ResponseEntity updateTagretTag(final Long targetTagId, final TagRequestBodyPut restTargetTagRest) { + public ResponseEntity updateTagretTag(final Long targetTagId, final MgmtTagRequestBodyPut restTargetTagRest) { LOG.debug("update {} target tag", restTargetTagRest); final TargetTag targetTag = findTargetTagById(targetTagId); - TagMapper.updateTag(restTargetTagRest, targetTag); + MgmtTagMapper.updateTag(restTargetTagRest, targetTag); final TargetTag updateTargetTag = this.tagManagement.updateTargetTag(targetTag); LOG.debug("target tag updated"); - return new ResponseEntity<>(TagMapper.toResponse(updateTargetTag), HttpStatus.OK); + return new ResponseEntity<>(MgmtTagMapper.toResponse(updateTargetTag), HttpStatus.OK); } @Override @@ -117,35 +118,35 @@ public class TargetTagResource implements TargetTagRestApi { } @Override - public ResponseEntity> getAssignedTargets(final Long targetTagId) { + public ResponseEntity> getAssignedTargets(final Long targetTagId) { final TargetTag targetTag = findTargetTagById(targetTagId); - return new ResponseEntity<>(TargetMapper.toResponseWithLinksAndPollStatus(targetTag.getAssignedToTargets()), + return new ResponseEntity<>(MgmtTargetMapper.toResponseWithLinksAndPollStatus(targetTag.getAssignedToTargets()), HttpStatus.OK); } @Override - public ResponseEntity toggleTagAssignment(final Long targetTagId, - final List assignedTargetRequestBodies) { + public ResponseEntity toggleTagAssignment(final Long targetTagId, + final List assignedTargetRequestBodies) { LOG.debug("Toggle Target assignment {} for target tag {}", assignedTargetRequestBodies.size(), targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); final TargetTagAssignmentResult assigmentResult = this.targetManagement .toggleTagAssignment(findTargetControllerIds(assignedTargetRequestBodies), targetTag.getName()); - final TargetTagAssigmentResultRest tagAssigmentResultRest = new TargetTagAssigmentResultRest(); - tagAssigmentResultRest.setAssignedTargets(TargetMapper.toResponse(assigmentResult.getAssignedEntity())); - tagAssigmentResultRest.setUnassignedTargets(TargetMapper.toResponse(assigmentResult.getUnassignedEntity())); + final MgmtTargetTagAssigmentResult tagAssigmentResultRest = new MgmtTargetTagAssigmentResult(); + tagAssigmentResultRest.setAssignedTargets(MgmtTargetMapper.toResponse(assigmentResult.getAssignedEntity())); + tagAssigmentResultRest.setUnassignedTargets(MgmtTargetMapper.toResponse(assigmentResult.getUnassignedEntity())); return new ResponseEntity<>(tagAssigmentResultRest, HttpStatus.OK); } @Override - public ResponseEntity> assignTargets(final Long targetTagId, - final List assignedTargetRequestBodies) { + public ResponseEntity> assignTargets(final Long targetTagId, + final List assignedTargetRequestBodies) { LOG.debug("Assign Targets {} for target tag {}", assignedTargetRequestBodies.size(), targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); final List assignedTarget = this.targetManagement .assignTag(findTargetControllerIds(assignedTargetRequestBodies), targetTag); - return new ResponseEntity<>(TargetMapper.toResponseWithLinksAndPollStatus(assignedTarget), HttpStatus.OK); + return new ResponseEntity<>(MgmtTargetMapper.toResponseWithLinksAndPollStatus(assignedTarget), HttpStatus.OK); } @Override @@ -176,7 +177,7 @@ public class TargetTagResource implements TargetTagRestApi { return tag; } - private List findTargetControllerIds(final List assignedTargetRequestBodies) { + private List findTargetControllerIds(final List assignedTargetRequestBodies) { return assignedTargetRequestBodies.stream().map(request -> request.getControllerId()) .collect(Collectors.toList()); } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/PagingUtility.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/PagingUtility.java similarity index 91% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/PagingUtility.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/PagingUtility.java index ac45796e5..abd9e9ec4 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/PagingUtility.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/PagingUtility.java @@ -6,8 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.ActionFields; import org.eclipse.hawkbit.repository.ActionStatusFields; import org.eclipse.hawkbit.repository.DistributionSetFields; @@ -19,6 +20,7 @@ import org.eclipse.hawkbit.repository.SoftwareModuleFields; import org.eclipse.hawkbit.repository.SoftwareModuleMetadataFields; import org.eclipse.hawkbit.repository.SoftwareModuleTypeFields; import org.eclipse.hawkbit.repository.TargetFields; +import org.eclipse.hawkbit.rest.util.SortUtility; import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; @@ -35,16 +37,16 @@ public final class PagingUtility { static int sanitizeOffsetParam(final int offset) { if (offset < 0) { - return Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET); + return Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET); } return offset; } static int sanitizePageLimitParam(final int pageLimit) { if (pageLimit < 1) { - return Integer.parseInt(RestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT); - } else if (pageLimit > RestConstants.REQUEST_PARAMETER_PAGING_MAX_LIMIT) { - return RestConstants.REQUEST_PARAMETER_PAGING_MAX_LIMIT; + return Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT); + } else if (pageLimit > MgmtRestConstants.REQUEST_PARAMETER_PAGING_MAX_LIMIT) { + return MgmtRestConstants.REQUEST_PARAMETER_PAGING_MAX_LIMIT; } return pageLimit; } diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java new file mode 100644 index 000000000..5a9f2785a --- /dev/null +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java @@ -0,0 +1,466 @@ +/** + * 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.mgmt.rest.resource; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.RandomStringUtils; +import org.eclipse.hawkbit.repository.model.DistributionSet; +import org.eclipse.hawkbit.repository.model.DistributionSetType; +import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupConditions; +import org.eclipse.hawkbit.repository.model.SoftwareModule; +import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.repository.model.Target; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +/** + * Builder class for building certain json strings. + * + * + * + */ +public abstract class JsonBuilder { + + public static String softwareModules(final List modules) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final SoftwareModule module : modules) { + try { + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("type", module.getType().getKey()) + .put("id", Long.MAX_VALUE).put("vendor", module.getVendor()) + .put("version", module.getVersion()).put("createdAt", "0").put("updatedAt", "0") + .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh").toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < modules.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + public static String softwareModulesCreatableFieldsOnly(final List modules) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final SoftwareModule module : modules) { + try { + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("type", module.getType().getKey()) + .put("vendor", module.getVendor()).put("version", module.getVersion()).toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < modules.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + public static String softwareModuleUpdatableFieldsOnly(final SoftwareModule module) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append(new JSONObject().put("description", module.getDescription()).put("vendor", module.getVendor()) + .toString()); + + return builder.toString(); + + } + + public static String softwareModuleTypes(final List types) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final SoftwareModuleType module : types) { + try { + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("id", Long.MAX_VALUE) + .put("key", module.getKey()).put("maxAssignments", module.getMaxAssignments()) + .put("createdAt", "0").put("updatedAt", "0").put("createdBy", "fghdfkjghdfkjh") + .put("updatedBy", "fghdfkjghdfkjh").toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < types.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + public static String softwareModuleTypesCreatableFieldsOnly(final List types) + throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final SoftwareModuleType module : types) { + try { + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("key", module.getKey()) + .put("maxAssignments", module.getMaxAssignments()).toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < types.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + /** + * builds a json string for the feedback for the execution "proceeding". + * + * @param id + * of the Action feedback refers to + * @return the built string + * @throws JSONException + */ + public static String deploymentActionInProgressFeedback(final String id) throws JSONException { + return deploymentActionFeedback(id, "proceeding"); + } + + /** + * builds a certain json string for a action feedback. + * + * @param id + * of the action the feedback refers to + * @param execution + * see ExecutionStatus + * @return the build json string + * @throws JSONException + */ + public static String deploymentActionFeedback(final String id, final String execution) throws JSONException { + return deploymentActionFeedback(id, execution, "none", RandomStringUtils.randomAscii(1000)); + + } + + public static String deploymentActionFeedback(final String id, final String execution, final String message) + throws JSONException { + return deploymentActionFeedback(id, execution, "none", message); + + } + + public static String deploymentActionFeedback(final String id, final String execution, final String finished, + final String message) throws JSONException { + final List messages = new ArrayList(); + messages.add(message); + + return new JSONObject() + .put("id", id) + .put("time", "20140511T121314") + .put("status", + new JSONObject() + .put("execution", execution) + .put("result", + new JSONObject().put("finished", finished).put("progress", + new JSONObject().put("cnt", 2).put("of", 5))).put("details", messages)) + .toString(); + + } + + /** + * @param types + * @return + */ + public static String distributionSetTypes(final List types) { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final DistributionSetType module : types) { + + try { + + final JSONArray osmTypes = new JSONArray(); + module.getOptionalModuleTypes().forEach(smt -> osmTypes.put(new JSONObject().put("id", smt.getId()))); + + final JSONArray msmTypes = new JSONArray(); + module.getMandatoryModuleTypes().forEach(smt -> msmTypes.put(new JSONObject().put("id", smt.getId()))); + + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("id", Long.MAX_VALUE) + .put("key", module.getKey()).put("createdAt", "0").put("updatedAt", "0") + .put("createdBy", "fghdfkjghdfkjh").put("optionalmodules", osmTypes) + .put("mandatorymodules", msmTypes).put("updatedBy", "fghdfkjghdfkjh").toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < types.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + } + + public static String distributionSetTypesCreateValidFieldsOnly(final List types) { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final DistributionSetType module : types) { + + try { + + final JSONArray osmTypes = new JSONArray(); + module.getOptionalModuleTypes().forEach(smt -> osmTypes.put(new JSONObject().put("id", smt.getId()))); + + final JSONArray msmTypes = new JSONArray(); + module.getMandatoryModuleTypes().forEach(smt -> msmTypes.put(new JSONObject().put("id", smt.getId()))); + + builder.append(new JSONObject().put("name", module.getName()) + .put("description", module.getDescription()).put("key", module.getKey()) + .put("optionalmodules", osmTypes).put("mandatorymodules", msmTypes).toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < types.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + } + + public static String distributionSets(final List sets) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final DistributionSet set : sets) { + try { + builder.append(distributionSet(set)); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < sets.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + public static String distributionSetsCreateValidFieldsOnly(final List sets) throws JSONException { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final DistributionSet set : sets) { + try { + builder.append(distributionSetCreateValidFieldsOnly(set)); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < sets.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + + } + + public static String distributionSetCreateValidFieldsOnly(final DistributionSet set) throws JSONException { + + final List modules = set.getModules().stream().map(module -> { + try { + return new JSONObject().put("id", module.getId()); + } catch (final Exception e) { + e.printStackTrace(); + } + + return null; + }).collect(Collectors.toList()); + + return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) + .put("type", set.getType() == null ? null : set.getType().getKey()).put("version", set.getVersion()) + .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", modules).toString(); + + } + + public static String distributionSetUpdateValidFieldsOnly(final DistributionSet set) throws JSONException { + + final List modules = set.getModules().stream().map(module -> { + try { + return new JSONObject().put("id", module.getId()); + } catch (final Exception e) { + e.printStackTrace(); + } + + return null; + }).collect(Collectors.toList()); + + return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) + .put("version", set.getVersion()).toString(); + + } + + public static String distributionSet(final DistributionSet set) throws JSONException { + + final List modules = set.getModules().stream().map(module -> { + try { + return new JSONObject().put("id", module.getId()); + } catch (final Exception e) { + e.printStackTrace(); + } + + return null; + }).collect(Collectors.toList()); + + return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) + .put("type", set.getType() == null ? null : set.getType().getKey()).put("id", Long.MAX_VALUE) + .put("version", set.getVersion()).put("createdAt", "0").put("updatedAt", "0") + .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh") + .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", modules).toString(); + + } + + /** + * @param targets + * @return + */ + public static String targets(final List targets) { + final StringBuilder builder = new StringBuilder(); + + builder.append("["); + int i = 0; + for (final Target target : targets) { + try { + builder.append(new JSONObject().put("controllerId", target.getControllerId()) + .put("description", target.getDescription()).put("name", target.getName()) + .put("createdAt", "0").put("updatedAt", "0").put("createdBy", "fghdfkjghdfkjh") + .put("updatedBy", "fghdfkjghdfkjh").toString()); + } catch (final Exception e) { + e.printStackTrace(); + } + + if (++i < targets.size()) { + builder.append(","); + } + } + + builder.append("]"); + + return builder.toString(); + } + + public static String rollout(final String name, final String description, final int groupSize, + final long distributionSetId, final String targetFilterQuery, final RolloutGroupConditions conditions) { + final JSONObject json = new JSONObject(); + json.put("name", name); + json.put("description", description); + json.put("amountGroups", groupSize); + json.put("distributionSetId", distributionSetId); + json.put("targetFilterQuery", targetFilterQuery); + + if (conditions != null) { + final JSONObject successCondition = new JSONObject(); + json.put("successCondition", successCondition); + successCondition.put("condition", conditions.getSuccessCondition().toString()); + successCondition.put("expression", conditions.getSuccessConditionExp().toString()); + + final JSONObject successAction = new JSONObject(); + json.put("successAction", successAction); + successAction.put("action", conditions.getSuccessAction().toString()); + successAction.put("expression", conditions.getSuccessActionExp().toString()); + + final JSONObject errorCondition = new JSONObject(); + json.put("errorCondition", errorCondition); + errorCondition.put("condition", conditions.getErrorCondition().toString()); + errorCondition.put("expression", conditions.getErrorConditionExp().toString()); + + final JSONObject errorAction = new JSONObject(); + json.put("errorAction", errorAction); + errorAction.put("action", conditions.getErrorAction().toString()); + errorAction.put("expression", conditions.getErrorActionExp().toString()); + } + + return json.toString(); + } + + public static String cancelActionFeedback(final String id, final String execution) throws JSONException { + return cancelActionFeedback(id, execution, RandomStringUtils.randomAscii(1000)); + + } + + public static String cancelActionFeedback(final String id, final String execution, final String message) + throws JSONException { + final List messages = new ArrayList(); + messages.add(message); + return new JSONObject() + .put("id", id) + .put("time", "20140511T121314") + .put("status", + new JSONObject().put("execution", execution) + .put("result", new JSONObject().put("finished", "success")).put("details", messages)) + .toString(); + + } + + public static String configData(final String id, final Map attributes, final String execution) + throws JSONException { + return new JSONObject() + .put("id", id) + .put("time", "20140511T121314") + .put("status", + new JSONObject().put("execution", execution) + .put("result", new JSONObject().put("finished", "success")) + .put("details", new ArrayList())).put("data", attributes).toString(); + + } + +} diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java similarity index 92% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java index 6254da992..b7839f7f6 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -27,9 +27,9 @@ import java.util.List; import java.util.Set; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.ActionRepository; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.DistributionSetManagement; @@ -60,7 +60,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @Features("Component Tests - Management API") @Stories("Distribution Set Resource") -public class DistributionSetResourceTest extends AbstractIntegrationTest { +public class MgmtDistributionSetResourceTest extends AbstractIntegrationTest { @Test @Description("This test verifies the call of all Software Modules that are assiged to a Distribution Set through the RESTful API.") @@ -68,7 +68,7 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { // Create DistributionSet with three software modules final DistributionSet set = TestDataUtil.generateDistributionSet("SMTest", softwareManagement, distributionSetManagement); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.size", equalTo(set.getModules().size()))); } @@ -89,7 +89,7 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { smList.put(new JSONObject().put("id", Long.valueOf(smID))); } // post assignment - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") + mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") .contentType(MediaType.APPLICATION_JSON).content(smList.toString())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); @@ -101,18 +101,19 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { list.put(new JSONObject().put("id", Long.valueOf(targetId))); } deploymentManagement.assignDistributionSet(disSet.getId(), knownTargetIds[0]); - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedTargets") - .contentType(MediaType.APPLICATION_JSON).content(list.toString())).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()).andExpect(jsonPath("$.assigned", equalTo(knownTargetIds.length - 1))) + mvc.perform( + post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedTargets") + .contentType(MediaType.APPLICATION_JSON).content(list.toString())) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("$.assigned", equalTo(knownTargetIds.length - 1))) .andExpect(jsonPath("$.alreadyAssigned", equalTo(1))) .andExpect(jsonPath("$.total", equalTo(knownTargetIds.length))); // try to delete the Software Module from DistSet that has been assigned // to the target. - mvc.perform(delete( - RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM/" + smIDs.get(0)) - .contentType(MediaType.APPLICATION_JSON)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isLocked()) + mvc.perform(delete(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM/" + + smIDs.get(0)).contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) + .andExpect(status().isLocked()) .andExpect(jsonPath("$.errorCode", equalTo("hawkbit.server.error.entitiylocked"))); } @@ -132,7 +133,7 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { smList.put(new JSONObject().put("id", Long.valueOf(smID))); } // post assignment - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") + mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") .contentType(MediaType.APPLICATION_JSON).content(smList.toString())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); @@ -145,9 +146,11 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { } // assign DisSet to target and test assignment deploymentManagement.assignDistributionSet(disSet.getId(), knownTargetIds[0]); - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedTargets") - .contentType(MediaType.APPLICATION_JSON).content(list.toString())).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()).andExpect(jsonPath("$.assigned", equalTo(knownTargetIds.length - 1))) + mvc.perform( + post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedTargets") + .contentType(MediaType.APPLICATION_JSON).content(list.toString())) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("$.assigned", equalTo(knownTargetIds.length - 1))) .andExpect(jsonPath("$.alreadyAssigned", equalTo(1))) .andExpect(jsonPath("$.total", equalTo(knownTargetIds.length))); @@ -161,7 +164,7 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { smList2.put(new JSONObject().put("id", Long.valueOf(smID))); } - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") + mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") .contentType(MediaType.APPLICATION_JSON).content(smList2.toString())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isLocked()) .andExpect(jsonPath("$.errorCode", equalTo("hawkbit.server.error.entitiylocked"))); @@ -175,7 +178,7 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { final DistributionSet disSet = TestDataUtil.generateDistributionSetWithNoSoftwareModules("Jupiter", "398,88", distributionSetManagement); // Test if size is 0 - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM")) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.size", equalTo(disSet.getModules().size()))); // create Software Modules @@ -194,11 +197,11 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { list.put(new JSONObject().put("id", Long.valueOf(smID))); } // post assignment - mvc.perform(post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") + mvc.perform(post(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM") .contentType(MediaType.APPLICATION_JSON).content(list.toString())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); // Test if size is 3 - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM")) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + disSet.getId() + "/assignedSM")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.size", equalTo(smIDs.size()))); } @@ -211,16 +214,16 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { final DistributionSet set = TestDataUtil.generateDistributionSet("Venus", softwareManagement, distributionSetManagement); int amountOfSM = set.getModules().size(); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.size", equalTo(amountOfSM))); // test the removal of all software modules one by one for (final Iterator iter = set.getModules().iterator(); iter.hasNext();) { final Long smId = iter.next().getId(); mvc.perform(delete( - RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM/" + smId)) + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM/" + smId)) .andExpect(status().isOk()); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + set.getId() + "/assignedSM")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.size", equalTo(--amountOfSM))); } @@ -242,8 +245,8 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { // assign already one target to DS deploymentManagement.assignDistributionSet(createdDs.getId(), knownTargetIds[0]); - mvc.perform( - post(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets") + mvc.perform(post( + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets") .contentType(MediaType.APPLICATION_JSON).content(list.toString())) .andExpect(status().isOk()).andExpect(jsonPath("$.assigned", equalTo(knownTargetIds.length - 1))) .andExpect(jsonPath("$.alreadyAssigned", equalTo(1))) @@ -263,8 +266,8 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { targetManagement.createTarget(new Target(knownTargetId)); deploymentManagement.assignDistributionSet(createdDs.getId(), knownTargetId); - mvc.perform( - get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets")) + mvc.perform(get( + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets")) .andExpect(status().isOk()).andExpect(jsonPath("$.size", equalTo(1))) .andExpect(jsonPath("$.content[0].controllerId", equalTo(knownTargetId))); } @@ -274,8 +277,8 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { public void getAssignedTargetsOfDistributionSetIsEmpty() throws Exception { final Set createDistributionSetsAlphabetical = createDistributionSetsAlphabetical(1); final DistributionSet createdDs = createDistributionSetsAlphabetical.iterator().next(); - mvc.perform( - get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets")) + mvc.perform(get( + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets")) .andExpect(status().isOk()).andExpect(jsonPath("$.size", equalTo(0))) .andExpect(jsonPath("$.total", equalTo(0))); } @@ -297,8 +300,8 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { sendUpdateActionStatusToTargets(controllerManagament, targetManagement, actionRepository, createdDs, Lists.newArrayList(createTarget), Status.FINISHED, "some message"); - mvc.perform( - get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/installedTargets")) + mvc.perform(get( + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/installedTargets")) .andExpect(status().isOk()).andExpect(jsonPath("$.size", equalTo(1))) .andExpect(jsonPath("$.content[0].controllerId", equalTo(knownTargetId))); } @@ -308,11 +311,11 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { public void getDistributionSetsWithoutAddtionalRequestParameters() throws Exception { final int sets = 5; createDistributionSetsAlphabetical(sets); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(sets))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(sets))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(sets))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(sets))); } @Test @@ -321,12 +324,12 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { final int sets = 5; final int limitSize = 1; createDistributionSetsAlphabetical(sets); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } @Test @@ -336,13 +339,13 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { final int offsetParam = 2; final int expectedSize = sets - offsetParam; createDistributionSetsAlphabetical(sets); - mvc.perform(get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(sets))) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(sets))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(sets))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } @Test @@ -825,9 +828,9 @@ public class DistributionSetResourceTest extends AbstractIntegrationTest { final String rsqlFindTargetId1 = "controllerId==1"; - mvc.perform( - get(RestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/assignedTargets?q=" - + rsqlFindTargetId1).contentType(MediaType.APPLICATION_JSON).content(list.toString())) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + + "/assignedTargets?q=" + rsqlFindTargetId1).contentType(MediaType.APPLICATION_JSON) + .content(list.toString())) .andExpect(status().isOk()).andExpect(jsonPath("total", equalTo(1))) .andExpect(jsonPath("size", equalTo(1))).andExpect(jsonPath("content[0].controllerId", equalTo("1"))); } diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java similarity index 94% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java index 9f3d2a89d..b2f309995 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DistributionSetTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.WithUser; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModule; @@ -44,12 +44,12 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Test for {@link DistributionSetTypeResource}. + * Test for {@link MgmtDistributionSetTypeResource}. * */ @Features("Component Tests - Management API") @Stories("Distribution Set Type Resource") -public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { +public class MgmtDistributionSetTypeResourceTest extends AbstractIntegrationTest { @Test @WithUser(principal = "uploadTester", allSpPermissions = true) @@ -101,7 +101,7 @@ public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { // descending mvc.perform(get("/rest/v1/distributionsettypes").accept(MediaType.APPLICATION_JSON) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "KEY:DESC")).andDo(MockMvcResultPrinter.print()) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "KEY:DESC")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content.[0].id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$content.[0].name", equalTo("TestName123"))) @@ -114,7 +114,7 @@ public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { // ascending mvc.perform(get("/rest/v1/distributionsettypes").accept(MediaType.APPLICATION_JSON) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "KEY:ASC")).andDo(MockMvcResultPrinter.print()) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "KEY:ASC")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content.[3].id", equalTo(testType.getId().intValue()))) .andExpect(jsonPath("$content.[3].name", equalTo("TestName123"))) @@ -439,11 +439,11 @@ public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { @Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.") public void getDistributionSetTypesWithoutAddtionalRequestParameters() throws Exception { final int types = 3; - mvc.perform(get(RestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); } @Test @@ -451,12 +451,12 @@ public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { public void getDistributionSetTypesWithPagingLimitRequestParameter() throws Exception { final int types = 3; final int limitSize = 1; - mvc.perform(get(RestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } @Test @@ -465,13 +465,13 @@ public class DistributionSetTypeResourceTest extends AbstractIntegrationTest { final int types = 3; final int offsetParam = 2; final int expectedSize = types - offsetParam; - mvc.perform(get(RestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(types))) + mvc.perform(get(MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(types))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } @Test diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DownloadResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java similarity index 84% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DownloadResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java index ee0fa52fe..2311b098c 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/DownloadResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java @@ -6,17 +6,17 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.cache.CacheConstants; import org.eclipse.hawkbit.cache.DownloadArtifactCache; import org.eclipse.hawkbit.cache.DownloadType; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; @@ -32,7 +32,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @Features("Component Tests - Management API") @Stories("Download Resource") -public class DownloadResourceTest extends AbstractIntegrationTestWithMongoDB { +public class MgmtDownloadResourceTest extends AbstractIntegrationTestWithMongoDB { @Autowired @Qualifier(CacheConstants.DOWNLOAD_ID_CACHE) @@ -58,7 +58,7 @@ public class DownloadResourceTest extends AbstractIntegrationTestWithMongoDB { @Description("This test verifies the call of download artifact without a valid download id fails.") public void testNoDownloadIdAvailable() throws Exception { mvc.perform( - get(RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, + get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdNotAvailable)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); @@ -68,13 +68,13 @@ public class DownloadResourceTest extends AbstractIntegrationTestWithMongoDB { @Description("This test verifies the call of download artifact works and the download id will be removed.") public void testDownload() throws Exception { mvc.perform( - get(RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, + get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdSha1)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); // because cache is empty mvc.perform( - get(RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + RestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, + get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdSha1)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java similarity index 96% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java index f27eb5186..f33ceb942 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/RolloutResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.Matchers.equalTo; @@ -22,9 +22,10 @@ import java.util.List; import java.util.concurrent.Callable; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; +import org.eclipse.hawkbit.mgmt.rest.resource.MgmtRolloutResource; import org.eclipse.hawkbit.repository.RolloutGroupManagement; import org.eclipse.hawkbit.repository.RolloutManagement; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -45,11 +46,11 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Tests for covering the {@link RolloutResource}. + * Tests for covering the {@link MgmtRolloutResource}. */ @Features("Component Tests - Management API") @Stories("Rollout Resource") -public class RolloutResourceTest extends AbstractIntegrationTest { +public class MgmtRolloutResourceTest extends AbstractIntegrationTest { @Autowired private RolloutManagement rolloutManagement; @@ -449,7 +450,7 @@ public class RolloutResourceTest extends AbstractIntegrationTest { // starting rollout mvc.perform(post("/rest/v1/rollouts/{rolloutId}/start", rollout.getId()) - .param(RestConstants.REQUEST_PARAMETER_ASYNC, "true")).andDo(MockMvcResultPrinter.print()) + .param(MgmtRestConstants.REQUEST_PARAMETER_ASYNC, "true")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); // check if running @@ -477,18 +478,18 @@ public class RolloutResourceTest extends AbstractIntegrationTest { createRollout("rollout3", 5, dsA.getId(), "controllerId==rollout3*"); createRollout("other1", 5, dsA.getId(), "controllerId==other1*"); - mvc.perform(get("/rest/v1/rollouts").param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==*2")) + mvc.perform(get("/rest/v1/rollouts").param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==*2")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(1))).andExpect(jsonPath("$total", equalTo(1))) .andExpect(jsonPath("$content[0].name", equalTo(rollout2.getName()))); - mvc.perform(get("/rest/v1/rollouts").param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==rollout*")) + mvc.perform(get("/rest/v1/rollouts").param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==rollout*")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(3))).andExpect(jsonPath("$total", equalTo(3))); - mvc.perform(get("/rest/v1/rollouts").param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==*1")) + mvc.perform(get("/rest/v1/rollouts").param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==*1")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(2))).andExpect(jsonPath("$total", equalTo(2))); @@ -509,18 +510,18 @@ public class RolloutResourceTest extends AbstractIntegrationTest { // retrieve rollout groups from created rollout mvc.perform(get("/rest/v1/rollouts/{rolloutId}/deploygroups", rollout.getId()) - .param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==group-1")).andDo(MockMvcResultPrinter.print()) + .param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==group-1")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(1))).andExpect(jsonPath("$total", equalTo(1))) .andExpect(jsonPath("$content[0].name", equalTo("group-1"))); mvc.perform(get("/rest/v1/rollouts/{rolloutId}/deploygroups", rollout.getId()) - .param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==group*")).andDo(MockMvcResultPrinter.print()) + .param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==group*")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(4))).andExpect(jsonPath("$total", equalTo(4))); mvc.perform(get("/rest/v1/rollouts/{rolloutId}/deploygroups", rollout.getId()) - .param(RestConstants.REQUEST_PARAMETER_SEARCH, "name==group-1,name==group-2")) + .param(MgmtRestConstants.REQUEST_PARAMETER_SEARCH, "name==group-1,name==group-2")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content", hasSize(2))).andExpect(jsonPath("$total", equalTo(2))); diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java similarity index 96% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java index 1d2222c9a..f6a945a29 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -34,10 +34,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.HashGeneratorUtils; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.exception.SpServerError; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -45,8 +46,7 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata; import org.eclipse.hawkbit.repository.model.SwMetadataCompositeKey; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -64,12 +64,12 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Tests for {@link SoftwareModuleResource} {@link RestController}. + * Tests for {@link MgmtSoftwareModuleResource} {@link RestController}. * */ @Features("Component Tests - Management API") @Stories("Software Module Resource") -public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongoDB { +public class MgmtSoftwareModuleResourceTest extends AbstractIntegrationTestWithMongoDB { @Before public void assertPreparationOfRepo() { @@ -142,7 +142,7 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo .andExpect(jsonPath("$providedFilename", equalTo("origFilename"))).andReturn(); // check rest of response compared to DB - final ArtifactRest artResult = ResourceUtility + final MgmtArtifact artResult = ResourceUtility .convertArtifactResponse(mvcResult.getResponse().getContentAsString()); final Long artId = ((LocalArtifact) softwareManagement.findSoftwareModuleWithDetails(sm.getId()).getArtifacts() .get(0)).getId(); @@ -473,11 +473,11 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo public void getSoftwareModulesWithoutAddtionalRequestParameters() throws Exception { final int modules = 5; createSoftwareModulesAlphabetical(modules); - mvc.perform(get(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(modules))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(modules))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(modules))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(modules))); } @Test @@ -486,12 +486,12 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo final int modules = 5; final int limitSize = 1; createSoftwareModulesAlphabetical(modules); - mvc.perform(get(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } @Test @@ -501,13 +501,13 @@ public class SoftwareModuleResourceTest extends AbstractIntegrationTestWithMongo final int offsetParam = 2; final int expectedSize = modules - offsetParam; createSoftwareModulesAlphabetical(modules); - mvc.perform(get(RestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(modules))) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(modules))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(modules))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } @Test diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java similarity index 91% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index a85e25bed..d8d113fbc 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SoftwareModuleTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -24,8 +24,8 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.WithUser; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.json.JSONException; @@ -41,12 +41,12 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Test for {@link SoftwareModuleTypeResource}. + * Test for {@link MgmtSoftwareModuleTypeResource}. * */ @Features("Component Tests - Management API") @Stories("Software Module Type Resource") -public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { +public class MgmtSoftwareModuleTypeResourceTest extends AbstractIntegrationTest { @Test @WithUser(principal = "uploadTester", allSpPermissions = true) @@ -101,7 +101,7 @@ public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { // descending mvc.perform(get("/rest/v1/softwaremoduletypes").accept(MediaType.APPLICATION_JSON) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "MAXASSIGNMENTS:DESC")) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "MAXASSIGNMENTS:DESC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content.[0].id", equalTo(testType.getId().intValue()))) @@ -116,7 +116,7 @@ public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { // ascending mvc.perform(get("/rest/v1/softwaremoduletypes").accept(MediaType.APPLICATION_JSON) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "MAXASSIGNMENTS:ASC")) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "MAXASSIGNMENTS:ASC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$content.[3].id", equalTo(testType.getId().intValue()))) @@ -252,11 +252,11 @@ public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { @Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.") public void getSoftwareModuleTypesWithoutAddtionalRequestParameters() throws Exception { final int types = 3; - mvc.perform(get(RestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(types))); } @Test @@ -264,12 +264,12 @@ public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { public void getSoftwareModuleTypesWithPagingLimitRequestParameter() throws Exception { final int types = 3; final int limitSize = 1; - mvc.perform(get(RestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))); } @Test @@ -278,13 +278,13 @@ public class SoftwareModuleTypeResourceTest extends AbstractIntegrationTest { final int types = 3; final int offsetParam = 2; final int expectedSize = types - offsetParam; - mvc.perform(get(RestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(types))) + mvc.perform(get(MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(types))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) - .andExpect(jsonPath(TargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_TOTAL, equalTo(types))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) + .andExpect(jsonPath(MgmtTargetResourceTest.JSON_PATH_PAGED_LIST_CONTENT, hasSize(expectedSize))); } @Test diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/TargetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java similarity index 84% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/TargetResourceTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java index 8d27d5114..6954aee31 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/TargetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -30,11 +30,11 @@ import java.util.Map; import java.util.stream.Collectors; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.im.authentication.SpPermission; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.ActionFields; import org.eclipse.hawkbit.repository.ActionStatusFields; import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException; @@ -46,7 +46,8 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetInfo; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.exception.MessageNotReadableException; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.eclipse.hawkbit.util.IpUtil; import org.json.JSONException; import org.json.JSONObject; @@ -68,12 +69,12 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Spring MVC Tests against the TargetResource. + * Spring MVC Tests against the MgmtTargetResource. * */ @Features("Component Tests - Management API") @Stories("Target Resource") -public class TargetResourceTest extends AbstractIntegrationTest { +public class MgmtTargetResourceTest extends AbstractIntegrationTest { private static final String TARGET_DESCRIPTION_TEST = "created in test"; @@ -117,10 +118,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { .get(0).getActionStatus().stream().sorted((e1, e2) -> Long.compare(e2.getId(), e1.getId())) .collect(Collectors.toList()).get(0); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actions.get(0).getId() + "/status") - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize)) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "ID:DESC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actions.get(0).getId() + "/status") + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize)) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:DESC")) .andExpect(status().isOk()).andDo(MockMvcResultPrinter.print()) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_TOTAL, equalTo(3))) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) @@ -139,7 +140,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownControllerId = "knownControllerId"; targetManagement.createTarget(new Target(knownControllerId)); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", knownControllerId)) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", knownControllerId)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("securityToken").doesNotExist()); } @@ -152,7 +153,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownControllerId = "knownControllerId"; final Target createTarget = targetManagement.createTarget(new Target(knownControllerId)); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", knownControllerId)) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}", knownControllerId)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("securityToken", equalTo(createTarget.getSecurityToken()))); } @@ -168,7 +169,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { createTarget(knownControllerId2); // test - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()).andExpect(jsonPath("total", equalTo(2))) .andExpect(jsonPath("size", equalTo(2))) .andExpect(jsonPath("$content.[?(@.controllerId==" + knownControllerId1 + ")][0].ipAddress", @@ -204,22 +205,22 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String rsqlFinishedStatus = "status==finished"; final String rsqlPendingOrFinishedStatus = rsqlFinishedStatus + "," + rsqlPendingStatus; // pending status one result - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlPendingStatus, + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlPendingStatus, createTarget.getControllerId())).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("total", equalTo(1))).andExpect(jsonPath("size", equalTo(1))) .andExpect(jsonPath("content[0].status", equalTo("pending"))); // finished status none result - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlFinishedStatus, + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlFinishedStatus, createTarget.getControllerId())).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("total", equalTo(0))).andExpect(jsonPath("size", equalTo(0))); // pending or finished status one result - mvc.perform( - get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlPendingOrFinishedStatus, - createTarget.getControllerId())) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()).andExpect(jsonPath("total", equalTo(1))) - .andExpect(jsonPath("size", equalTo(1))).andExpect(jsonPath("content[0].status", equalTo("pending"))); + mvc.perform(get( + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions?q=" + rsqlPendingOrFinishedStatus, + createTarget.getControllerId())).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("total", equalTo(1))).andExpect(jsonPath("size", equalTo(1))) + .andExpect(jsonPath("content[0].status", equalTo("pending"))); } @Test @@ -229,7 +230,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final Target tA = createTargetAndStartAction(); // test - cancel the active action - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", tA.getControllerId(), tA.getActions().get(0).getId())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNoContent()); @@ -261,7 +262,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { assertThat(cancelActions).hasSize(1); // test - cancel an cancel action returns forbidden - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}", tA.getControllerId(), cancelActions.get(0).getId())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); } @@ -282,7 +283,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { assertThat(cancelActions.get(0).isCancelingOrCanceled()).isTrue(); // test - force quit an canceled action should return 204 - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}?force=true", + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}?force=true", tA.getControllerId(), cancelActions.get(0).getId())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNoContent()); } @@ -294,7 +295,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final Target tA = createTargetAndStartAction(); // test - cancel an cancel action returns forbidden - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}?force=true", + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/{targetId}/actions/{actionId}?force=true", tA.getControllerId(), tA.getActions().get(0).getId())).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); } @@ -305,7 +306,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownControllerId = "knownControllerIdDelete"; targetManagement.createTarget(new Target(knownControllerId)); - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) .andExpect(status().isOk()); final Target findTargetByControllerID = targetManagement.findTargetByControllerID(knownControllerId); @@ -317,7 +318,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { public void deleteTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { final String knownControllerId = "knownControllerIdDelete"; - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) .andExpect(status().isNotFound()); } @@ -325,7 +326,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { @Description("Ensures that update is refused with not found if target does not exist.") public void updateTargetWhichDoesNotExistsLeadsToEntityNotFound() throws Exception { final String knownControllerId = "knownControllerIdUpdate"; - mvc.perform(put(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId).content("{}") + mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId).content("{}") .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); } @@ -344,7 +345,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { t.setName(knownNameNotModiy); targetManagement.createTarget(t); - mvc.perform(put(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId).content(body) + mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId).content(body) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.controllerId", equalTo(knownControllerId))) .andExpect(jsonPath("$.description", equalTo(knownNewDescription))) @@ -364,7 +365,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String idC = "c"; final String linksHrefPrefix = "http://localhost/rest/v1/targets/"; createTargetsAlphabetical(knownTargetAmount); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING)).andExpect(status().isOk()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING)).andExpect(status().isOk()) .andDo(MockMvcResultPrinter.print()) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_TOTAL, equalTo(knownTargetAmount))) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_SIZE, equalTo(knownTargetAmount))) @@ -404,8 +405,9 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String idA = "a"; final String linksHrefPrefix = "http://localhost/rest/v1/targets/"; - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING).param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, - String.valueOf(limitSize))).andExpect(status().isOk()).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(limitSize))) + .andExpect(status().isOk()).andDo(MockMvcResultPrinter.print()) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_TOTAL, equalTo(knownTargetAmount))) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_SIZE, equalTo(limitSize))) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(limitSize))) @@ -431,9 +433,9 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String linksHrefPrefix = "http://localhost/rest/v1/targets/"; createTargetsAlphabetical(knownTargetAmount); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(knownTargetAmount))) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(offsetParam)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(knownTargetAmount))) .andExpect(status().isOk()).andDo(MockMvcResultPrinter.print()) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_TOTAL, equalTo(knownTargetAmount))) .andExpect(jsonPath(JSON_PATH_PAGED_LIST_SIZE, equalTo(expectedSize))) @@ -472,7 +474,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { createSingleTarget(knownControllerId, knownName); final String hrefPrefix = "http://localhost/rest/v1/targets/" + knownControllerId + "/"; // test - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath(JSON_PATH_NAME, equalTo(knownName))) .andExpect(jsonPath(JSON_PATH_CONTROLLERID, equalTo(knownControllerId))) @@ -491,7 +493,8 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String targetIdNotExists = "bubu"; // test - final MvcResult mvcResult = mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + targetIdNotExists)) + final MvcResult mvcResult = mvc + .perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + targetIdNotExists)) .andExpect(status().isNotFound()).andReturn(); // verify response json exception message @@ -509,7 +512,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { // test - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/assignedDS")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/assignedDS")) .andExpect(status().isNoContent()).andExpect(content().string("")); } @@ -529,7 +532,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final SoftwareModule os = ds.findFirstModuleByType(osType); final SoftwareModule jvm = ds.findFirstModuleByType(runtimeType); final SoftwareModule bApp = ds.findFirstModuleByType(appType); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/assignedDS")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/assignedDS")) .andExpect(status().isOk()).andDo(MockMvcResultPrinter.print()) .andExpect(jsonPath(JSON_PATH_ID, equalTo(ds.getId().intValue()))) .andExpect(jsonPath(JSON_PATH_NAME, equalTo(ds.getName()))) @@ -579,7 +582,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { // test - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/installedDS")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/installedDS")) .andExpect(status().isNoContent()).andExpect(content().string("")); } @@ -602,7 +605,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final SoftwareModule os = ds.findFirstModuleByType(osType); final SoftwareModule jvm = ds.findFirstModuleByType(runtimeType); final SoftwareModule bApp = ds.findFirstModuleByType(appType); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/installedDS")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownControllerId + "/installedDS")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath(JSON_PATH_ID, equalTo(ds.getId().intValue()))) .andExpect(jsonPath(JSON_PATH_NAME, equalTo(ds.getName()))) @@ -646,7 +649,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { public void createTargetWithoutPayloadBadRequest() throws Exception { final MvcResult mvcResult = mvc - .perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).contentType(MediaType.APPLICATION_JSON)) + .perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); assertThat(targetManagement.countTargetsAll()).isEqualTo(0); @@ -663,7 +666,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String notJson = "abc"; final MvcResult mvcResult = mvc - .perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).content(notJson) + .perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content(notJson) .contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); @@ -743,7 +746,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownDescription = "someDescription"; final String createTargetsJson = getCreateTargetsListJsonString(knownControllerId, knownName, knownDescription); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().is2xxSuccessful()); @@ -764,12 +767,12 @@ public class TargetResourceTest extends AbstractIntegrationTest { // create a taret first to provoke a already exists error - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().is2xxSuccessful()); // create another one to retrieve the entity already exists exception final MvcResult mvcResult = mvc - .perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) + .perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().is(HttpStatus.CONFLICT.value())).andReturn(); @@ -792,7 +795,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String createTargetsJson = getCreateTargetsListJsonStringWithAdditionalNotExistingAttribute( knownControllerId, knownName, knownDescription); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING).content(createTargetsJson) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().is2xxSuccessful()); @@ -810,10 +813,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { final Target target = new Target(knownTargetId); targetManagement.createTarget(target); - mvc.perform(get( - RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + RestConstants.TARGET_V1_ACTIONS)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()).andExpect(jsonPath("size", equalTo(0))) - .andExpect(jsonPath("content", hasSize(0))).andExpect(jsonPath("total", equalTo(0))); + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("size", equalTo(0))).andExpect(jsonPath("content", hasSize(0))) + .andExpect(jsonPath("total", equalTo(0))); } @Test @@ -821,9 +824,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actions.get(0).getId())).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()).andExpect(jsonPath("id", equalTo(actions.get(0).getId().intValue()))) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actions.get(0).getId())) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("id", equalTo(actions.get(0).getId().intValue()))) .andExpect(jsonPath("type", equalTo("cancel"))).andExpect(jsonPath("status", equalTo("pending"))) .andExpect(jsonPath("_links.self.href", equalTo(generateActionSelfLink(knownTargetId, actions.get(0))))) .andExpect(jsonPath("_links.canceledaction.href", @@ -837,9 +841,8 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); - mvc.perform(get( - RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + RestConstants.TARGET_V1_ACTIONS) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS).param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[1].id", equalTo(actions.get(1).getId().intValue()))) .andExpect(jsonPath("content.[1].type", equalTo("update"))) @@ -866,9 +869,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { .sorted((e1, e2) -> Long.compare(e2.getId(), e1.getId())).collect(Collectors.toList()); // sort is default descending order, latest status first - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS)).andDo(MockMvcResultPrinter.print()) + .andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(0).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("canceling"))) .andExpect(jsonPath("content.[0].messages", hasItem("manual cancelation requested"))) @@ -890,9 +894,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { .sorted((e1, e2) -> Long.compare(e1.getId(), e2.getId())).collect(Collectors.toList()); // descending order - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "REPORTEDAT:DESC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS).param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, + "REPORTEDAT:DESC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(1).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("canceling"))) @@ -906,9 +911,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(2))); // ascending order - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "REPORTEDAT:ASC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS).param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, + "REPORTEDAT:ASC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[1].id", equalTo(actionStatus.get(1).getId().intValue()))) .andExpect(jsonPath("content.[1].type", equalTo("canceling"))) @@ -932,9 +938,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { .sorted((e1, e2) -> Long.compare(e1.getId(), e2.getId())).collect(Collectors.toList()); // Page 1 - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1))) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS).param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, + String.valueOf(1))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(1).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("canceling"))) @@ -945,10 +952,11 @@ public class TargetResourceTest extends AbstractIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); // Page 2 - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1))) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1))) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actionStatus.get(0).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("running"))) @@ -964,10 +972,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); // page 1: one entry - mvc.perform(get( - RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + RestConstants.TARGET_V1_ACTIONS) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actions.get(0).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("cancel"))) @@ -979,12 +987,12 @@ public class TargetResourceTest extends AbstractIntegrationTest { .andExpect(jsonPath(JSON_PATH_PAGED_LIST_CONTENT, hasSize(1))); // page 2: one entry - mvc.perform(get( - RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + RestConstants.TARGET_V1_ACTIONS) - .param(RestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1)) - .param(RestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1)) - .param(RestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, String.valueOf(1)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1)) + .param(MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, String.valueOf(1)) + .param(MgmtRestConstants.REQUEST_PARAMETER_SORTING, "ID:ASC")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("content.[0].id", equalTo(actions.get(1).getId().intValue()))) .andExpect(jsonPath("content.[0].type", equalTo("update"))) @@ -997,19 +1005,19 @@ public class TargetResourceTest extends AbstractIntegrationTest { } private String generateActionSelfLink(final String knownTargetId, final Action action) { - return "http://localhost" + RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId(); + return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId(); } private String generateCanceledactionreferenceLink(final String knownTargetId, final Action action) { - return "http://localhost" + RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId(); + return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId(); } private String generateStatusreferenceLink(final String knownTargetId, final Action action) { - return "http://localhost" + RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + RestConstants.TARGET_V1_ACTION_STATUS - + "?offset=0&limit=50&sort=id:DESC"; + return "http://localhost" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + action.getId() + "/" + + MgmtRestConstants.TARGET_V1_ACTION_STATUS + "?offset=0&limit=50&sort=id:DESC"; } private List generateTargetWithTwoUpdatesWithOneOverride(final String knownTargetId) @@ -1047,9 +1055,10 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownTargetId = "targetId"; final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actions.get(1).getId())).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()).andExpect(jsonPath("id", equalTo(actions.get(1).getId().intValue()))) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actions.get(1).getId())) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) + .andExpect(jsonPath("id", equalTo(actions.get(1).getId().intValue()))) .andExpect(jsonPath("type", equalTo("update"))).andExpect(jsonPath("status", equalTo("pending"))) .andExpect(jsonPath("_links.self.href", equalTo(generateActionSelfLink(knownTargetId, actions.get(1))))) .andExpect(jsonPath("_links.distributionset.href", @@ -1066,7 +1075,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final DistributionSet set = TestDataUtil.generateDistributionSet("one", softwareManagement, distributionSetManagement); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") .content("{\"id\":" + set.getId() + "}").contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); @@ -1084,7 +1093,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String body = new JSONObject().put("id", set.getId()).put("type", "timeforced") .put("forcetime", forceTime).toString(); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS").content(body) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS").content(body) .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); @@ -1101,25 +1110,25 @@ public class TargetResourceTest extends AbstractIntegrationTest { final DistributionSet set = TestDataUtil.generateDistributionSet("one", softwareManagement, distributionSetManagement); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") .content("{\"id\":" + set.getId() + "}").contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); targetManagement.createTarget(new Target("fsdfsd")); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") .content("{\"id\":" + set.getId() + "}").contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS").content("{\"id\":12345678}") - .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isNotFound()); + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + .content("{\"id\":12345678}").contentType(MediaType.APPLICATION_JSON)) + .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") .contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); - mvc.perform(put(RestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") + mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/fsdfsd/assignedDS") .content("{\"id\":" + set.getId() + "}").contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isMethodNotAllowed()); @@ -1130,28 +1139,28 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownTargetId = "targetId"; // target does not exist - mvc.perform(get( - RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + RestConstants.TARGET_V1_ACTIONS)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS)).andDo(MockMvcResultPrinter.print()) + .andExpect(status().isNotFound()); final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); final Long actionId = actions.get(0).getId(); // should work now - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); // action does not exist - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/12321")).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/12321")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); // not allowed methods - mvc.perform(put(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) + mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId)).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); } @@ -1160,31 +1169,31 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String knownTargetId = "targetId"; // target does not exist - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/1/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/1/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); final List actions = generateTargetWithTwoUpdatesWithOneOverride(knownTargetId); final Long actionId = actions.get(0).getId(); // should work now - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isOk()); // action does not exist - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/12321/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/12321/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isNotFound()); // not allowed methods - mvc.perform(delete(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(delete(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); - mvc.perform(put(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(put(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); - mvc.perform(post(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" - + RestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) + mvc.perform(post(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/" + + MgmtRestConstants.TARGET_V1_ACTIONS + "/" + actionId + "/status")).andDo(MockMvcResultPrinter.print()) .andExpect(status().isMethodNotAllowed()); } @@ -1200,7 +1209,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { controllerManagament.updateControllerAttributes(knownTargetId, knownControllerAttrs); // test query target over rest resource - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/attributes")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/attributes")) .andDo(MockMvcResultPrinter.print()).andExpect(status().is2xxSuccessful()) .andExpect(jsonPath("$.a", equalTo("1"))).andExpect(jsonPath("$.b", equalTo("2"))); } @@ -1213,7 +1222,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { targetManagement.createTarget(target); // test query target over rest resource - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/attributes")) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "/" + knownTargetId + "/attributes")) .andDo(MockMvcResultPrinter.print()).andExpect(status().is(HttpStatus.NO_CONTENT.value())); } @@ -1224,7 +1233,7 @@ public class TargetResourceTest extends AbstractIntegrationTest { final String rsqlFindAOrB = "controllerId==a,controllerId==b"; - mvc.perform(get(RestConstants.TARGET_V1_REQUEST_MAPPING + "?q=" + rsqlFindAOrB)) + mvc.perform(get(MgmtRestConstants.TARGET_V1_REQUEST_MAPPING + "?q=" + rsqlFindAOrB)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()).andExpect(jsonPath("size", equalTo(2))) .andExpect(jsonPath("total", equalTo(2))).andExpect(jsonPath("content[0].controllerId", equalTo("a"))) .andExpect(jsonPath("content[1].controllerId", equalTo("b"))); diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java new file mode 100644 index 000000000..7d07b3bd3 --- /dev/null +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java @@ -0,0 +1,55 @@ +/** + * 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.mgmt.rest.resource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.ResultHandler; +import org.springframework.test.web.servlet.result.PrintingResultHandler; +import org.springframework.util.CollectionUtils; + +public abstract class MockMvcResultPrinter { + private static final Logger LOG = LoggerFactory.getLogger(MockMvcResultPrinter.class); + + private MockMvcResultPrinter() { + } + + /** + * Print {@link MvcResult} details to the "standard" output stream. + */ + public static ResultHandler print() { + return new ConsolePrintingResultHandler(); + } + + /** + * An {@link PrintingResultHandler} that writes to the "standard" output + * stream + */ + private static class ConsolePrintingResultHandler extends PrintingResultHandler { + + public ConsolePrintingResultHandler() { + super(new ResultValuePrinter() { + + @Override + public void printHeading(final String heading) { + LOG.debug(String.format("%20s:", heading)); + } + + @Override + public void printValue(final String label, Object value) { + if (value != null && value.getClass().isArray()) { + value = CollectionUtils.arrayToList(value); + } + LOG.debug(String.format("%20s = %s", label, value)); + } + }); + } + } +} diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ResourceUtility.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/ResourceUtility.java similarity index 77% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ResourceUtility.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/ResourceUtility.java index 9e99031e9..e94d1b857 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ResourceUtility.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/ResourceUtility.java @@ -6,13 +6,13 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.io.IOException; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; -import org.eclipse.hawkbit.rest.resource.model.PagedList; -import org.eclipse.hawkbit.rest.resource.model.artifact.ArtifactRest; +import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; @@ -33,9 +33,9 @@ public final class ResourceUtility { return mapper.readValue(jsonExceptionResponse, ExceptionInfo.class); } - static ArtifactRest convertArtifactResponse(final String jsonResponse) + static MgmtArtifact convertArtifactResponse(final String jsonResponse) throws JsonParseException, JsonMappingException, IOException { - return mapper.readValue(jsonResponse, ArtifactRest.class); + return mapper.readValue(jsonResponse, MgmtArtifact.class); } diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SMRessourceMisingMongoDbConnectionTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java similarity index 93% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SMRessourceMisingMongoDbConnectionTest.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java index 664dc861c..4f80728f1 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SMRessourceMisingMongoDbConnectionTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.fileUpload; @@ -14,10 +14,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import org.apache.commons.lang3.RandomStringUtils; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.repository.model.SoftwareModule; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.mock.web.MockMultipartFile; @@ -28,7 +27,8 @@ import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; /** - * Tests {@link SoftwareModuleResource} in case of missing MongoDB connection. + * Tests {@link MgmtSoftwareModuleResource} in case of missing MongoDB + * connection. * */ @Features("Component Tests - Management API") diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SuccessCondition.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java similarity index 91% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SuccessCondition.java rename to hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java index be6e166ef..cafc36b0b 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SuccessCondition.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; /** * diff --git a/hawkbit-rest-resource/src/test/resources/application-test.properties b/hawkbit-mgmt-resource/src/test/resources/application-test.properties similarity index 100% rename from hawkbit-rest-resource/src/test/resources/application-test.properties rename to hawkbit-mgmt-resource/src/test/resources/application-test.properties diff --git a/hawkbit-rest-resource/src/test/resources/log4j2.xml b/hawkbit-mgmt-resource/src/test/resources/log4j2.xml similarity index 100% rename from hawkbit-rest-resource/src/test/resources/log4j2.xml rename to hawkbit-mgmt-resource/src/test/resources/log4j2.xml diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml new file mode 100644 index 000000000..9048cf677 --- /dev/null +++ b/hawkbit-rest-core/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-rest-core + hawkBit :: REST Resources + + + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + + + org.eclipse.hawkbit + hawkbit-core + ${project.version} + + + + javax.servlet + javax.servlet-api + provided + + + org.apache.tomcat.embed + tomcat-embed-core + provided + + + org.springframework.data + spring-data-commons + + + org.springframework + spring-web + + + + + org.easytesting + fest-assert + test + + + ru.yandex.qatools.allure + allure-junit-adaptor + test + + + \ No newline at end of file diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortDirection.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/data/SortDirection.java similarity index 89% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortDirection.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/data/SortDirection.java index 344c27ce7..ca33d25b3 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortDirection.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/data/SortDirection.java @@ -6,7 +6,9 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.data; + +import org.eclipse.hawkbit.rest.exception.SortParameterUnsupportedDirectionException; /** * A definition of possible sorting direction. diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/MessageNotReadableException.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/MessageNotReadableException.java similarity index 95% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/MessageNotReadableException.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/MessageNotReadableException.java index 023b67352..3c5e0aee3 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/MessageNotReadableException.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/MessageNotReadableException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.exception; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/ResponseExceptionHandler.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java similarity index 98% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/ResponseExceptionHandler.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java index 25ddc7c4c..0f8da9ebe 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/ResponseExceptionHandler.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/ResponseExceptionHandler.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.exception; import java.util.EnumMap; import java.util.Map; @@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.tomcat.util.http.fileupload.FileUploadBase.FileSizeLimitExceededException; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; @@ -86,7 +86,8 @@ public class ResponseExceptionHandler { * as entity. */ @ExceptionHandler(SpServerRtException.class) - public ResponseEntity handleSpServerRtExceptions(final HttpServletRequest request, final Exception ex) { + public ResponseEntity handleSpServerRtExceptions(final HttpServletRequest request, + final Exception ex) { LOG.debug("Handling exception of request {}", request.getRequestURL()); final ExceptionInfo response = new ExceptionInfo(); final HttpStatus responseStatus; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterSyntaxErrorException.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterSyntaxErrorException.java similarity index 95% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterSyntaxErrorException.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterSyntaxErrorException.java index b6bacd9d2..a8d476ac1 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterSyntaxErrorException.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterSyntaxErrorException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.exception; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedDirectionException.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedDirectionException.java similarity index 97% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedDirectionException.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedDirectionException.java index 60fa3d8df..b44b94917 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedDirectionException.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedDirectionException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.exception; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedFieldException.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedFieldException.java similarity index 97% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedFieldException.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedFieldException.java index 20c6f03d6..c9ce0dcdd 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortParameterUnsupportedFieldException.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/exception/SortParameterUnsupportedFieldException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.exception; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfo.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfo.java similarity index 97% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfo.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfo.java index e2d808943..d68e0037f 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfo.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfo.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.rest.json.model; import java.util.List; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/ByteRange.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/ByteRange.java similarity index 98% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/ByteRange.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/ByteRange.java index df72e2c53..667fc197d 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/ByteRange.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/ByteRange.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.helper; +package org.eclipse.hawkbit.rest.util; /** * Byte range for resume download operations. diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileSteamingFailedException.java similarity index 96% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileSteamingFailedException.java index e246bc6cd..abf7c0245 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/FileSteamingFailedException.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileSteamingFailedException.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.helper; +package org.eclipse.hawkbit.rest.util; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.exception.SpServerRtException; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java similarity index 94% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java index f09bd7401..827506048 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/helper/RestResourceConversionHelper.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.helper; +package org.eclipse.hawkbit.rest.util; import static com.google.common.base.Preconditions.checkNotNull; @@ -23,9 +23,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; -import org.eclipse.hawkbit.repository.model.Action.ActionType; import org.eclipse.hawkbit.repository.model.LocalArtifact; -import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; @@ -38,9 +36,6 @@ import com.google.common.net.HttpHeaders; /** * Utility class for the Rest Source API. * - * - * - * */ public final class RestResourceConversionHelper { private static final Logger LOG = LoggerFactory.getLogger(RestResourceConversionHelper.class); @@ -346,28 +341,4 @@ public final class RestResourceConversionHelper { return Arrays.binarySearch(matchValues, toMatch) > -1 || Arrays.binarySearch(matchValues, "*") > -1; } - /** - * Convert a action rest type to a action repository type. - * - * @param actionTypeRest - * the rest type - * @return or the action repository type - */ - public static ActionType convertActionType(final ActionTypeRest actionTypeRest) { - if (actionTypeRest == null) { - return null; - } - - switch (actionTypeRest) { - case SOFT: - return ActionType.SOFT; - case FORCED: - return ActionType.FORCED; - case TIMEFORCED: - return ActionType.TIMEFORCED; - default: - throw new IllegalStateException("Action Type is not supported"); - } - - } } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortUtility.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/SortUtility.java similarity index 94% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortUtility.java rename to hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/SortUtility.java index f8b997bf9..d0abc47a7 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SortUtility.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/SortUtility.java @@ -6,12 +6,15 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.util; import java.util.List; import java.util.StringTokenizer; import org.eclipse.hawkbit.repository.FieldNameProvider; +import org.eclipse.hawkbit.rest.exception.SortParameterSyntaxErrorException; +import org.eclipse.hawkbit.rest.exception.SortParameterUnsupportedDirectionException; +import org.eclipse.hawkbit.rest.exception.SortParameterUnsupportedFieldException; import org.springframework.data.domain.Sort.Direction; import org.springframework.data.domain.Sort.Order; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfoTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java similarity index 95% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfoTest.java rename to hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java index d240a814b..263bb75c5 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfoTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/json/model/ExceptionInfoTest.java @@ -6,13 +6,14 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model; +package org.eclipse.hawkbit.rest.json.model; import static org.fest.assertions.Assertions.assertThat; import java.util.ArrayList; import java.util.List; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.junit.Test; import ru.yandex.qatools.allure.annotations.Description; diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SortUtilityTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SortUtilityTest.java similarity index 91% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SortUtilityTest.java rename to hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SortUtilityTest.java index 09a90c39c..8f1b814bf 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SortUtilityTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SortUtilityTest.java @@ -6,14 +6,17 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.rest.util; -import static org.fest.assertions.api.Assertions.assertThat; +import static org.fest.assertions.Assertions.assertThat; import static org.junit.Assert.fail; import java.util.List; import org.eclipse.hawkbit.repository.TargetFields; +import org.eclipse.hawkbit.rest.exception.SortParameterSyntaxErrorException; +import org.eclipse.hawkbit.rest.exception.SortParameterUnsupportedDirectionException; +import org.eclipse.hawkbit.rest.exception.SortParameterUnsupportedFieldException; import org.junit.Test; import org.springframework.data.domain.Sort.Order; diff --git a/hawkbit-rest-core/src/test/resources/application-test.properties b/hawkbit-rest-core/src/test/resources/application-test.properties new file mode 100644 index 000000000..92506caa4 --- /dev/null +++ b/hawkbit-rest-core/src/test/resources/application-test.properties @@ -0,0 +1,63 @@ +# +# 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 +# + +# used if IM profile is disabled +security.ignored=true + +# IM required for integration tests +spring.profiles.active=im,suiteembedded,artifactrepository,redis + +server.port=12222 + +spring.data.mongodb.uri=mongodb://localhost/spArtifactRepository${random.value} +spring.data.mongodb.port=28017 + + +# supported: H2, MYSQL +hawkbit.server.database=H2 +hawkbit.server.database.env=TEST +spring.main.show_banner=false + +hawkbit.server.ddi.security.authentication.header=true + +hawkbit.server.artifact.repo.upload.maxFileSize=5MB + +hawkbit.server.security.dos.maxStatusEntriesPerAction=100 + +hawkbit.server.security.dos.maxAttributeEntriesPerTarget=10 + +spring.jpa.database=${hawkbit.server.database} +#spring.jpa.show-sql=true + + +flyway.sqlMigrationSuffix=${spring.jpa.database}.sql + +# effective DB setting +spring.datasource.url=${${hawkbit.server.database}.spring.datasource.url} +spring.datasource.driverClassName=${${hawkbit.server.database}.spring.datasource.driverClassName} +spring.datasource.username=${${hawkbit.server.database}.spring.datasource.username} +spring.datasource.password=${${hawkbit.server.database}.spring.datasource.password} + +# H2 +##;AUTOCOMMIT=ON +H2.spring.datasource.url=jdbc:h2:mem:sp-db;DB_CLOSE_ON_EXIT=FALSE +#H2.spring.datasource.url=jdbc:h2:./db/sp-db;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE +H2.spring.datasource.driverClassName=org.h2.Driver +H2.spring.datasource.username=sa +H2.spring.datasource.password=sa + +# MYSQL +MYSQL.spring.datasource.url=jdbc:mysql://localhost:3306/sp_test +MYSQL.spring.datasource.driverClassName=org.mariadb.jdbc.Driver +MYSQL.spring.datasource.username=root +MYSQL.spring.datasource.password= + +# SP Controller configuration +hawkbit.controller.pollingTime=00:01:00 +hawkbit.controller.pollingOverdueTime=00:01:00 diff --git a/hawkbit-rest-core/src/test/resources/log4j2.xml b/hawkbit-rest-core/src/test/resources/log4j2.xml new file mode 100644 index 000000000..98ea99ac9 --- /dev/null +++ b/hawkbit-rest-core/src/test/resources/log4j2.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/OffsetBasedPageRequest.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/OffsetBasedPageRequest.java deleted file mode 100644 index 5ab6b33c6..000000000 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/OffsetBasedPageRequest.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.rest.resource; - -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; - -/** - * An implementation of the {@link PageRequest} which is offset based by means - * the offset is given and not the page number as in the original - * {@link PageRequest} implemntation where the offset is generated. Due that the - * REST-API is working with {@code offset} and {@code limit} parameter we need - * an offset based page request for JPA. - * - * - * - * - */ -public final class OffsetBasedPageRequest extends PageRequest { - - private static final long serialVersionUID = 1L; - private final int offset; - - /** - * Creates a new {@link OffsetBasedPageRequest}. Offsets are zero indexed, - * thus providing 0 for {@code offset} will return the first entry. - * - * @param offset - * zero-based offset index. - * @param limit - * the limit of the page to be returned. - */ - public OffsetBasedPageRequest(final int offset, final int limit) { - this(offset, limit, null); - } - - /** - * Creates a new {@link OffsetBasedPageRequest}. Offsets are zero indexed, - * thus providing 0 for {@code offset} will return the first entry. - * - * @param offset - * zero-based offset index. - * @param limit - * the limit of the page to be returned. - * @param sort - * sort can be {@literal null}. - */ - public OffsetBasedPageRequest(final int offset, final int limit, final Sort sort) { - super(0, limit, sort); - this.offset = offset; - } - - @Override - public int getOffset() { - return offset; - } - - @Override - public String toString() { - return "OffsetBasedPageRequest [offset=" + offset + ", getPageSize()=" + getPageSize() + ", getPageNumber()=" - + getPageNumber() + "]"; - } -} diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RestModelMapper.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RestModelMapper.java deleted file mode 100644 index 9616d0e86..000000000 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/RestModelMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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.rest.resource; - -import org.eclipse.hawkbit.repository.model.NamedEntity; -import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity; -import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest; -import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest; - -/** - * A mapper which maps repository model to RESTful model representation and - * back. - * - * - * - * - */ -final class RestModelMapper { - - // private constructor, utility class - private RestModelMapper() { - - } - - static void mapBaseToBase(final BaseEntityRest response, final TenantAwareBaseEntity base) { - response.setCreatedBy(base.getCreatedBy()); - response.setLastModifiedBy(base.getLastModifiedBy()); - if (base.getCreatedAt() != null) { - response.setCreatedAt(base.getCreatedAt()); - } - if (base.getLastModifiedAt() != null) { - response.setLastModifiedAt(base.getLastModifiedAt()); - } - } - - static void mapNamedToNamed(final NamedEntityRest response, final NamedEntity base) { - mapBaseToBase(response, base); - - response.setName(base.getName()); - response.setDescription(base.getDescription()); - } -} diff --git a/hawkbit-rest-api/pom.xml b/hawkbit-system-api/pom.xml similarity index 83% rename from hawkbit-rest-api/pom.xml rename to hawkbit-system-api/pom.xml index 703d6caf3..b68b02b36 100644 --- a/hawkbit-rest-api/pom.xml +++ b/hawkbit-system-api/pom.xml @@ -16,15 +16,11 @@ hawkbit-parent 0.2.0-SNAPSHOT - hawkbit-rest-api - hawkBit :: REST API + hawkbit-system-api + hawkBit :: System REST API - - javax.validation - validation-api - org.springframework.hateoas spring-hateoas diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRest.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java similarity index 94% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRest.java rename to hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java index 47dcfebe0..c152de0c3 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRest.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.system; +package org.eclipse.hawkbit.system.json.model.system; import org.springframework.hateoas.ResourceSupport; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TenantConfigurationValueRest extends ResourceSupport { +public class SystemTenantConfigurationValue extends ResourceSupport { @JsonInclude(Include.ALWAYS) private Object value; diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRequest.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java similarity index 80% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRequest.java rename to hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java index b0ae6e546..08bd06dd8 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationValueRequest.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.system; +package org.eclipse.hawkbit.system.json.model.system; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TenantConfigurationValueRequest { +public class SystemTenantConfigurationValueRequest { @JsonProperty(required = true) private Object value; /** * - * @return the value of the TenantConfigurationValueRequest + * @return the value of the SystemTenantConfigurationValueRequest */ public Object getValue() { return value; } /** - * Sets the TenantConfigurationValueRequest + * Sets the SystemTenantConfigurationValueRequest * * @param value */ diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/CacheRest.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java similarity index 84% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/CacheRest.java rename to hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java index 35d35c0b1..428483be9 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/CacheRest.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.systemmanagement; +package org.eclipse.hawkbit.system.json.model.systemmanagement; import java.util.Collection; @@ -16,14 +16,11 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; /** * Model representation of an Cache entry as json. - * - * - * * */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class CacheRest { +public class SystemCache { private final String name; private final Collection keys; @@ -34,7 +31,7 @@ public class CacheRest { * @param cacheKeys * the keys which contains in the cache */ - public CacheRest(final String name, final Collection cacheKeys) { + public SystemCache(final String name, final Collection cacheKeys) { this.name = name; this.keys = cacheKeys; } @@ -60,6 +57,6 @@ public class CacheRest { */ @Override public String toString() { - return "CacheRest [name=" + name + ", keys=" + keys + "]"; + return "SystemCache [name=" + name + ", keys=" + keys + "]"; } } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/SystemStatisticsRest.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java similarity index 89% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/SystemStatisticsRest.java rename to hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java index c69201d69..8e1c80ded 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/SystemStatisticsRest.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.systemmanagement; +package org.eclipse.hawkbit.system.json.model.systemmanagement; import java.util.List; @@ -28,7 +28,7 @@ public class SystemStatisticsRest { private long overallActions; private long overallTenants; - private List tenantStats; + private List tenantStats; public long getOverallTargets() { return overallTargets; @@ -75,11 +75,11 @@ public class SystemStatisticsRest { return this; } - public void setTenantStats(final List tenantStats) { + public void setTenantStats(final List tenantStats) { this.tenantStats = tenantStats; } - public List getTenantStats() { + public List getTenantStats() { return tenantStats; } diff --git a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/TenantSystemUsageRest.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java similarity index 91% rename from hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/TenantSystemUsageRest.java rename to hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java index bc8653b36..ab7b7e6b8 100644 --- a/hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/systemmanagement/TenantSystemUsageRest.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource.model.systemmanagement; +package org.eclipse.hawkbit.system.json.model.systemmanagement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class TenantSystemUsageRest { +public class SystemTenantServiceUsage { private final String tenantName; private long targets; @@ -31,7 +31,7 @@ public class TenantSystemUsageRest { * * @param tenantName */ - public TenantSystemUsageRest(final String tenantName) { + public SystemTenantServiceUsage(final String tenantName) { super(); this.tenantName = tenantName; } diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java new file mode 100644 index 000000000..9e7864439 --- /dev/null +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java @@ -0,0 +1,64 @@ +/** + * 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.system.rest.api; + +import java.util.Collection; + +import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemCache; +import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemStatisticsRest; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * {@link SystemManagement} capabilities by REST. + * + */ +@RequestMapping(SystemRestConstant.SYSTEM_ADMIN_MAPPING) +public interface SystemManagementRestApi { + + /** + * Deletes the tenant data of a given tenant. USE WITH CARE! + * + * @param tenant + * to delete + * @return HttpStatus.OK + */ + @RequestMapping(method = RequestMethod.DELETE, value = "/tenants/{tenant}") + ResponseEntity deleteTenant(@PathVariable final String tenant); + + /** + * Collects and returns system usage statistics. It provides a system wide + * overview and tenant based stats. + * + * @return system usage statistics + */ + @RequestMapping(method = RequestMethod.GET, value = "/usage", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity getSystemUsageStats(); + + /** + * Returns a list of all caches. + * + * @return a list of caches for all tenants + */ + @RequestMapping(method = RequestMethod.GET, value = "/caches") + ResponseEntity> getCaches(); + + /** + * Invalidates all caches for all tenants. + * + * @return a list of cache names which has been invalidated + */ + @RequestMapping(method = RequestMethod.DELETE, value = "/caches") + ResponseEntity> invalidateCaches(); + +} diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java new file mode 100644 index 000000000..aa764d82a --- /dev/null +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java @@ -0,0 +1,86 @@ +/** + * 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.system.rest.api; + +import java.util.Map; + +import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; +import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValueRequest; +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; + +/** + * REST Resource handling tenant specific configuration operations. + * + * + */ +@RequestMapping(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING) +public interface SystemRestApi { + + @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity getSystem(); + + /** + * @return a Map of all configuration values. + */ + @RequestMapping(method = RequestMethod.GET, value = "/configs", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity> getSystemConfiguration(); + + /** + * Handles the DELETE request of deleting a tenant specific configuration + * value within SP. + * + * @param keyName + * the Name of the configuration key + * @return If the given configuration value exists and could be deleted Http + * OK. In any failure the JsonResponseExceptionHandler is handling + * the response. + */ + @RequestMapping(method = RequestMethod.DELETE, value = "/configs/{keyName}", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity deleteConfigurationValue(@PathVariable final String keyName); + + /** + * Handles the GET request of deleting a tenant specific configuration value + * within SP. + * + * @param keyName + * the Name of the configuration key + * @return If the given configuration value exists and could be get Http OK. + * In any failure the JsonResponseExceptionHandler is handling the + * response. + */ + @RequestMapping(method = RequestMethod.GET, value = "/configs/{keyName}", produces = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity getConfigurationValue(@PathVariable final String keyName); + + /** + * Handles the GET request of deleting a tenant specific configuration value + * within SP. + * + * @param keyName + * the Name of the configuration key + * @param configurationValueRest + * the new value for the configuration + * @return If the given configuration value exists and could be get Http OK. + * In any failure the JsonResponseExceptionHandler is handling the + * response. + */ + @RequestMapping(method = RequestMethod.PUT, value = "/configs/{keyName}", consumes = { "application/hal+json", + MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) + ResponseEntity updateConfigurationValue(@PathVariable final String keyName, + @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest); + +} \ No newline at end of file diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java new file mode 100644 index 000000000..cb10ba8b2 --- /dev/null +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java @@ -0,0 +1,41 @@ +/** + * 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.system.rest.api; + +/** + * + */ +public final class SystemRestConstant { + + /** + * API version definition. We are using only major versions. + */ + public static final String API_VERSION = "v1"; + + /** + * The base URL mapping for the spring acuator management context path. + */ + public static final String BASE_SYSTEM_MAPPING = "/system"; + + /** + * The base URL mapping of the SP rest resources. + */ + public static final String BASE_V1_REQUEST_MAPPING = "/rest/" + API_VERSION; + + /** + * URL mapping for system admin operations. + */ + public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin"; + + public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + BASE_SYSTEM_MAPPING; + + private SystemRestConstant() { + + } +} diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml new file mode 100644 index 000000000..fed198db3 --- /dev/null +++ b/hawkbit-system-resource/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-system-resource + hawkBit :: REST Resources + + + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + + + org.eclipse.hawkbit + hawkbit-system-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-rest-core + ${project.version} + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.easytesting + fest-assert-core + test + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + tests + test + + + org.easytesting + fest-assert + test + + + ru.yandex.qatools.allure + allure-junit-adaptor + test + + + \ No newline at end of file diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java new file mode 100644 index 000000000..209dfdd95 --- /dev/null +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java @@ -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.system.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 System API. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Configuration +@ComponentScan +public @interface EnableSystemApi { + +} diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemManagementResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java similarity index 71% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemManagementResource.java rename to hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java index 27cfdb924..074cf444d 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemManagementResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.system.rest.resource; import java.util.Collection; import java.util.Collections; @@ -17,43 +17,32 @@ import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions; import org.eclipse.hawkbit.report.model.SystemUsageReport; import org.eclipse.hawkbit.report.model.TenantUsage; import org.eclipse.hawkbit.repository.SystemManagement; -import org.eclipse.hawkbit.repository.TenantConfigurationManagement; -import org.eclipse.hawkbit.rest.resource.model.systemmanagement.CacheRest; -import org.eclipse.hawkbit.rest.resource.model.systemmanagement.SystemStatisticsRest; -import org.eclipse.hawkbit.rest.resource.model.systemmanagement.TenantSystemUsageRest; +import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemCache; +import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemStatisticsRest; +import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemTenantServiceUsage; +import org.eclipse.hawkbit.system.rest.api.SystemManagementRestApi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * {@link SystemManagement} capabilities by REST. * - * - * - * */ @RestController -@RequestMapping(RestConstants.SYSTEM_ADMIN_MAPPING) -public class SystemManagementResource { +public class SystemManagementResource implements SystemManagementRestApi { private static final Logger LOGGER = LoggerFactory.getLogger(SystemManagementResource.class); @Autowired private SystemManagement systemManagement; - @Autowired - private TenantConfigurationManagement tenantConfigurationManagement; - @Autowired private CacheManager cacheManager; @@ -64,10 +53,9 @@ public class SystemManagementResource { * to delete * @return HttpStatus.OK */ - @RequestMapping(method = RequestMethod.DELETE, value = "/tenants/{tenant}") - public ResponseEntity deleteTenant(@PathVariable final String tenant) { + @Override + public ResponseEntity deleteTenant(final String tenant) { systemManagement.deleteTenant(tenant); - return new ResponseEntity<>(HttpStatus.OK); } @@ -77,8 +65,7 @@ public class SystemManagementResource { * * @return system usage statistics */ - @RequestMapping(method = RequestMethod.GET, value = "/usage", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) + @Override public ResponseEntity getSystemUsageStats() { final SystemUsageReport report = systemManagement.getSystemUsageStatistics(); @@ -93,8 +80,8 @@ public class SystemManagementResource { return ResponseEntity.ok(result); } - private static TenantSystemUsageRest convertTenant(final TenantUsage tenant) { - final TenantSystemUsageRest result = new TenantSystemUsageRest(tenant.getTenantName()); + private static SystemTenantServiceUsage convertTenant(final TenantUsage tenant) { + final SystemTenantServiceUsage result = new SystemTenantServiceUsage(tenant.getTenantName()); result.setActions(tenant.getActions()); result.setArtifacts(tenant.getArtifacts()); result.setOverallArtifactVolumeInBytes(tenant.getOverallArtifactVolumeInBytes()); @@ -108,9 +95,9 @@ public class SystemManagementResource { * * @return a list of caches for all tenants */ - @RequestMapping(method = RequestMethod.GET, value = "/caches") + @Override @PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN) - public ResponseEntity> getCaches() { + public ResponseEntity> getCaches() { final Collection cacheNames = cacheManager.getCacheNames(); return ResponseEntity .ok(cacheNames.stream().map(cacheManager::getCache).map(this::cacheRest).collect(Collectors.toList())); @@ -121,8 +108,8 @@ public class SystemManagementResource { * * @return a list of cache names which has been invalidated */ - @RequestMapping(method = RequestMethod.DELETE, value = "/caches") @PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN) + @Override public ResponseEntity> invalidateCaches() { final Collection cacheNames = cacheManager.getCacheNames(); LOGGER.info("Invalidating caches {}", cacheNames); @@ -130,20 +117,20 @@ public class SystemManagementResource { return ResponseEntity.ok(cacheNames); } - private CacheRest cacheRest(final Cache cache) { + private SystemCache cacheRest(final Cache cache) { final Object nativeCache = cache.getNativeCache(); if (nativeCache instanceof com.google.common.cache.Cache) { return guavaCache(cache, nativeCache); } else { - return new CacheRest(cache.getName(), Collections.emptyList()); + return new SystemCache(cache.getName(), Collections.emptyList()); } } @SuppressWarnings("unchecked") - private CacheRest guavaCache(final Cache cache, final Object nativeCache) { + private SystemCache guavaCache(final Cache cache, final Object nativeCache) { final com.google.common.cache.Cache guavaCache = (com.google.common.cache.Cache) nativeCache; final List keys = guavaCache.asMap().keySet().stream().map(key -> key.toString()) .collect(Collectors.toList()); - return new CacheRest(cache.getName(), keys); + return new SystemCache(cache.getName(), keys); } } diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemMapper.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java similarity index 81% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemMapper.java rename to hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java index 0f8119b53..3a7b39029 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemMapper.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.system.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -16,7 +16,7 @@ import java.util.Map; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.rest.resource.model.system.TenantConfigurationValueRest; +import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; /** @@ -34,10 +34,10 @@ public class SystemMapper { * instance of TenantConfigurationManagement * @return a map of all existing configuration values */ - public static Map toResponse( + public static Map toResponse( final TenantConfigurationManagement tenantConfigurationManagement) { - final Map configurationMap = new HashMap<>(); + final Map configurationMap = new HashMap<>(); for (final TenantConfigurationKey key : TenantConfigurationKey.values()) { configurationMap.put(key.getKeyName(), @@ -49,15 +49,15 @@ public class SystemMapper { /** * maps a TenantConfigurationValue from the repository model to a - * TenantConfigurationValueRest, the RESTful model. + * SystemTenantConfigurationValue, the RESTful model. * * @param repoConfValue * configuration value as repository model * @return configuration value as RESTful model */ - public static TenantConfigurationValueRest toResponse(final String key, + public static SystemTenantConfigurationValue toResponse(final String key, final TenantConfigurationValue repoConfValue) { - final TenantConfigurationValueRest restConfValue = new TenantConfigurationValueRest(); + final SystemTenantConfigurationValue restConfValue = new SystemTenantConfigurationValue(); restConfValue.setValue(repoConfValue.getValue()); restConfValue.setGlobal(repoConfValue.isGlobal()); diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java similarity index 67% rename from hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemResource.java rename to hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java index 9f2201868..ca9b84df4 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/rest/resource/SystemResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.system.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -15,20 +15,16 @@ import java.util.Map; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.rest.resource.model.system.TenantConfigurationValueRequest; -import org.eclipse.hawkbit.rest.resource.model.system.TenantConfigurationValueRest; +import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; +import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValueRequest; +import org.eclipse.hawkbit.system.rest.api.SystemRestApi; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.ResourceSupport; 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.RestController; /** @@ -39,15 +35,14 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -@RequestMapping(RestConstants.SYSTEM_V1_REQUEST_MAPPING) -public class SystemResource { +public class SystemResource implements SystemRestApi { private static final Logger LOG = LoggerFactory.getLogger(SystemResource.class); @Autowired private TenantConfigurationManagement tenantConfigurationManagement; - @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) + @Override public ResponseEntity getSystem() { final ResourceSupport resourceSupport = new ResourceSupport(); resourceSupport.add(linkTo(methodOn(SystemResource.class).getSystemConfiguration()).withRel("configs")); @@ -57,9 +52,8 @@ public class SystemResource { /** * @return a Map of all configuration values. */ - @RequestMapping(method = RequestMethod.GET, value = "/configs", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getSystemConfiguration() { + @Override + public ResponseEntity> getSystemConfiguration() { return new ResponseEntity<>(SystemMapper.toResponse(tenantConfigurationManagement), HttpStatus.OK); } @@ -73,9 +67,8 @@ public class SystemResource { * OK. In any failure the JsonResponseExceptionHandler is handling * the response. */ - @RequestMapping(method = RequestMethod.DELETE, value = "/configs/{keyName}", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity deleteConfigurationValue(@PathVariable final String keyName) { + @Override + public ResponseEntity deleteConfigurationValue(final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -95,9 +88,8 @@ public class SystemResource { * In any failure the JsonResponseExceptionHandler is handling the * response. */ - @RequestMapping(method = RequestMethod.GET, value = "/configs/{keyName}", produces = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getConfigurationValue(@PathVariable final String keyName) { + @Override + public ResponseEntity getConfigurationValue(final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -118,10 +110,9 @@ public class SystemResource { * In any failure the JsonResponseExceptionHandler is handling the * response. */ - @RequestMapping(method = RequestMethod.PUT, value = "/configs/{keyName}", consumes = { "application/hal+json", - MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity updateConfigurationValue(@PathVariable final String keyName, - @RequestBody final TenantConfigurationValueRequest configurationValueRest) { + @Override + public ResponseEntity updateConfigurationValue(final String keyName, + final SystemTenantConfigurationValueRequest configurationValueRest) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java new file mode 100644 index 000000000..de82640dc --- /dev/null +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java @@ -0,0 +1,55 @@ +/** + * 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.system.rest.resource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.ResultHandler; +import org.springframework.test.web.servlet.result.PrintingResultHandler; +import org.springframework.util.CollectionUtils; + +public abstract class MockMvcResultPrinter { + private static final Logger LOG = LoggerFactory.getLogger(MockMvcResultPrinter.class); + + private MockMvcResultPrinter() { + } + + /** + * Print {@link MvcResult} details to the "standard" output stream. + */ + public static ResultHandler print() { + return new ConsolePrintingResultHandler(); + } + + /** + * An {@link PrintingResultHandler} that writes to the "standard" output + * stream + */ + private static class ConsolePrintingResultHandler extends PrintingResultHandler { + + public ConsolePrintingResultHandler() { + super(new ResultValuePrinter() { + + @Override + public void printHeading(final String heading) { + LOG.debug(String.format("%20s:", heading)); + } + + @Override + public void printValue(final String label, Object value) { + if (value != null && value.getClass().isArray()) { + value = CollectionUtils.arrayToList(value); + } + LOG.debug(String.format("%20s = %s", label, value)); + } + }); + } + } +} diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java new file mode 100644 index 000000000..1b2772530 --- /dev/null +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java @@ -0,0 +1,32 @@ +/** + * 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.system.rest.resource; + +import java.io.IOException; + +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * Utility additions for the REST API tests. + * + * + */ +public final class ResourceUtility { + private static final ObjectMapper mapper = new ObjectMapper(); + + static ExceptionInfo convertException(final String jsonExceptionResponse) + throws JsonParseException, JsonMappingException, IOException { + return mapper.readValue(jsonExceptionResponse, ExceptionInfo.class); + } + +} diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SystemManagementResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java similarity index 98% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SystemManagementResourceTest.java rename to hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java index 76cd68d64..38a8f1b11 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/SystemManagementResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.system.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -21,7 +21,6 @@ import java.util.List; import java.util.Random; import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithSpringAuthorityRule; import org.eclipse.hawkbit.WithUser; @@ -40,7 +39,7 @@ import ru.yandex.qatools.allure.annotations.Stories; * * */ -@Features("Component Tests - Management API") +@Features("Component Tests - System API") @Stories("System Management Resource") public class SystemManagementResourceTest extends AbstractIntegrationTestWithMongoDB { diff --git a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ConfigurationResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java similarity index 87% rename from hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ConfigurationResourceTest.java rename to hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java index 39e571a2c..13ccf0999 100644 --- a/hawkbit-rest-resource/src/test/java/org/eclipse/hawkbit/rest/resource/ConfigurationResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.rest.resource; +package org.eclipse.hawkbit.system.rest.resource; import static org.fest.assertions.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.equalTo; @@ -19,10 +19,10 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.MockMvcResultPrinter; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.rest.resource.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; +import org.eclipse.hawkbit.system.rest.api.SystemRestConstant; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.junit.Test; import org.springframework.http.MediaType; @@ -33,9 +33,9 @@ import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; import ru.yandex.qatools.allure.annotations.Stories; -@Features("Component Tests - Management RESTful API") +@Features("Component Tests - System RESTful API") @Stories("ConfigurationResource") -public class ConfigurationResourceTest extends AbstractIntegrationTest { +public class SystemResourceTest extends AbstractIntegrationTest { private static String BASE_JSON_REQUEST_STRING = "{\"value\":\"%s\"}"; @@ -43,7 +43,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { @Description("perform a GET request on all existing configurations.") public void getConfigurationValues() throws Exception { - final ResultActions resultActions = mvc.perform(get(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/")) + final ResultActions resultActions = mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/")) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("$.*", hasSize(TenantConfigurationKey.values().length))); @@ -64,7 +64,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { tenantConfigurationManagement.addOrUpdateConfiguration(key, notGlobalValue); - mvc.perform(get(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) + mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("value", equalTo(notGlobalValue))).andExpect(jsonPath("global", equalTo(false))) .andExpect(jsonPath("createdAt", notNullValue())).andExpect(jsonPath("createdBy", notNullValue())); @@ -77,7 +77,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; final String testValue = "12:12:12"; - mvc.perform(put(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName()) + mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName()) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)).contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); @@ -98,7 +98,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).getValue()) .isEqualTo(notGlobalValue); - mvc.perform(delete(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) + mvc.perform(delete(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNoContent()); assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).isGlobal()).isEqualTo(true); @@ -114,7 +114,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { final String testValue = "12:12:12"; final MvcResult mvcResult = mvc - .perform(put(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", notExistingKey) + .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", notExistingKey) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) .contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); @@ -133,7 +133,7 @@ public class ConfigurationResourceTest extends AbstractIntegrationTest { final String testValue = "invalidFormattedDuration"; final MvcResult mvcResult = mvc - .perform(put(RestConstants.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", key.getKeyName()) + .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", key.getKeyName()) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) .contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); diff --git a/hawkbit-system-resource/src/test/resources/application-test.properties b/hawkbit-system-resource/src/test/resources/application-test.properties new file mode 100644 index 000000000..92506caa4 --- /dev/null +++ b/hawkbit-system-resource/src/test/resources/application-test.properties @@ -0,0 +1,63 @@ +# +# 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 +# + +# used if IM profile is disabled +security.ignored=true + +# IM required for integration tests +spring.profiles.active=im,suiteembedded,artifactrepository,redis + +server.port=12222 + +spring.data.mongodb.uri=mongodb://localhost/spArtifactRepository${random.value} +spring.data.mongodb.port=28017 + + +# supported: H2, MYSQL +hawkbit.server.database=H2 +hawkbit.server.database.env=TEST +spring.main.show_banner=false + +hawkbit.server.ddi.security.authentication.header=true + +hawkbit.server.artifact.repo.upload.maxFileSize=5MB + +hawkbit.server.security.dos.maxStatusEntriesPerAction=100 + +hawkbit.server.security.dos.maxAttributeEntriesPerTarget=10 + +spring.jpa.database=${hawkbit.server.database} +#spring.jpa.show-sql=true + + +flyway.sqlMigrationSuffix=${spring.jpa.database}.sql + +# effective DB setting +spring.datasource.url=${${hawkbit.server.database}.spring.datasource.url} +spring.datasource.driverClassName=${${hawkbit.server.database}.spring.datasource.driverClassName} +spring.datasource.username=${${hawkbit.server.database}.spring.datasource.username} +spring.datasource.password=${${hawkbit.server.database}.spring.datasource.password} + +# H2 +##;AUTOCOMMIT=ON +H2.spring.datasource.url=jdbc:h2:mem:sp-db;DB_CLOSE_ON_EXIT=FALSE +#H2.spring.datasource.url=jdbc:h2:./db/sp-db;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE +H2.spring.datasource.driverClassName=org.h2.Driver +H2.spring.datasource.username=sa +H2.spring.datasource.password=sa + +# MYSQL +MYSQL.spring.datasource.url=jdbc:mysql://localhost:3306/sp_test +MYSQL.spring.datasource.driverClassName=org.mariadb.jdbc.Driver +MYSQL.spring.datasource.username=root +MYSQL.spring.datasource.password= + +# SP Controller configuration +hawkbit.controller.pollingTime=00:01:00 +hawkbit.controller.pollingOverdueTime=00:01:00 diff --git a/pom.xml b/pom.xml index 11374a16d..0260683ba 100644 --- a/pom.xml +++ b/pom.xml @@ -24,24 +24,27 @@ hawkBit :: Parent - hawkbit-dmf-api - hawkbit-rest-api - hawkbit-ddi-api hawkbit-core hawkbit-security-core - hawkbit-repository + hawkbit-rest-core + hawkbit-system-api + hawkbit-system-resource + hawkbit-mgmt-api + hawkbit-mgmt-resource + hawkbit-ddi-api + hawkbit-ddi-resource + hawkbit-dmf-api hawkbit-dmf-amqp + hawkbit-repository hawkbit-security-integration hawkbit-http-security - hawkbit-rest-resource - hawkbit-ddi-resource hawkbit-ui hawkbit-artifact-repository-mongo hawkbit-autoconfigure hawkbit-cache-redis hawkbit-test-report - examples - + examples + From 2538d1278501e83441c69d2590b9ce3586d4b863 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 20 Apr 2016 17:55:54 +0200 Subject: [PATCH 013/124] Remove duplicate test util classes Signed-off-by: SirWayne --- hawkbit-ddi-resource/pom.xml | 8 +- .../rest/resource/DdiCancelActionTest.java | 2 + .../ddi/rest/resource/DdiConfigDataTest.java | 2 + .../rest/resource/DdiDeploymentBaseTest.java | 2 + .../rest/resource/DdiRootControllerTest.java | 2 + hawkbit-mgmt-resource/pom.xml | 6 + .../mgmt/rest/resource/JsonBuilder.java | 466 ------------------ .../MgmtDistributionSetResourceTest.java | 2 + .../MgmtDistributionSetTypeResourceTest.java | 2 + .../resource/MgmtDownloadResourceTest.java | 1 + .../resource/MgmtRolloutResourceTest.java | 4 +- .../MgmtSoftwareModuleResourceTest.java | 2 + .../MgmtSoftwareModuleTypeResourceTest.java | 2 + .../rest/resource/MgmtTargetResourceTest.java | 2 + .../rest/resource/MockMvcResultPrinter.java | 55 --- ...MRessourceMisingMongoDbConnectionTest.java | 1 + hawkbit-rest-core/pom.xml | 26 + .../hawkbit/rest/util}/JsonBuilder.java | 2 +- .../rest/util}/MockMvcResultPrinter.java | 2 +- .../hawkbit/rest/util}/SuccessCondition.java | 2 +- .../src/test/resources/log4j2.xml | 26 - hawkbit-system-resource/pom.xml | 6 + .../rest/resource/MockMvcResultPrinter.java | 55 --- .../SystemManagementResourceTest.java | 1 + .../rest/resource/SystemResourceTest.java | 1 + .../resources/application-test.properties | 63 --- 26 files changed, 73 insertions(+), 670 deletions(-) delete mode 100644 hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java delete mode 100644 hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java rename {hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource => hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util}/JsonBuilder.java (99%) rename {hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource => hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util}/MockMvcResultPrinter.java (97%) rename {hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource => hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util}/SuccessCondition.java (91%) delete mode 100644 hawkbit-rest-core/src/test/resources/log4j2.xml delete mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java delete mode 100644 hawkbit-system-resource/src/test/resources/application-test.properties diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index cafcfdf70..f73cb6c1e 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -28,7 +28,7 @@ org.eclipse.hawkbit - hawkbit-rest-core + hawkbit-rest-core ${project.version} @@ -40,6 +40,12 @@ + + org.eclipse.hawkbit + hawkbit-rest-core + ${project.version} + test + org.springframework.boot spring-boot-starter diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java index 27a7e7f1f..ddd826e8a 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java @@ -28,6 +28,8 @@ import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java index b757f1f1a..4a86cfe8c 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiConfigDataTest.java @@ -23,6 +23,8 @@ import java.util.Map; import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java index dd2f66a04..5c89291cc 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java @@ -35,6 +35,8 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.fest.assertions.core.Condition; import org.junit.Test; import org.springframework.data.domain.PageRequest; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java index f291393b9..407ff63d0 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java @@ -32,6 +32,8 @@ import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.eclipse.hawkbit.util.IpUtil; import org.junit.Test; diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index 311cbae76..cc95f8026 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -31,6 +31,12 @@ + + org.eclipse.hawkbit + hawkbit-rest-core + ${project.version} + test + org.springframework.boot spring-boot-starter diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java deleted file mode 100644 index 5a9f2785a..000000000 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/JsonBuilder.java +++ /dev/null @@ -1,466 +0,0 @@ -/** - * 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.mgmt.rest.resource; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.RandomStringUtils; -import org.eclipse.hawkbit.repository.model.DistributionSet; -import org.eclipse.hawkbit.repository.model.DistributionSetType; -import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupConditions; -import org.eclipse.hawkbit.repository.model.SoftwareModule; -import org.eclipse.hawkbit.repository.model.SoftwareModuleType; -import org.eclipse.hawkbit.repository.model.Target; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -/** - * Builder class for building certain json strings. - * - * - * - */ -public abstract class JsonBuilder { - - public static String softwareModules(final List modules) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final SoftwareModule module : modules) { - try { - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("type", module.getType().getKey()) - .put("id", Long.MAX_VALUE).put("vendor", module.getVendor()) - .put("version", module.getVersion()).put("createdAt", "0").put("updatedAt", "0") - .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh").toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < modules.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - public static String softwareModulesCreatableFieldsOnly(final List modules) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final SoftwareModule module : modules) { - try { - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("type", module.getType().getKey()) - .put("vendor", module.getVendor()).put("version", module.getVersion()).toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < modules.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - public static String softwareModuleUpdatableFieldsOnly(final SoftwareModule module) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append(new JSONObject().put("description", module.getDescription()).put("vendor", module.getVendor()) - .toString()); - - return builder.toString(); - - } - - public static String softwareModuleTypes(final List types) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final SoftwareModuleType module : types) { - try { - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("id", Long.MAX_VALUE) - .put("key", module.getKey()).put("maxAssignments", module.getMaxAssignments()) - .put("createdAt", "0").put("updatedAt", "0").put("createdBy", "fghdfkjghdfkjh") - .put("updatedBy", "fghdfkjghdfkjh").toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < types.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - public static String softwareModuleTypesCreatableFieldsOnly(final List types) - throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final SoftwareModuleType module : types) { - try { - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("key", module.getKey()) - .put("maxAssignments", module.getMaxAssignments()).toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < types.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - /** - * builds a json string for the feedback for the execution "proceeding". - * - * @param id - * of the Action feedback refers to - * @return the built string - * @throws JSONException - */ - public static String deploymentActionInProgressFeedback(final String id) throws JSONException { - return deploymentActionFeedback(id, "proceeding"); - } - - /** - * builds a certain json string for a action feedback. - * - * @param id - * of the action the feedback refers to - * @param execution - * see ExecutionStatus - * @return the build json string - * @throws JSONException - */ - public static String deploymentActionFeedback(final String id, final String execution) throws JSONException { - return deploymentActionFeedback(id, execution, "none", RandomStringUtils.randomAscii(1000)); - - } - - public static String deploymentActionFeedback(final String id, final String execution, final String message) - throws JSONException { - return deploymentActionFeedback(id, execution, "none", message); - - } - - public static String deploymentActionFeedback(final String id, final String execution, final String finished, - final String message) throws JSONException { - final List messages = new ArrayList(); - messages.add(message); - - return new JSONObject() - .put("id", id) - .put("time", "20140511T121314") - .put("status", - new JSONObject() - .put("execution", execution) - .put("result", - new JSONObject().put("finished", finished).put("progress", - new JSONObject().put("cnt", 2).put("of", 5))).put("details", messages)) - .toString(); - - } - - /** - * @param types - * @return - */ - public static String distributionSetTypes(final List types) { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final DistributionSetType module : types) { - - try { - - final JSONArray osmTypes = new JSONArray(); - module.getOptionalModuleTypes().forEach(smt -> osmTypes.put(new JSONObject().put("id", smt.getId()))); - - final JSONArray msmTypes = new JSONArray(); - module.getMandatoryModuleTypes().forEach(smt -> msmTypes.put(new JSONObject().put("id", smt.getId()))); - - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("id", Long.MAX_VALUE) - .put("key", module.getKey()).put("createdAt", "0").put("updatedAt", "0") - .put("createdBy", "fghdfkjghdfkjh").put("optionalmodules", osmTypes) - .put("mandatorymodules", msmTypes).put("updatedBy", "fghdfkjghdfkjh").toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < types.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - } - - public static String distributionSetTypesCreateValidFieldsOnly(final List types) { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final DistributionSetType module : types) { - - try { - - final JSONArray osmTypes = new JSONArray(); - module.getOptionalModuleTypes().forEach(smt -> osmTypes.put(new JSONObject().put("id", smt.getId()))); - - final JSONArray msmTypes = new JSONArray(); - module.getMandatoryModuleTypes().forEach(smt -> msmTypes.put(new JSONObject().put("id", smt.getId()))); - - builder.append(new JSONObject().put("name", module.getName()) - .put("description", module.getDescription()).put("key", module.getKey()) - .put("optionalmodules", osmTypes).put("mandatorymodules", msmTypes).toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < types.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - } - - public static String distributionSets(final List sets) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final DistributionSet set : sets) { - try { - builder.append(distributionSet(set)); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < sets.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - public static String distributionSetsCreateValidFieldsOnly(final List sets) throws JSONException { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final DistributionSet set : sets) { - try { - builder.append(distributionSetCreateValidFieldsOnly(set)); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < sets.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - - } - - public static String distributionSetCreateValidFieldsOnly(final DistributionSet set) throws JSONException { - - final List modules = set.getModules().stream().map(module -> { - try { - return new JSONObject().put("id", module.getId()); - } catch (final Exception e) { - e.printStackTrace(); - } - - return null; - }).collect(Collectors.toList()); - - return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) - .put("type", set.getType() == null ? null : set.getType().getKey()).put("version", set.getVersion()) - .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", modules).toString(); - - } - - public static String distributionSetUpdateValidFieldsOnly(final DistributionSet set) throws JSONException { - - final List modules = set.getModules().stream().map(module -> { - try { - return new JSONObject().put("id", module.getId()); - } catch (final Exception e) { - e.printStackTrace(); - } - - return null; - }).collect(Collectors.toList()); - - return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) - .put("version", set.getVersion()).toString(); - - } - - public static String distributionSet(final DistributionSet set) throws JSONException { - - final List modules = set.getModules().stream().map(module -> { - try { - return new JSONObject().put("id", module.getId()); - } catch (final Exception e) { - e.printStackTrace(); - } - - return null; - }).collect(Collectors.toList()); - - return new JSONObject().put("name", set.getName()).put("description", set.getDescription()) - .put("type", set.getType() == null ? null : set.getType().getKey()).put("id", Long.MAX_VALUE) - .put("version", set.getVersion()).put("createdAt", "0").put("updatedAt", "0") - .put("createdBy", "fghdfkjghdfkjh").put("updatedBy", "fghdfkjghdfkjh") - .put("requiredMigrationStep", set.isRequiredMigrationStep()).put("modules", modules).toString(); - - } - - /** - * @param targets - * @return - */ - public static String targets(final List targets) { - final StringBuilder builder = new StringBuilder(); - - builder.append("["); - int i = 0; - for (final Target target : targets) { - try { - builder.append(new JSONObject().put("controllerId", target.getControllerId()) - .put("description", target.getDescription()).put("name", target.getName()) - .put("createdAt", "0").put("updatedAt", "0").put("createdBy", "fghdfkjghdfkjh") - .put("updatedBy", "fghdfkjghdfkjh").toString()); - } catch (final Exception e) { - e.printStackTrace(); - } - - if (++i < targets.size()) { - builder.append(","); - } - } - - builder.append("]"); - - return builder.toString(); - } - - public static String rollout(final String name, final String description, final int groupSize, - final long distributionSetId, final String targetFilterQuery, final RolloutGroupConditions conditions) { - final JSONObject json = new JSONObject(); - json.put("name", name); - json.put("description", description); - json.put("amountGroups", groupSize); - json.put("distributionSetId", distributionSetId); - json.put("targetFilterQuery", targetFilterQuery); - - if (conditions != null) { - final JSONObject successCondition = new JSONObject(); - json.put("successCondition", successCondition); - successCondition.put("condition", conditions.getSuccessCondition().toString()); - successCondition.put("expression", conditions.getSuccessConditionExp().toString()); - - final JSONObject successAction = new JSONObject(); - json.put("successAction", successAction); - successAction.put("action", conditions.getSuccessAction().toString()); - successAction.put("expression", conditions.getSuccessActionExp().toString()); - - final JSONObject errorCondition = new JSONObject(); - json.put("errorCondition", errorCondition); - errorCondition.put("condition", conditions.getErrorCondition().toString()); - errorCondition.put("expression", conditions.getErrorConditionExp().toString()); - - final JSONObject errorAction = new JSONObject(); - json.put("errorAction", errorAction); - errorAction.put("action", conditions.getErrorAction().toString()); - errorAction.put("expression", conditions.getErrorActionExp().toString()); - } - - return json.toString(); - } - - public static String cancelActionFeedback(final String id, final String execution) throws JSONException { - return cancelActionFeedback(id, execution, RandomStringUtils.randomAscii(1000)); - - } - - public static String cancelActionFeedback(final String id, final String execution, final String message) - throws JSONException { - final List messages = new ArrayList(); - messages.add(message); - return new JSONObject() - .put("id", id) - .put("time", "20140511T121314") - .put("status", - new JSONObject().put("execution", execution) - .put("result", new JSONObject().put("finished", "success")).put("details", messages)) - .toString(); - - } - - public static String configData(final String id, final Map attributes, final String execution) - throws JSONException { - return new JSONObject() - .put("id", id) - .put("time", "20140511T121314") - .put("status", - new JSONObject().put("execution", execution) - .put("result", new JSONObject().put("finished", "success")) - .put("details", new ArrayList())).put("data", attributes).toString(); - - } - -} diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java index b7839f7f6..61a84fdd8 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java @@ -44,6 +44,8 @@ import org.eclipse.hawkbit.repository.model.DistributionSetMetadata; import org.eclipse.hawkbit.repository.model.DsMetadataCompositeKey; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java index b2f309995..8bc8c6ca9 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java @@ -30,6 +30,8 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONException; import org.json.JSONObject; import org.junit.Test; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java index 2311b098c..1122f3ed4 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java @@ -20,6 +20,7 @@ import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java index f33ceb942..35ab7a786 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java @@ -25,7 +25,6 @@ import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; -import org.eclipse.hawkbit.mgmt.rest.resource.MgmtRolloutResource; import org.eclipse.hawkbit.repository.RolloutGroupManagement; import org.eclipse.hawkbit.repository.RolloutManagement; import org.eclipse.hawkbit.repository.model.DistributionSet; @@ -35,6 +34,9 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupConditionBuilder; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; +import org.eclipse.hawkbit.rest.util.SuccessCondition; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Description; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java index f6a945a29..dbce7d90e 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java @@ -47,6 +47,8 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata; import org.eclipse.hawkbit.repository.model.SwMetadataCompositeKey; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index d8d113fbc..aa2cd68e2 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -28,6 +28,8 @@ import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONException; import org.json.JSONObject; import org.junit.Test; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java index 6954aee31..fff9d8d2e 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java @@ -48,6 +48,8 @@ import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetInfo; import org.eclipse.hawkbit.rest.exception.MessageNotReadableException; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.util.JsonBuilder; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.eclipse.hawkbit.util.IpUtil; import org.json.JSONException; import org.json.JSONObject; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java deleted file mode 100644 index 7d07b3bd3..000000000 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MockMvcResultPrinter.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.mgmt.rest.resource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.ResultHandler; -import org.springframework.test.web.servlet.result.PrintingResultHandler; -import org.springframework.util.CollectionUtils; - -public abstract class MockMvcResultPrinter { - private static final Logger LOG = LoggerFactory.getLogger(MockMvcResultPrinter.class); - - private MockMvcResultPrinter() { - } - - /** - * Print {@link MvcResult} details to the "standard" output stream. - */ - public static ResultHandler print() { - return new ConsolePrintingResultHandler(); - } - - /** - * An {@link PrintingResultHandler} that writes to the "standard" output - * stream - */ - private static class ConsolePrintingResultHandler extends PrintingResultHandler { - - public ConsolePrintingResultHandler() { - super(new ResultValuePrinter() { - - @Override - public void printHeading(final String heading) { - LOG.debug(String.format("%20s:", heading)); - } - - @Override - public void printValue(final String label, Object value) { - if (value != null && value.getClass().isArray()) { - value = CollectionUtils.arrayToList(value); - } - LOG.debug(String.format("%20s = %s", label, value)); - } - }); - } - } -} diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java index 4f80728f1..15d22c703 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SMRessourceMisingMongoDbConnectionTest.java @@ -17,6 +17,7 @@ import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.mock.web.MockMultipartFile; diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml index 9048cf677..f731a35a3 100644 --- a/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest-core/pom.xml @@ -55,5 +55,31 @@ allure-junit-adaptor test + + org.springframework.boot + spring-boot-starter-test + test + + + org.json + json + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + \ No newline at end of file diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java similarity index 99% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java rename to hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java index cf791bcf8..b73320f0e 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/JsonBuilder.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/JsonBuilder.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.rest.resource; +package org.eclipse.hawkbit.rest.util; import java.util.ArrayList; import java.util.List; diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/MockMvcResultPrinter.java similarity index 97% rename from hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java rename to hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/MockMvcResultPrinter.java index ba5020c58..b1de56f61 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/MockMvcResultPrinter.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/MockMvcResultPrinter.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.rest.resource; +package org.eclipse.hawkbit.rest.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SuccessCondition.java similarity index 91% rename from hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java rename to hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SuccessCondition.java index cafc36b0b..f3424b0c0 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/SuccessCondition.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/SuccessCondition.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.mgmt.rest.resource; +package org.eclipse.hawkbit.rest.util; /** * diff --git a/hawkbit-rest-core/src/test/resources/log4j2.xml b/hawkbit-rest-core/src/test/resources/log4j2.xml deleted file mode 100644 index 98ea99ac9..000000000 --- a/hawkbit-rest-core/src/test/resources/log4j2.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml index fed198db3..6b02cf70c 100644 --- a/hawkbit-system-resource/pom.xml +++ b/hawkbit-system-resource/pom.xml @@ -31,6 +31,12 @@ + + org.eclipse.hawkbit + hawkbit-rest-core + ${project.version} + test + org.springframework.boot spring-boot-starter-test diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java deleted file mode 100644 index de82640dc..000000000 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/MockMvcResultPrinter.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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.system.rest.resource; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.ResultHandler; -import org.springframework.test.web.servlet.result.PrintingResultHandler; -import org.springframework.util.CollectionUtils; - -public abstract class MockMvcResultPrinter { - private static final Logger LOG = LoggerFactory.getLogger(MockMvcResultPrinter.class); - - private MockMvcResultPrinter() { - } - - /** - * Print {@link MvcResult} details to the "standard" output stream. - */ - public static ResultHandler print() { - return new ConsolePrintingResultHandler(); - } - - /** - * An {@link PrintingResultHandler} that writes to the "standard" output - * stream - */ - private static class ConsolePrintingResultHandler extends PrintingResultHandler { - - public ConsolePrintingResultHandler() { - super(new ResultValuePrinter() { - - @Override - public void printHeading(final String heading) { - LOG.debug(String.format("%20s:", heading)); - } - - @Override - public void printValue(final String label, Object value) { - if (value != null && value.getClass().isArray()) { - value = CollectionUtils.arrayToList(value); - } - LOG.debug(String.format("%20s = %s", label, value)); - } - }); - } - } -} diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java index 38a8f1b11..fb98a8470 100644 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java @@ -28,6 +28,7 @@ import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Test; import org.springframework.http.MediaType; diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java index 13ccf0999..abb61ef67 100644 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java @@ -22,6 +22,7 @@ import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.exception.SpServerError; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; +import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.eclipse.hawkbit.system.rest.api.SystemRestConstant; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.junit.Test; diff --git a/hawkbit-system-resource/src/test/resources/application-test.properties b/hawkbit-system-resource/src/test/resources/application-test.properties deleted file mode 100644 index 92506caa4..000000000 --- a/hawkbit-system-resource/src/test/resources/application-test.properties +++ /dev/null @@ -1,63 +0,0 @@ -# -# 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 -# - -# used if IM profile is disabled -security.ignored=true - -# IM required for integration tests -spring.profiles.active=im,suiteembedded,artifactrepository,redis - -server.port=12222 - -spring.data.mongodb.uri=mongodb://localhost/spArtifactRepository${random.value} -spring.data.mongodb.port=28017 - - -# supported: H2, MYSQL -hawkbit.server.database=H2 -hawkbit.server.database.env=TEST -spring.main.show_banner=false - -hawkbit.server.ddi.security.authentication.header=true - -hawkbit.server.artifact.repo.upload.maxFileSize=5MB - -hawkbit.server.security.dos.maxStatusEntriesPerAction=100 - -hawkbit.server.security.dos.maxAttributeEntriesPerTarget=10 - -spring.jpa.database=${hawkbit.server.database} -#spring.jpa.show-sql=true - - -flyway.sqlMigrationSuffix=${spring.jpa.database}.sql - -# effective DB setting -spring.datasource.url=${${hawkbit.server.database}.spring.datasource.url} -spring.datasource.driverClassName=${${hawkbit.server.database}.spring.datasource.driverClassName} -spring.datasource.username=${${hawkbit.server.database}.spring.datasource.username} -spring.datasource.password=${${hawkbit.server.database}.spring.datasource.password} - -# H2 -##;AUTOCOMMIT=ON -H2.spring.datasource.url=jdbc:h2:mem:sp-db;DB_CLOSE_ON_EXIT=FALSE -#H2.spring.datasource.url=jdbc:h2:./db/sp-db;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE -H2.spring.datasource.driverClassName=org.h2.Driver -H2.spring.datasource.username=sa -H2.spring.datasource.password=sa - -# MYSQL -MYSQL.spring.datasource.url=jdbc:mysql://localhost:3306/sp_test -MYSQL.spring.datasource.driverClassName=org.mariadb.jdbc.Driver -MYSQL.spring.datasource.username=root -MYSQL.spring.datasource.password= - -# SP Controller configuration -hawkbit.controller.pollingTime=00:01:00 -hawkbit.controller.pollingOverdueTime=00:01:00 From 3fa91054284b8f3dbff9e74dbe33eeef73fa00b6 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 10:02:03 +0200 Subject: [PATCH 014/124] Add test dependencies Add name of @PathVariable Signed-off-by: SirWayne --- .../SoftwareModuleResourceClient.java | 4 +- hawkbit-ddi-resource/pom.xml | 20 +--- .../mgmt/rest/api/MgmtDownloadRestApi.java | 2 +- ...PI.java => MgmtSoftwareModuleRestApi.java} | 2 +- hawkbit-mgmt-resource/pom.xml | 28 ++--- .../resource/MgmtSoftwareModuleMapper.java | 8 +- .../resource/MgmtSoftwareModuleResource.java | 4 +- .../MgmtDistributionSetResourceTest.java | 64 +---------- .../org/eclipse/hawkbit/TestDataUtil.java | 59 +++++++++++ hawkbit-rest-core/pom.xml | 2 +- .../resources/application-test.properties | 63 ----------- .../rest/api/SystemManagementRestApi.java | 2 +- hawkbit-system-resource/pom.xml | 100 ++++++++++++++++-- 13 files changed, 174 insertions(+), 184 deletions(-) rename hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/{MgmtSoftwareModuleRestAPI.java => MgmtSoftwareModuleRestApi.java} (99%) delete mode 100644 hawkbit-rest-core/src/test/resources/application-test.properties diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java index aaf589779..80fcf734e 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java @@ -8,13 +8,13 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the SoftwareModule resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremodules") -public interface SoftwareModuleResourceClient extends MgmtSoftwareModuleRestAPI { +public interface SoftwareModuleResourceClient extends MgmtSoftwareModuleRestApi { } diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index f73cb6c1e..d5ba2c21c 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -42,9 +42,10 @@ org.eclipse.hawkbit - hawkbit-rest-core + hawkbit-rest-core ${project.version} - test + tests + test org.springframework.boot @@ -151,19 +152,4 @@ test - - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java index c7caed01b..85c498296 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java @@ -36,7 +36,7 @@ public interface MgmtDownloadRestApi { */ @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING) @ResponseBody - ResponseEntity downloadArtifactByDownloadId(@PathVariable final String downloadId, + ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId, final HttpServletResponse response); } diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java similarity index 99% rename from hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index e452eb9a3..d5dbb6c7e 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestAPI.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -32,7 +32,7 @@ import org.springframework.web.multipart.MultipartFile; * */ @RequestMapping(MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) -public interface MgmtSoftwareModuleRestAPI { +public interface MgmtSoftwareModuleRestApi { /** * Handles POST request for artifact upload. diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index cc95f8026..c52506e11 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -10,7 +10,7 @@ 0.2.0-SNAPSHOT hawkbit-mgmt-resource - hawkBit :: REST Resources + hawkBit :: REST Managment Resources @@ -31,11 +31,12 @@ - + org.eclipse.hawkbit - hawkbit-rest-core + hawkbit-rest-core ${project.version} - test + tests + test org.springframework.boot @@ -136,25 +137,10 @@ allure-junit-adaptor test - + org.springframework spring-context-support test - + - - - - org.apache.maven.plugins - maven-jar-plugin - - - - test-jar - - - - - - \ No newline at end of file diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java index b31fe068a..a100b6fb4 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java @@ -20,7 +20,7 @@ import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifactHash; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; -import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestApi; import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; @@ -140,9 +140,9 @@ public final class MgmtSoftwareModuleMapper { response.setType(baseSofwareModule.getType().getKey()); response.setVendor(baseSofwareModule.getVendor()); - response.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getArtifacts(response.getModuleId())) + response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getArtifacts(response.getModuleId())) .withRel(MgmtRestConstants.SOFTWAREMODULE_V1_ARTIFACT)); - response.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getSoftwareModule(response.getModuleId())) + response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getSoftwareModule(response.getModuleId())) .withRel("self")); response.add(linkTo( @@ -176,7 +176,7 @@ public final class MgmtSoftwareModuleMapper { MgmtRestModelMapper.mapBaseToBase(artifactRest, artifact); - artifactRest.add(linkTo(methodOn(MgmtSoftwareModuleRestAPI.class).getArtifact(artifact.getSoftwareModule().getId(), + artifactRest.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getArtifact(artifact.getSoftwareModule().getId(), artifact.getId())).withRel("self")); if (artifact instanceof LocalArtifact) { diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java index f4135744b..51b543366 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java @@ -18,7 +18,7 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleRequestBodyPut; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; -import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestAPI; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; @@ -51,7 +51,7 @@ import org.springframework.web.multipart.MultipartFile; * */ @RestController -public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestAPI { +public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { private static final Logger LOG = LoggerFactory.getLogger(MgmtSoftwareModuleResource.class); @Autowired diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java index 61a84fdd8..5017d4ff6 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java @@ -30,15 +30,8 @@ import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; -import org.eclipse.hawkbit.repository.ActionRepository; -import org.eclipse.hawkbit.repository.ControllerManagement; -import org.eclipse.hawkbit.repository.DistributionSetManagement; -import org.eclipse.hawkbit.repository.SoftwareManagement; -import org.eclipse.hawkbit.repository.TargetManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; -import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; -import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetMetadata; import org.eclipse.hawkbit.repository.model.DsMetadataCompositeKey; @@ -299,8 +292,8 @@ public class MgmtDistributionSetResourceTest extends AbstractIntegrationTest { // assign knownTargetId to distribution set deploymentManagement.assignDistributionSet(createdDs.getId(), knownTargetId); // make it in install state - sendUpdateActionStatusToTargets(controllerManagament, targetManagement, actionRepository, createdDs, - Lists.newArrayList(createTarget), Status.FINISHED, "some message"); + TestDataUtil.sendUpdateActionStatusToTargets(controllerManagament, targetManagement, actionRepository, + createdDs, Lists.newArrayList(createTarget), Status.FINISHED, "some message"); mvc.perform(get( MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING + "/" + createdDs.getId() + "/installedTargets")) @@ -399,7 +392,8 @@ public class MgmtDistributionSetResourceTest extends AbstractIntegrationTest { @WithUser(principal = "uploadTester", allSpPermissions = true) @Description("Ensures that single DS requested by ID is listed with expected payload.") public void getDistributionSet() throws Exception { - final DistributionSet set = createTestDistributionSet(softwareManagement, distributionSetManagement); + final DistributionSet set = TestDataUtil.createTestDistributionSet(softwareManagement, + distributionSetManagement); // perform request mvc.perform(get("/rest/v1/distributionsets/{dsId}", set.getId()).accept(MediaType.APPLICATION_JSON)) @@ -869,54 +863,4 @@ public class MgmtDistributionSetResourceTest extends AbstractIntegrationTest { return created; } - public static List sendUpdateActionStatusToTargets(final ControllerManagement controllerManagament, - final TargetManagement targetManagement, final ActionRepository actionRepository, final DistributionSet dsA, - final Iterable targs, final Status status, final String... msgs) { - final List result = new ArrayList(); - for (final Target t : targs) { - final List findByTarget = actionRepository.findByTarget(t); - for (final Action action : findByTarget) { - result.add(sendUpdateActionStatusToTarget(controllerManagament, targetManagement, status, action, t, - msgs)); - } - } - return result; - } - - private static Target sendUpdateActionStatusToTarget(final ControllerManagement controllerManagament, - final TargetManagement targetManagement, final Status status, final Action updActA, final Target t, - final String... msgs) { - updActA.setStatus(status); - - final ActionStatus statusMessages = new ActionStatus(); - statusMessages.setAction(updActA); - statusMessages.setOccurredAt(System.currentTimeMillis()); - statusMessages.setStatus(status); - for (final String msg : msgs) { - statusMessages.addMessage(msg); - } - controllerManagament.addUpdateActionStatus(statusMessages, updActA); - return targetManagement.findTargetByControllerID(t.getControllerId()); - } - - public static DistributionSet createTestDistributionSet(final SoftwareManagement softwareManagement, - final DistributionSetManagement distributionSetManagement) { - - DistributionSet set = TestDataUtil.generateDistributionSet("one", softwareManagement, - distributionSetManagement); - set.setVersion("anotherVersion"); - set = distributionSetManagement.updateDistributionSet(set); - - set.getModules().forEach(module -> { - module.setDescription("updated description"); - softwareManagement.updateSoftwareModule(module); - }); - - // load also lazy stuff - set = distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()); - - assertThat(distributionSetManagement.findDistributionSetsAll(pageReq, false, true)).hasSize(1); - return set; - } - } diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/TestDataUtil.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/TestDataUtil.java index 1787d29e4..7ce8283dc 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/TestDataUtil.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/TestDataUtil.java @@ -8,6 +8,8 @@ */ package org.eclipse.hawkbit; +import static org.fest.assertions.api.Assertions.assertThat; + import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; @@ -16,10 +18,15 @@ import java.util.Random; import java.util.UUID; import org.apache.commons.io.IOUtils; +import org.eclipse.hawkbit.repository.ActionRepository; import org.eclipse.hawkbit.repository.ArtifactManagement; +import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.TargetManagement; +import org.eclipse.hawkbit.repository.model.Action; +import org.eclipse.hawkbit.repository.model.Action.Status; +import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetTag; import org.eclipse.hawkbit.repository.model.DistributionSetType; @@ -27,6 +34,8 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetTag; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; import com.google.common.base.Strings; import com.google.common.collect.Lists; @@ -42,6 +51,56 @@ import net._01001111.text.LoremIpsum; public class TestDataUtil { private static final LoremIpsum LOREM = new LoremIpsum(); + public static DistributionSet createTestDistributionSet(final SoftwareManagement softwareManagement, + final DistributionSetManagement distributionSetManagement) { + final Pageable pageReq = new PageRequest(0, 400); + DistributionSet set = TestDataUtil.generateDistributionSet("one", softwareManagement, + distributionSetManagement); + set.setVersion("anotherVersion"); + set = distributionSetManagement.updateDistributionSet(set); + + set.getModules().forEach(module -> { + module.setDescription("updated description"); + softwareManagement.updateSoftwareModule(module); + }); + + // load also lazy stuff + set = distributionSetManagement.findDistributionSetByIdWithDetails(set.getId()); + + assertThat(distributionSetManagement.findDistributionSetsAll(pageReq, false, true)).hasSize(1); + return set; + } + + public static List sendUpdateActionStatusToTargets(final ControllerManagement controllerManagament, + final TargetManagement targetManagement, final ActionRepository actionRepository, final DistributionSet dsA, + final Iterable targs, final Status status, final String... msgs) { + final List result = new ArrayList(); + for (final Target t : targs) { + final List findByTarget = actionRepository.findByTarget(t); + for (final Action action : findByTarget) { + result.add(sendUpdateActionStatusToTarget(controllerManagament, targetManagement, status, action, t, + msgs)); + } + } + return result; + } + + private static Target sendUpdateActionStatusToTarget(final ControllerManagement controllerManagament, + final TargetManagement targetManagement, final Status status, final Action updActA, final Target t, + final String... msgs) { + updActA.setStatus(status); + + final ActionStatus statusMessages = new ActionStatus(); + statusMessages.setAction(updActA); + statusMessages.setOccurredAt(System.currentTimeMillis()); + statusMessages.setStatus(status); + for (final String msg : msgs) { + statusMessages.addMessage(msg); + } + controllerManagament.addUpdateActionStatus(statusMessages, updActA); + return targetManagement.findTargetByControllerID(t.getControllerId()); + } + public static List generateDistributionSets(final String suffix, final int number, final SoftwareManagement softwareManagement, final DistributionSetManagement distributionSetManagement) { diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml index f731a35a3..6cc9d432b 100644 --- a/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest-core/pom.xml @@ -10,7 +10,7 @@ 0.2.0-SNAPSHOT hawkbit-rest-core - hawkBit :: REST Resources + hawkBit :: REST Core diff --git a/hawkbit-rest-core/src/test/resources/application-test.properties b/hawkbit-rest-core/src/test/resources/application-test.properties deleted file mode 100644 index 92506caa4..000000000 --- a/hawkbit-rest-core/src/test/resources/application-test.properties +++ /dev/null @@ -1,63 +0,0 @@ -# -# 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 -# - -# used if IM profile is disabled -security.ignored=true - -# IM required for integration tests -spring.profiles.active=im,suiteembedded,artifactrepository,redis - -server.port=12222 - -spring.data.mongodb.uri=mongodb://localhost/spArtifactRepository${random.value} -spring.data.mongodb.port=28017 - - -# supported: H2, MYSQL -hawkbit.server.database=H2 -hawkbit.server.database.env=TEST -spring.main.show_banner=false - -hawkbit.server.ddi.security.authentication.header=true - -hawkbit.server.artifact.repo.upload.maxFileSize=5MB - -hawkbit.server.security.dos.maxStatusEntriesPerAction=100 - -hawkbit.server.security.dos.maxAttributeEntriesPerTarget=10 - -spring.jpa.database=${hawkbit.server.database} -#spring.jpa.show-sql=true - - -flyway.sqlMigrationSuffix=${spring.jpa.database}.sql - -# effective DB setting -spring.datasource.url=${${hawkbit.server.database}.spring.datasource.url} -spring.datasource.driverClassName=${${hawkbit.server.database}.spring.datasource.driverClassName} -spring.datasource.username=${${hawkbit.server.database}.spring.datasource.username} -spring.datasource.password=${${hawkbit.server.database}.spring.datasource.password} - -# H2 -##;AUTOCOMMIT=ON -H2.spring.datasource.url=jdbc:h2:mem:sp-db;DB_CLOSE_ON_EXIT=FALSE -#H2.spring.datasource.url=jdbc:h2:./db/sp-db;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;MVCC=TRUE -H2.spring.datasource.driverClassName=org.h2.Driver -H2.spring.datasource.username=sa -H2.spring.datasource.password=sa - -# MYSQL -MYSQL.spring.datasource.url=jdbc:mysql://localhost:3306/sp_test -MYSQL.spring.datasource.driverClassName=org.mariadb.jdbc.Driver -MYSQL.spring.datasource.username=root -MYSQL.spring.datasource.password= - -# SP Controller configuration -hawkbit.controller.pollingTime=00:01:00 -hawkbit.controller.pollingOverdueTime=00:01:00 diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java index 9e7864439..6185fceea 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java @@ -33,7 +33,7 @@ public interface SystemManagementRestApi { * @return HttpStatus.OK */ @RequestMapping(method = RequestMethod.DELETE, value = "/tenants/{tenant}") - ResponseEntity deleteTenant(@PathVariable final String tenant); + ResponseEntity deleteTenant(@PathVariable("tenant") final String tenant); /** * Collects and returns system usage statistics. It provides a system wide diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml index 6b02cf70c..7c00b3fec 100644 --- a/hawkbit-system-resource/pom.xml +++ b/hawkbit-system-resource/pom.xml @@ -10,7 +10,7 @@ 0.2.0-SNAPSHOT hawkbit-system-resource - hawkBit :: REST Resources + hawkBit :: System REST Resources @@ -33,25 +33,93 @@ org.eclipse.hawkbit - hawkbit-rest-core + hawkbit-rest-core ${project.version} - test + tests + test + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + test + + + org.springframework.boot + spring-boot-starter-log4j2 + test + + + com.h2database + h2 + test + + + org.mariadb.jdbc + mariadb-java-client + test + + + javax.el + javax.el-api + test + + + org.springframework.security + spring-security-config + test + + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + tests + test + + + org.eclipse.hawkbit + hawkbit-http-security + ${project.version} + test + + + com.jayway.jsonpath + json-path + test + + + org.json + json + test + + + com.fasterxml.jackson.core + jackson-databind + test + + + com.fasterxml.jackson.core + jackson-core + test org.springframework.boot spring-boot-starter-test test - - org.easytesting - fest-assert-core + + org.springframework.security + spring-security-aspects test - - org.eclipse.hawkbit - hawkbit-repository - ${project.version} - tests + + org.easytesting + fest-assert-core test @@ -59,10 +127,20 @@ fest-assert test + + de.flapdoodle.embed + de.flapdoodle.embed.mongo + test + ru.yandex.qatools.allure allure-junit-adaptor test + + org.springframework + spring-context-support + test + \ No newline at end of file From bb0fb5da8d16f34aa376de87e7dde68e0ceef380 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 11:29:56 +0200 Subject: [PATCH 015/124] Add name of @PathVariable Signed-off-by: SirWayne --- .../rest/resource/DataConversionHelper.java | 6 +-- ...r.java => DdiArtifactStoreController.java} | 22 +++++----- ...Controller.java => DdiRootController.java} | 44 ++++++++----------- hawkbit-mgmt-resource/pom.xml | 7 ++- .../system/rest/api/SystemRestApi.java | 7 +-- .../rest/resource/SystemResourceTest.java | 10 ++--- 6 files changed, 47 insertions(+), 49 deletions(-) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/{ArtifactStoreController.java => DdiArtifactStoreController.java} (84%) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/{RootController.java => DdiRootController.java} (91%) diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index 2fd151f6e..b662f2b5f 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -117,12 +117,12 @@ public final class DataConversionHelper { // have changed from 'soft' to 'forced' type and we need to // change the payload of the // response because of eTags. - result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()) + result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant()) .getControllerBasedeploymentAction(target.getControllerId(), action.getId(), actions.hashCode(), null)).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION)); addedUpdate = true; } else if (action.isCancelingOrCanceled() && !addedCancel) { - result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()) + result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant()) .getControllerCancelAction(target.getControllerId(), action.getId(), null)) .withRel(DdiRestConstants.CANCEL_ACTION)); addedCancel = true; @@ -130,7 +130,7 @@ public final class DataConversionHelper { } if (target.getTargetInfo().isRequestControllerAttributes()) { - result.add(linkTo(methodOn(RootController.class, tenantAware.getCurrentTenant()).putConfigData(null, + result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant()).putConfigData(null, target.getControllerId(), null)).withRel(DdiRestConstants.CONFIG_DATA_ACTION)); } return result; diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java similarity index 84% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index 2a6d544ab..4c24b0238 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/ArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -32,21 +32,20 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** - * The {@link ArtifactStoreController} of the HawkBit server controller API that - * is queried by the HawkBit target in order to download artifacts independent - * of their own individual resource. This is offered in addition to the - * {@link RootController#downloadArtifact(String, Long, Long, javax.servlet.http.HttpServletResponse)} + * The {@link DdiArtifactStoreController} of the HawkBit server controller API + * that is queried by the HawkBit target in order to download artifacts + * independent of their own individual resource. This is offered in addition to + * the + * {@link DdiRootController#downloadArtifact(String, Long, Long, javax.servlet.http.HttpServletResponse)} * for legacy controllers that can not be fed with a download URI at runtime. */ @RestController -public class ArtifactStoreController implements DdiArtifactStoreControllerRestApi { +public class DdiArtifactStoreController implements DdiArtifactStoreControllerRestApi { - private static final Logger LOG = LoggerFactory.getLogger(ArtifactStoreController.class); + private static final Logger LOG = LoggerFactory.getLogger(DdiArtifactStoreController.class); @Autowired private ArtifactManagement artifactManagement; @@ -61,9 +60,8 @@ public class ArtifactStoreController implements DdiArtifactStoreControllerRestAp private HawkbitSecurityProperties securityProperties; @Override - public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, - final HttpServletResponse response, final HttpServletRequest request, - @AuthenticationPrincipal final String targetid) { + public ResponseEntity downloadArtifactByFilename(final String fileName, final HttpServletResponse response, + final HttpServletRequest request, final String targetid) { ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -100,7 +98,7 @@ public class ArtifactStoreController implements DdiArtifactStoreControllerRestAp } @Override - public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, + public ResponseEntity downloadArtifactMD5ByFilename(final String fileName, final HttpServletResponse response) { final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java similarity index 91% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index 4f485984b..3a9e07d79 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/RootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -52,20 +52,19 @@ import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * The {@link RootController} of the hawkBit server DDI API that is queried by + * The {@link DdiRootController} of the hawkBit server DDI API that is queried by * the hawkBit controller in order to pull {@link Action}s that have to be * fulfilled and report status updates concerning the {@link Action} processing. * * Transactional (read-write) as all queries at least update the last poll time. */ @RestController -public class RootController implements DdiRootControllerRestApi { +public class DdiRootController implements DdiRootControllerRestApi { - private static final Logger LOG = LoggerFactory.getLogger(RootController.class); + private static final Logger LOG = LoggerFactory.getLogger(DdiRootController.class); private static final String GIVEN_ACTION_IS_NOT_ASSIGNED_TO_GIVEN_TARGET = "given action ({}) is not assigned to given target ({})."; @Autowired @@ -91,7 +90,7 @@ public class RootController implements DdiRootControllerRestApi { @Override public ResponseEntity> getSoftwareModulesArtifacts( - @PathVariable final String targetid, @PathVariable final Long softwareModuleId) { + final String targetid, final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); final SoftwareModule softwareModule = softwareManagement.findSoftwareModuleById(softwareModuleId); @@ -107,7 +106,7 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerBase(@PathVariable final String targetid, + public ResponseEntity getControllerBase(final String targetid, final HttpServletRequest request) { LOG.debug("getControllerBase({})", targetid); @@ -128,9 +127,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity downloadArtifact(@PathVariable final String targetid, - @PathVariable final Long softwareModuleId, @PathVariable final String fileName, - final HttpServletResponse response, final HttpServletRequest request) { + public ResponseEntity downloadArtifact(final String targetid, final Long softwareModuleId, + final String fileName, final HttpServletResponse response, final HttpServletRequest request) { ResponseEntity result; final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -181,9 +179,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity downloadArtifactMd5(@PathVariable final String targetid, - @PathVariable final Long softwareModuleId, @PathVariable final String fileName, - final HttpServletResponse response, final HttpServletRequest request) { + public ResponseEntity downloadArtifactMd5(final String targetid, final Long softwareModuleId, + final String fileName, final HttpServletResponse response, final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); @@ -206,10 +203,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerBasedeploymentAction( - @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, - @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, - final HttpServletRequest request) { + public ResponseEntity getControllerBasedeploymentAction(final String targetid, + final Long actionId, final int resource, final HttpServletRequest request) { LOG.debug("getControllerBasedeploymentAction({},{})", targetid, resource); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -242,9 +237,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, - @PathVariable final String targetid, @PathVariable @NotEmpty final Long actionId, - final HttpServletRequest request) { + public ResponseEntity postBasedeploymentActionFeedback(final DdiActionFeedback feedback, + final String targetid, final Long actionId, final HttpServletRequest request) { LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -277,8 +271,8 @@ public class RootController implements DdiRootControllerRestApi { } - private ActionStatus generateUpdateStatus(final DdiActionFeedback feedback, final String targetid, final Long actionid, - final Action action) { + private ActionStatus generateUpdateStatus(final DdiActionFeedback feedback, final String targetid, + final Long actionid, final Action action) { final ActionStatus actionStatus = new ActionStatus(); actionStatus.setAction(action); @@ -339,8 +333,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, - @PathVariable final String targetid, final HttpServletRequest request) { + public ResponseEntity putConfigData(final DdiConfigData configData, final String targetid, + final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); @@ -350,8 +344,8 @@ public class RootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerCancelAction(@PathVariable @NotEmpty final String targetid, - @PathVariable @NotEmpty final Long actionId, final HttpServletRequest request) { + public ResponseEntity getControllerCancelAction(final String targetid, final Long actionId, + final HttpServletRequest request) { LOG.debug("getControllerCancelAction({})", targetid); final Target target = controllerManagement.updateLastTargetQuery(targetid, diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index c52506e11..db9535591 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -29,9 +29,14 @@ hawkbit-rest-core ${project.version} + + commons-io + commons-io + 2.4 + - + org.eclipse.hawkbit hawkbit-rest-core ${project.version} diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java index aa764d82a..1f2c497e2 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java +++ b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java @@ -50,7 +50,7 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.DELETE, value = "/configs/{keyName}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity deleteConfigurationValue(@PathVariable final String keyName); + ResponseEntity deleteConfigurationValue(@PathVariable("keyName") final String keyName); /** * Handles the GET request of deleting a tenant specific configuration value @@ -64,7 +64,7 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/configs/{keyName}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getConfigurationValue(@PathVariable final String keyName); + ResponseEntity getConfigurationValue(@PathVariable("keyName") final String keyName); /** * Handles the GET request of deleting a tenant specific configuration value @@ -80,7 +80,8 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/configs/{keyName}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity updateConfigurationValue(@PathVariable final String keyName, + ResponseEntity updateConfigurationValue( + @PathVariable("keyName") final String keyName, @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest); } \ No newline at end of file diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java index abb61ef67..8458153ea 100644 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java @@ -65,7 +65,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { tenantConfigurationManagement.addOrUpdateConfiguration(key, notGlobalValue); - mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) + mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) .andExpect(jsonPath("value", equalTo(notGlobalValue))).andExpect(jsonPath("global", equalTo(false))) .andExpect(jsonPath("createdAt", notNullValue())).andExpect(jsonPath("createdBy", notNullValue())); @@ -78,7 +78,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; final String testValue = "12:12:12"; - mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName()) + mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", key.getKeyName()) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)).contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); @@ -99,7 +99,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).getValue()) .isEqualTo(notGlobalValue); - mvc.perform(delete(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}/", key.getKeyName())) + mvc.perform(delete(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName())) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNoContent()); assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).isGlobal()).isEqualTo(true); @@ -115,7 +115,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { final String testValue = "12:12:12"; final MvcResult mvcResult = mvc - .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", notExistingKey) + .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", notExistingKey) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) .contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); @@ -134,7 +134,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { final String testValue = "invalidFormattedDuration"; final MvcResult mvcResult = mvc - .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{configId}", key.getKeyName()) + .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", key.getKeyName()) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) .contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); From 2b3d9789786f65a1aad864ff27e4259b248796ea Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 13:00:54 +0200 Subject: [PATCH 016/124] =?UTF-8?q?Add=20signature=20from=20interface=20to?= =?UTF-8?q?=20the=20concret=20class,=20because=20of=20Spring=20MVC=20and?= =?UTF-8?q?=20parameter=20inheritance.=20"also=20actually=20doesn=E2=80=99?= =?UTF-8?q?t=20work=20with=20Spring=20MVC=20in=20its=20current=20form=20(m?= =?UTF-8?q?ethod=20parameter=20mapping=20is=20not=20inherited"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SirWayne --- .../resource/DdiArtifactStoreController.java | 9 ++-- .../ddi/rest/resource/DdiRootController.java | 47 +++++++++++-------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index 4c24b0238..024a32454 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -32,6 +32,8 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** @@ -60,8 +62,9 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes private HawkbitSecurityProperties securityProperties; @Override - public ResponseEntity downloadArtifactByFilename(final String fileName, final HttpServletResponse response, - final HttpServletRequest request, final String targetid) { + public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, + final HttpServletResponse response, final HttpServletRequest request, + @AuthenticationPrincipal final String targetid) { ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -98,7 +101,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes } @Override - public ResponseEntity downloadArtifactMD5ByFilename(final String fileName, + public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, final HttpServletResponse response) { final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index 3a9e07d79..c9c4f1d92 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -52,11 +52,12 @@ import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * The {@link DdiRootController} of the hawkBit server DDI API that is queried by - * the hawkBit controller in order to pull {@link Action}s that have to be + * The {@link DdiRootController} of the hawkBit server DDI API that is queried + * by the hawkBit controller in order to pull {@link Action}s that have to be * fulfilled and report status updates concerning the {@link Action} processing. * * Transactional (read-write) as all queries at least update the last poll time. @@ -90,7 +91,8 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity> getSoftwareModulesArtifacts( - final String targetid, final Long softwareModuleId) { + @PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); final SoftwareModule softwareModule = softwareManagement.findSoftwareModuleById(softwareModuleId); @@ -106,7 +108,7 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerBase(final String targetid, + public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, final HttpServletRequest request) { LOG.debug("getControllerBase({})", targetid); @@ -127,8 +129,10 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity downloadArtifact(final String targetid, final Long softwareModuleId, - final String fileName, final HttpServletResponse response, final HttpServletRequest request) { + public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("fileName") final String fileName, final HttpServletResponse response, + final HttpServletRequest request) { ResponseEntity result; final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -179,8 +183,10 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity downloadArtifactMd5(final String targetid, final Long softwareModuleId, - final String fileName, final HttpServletResponse response, final HttpServletRequest request) { + public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, + @PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("fileName") final String fileName, final HttpServletResponse response, + final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); @@ -203,8 +209,10 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerBasedeploymentAction(final String targetid, - final Long actionId, final int resource, final HttpServletRequest request) { + public ResponseEntity getControllerBasedeploymentAction( + @PathVariable("targetid") final String targetid, @PathVariable("actionId") final Long actionId, + @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, + final HttpServletRequest request) { LOG.debug("getControllerBasedeploymentAction({},{})", targetid, resource); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -237,8 +245,9 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity postBasedeploymentActionFeedback(final DdiActionFeedback feedback, - final String targetid, final Long actionId, final HttpServletRequest request) { + public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, + @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, + final HttpServletRequest request) { LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -333,8 +342,8 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity putConfigData(final DdiConfigData configData, final String targetid, - final HttpServletRequest request) { + public ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, + @PathVariable("targetid") final String targetid, final HttpServletRequest request) { controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); @@ -344,8 +353,9 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerCancelAction(final String targetid, final Long actionId, - final HttpServletRequest request) { + public ResponseEntity getControllerCancelAction( + @PathVariable("targetid") @NotEmpty final String targetid, + @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request) { LOG.debug("getControllerCancelAction({})", targetid); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -374,8 +384,8 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, - @PathVariable @NotEmpty final String targetid, @PathVariable @NotEmpty final Long actionId, - final HttpServletRequest request) { + @PathVariable("targetid") @NotEmpty final String targetid, + @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request) { LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, @@ -454,5 +464,4 @@ public class DdiRootController implements DdiRootControllerRestApi { } return findAction; } - } From f33cb18a11f18a5f14e420733ddba1100f517474 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 21 Apr 2016 13:22:55 +0200 Subject: [PATCH 017/124] Added method signature form interface to implementation Signed-off-by: Jonathan Philip Knoblauch --- .../rest/resource/SystemManagementResource.java | 3 ++- .../hawkbit/system/rest/resource/SystemResource.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java index 074cf444d..6ea27d9ce 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java @@ -29,6 +29,7 @@ import org.springframework.cache.CacheManager; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** @@ -54,7 +55,7 @@ public class SystemManagementResource implements SystemManagementRestApi { * @return HttpStatus.OK */ @Override - public ResponseEntity deleteTenant(final String tenant) { + public ResponseEntity deleteTenant(@PathVariable("tenant") final String tenant) { systemManagement.deleteTenant(tenant); return new ResponseEntity<>(HttpStatus.OK); } diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java index ca9b84df4..4333cfefb 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java @@ -25,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.ResourceSupport; import org.springframework.http.HttpStatus; 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.RestController; /** @@ -68,7 +70,7 @@ public class SystemResource implements SystemRestApi { * the response. */ @Override - public ResponseEntity deleteConfigurationValue(final String keyName) { + public ResponseEntity deleteConfigurationValue(@PathVariable("keyName") final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -89,7 +91,8 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity getConfigurationValue(final String keyName) { + public ResponseEntity getConfigurationValue( + @PathVariable("keyName") final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); @@ -111,8 +114,9 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity updateConfigurationValue(final String keyName, - final SystemTenantConfigurationValueRequest configurationValueRest) { + public ResponseEntity updateConfigurationValue( + @PathVariable("keyName") final String keyName, + @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); From 4f336e05c1b5093ec37b5d67b78dc7bb4a9fc93a Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 21 Apr 2016 13:35:17 +0200 Subject: [PATCH 018/124] Added slash to test Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/system/rest/resource/SystemResourceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java index 8458153ea..3dc9613e2 100644 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java +++ b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java @@ -78,7 +78,7 @@ public class SystemResourceTest extends AbstractIntegrationTest { final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; final String testValue = "12:12:12"; - mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", key.getKeyName()) + mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName()) .content(String.format(BASE_JSON_REQUEST_STRING, testValue)).contentType(MediaType.APPLICATION_JSON)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); From 2b6f7665e0c7a1ac354083ffa65679a4c8cd5a90 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 14:11:11 +0200 Subject: [PATCH 019/124] =?UTF-8?q?Add=20signature=20from=20interface=20to?= =?UTF-8?q?=20the=20concret=20class,=20because=20of=20Spring=20MVC=20and?= =?UTF-8?q?=20parameter=20inheritance.=20"also=20actually=20doesn=E2=80=99?= =?UTF-8?q?t=20work=20with=20Spring=20MVC=20in=20its=20current=20form=20(m?= =?UTF-8?q?ethod=20parameter=20mapping=20is=20not=20inherited"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SirWayne --- .../rest/api/MgmtDistributionSetRestApi.java | 38 ++++----- .../resource/MgmtDistributionSetResource.java | 83 +++++++++++++------ .../MgmtDistributionSetTagResource.java | 48 +++++++---- .../MgmtDistributionSetTypeResource.java | 42 ++++++---- .../MgmtDownloadArtifactResource.java | 6 +- .../rest/resource/MgmtDownloadResource.java | 5 +- .../rest/resource/MgmtRolloutResource.java | 41 ++++++--- .../resource/MgmtSoftwareModuleResource.java | 52 +++++++----- .../MgmtSoftwareModuleTypeResource.java | 24 ++++-- .../rest/resource/MgmtTargetResource.java | 53 ++++++++---- .../rest/resource/MgmtTargetTagResource.java | 37 ++++++--- 11 files changed, 273 insertions(+), 156 deletions(-) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index 26788760e..cd66b1aec 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -2,7 +2,7 @@ * 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 + * are made available under the terms of the Eclipse License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ @@ -55,7 +55,7 @@ public interface MgmtDistributionSetRestApi { * JsonResponseExceptionHandler is handling the response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getDistributionSets( + ResponseEntity> getDistributionSets( @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -74,7 +74,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getDistributionSet( + ResponseEntity getDistributionSet( @PathVariable("distributionSetId") final Long distributionSetId); /** @@ -90,7 +90,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> createDistributionSets( + ResponseEntity> createDistributionSets( @RequestBody final List sets); /** @@ -102,7 +102,7 @@ public interface MgmtDistributionSetRestApi { * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetId}") - public ResponseEntity deleteDistributionSet(@PathVariable("distributionSetId") final Long distributionSetId); + ResponseEntity deleteDistributionSet(@PathVariable("distributionSetId") final Long distributionSetId); /** * Handles the UPDATE request for a single DistributionSet . @@ -117,7 +117,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity updateDistributionSet( + ResponseEntity updateDistributionSet( @PathVariable("distributionSetId") final Long distributionSetId, @RequestBody final MgmtDistributionSetRequestBodyPut toUpdate); @@ -145,7 +145,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedTargets", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getAssignedTargets( + ResponseEntity> getAssignedTargets( @PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @@ -176,7 +176,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/installedTargets", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getInstalledTargets( + ResponseEntity> getInstalledTargets( @PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @@ -199,7 +199,7 @@ public interface MgmtDistributionSetRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/assignedTargets", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity createAssignedTarget( + ResponseEntity createAssignedTarget( @PathVariable("distributionSetId") final Long distributionSetId, @RequestBody final List targetIds); @@ -225,8 +225,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/metadata", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> getMetadata( - @PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity> getMetadata(@PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -244,8 +243,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity getMetadataValue( - @PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity getMetadataValue(@PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("metadataKey") final String metadataKey); /** @@ -260,7 +258,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata); /** @@ -273,7 +271,7 @@ public interface MgmtDistributionSetRestApi { * @return status OK if the delete request is successful */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetId}/metadata/{metadataKey}") - public ResponseEntity deleteMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity deleteMetadata(@PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("metadataKey") final String metadataKey); /** @@ -289,8 +287,7 @@ public interface MgmtDistributionSetRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - public ResponseEntity> createMetadata( - @PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity> createMetadata(@PathVariable("distributionSetId") final Long distributionSetId, @RequestBody final List metadataRest); /** @@ -309,7 +306,7 @@ public interface MgmtDistributionSetRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/assignedSM", consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, @RequestBody final List softwareModuleIDs); /** @@ -327,8 +324,7 @@ public interface MgmtDistributionSetRestApi { * {@code distributionSetId} exists. */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetId}/assignedSM/{softwareModuleId}") - public ResponseEntity deleteAssignSoftwareModules( - @PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity deleteAssignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("softwareModuleId") final Long softwareModuleId); /** @@ -354,7 +350,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedSM", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - public ResponseEntity> getAssignedSoftwareModules( + ResponseEntity> getAssignedSoftwareModules( @PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java index 2db11f489..42199181e 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java @@ -24,6 +24,7 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssigment; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.DeploymentManagement; import org.eclipse.hawkbit.repository.DistributionSetAssignmentResult; import org.eclipse.hawkbit.repository.DistributionSetFields; @@ -51,6 +52,9 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -79,8 +83,11 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSets(final int pagingOffsetParam, - final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getDistributionSets( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -100,7 +107,8 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity getDistributionSet(final Long distributionSetId) { + public ResponseEntity getDistributionSet( + @PathVariable("distributionSetId") final Long distributionSetId) { final DistributionSet foundDs = findDistributionSetWithExceptionIfNotFound(distributionSetId); return new ResponseEntity<>(MgmtDistributionSetMapper.toResponse(foundDs), HttpStatus.OK); @@ -108,7 +116,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { @Override public ResponseEntity> createDistributionSets( - final List sets) { + @RequestBody final List sets) { LOG.debug("creating {} distribution sets", sets.size()); // set default Ds type if ds type is null @@ -124,7 +132,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity deleteDistributionSet(final Long distributionSetId) { + public ResponseEntity deleteDistributionSet(@PathVariable("distributionSetId") final Long distributionSetId) { final DistributionSet set = findDistributionSetWithExceptionIfNotFound(distributionSetId); this.distributionSetManagement.deleteDistributionSet(set); @@ -133,8 +141,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity updateDistributionSet(final Long distributionSetId, - final MgmtDistributionSetRequestBodyPut toUpdate) { + public ResponseEntity updateDistributionSet( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestBody final MgmtDistributionSetRequestBodyPut toUpdate) { final DistributionSet set = findDistributionSetWithExceptionIfNotFound(distributionSetId); if (toUpdate.getDescription() != null) { @@ -154,8 +163,12 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> getAssignedTargets(final Long distributionSetId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getAssignedTargets( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { // check if distribution set exists otherwise throw exception // immediately @@ -179,8 +192,12 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> getInstalledTargets(final Long distributionSetId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getInstalledTargets( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { // check if distribution set exists otherwise throw exception // immediately findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -206,8 +223,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity createAssignedTarget(final Long distributionSetId, - final List targetIds) { + public ResponseEntity createAssignedTarget( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestBody final List targetIds) { final DistributionSetAssignmentResult assignDistributionSet = this.deployManagament.assignDistributionSet( distributionSetId, @@ -220,8 +238,12 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> getMetadata(final Long distributionSetId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getMetadata( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { // check if distribution set exists otherwise throw exception // immediately @@ -250,7 +272,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity getMetadataValue(final Long distributionSetId, final String metadataKey) { + public ResponseEntity getMetadataValue( + @PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("metadataKey") final String metadataKey) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -260,8 +284,8 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity updateMetadata(final Long distributionSetId, final String metadataKey, - final MetadataRest metadata) { + public ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -271,7 +295,8 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity deleteMetadata(final Long distributionSetId, final String metadataKey) { + public ResponseEntity deleteMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("metadataKey") final String metadataKey) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -280,8 +305,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> createMetadata(final Long distributionSetId, - final List metadataRest) { + public ResponseEntity> createMetadata( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestBody final List metadataRest) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -293,8 +319,8 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity assignSoftwareModules(final Long distributionSetId, - final List softwareModuleIDs) { + public ResponseEntity assignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, + @RequestBody final List softwareModuleIDs) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -314,7 +340,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity deleteAssignSoftwareModules(final Long distributionSetId, final Long softwareModuleId) { + public ResponseEntity deleteAssignSoftwareModules( + @PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("softwareModuleId") final Long softwareModuleId) { // check if distribution set and software module exist otherwise throw // exception immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -324,8 +352,11 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> getAssignedSoftwareModules(final Long distributionSetId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) { + public ResponseEntity> getAssignedSoftwareModules( + @PathVariable("distributionSetId") final Long distributionSetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet foundDs = findDistributionSetWithExceptionIfNotFound(distributionSetId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java index 5d0131fec..907bbb574 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTagResource.java @@ -18,6 +18,7 @@ import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtDistributionSetTagAssigmentRe import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTagRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.TagFields; @@ -36,6 +37,9 @@ import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -53,8 +57,11 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSetTags(final int pagingOffsetParam, - final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getDistributionSetTags( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -80,13 +87,15 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity getDistributionSetTag(final Long distributionsetTagId) { + public ResponseEntity getDistributionSetTag( + @PathVariable("distributionsetTagId") final Long distributionsetTagId) { final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); return new ResponseEntity<>(MgmtTagMapper.toResponse(tag), HttpStatus.OK); } @Override - public ResponseEntity> createDistributionSetTags(final List tags) { + public ResponseEntity> createDistributionSetTags( + @RequestBody final List tags) { LOG.debug("creating {} ds tags", tags.size()); final List createdTags = this.tagManagement @@ -96,8 +105,9 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity updateDistributionSetTag(final Long distributionsetTagId, - final MgmtTagRequestBodyPut restDSTagRest) { + public ResponseEntity updateDistributionSetTag( + @PathVariable("distributionsetTagId") final Long distributionsetTagId, + @RequestBody final MgmtTagRequestBodyPut restDSTagRest) { LOG.debug("update {} ds tag", restDSTagRest); final DistributionSetTag distributionSetTag = findDistributionTagById(distributionsetTagId); @@ -111,7 +121,8 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity deleteDistributionSetTag(final Long distributionsetTagId) { + public ResponseEntity deleteDistributionSetTag( + @PathVariable("distributionsetTagId") final Long distributionsetTagId) { LOG.debug("Delete {} distribution set tag", distributionsetTagId); final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); @@ -121,15 +132,18 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity> getAssignedDistributionSets(final Long distributionsetTagId) { + public ResponseEntity> getAssignedDistributionSets( + @PathVariable("distributionsetTagId") final Long distributionsetTagId) { final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); return new ResponseEntity<>( - MgmtDistributionSetMapper.toResponseDistributionSets(tag.getAssignedToDistributionSet()), HttpStatus.OK); + MgmtDistributionSetMapper.toResponseDistributionSets(tag.getAssignedToDistributionSet()), + HttpStatus.OK); } @Override - public ResponseEntity toggleTagAssignment(final Long distributionsetTagId, - final List assignedDSRequestBodies) { + public ResponseEntity toggleTagAssignment( + @PathVariable("distributionsetTagId") final Long distributionsetTagId, + @RequestBody final List assignedDSRequestBodies) { LOG.debug("Toggle distribution set assignment {} for ds tag {}", assignedDSRequestBodies.size(), distributionsetTagId); @@ -151,8 +165,9 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity> assignDistributionSets(final Long distributionsetTagId, - final List assignedDSRequestBodies) { + public ResponseEntity> assignDistributionSets( + @PathVariable("distributionsetTagId") final Long distributionsetTagId, + @RequestBody final List assignedDSRequestBodies) { LOG.debug("Assign DistributionSet {} for ds tag {}", assignedDSRequestBodies.size(), distributionsetTagId); final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); @@ -163,7 +178,8 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity unassignDistributionSets(final Long distributionsetTagId) { + public ResponseEntity unassignDistributionSets( + @PathVariable("distributionsetTagId") final Long distributionsetTagId) { LOG.debug("Unassign all DS for ds tag {}", distributionsetTagId); final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); if (tag.getAssignedToDistributionSet() == null) { @@ -178,7 +194,9 @@ public class MgmtDistributionSetTagResource implements MgmtDistributionSetTagRes } @Override - public ResponseEntity unassignDistributionSet(final Long distributionsetTagId, final Long distributionsetId) { + public ResponseEntity unassignDistributionSet( + @PathVariable("distributionsetTagId") final Long distributionsetTagId, + @PathVariable("distributionsetId") final Long distributionsetId) { LOG.debug("Unassign ds {} for ds tag {}", distributionsetId, distributionsetTagId); final DistributionSetTag tag = findDistributionTagById(distributionsetTagId); this.distributionSetManagement.unAssignTag(distributionsetId, tag); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java index 0e5adccdc..8d5239d9e 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java @@ -86,14 +86,15 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR @Override public ResponseEntity getDistributionSetType( - @PathVariable final Long distributionSetTypeId) { + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toResponse(foundType), HttpStatus.OK); } @Override - public ResponseEntity deleteDistributionSetType(@PathVariable final Long distributionSetTypeId) { + public ResponseEntity deleteDistributionSetType( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId) { final DistributionSetType module = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); distributionSetManagement.deleteDistributionSetType(module); @@ -103,7 +104,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR @Override public ResponseEntity updateDistributionSetType( - @PathVariable final Long distributionSetTypeId, + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType) { final DistributionSetType type = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -115,7 +116,8 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR final DistributionSetType updatedDistributionSetType = distributionSetManagement .updateDistributionSetType(type); - return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toResponse(updatedDistributionSetType), HttpStatus.OK); + return new ResponseEntity<>(MgmtDistributionSetTypeMapper.toResponse(updatedDistributionSetType), + HttpStatus.OK); } @Override @@ -140,7 +142,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR @Override public ResponseEntity> getMandatoryModules( - @PathVariable final Long distributionSetTypeId) { + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toListResponse(foundType.getMandatoryModuleTypes()), @@ -148,8 +150,9 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity getMandatoryModule(@PathVariable final Long distributionSetTypeId, - @PathVariable final Long softwareModuleTypeId) { + public ResponseEntity getMandatoryModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -164,8 +167,9 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity getOptionalModule(@PathVariable final Long distributionSetTypeId, - @PathVariable final Long softwareModuleTypeId) { + public ResponseEntity getOptionalModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -181,7 +185,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR @Override public ResponseEntity> getOptionalModules( - @PathVariable final Long distributionSetTypeId) { + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -190,8 +194,9 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity removeMandatoryModule(@PathVariable final Long distributionSetTypeId, - @PathVariable final Long softwareModuleTypeId) { + public ResponseEntity removeMandatoryModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -210,8 +215,9 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity removeOptionalModule(@PathVariable final Long distributionSetTypeId, - @PathVariable final Long softwareModuleTypeId) { + public ResponseEntity removeOptionalModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); final SoftwareModuleType foundSmType = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); @@ -229,8 +235,8 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity addMandatoryModule(@PathVariable final Long distributionSetTypeId, - @RequestBody final MgmtId smtId) { + public ResponseEntity addMandatoryModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final MgmtId smtId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -244,8 +250,8 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity addOptionalModule(@PathVariable final Long distributionSetTypeId, - @RequestBody final MgmtId smtId) { + public ResponseEntity addOptionalModule( + @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final MgmtId smtId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index ec06c3c8a..ddd7180cf 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -22,6 +22,7 @@ import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @@ -53,8 +54,9 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi */ @Override @ResponseBody - public ResponseEntity downloadArtifact(final Long softwareModuleId, final Long artifactId, - final HttpServletResponse servletResponse, final HttpServletRequest request) { + public ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse, + final HttpServletRequest request) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); if (null == module || !module.getLocalArtifact(artifactId).isPresent()) { diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java index ec2eced90..ca4959810 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java @@ -26,6 +26,8 @@ import org.springframework.cache.Cache; import org.springframework.cache.Cache.ValueWrapper; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** @@ -57,7 +59,8 @@ public class MgmtDownloadResource implements MgmtDownloadRestApi { * successful */ @Override - public ResponseEntity downloadArtifactByDownloadId(final String downloadId, + @ResponseBody + public ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId, final HttpServletResponse response) { try { final ValueWrapper cacheWrapper = cache.get(downloadId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java index ba1017cf3..37d5c6fdc 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java @@ -15,6 +15,7 @@ import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutResponseBody; import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; import org.eclipse.hawkbit.mgmt.json.model.rolloutgroup.MgmtRolloutGroupResponseBody; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRolloutRestApi; import org.eclipse.hawkbit.repository.DistributionSetManagement; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; @@ -41,7 +42,9 @@ import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -63,8 +66,11 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi { private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getRollouts(final int pagingOffsetParam, - final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getRollouts( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -85,13 +91,14 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi { } @Override - public ResponseEntity getRollout(final Long rolloutId) { + public ResponseEntity getRollout(@PathVariable("rolloutId") final Long rolloutId) { final Rollout findRolloutById = findRolloutOrThrowException(rolloutId); return new ResponseEntity<>(MgmtRolloutMapper.toResponseRollout(findRolloutById), HttpStatus.OK); } @Override - public ResponseEntity create(@RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody) { + public ResponseEntity create( + @RequestBody final MgmtRolloutRestRequestBody rolloutRequestBody) { // first check the given RSQL query if it's well formed, otherwise and // exception is thrown @@ -142,7 +149,8 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi { } @Override - public ResponseEntity start(final Long rolloutId, final boolean startAsync) { + public ResponseEntity start(@PathVariable("rolloutId") final Long rolloutId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_ASYNC, defaultValue = "false") final boolean startAsync) { final Rollout rollout = findRolloutOrThrowException(rolloutId); if (startAsync) { this.rolloutManagement.startRolloutAsync(rollout); @@ -153,22 +161,26 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi { } @Override - public ResponseEntity pause(final Long rolloutId) { + public ResponseEntity pause(@PathVariable("rolloutId") final Long rolloutId) { final Rollout rollout = findRolloutOrThrowException(rolloutId); this.rolloutManagement.pauseRollout(rollout); return ResponseEntity.ok().build(); } @Override - public ResponseEntity resume(final Long rolloutId) { + public ResponseEntity resume(@PathVariable("rolloutId") final Long rolloutId) { final Rollout rollout = findRolloutOrThrowException(rolloutId); this.rolloutManagement.resumeRollout(rollout); return ResponseEntity.ok().build(); } @Override - public ResponseEntity> getRolloutGroups(final Long rolloutId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getRolloutGroups( + @PathVariable("rolloutId") final Long rolloutId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final Rollout rollout = findRolloutOrThrowException(rolloutId); final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); @@ -191,15 +203,20 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi { } @Override - public ResponseEntity getRolloutGroup(final Long rolloutId, final Long groupId) { + public ResponseEntity getRolloutGroup(@PathVariable("rolloutId") final Long rolloutId, + @PathVariable("groupId") final Long groupId) { findRolloutOrThrowException(rolloutId); final RolloutGroup rolloutGroup = findRolloutGroupOrThrowException(groupId); return ResponseEntity.ok(MgmtRolloutMapper.toResponseRolloutGroup(rolloutGroup)); } @Override - public ResponseEntity> getRolloutGroupTargets(final Long rolloutId, final Long groupId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getRolloutGroupTargets(@PathVariable("rolloutId") final Long rolloutId, + @PathVariable("groupId") final Long groupId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { findRolloutOrThrowException(rolloutId); final RolloutGroup rolloutGroup = findRolloutGroupOrThrowException(groupId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java index 51b543366..866120c5b 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java @@ -42,6 +42,7 @@ 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.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; @@ -61,7 +62,7 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { private SoftwareManagement softwareManagement; @Override - public ResponseEntity uploadArtifact(@PathVariable final Long softwareModuleId, + public ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam("file") final MultipartFile file, @RequestParam(value = "filename", required = false) final String optionalFileName, @RequestParam(value = "md5sum", required = false) final String md5Sum, @@ -92,15 +93,18 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity> getArtifacts(@PathVariable final Long softwareModuleId) { + @ResponseBody + public ResponseEntity> getArtifacts( + @PathVariable("softwareModuleId") final Long softwareModuleId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); return new ResponseEntity<>(MgmtSoftwareModuleMapper.artifactsToResponse(module.getArtifacts()), HttpStatus.OK); } @Override - public ResponseEntity getArtifact(@PathVariable final Long softwareModuleId, - @PathVariable final Long artifactId) { + @ResponseBody + public ResponseEntity getArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("artifactId") final Long artifactId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(module.getLocalArtifact(artifactId).get()), @@ -108,8 +112,9 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity deleteArtifact(@PathVariable final Long softwareModuleId, - @PathVariable final Long artifactId) { + @ResponseBody + public ResponseEntity deleteArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("artifactId") final Long artifactId) { findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); artifactManagement.deleteLocalArtifact(artifactId); @@ -147,7 +152,8 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity getSoftwareModule(@PathVariable final Long softwareModuleId) { + public ResponseEntity getSoftwareModule( + @PathVariable("softwareModuleId") final Long softwareModuleId) { final SoftwareModule findBaseSoftareModule = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); return new ResponseEntity<>(MgmtSoftwareModuleMapper.toResponse(findBaseSoftareModule), HttpStatus.OK); @@ -166,7 +172,8 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity updateSoftwareModule(@PathVariable final Long softwareModuleId, + public ResponseEntity updateSoftwareModule( + @PathVariable("softwareModuleId") final Long softwareModuleId, @RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); @@ -183,7 +190,7 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity deleteSoftwareModule(@PathVariable final Long softwareModuleId) { + public ResponseEntity deleteSoftwareModule(@PathVariable("softwareModuleId") final Long softwareModuleId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); softwareManagement.deleteSoftwareModule(module); @@ -192,7 +199,8 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity> getMetadata(@PathVariable final Long softwareModuleId, + public ResponseEntity> getMetadata( + @PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -222,19 +230,17 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity getMetadataValue(@PathVariable final Long softwareModuleId, - @PathVariable final String metadataKey) { - // check if distribution set exists otherwise throw exception - // immediately + public ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("metadataKey") final String metadataKey) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); - final SoftwareModuleMetadata findOne = softwareManagement.findSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey)); + final SoftwareModuleMetadata findOne = softwareManagement + .findSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey)); return ResponseEntity. ok(MgmtSoftwareModuleMapper.toResponseSwMetadata(findOne)); } @Override - public ResponseEntity updateMetadata(@PathVariable final Long softwareModuleId, - @PathVariable final String metadataKey, @RequestBody final MetadataRest metadata) { - // check if software module exists otherwise throw exception immediately + public ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final SoftwareModuleMetadata updated = softwareManagement .updateSoftwareModuleMetadata(new SoftwareModuleMetadata(metadataKey, sw, metadata.getValue())); @@ -242,18 +248,17 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity deleteMetadata(@PathVariable final Long softwareModuleId, - @PathVariable final String metadataKey) { - // check if software module exists otherwise throw exception immediately + public ResponseEntity deleteMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("metadataKey") final String metadataKey) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); softwareManagement.deleteSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey)); return ResponseEntity.ok().build(); } @Override - public ResponseEntity> createMetadata(@PathVariable final Long softwareModuleId, + public ResponseEntity> createMetadata( + @PathVariable("softwareModuleId") final Long softwareModuleId, @RequestBody final List metadataRest) { - // check if software module exists otherwise throw exception immediately final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final List created = softwareManagement @@ -273,4 +278,5 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } return module; } + } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java index ab23046b3..deba883f6 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResource.java @@ -14,6 +14,7 @@ import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleTypeRequestBodyPut; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.SoftwareManagement; @@ -30,6 +31,9 @@ import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -43,8 +47,11 @@ public class MgmtSoftwareModuleTypeResource implements MgmtSoftwareModuleTypeRes private SoftwareManagement softwareManagement; @Override - public ResponseEntity> getTypes(final int pagingOffsetParam, - final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getTypes( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -69,14 +76,16 @@ public class MgmtSoftwareModuleTypeResource implements MgmtSoftwareModuleTypeRes } @Override - public ResponseEntity getSoftwareModuleType(final Long softwareModuleTypeId) { + public ResponseEntity getSoftwareModuleType( + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final SoftwareModuleType foundType = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); return new ResponseEntity<>(MgmtSoftwareModuleTypeMapper.toResponse(foundType), HttpStatus.OK); } @Override - public ResponseEntity deleteSoftwareModuleType(final Long softwareModuleTypeId) { + public ResponseEntity deleteSoftwareModuleType( + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId) { final SoftwareModuleType module = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); this.softwareManagement.deleteSoftwareModuleType(module); @@ -85,8 +94,9 @@ public class MgmtSoftwareModuleTypeResource implements MgmtSoftwareModuleTypeRes } @Override - public ResponseEntity updateSoftwareModuleType(final Long softwareModuleTypeId, - final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType) { + public ResponseEntity updateSoftwareModuleType( + @PathVariable("softwareModuleTypeId") final Long softwareModuleTypeId, + @RequestBody final MgmtSoftwareModuleTypeRequestBodyPut restSoftwareModuleType) { final SoftwareModuleType type = findSoftwareModuleTypeWithExceptionIfNotFound(softwareModuleTypeId); // only description can be modified @@ -100,7 +110,7 @@ public class MgmtSoftwareModuleTypeResource implements MgmtSoftwareModuleTypeRes @Override public ResponseEntity> createSoftwareModuleTypes( - final List softwareModuleTypes) { + @RequestBody final List softwareModuleTypes) { final List createdSoftwareModules = this.softwareManagement .createSoftwareModuleType(MgmtSoftwareModuleTypeMapper.smFromRequest(softwareModuleTypes)); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java index 449c57362..4a7c760e3 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResource.java @@ -49,6 +49,8 @@ import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -66,7 +68,7 @@ public class MgmtTargetResource implements MgmtTargetRestApi { private DeploymentManagement deploymentManagement; @Override - public ResponseEntity getTarget(final String targetId) { + public ResponseEntity getTarget(@PathVariable("targetId") final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); // to single response include poll status final MgmtTarget response = MgmtTargetMapper.toResponse(findTarget); @@ -77,8 +79,11 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity> getTargets(final int pagingOffsetParam, final int pagingLimitParam, - final String sortParam, final String rsqlParam) { + public ResponseEntity> getTargets( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -102,7 +107,7 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity> createTargets(final List targets) { + public ResponseEntity> createTargets(@RequestBody final List targets) { LOG.debug("creating {} targets", targets.size()); final Iterable createdTargets = this.targetManagement .createTargets(MgmtTargetMapper.fromRequest(targets)); @@ -111,7 +116,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity updateTarget(final String targetId, final MgmtTargetRequestBody targetRest) { + public ResponseEntity updateTarget(@PathVariable("targetId") final String targetId, + @RequestBody final MgmtTargetRequestBody targetRest) { final Target existingTarget = findTargetWithExceptionIfNotFound(targetId); LOG.debug("updating target {}", existingTarget.getId()); if (targetRest.getDescription() != null) { @@ -126,7 +132,7 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity deleteTarget(final String targetId) { + public ResponseEntity deleteTarget(@PathVariable("targetId") final String targetId) { final Target target = findTargetWithExceptionIfNotFound(targetId); this.targetManagement.deleteTargets(target.getId()); LOG.debug("{} target deleted, return status {}", targetId, HttpStatus.OK); @@ -134,7 +140,7 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity getAttributes(final String targetId) { + public ResponseEntity getAttributes(@PathVariable("targetId") final String targetId) { final Target foundTarget = findTargetWithExceptionIfNotFound(targetId); final Map controllerAttributes = foundTarget.getTargetInfo().getControllerAttributes(); if (controllerAttributes.isEmpty()) { @@ -148,8 +154,11 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity> getActionHistory(final String targetId, final int pagingOffsetParam, - final int pagingLimitParam, final String sortParam, final String rsqlParam) { + public ResponseEntity> getActionHistory(@PathVariable("targetId") final String targetId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final Target foundTarget = findTargetWithExceptionIfNotFound(targetId); @@ -175,7 +184,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity getAction(final String targetId, final Long actionId) { + public ResponseEntity getAction(@PathVariable("targetId") final String targetId, + @PathVariable("actionId") final Long actionId) { final Target target = findTargetWithExceptionIfNotFound(targetId); final Action action = findActionWithExceptionIfNotFound(actionId); @@ -204,8 +214,9 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity cancelAction(final String targetId, final Long actionId, - @RequestParam(required = false, defaultValue = "false") final boolean force) { + public ResponseEntity cancelAction(@PathVariable("targetId") final String targetId, + @PathVariable("actionId") final Long actionId, + @RequestParam(value = "force", required = false, defaultValue = "false") final boolean force) { final Target target = findTargetWithExceptionIfNotFound(targetId); final Action action = findActionWithExceptionIfNotFound(actionId); @@ -221,8 +232,11 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity> getActionStatusList(final String targetId, final Long actionId, - final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) { + public ResponseEntity> getActionStatusList( + @PathVariable("targetId") final String targetId, @PathVariable("actionId") final Long actionId, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam) { final Target target = findTargetWithExceptionIfNotFound(targetId); @@ -247,7 +261,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity getAssignedDistributionSet(final String targetId) { + public ResponseEntity getAssignedDistributionSet( + @PathVariable("targetId") final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); final MgmtDistributionSet distributionSetRest = MgmtDistributionSetMapper .toResponse(findTarget.getAssignedDistributionSet()); @@ -261,8 +276,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity postAssignedDistributionSet(final String targetId, - final MgmtDistributionSetAssigment dsId) { + public ResponseEntity postAssignedDistributionSet(@PathVariable("targetId") final String targetId, + @RequestBody final MgmtDistributionSetAssigment dsId) { findTargetWithExceptionIfNotFound(targetId); final ActionType type = (dsId.getType() != null) ? MgmtRestModelMapper.convertActionType(dsId.getType()) @@ -281,7 +296,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } @Override - public ResponseEntity getInstalledDistributionSet(final String targetId) { + public ResponseEntity getInstalledDistributionSet( + @PathVariable("targetId") final String targetId) { final Target findTarget = findTargetWithExceptionIfNotFound(targetId); final MgmtDistributionSet distributionSetRest = MgmtDistributionSetMapper .toResponse(findTarget.getTargetInfo().getInstalledDistributionSet()); @@ -309,4 +325,5 @@ public class MgmtTargetResource implements MgmtTargetRestApi { } return findAction; } + } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java index d98518208..03265a76c 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java @@ -17,6 +17,7 @@ import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTag; import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTagRequestBodyPut; import org.eclipse.hawkbit.mgmt.json.model.tag.MgmtTargetTagAssigmentResult; import org.eclipse.hawkbit.mgmt.json.model.target.MgmtTarget; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.mgmt.rest.api.MgmtTargetTagRestApi; import org.eclipse.hawkbit.repository.OffsetBasedPageRequest; import org.eclipse.hawkbit.repository.TagFields; @@ -36,7 +37,9 @@ import org.springframework.data.domain.Slice; import org.springframework.data.domain.Sort; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -54,8 +57,11 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { private TargetManagement targetManagement; @Override - public ResponseEntity> getTargetTags(final int pagingOffsetParam, final int pagingLimitParam, - final String sortParam, final String rsqlParam) { + public ResponseEntity> getTargetTags( + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, + @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) final String rsqlParam) { final int sanitizedOffsetParam = PagingUtility.sanitizeOffsetParam(pagingOffsetParam); final int sanitizedLimitParam = PagingUtility.sanitizePageLimitParam(pagingLimitParam); @@ -81,7 +87,7 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity getTargetTag(final Long targetTagId) { + public ResponseEntity getTargetTag(@PathVariable("targetTagId") final Long targetTagId) { final TargetTag tag = findTargetTagById(targetTagId); return new ResponseEntity<>(MgmtTagMapper.toResponse(tag), HttpStatus.OK); } @@ -95,7 +101,8 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity updateTagretTag(final Long targetTagId, final MgmtTagRequestBodyPut restTargetTagRest) { + public ResponseEntity updateTagretTag(@PathVariable("targetTagId") final Long targetTagId, + @RequestBody final MgmtTagRequestBodyPut restTargetTagRest) { LOG.debug("update {} target tag", restTargetTagRest); final TargetTag targetTag = findTargetTagById(targetTagId); @@ -108,7 +115,7 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity deleteTargetTag(final Long targetTagId) { + public ResponseEntity deleteTargetTag(@PathVariable("targetTagId") final Long targetTagId) { LOG.debug("Delete {} target tag", targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); @@ -118,15 +125,16 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity> getAssignedTargets(final Long targetTagId) { + public ResponseEntity> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId) { final TargetTag targetTag = findTargetTagById(targetTagId); return new ResponseEntity<>(MgmtTargetMapper.toResponseWithLinksAndPollStatus(targetTag.getAssignedToTargets()), HttpStatus.OK); } @Override - public ResponseEntity toggleTagAssignment(final Long targetTagId, - final List assignedTargetRequestBodies) { + public ResponseEntity toggleTagAssignment( + @PathVariable("targetTagId") final Long targetTagId, + @RequestBody final List assignedTargetRequestBodies) { LOG.debug("Toggle Target assignment {} for target tag {}", assignedTargetRequestBodies.size(), targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); @@ -140,8 +148,8 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity> assignTargets(final Long targetTagId, - final List assignedTargetRequestBodies) { + public ResponseEntity> assignTargets(@PathVariable("targetTagId") final Long targetTagId, + @RequestBody final List assignedTargetRequestBodies) { LOG.debug("Assign Targets {} for target tag {}", assignedTargetRequestBodies.size(), targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); final List assignedTarget = this.targetManagement @@ -150,7 +158,7 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity unassignTargets(final Long targetTagId) { + public ResponseEntity unassignTargets(@PathVariable("targetTagId") final Long targetTagId) { LOG.debug("Unassign all Targets for target tag {}", targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); if (targetTag.getAssignedToTargets() == null) { @@ -162,7 +170,8 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { } @Override - public ResponseEntity unassignTarget(final Long targetTagId, final String controllerId) { + public ResponseEntity unassignTarget(@PathVariable("targetTagId") final Long targetTagId, + @PathVariable("controllerId") final String controllerId) { LOG.debug("Unassign target {} for target tag {}", controllerId, targetTagId); final TargetTag targetTag = findTargetTagById(targetTagId); this.targetManagement.unAssignTag(controllerId, targetTag); @@ -177,8 +186,10 @@ public class MgmtTargetTagResource implements MgmtTargetTagRestApi { return tag; } - private List findTargetControllerIds(final List assignedTargetRequestBodies) { + private List findTargetControllerIds( + final List assignedTargetRequestBodies) { return assignedTargetRequestBodies.stream().map(request -> request.getControllerId()) .collect(Collectors.toList()); } + } From 5d30ea3d092aa9859cfad8af86edb1a52008cd05 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 14:36:00 +0200 Subject: [PATCH 020/124] Rename Mgmt MetaData Signed-off-by: SirWayne --- .../{MetadataRest.java => MgmtMetadata.java} | 2 +- .../mgmt/json/model/artifact/MgmtArtifact.java | 2 ++ .../rest/api/MgmtDistributionSetRestApi.java | 14 +++++++------- .../mgmt/rest/api/MgmtSoftwareModuleRestApi.java | 14 +++++++------- .../rest/resource/MgmtDistributionSetMapper.java | 16 ++++++++-------- .../resource/MgmtDistributionSetResource.java | 16 ++++++++-------- .../rest/resource/MgmtSoftwareModuleMapper.java | 14 +++++++------- .../resource/MgmtSoftwareModuleResource.java | 16 ++++++++-------- 8 files changed, 48 insertions(+), 46 deletions(-) rename hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/{MetadataRest.java => MgmtMetadata.java} (97%) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java similarity index 97% rename from hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java index 70cfff0d0..6a6371d6b 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MetadataRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/MgmtMetadata.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class MetadataRest { +public class MgmtMetadata { @JsonProperty(required = true) private String key; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java index 35ad382e7..0d9e83690 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java @@ -15,6 +15,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; import com.fasterxml.jackson.annotation.JsonValue; /** @@ -22,6 +23,7 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) +@JsonRootName(value = "") public class MgmtArtifact extends MgmtBaseEntity { @JsonProperty(required = true) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index cd66b1aec..0b960543c 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -11,7 +11,7 @@ package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; @@ -225,7 +225,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/metadata", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity> getMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity> getMetadata(@PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -243,7 +243,7 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getMetadataValue(@PathVariable("distributionSetId") final Long distributionSetId, + ResponseEntity getMetadataValue(@PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("metadataKey") final String metadataKey); /** @@ -258,8 +258,8 @@ public interface MgmtDistributionSetRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, - @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata); + ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata); /** * Deletes a single meta data entry from the distribution set. @@ -287,8 +287,8 @@ public interface MgmtDistributionSetRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity> createMetadata(@PathVariable("distributionSetId") final Long distributionSetId, - @RequestBody final List metadataRest); + ResponseEntity> createMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + @RequestBody final List metadataRest); /** * Assigns a list of software modules to a distribution set. diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index d5dbb6c7e..dab8cc594 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -10,7 +10,7 @@ package org.eclipse.hawkbit.mgmt.rest.api; import java.util.List; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; @@ -214,7 +214,7 @@ public interface MgmtSoftwareModuleRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity> getMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity> getMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -232,7 +232,7 @@ public interface MgmtSoftwareModuleRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("metadataKey") final String metadataKey); /** @@ -247,8 +247,8 @@ public interface MgmtSoftwareModuleRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{softwareModuleId}/metadata/{metadataKey}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata); + ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata); /** * Deletes a single meta data entry from the software module. @@ -276,7 +276,7 @@ public interface MgmtSoftwareModuleRestApi { @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/metadata", consumes = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) - ResponseEntity> createMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, - @RequestBody final List metadataRest); + ResponseEntity> createMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @RequestBody final List metadataRest); } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java index 111ba00ae..6d2d890b2 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetMapper.java @@ -14,7 +14,7 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtTargetAssignmentResponseBody; @@ -128,16 +128,16 @@ public final class MgmtDistributionSetMapper { } /** - * From {@link MetadataRest} to {@link DistributionSetMetadata}. + * From {@link MgmtMetadata} to {@link DistributionSetMetadata}. * * @param ds * @param metadata * @return */ static List fromRequestDsMetadata(final DistributionSet ds, - final List metadata) { + final List metadata) { final List mappedList = new ArrayList<>(metadata.size()); - for (final MetadataRest metadataRest : metadata) { + for (final MgmtMetadata metadataRest : metadata) { if (metadataRest.getKey() == null) { throw new IllegalArgumentException("the key of the metadata must be present"); } @@ -204,16 +204,16 @@ public final class MgmtDistributionSetMapper { return response; } - static MetadataRest toResponseDsMetadata(final DistributionSetMetadata metadata) { - final MetadataRest metadataRest = new MetadataRest(); + static MgmtMetadata toResponseDsMetadata(final DistributionSetMetadata metadata) { + final MgmtMetadata metadataRest = new MgmtMetadata(); metadataRest.setKey(metadata.getId().getKey()); metadataRest.setValue(metadata.getValue()); return metadataRest; } - static List toResponseDsMetadata(final List metadata) { + static List toResponseDsMetadata(final List metadata) { - final List mappedList = new ArrayList<>(metadata.size()); + final List mappedList = new ArrayList<>(metadata.size()); for (final DistributionSetMetadata distributionSetMetadata : metadata) { mappedList.add(toResponseDsMetadata(distributionSetMetadata)); } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java index 42199181e..17f4c3303 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResource.java @@ -13,7 +13,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSet; import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtDistributionSetRequestBodyPost; @@ -238,7 +238,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> getMetadata( + public ResponseEntity> getMetadata( @PathVariable("distributionSetId") final Long distributionSetId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @@ -272,7 +272,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity getMetadataValue( + public ResponseEntity getMetadataValue( @PathVariable("distributionSetId") final Long distributionSetId, @PathVariable("metadataKey") final String metadataKey) { // check if distribution set exists otherwise throw exception @@ -280,12 +280,12 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); final DistributionSetMetadata findOne = this.distributionSetManagement .findOne(new DsMetadataCompositeKey(ds, metadataKey)); - return ResponseEntity. ok(MgmtDistributionSetMapper.toResponseDsMetadata(findOne)); + return ResponseEntity. ok(MgmtDistributionSetMapper.toResponseDsMetadata(findOne)); } @Override - public ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, - @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata) { + public ResponseEntity updateMetadata(@PathVariable("distributionSetId") final Long distributionSetId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); @@ -305,9 +305,9 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi { } @Override - public ResponseEntity> createMetadata( + public ResponseEntity> createMetadata( @PathVariable("distributionSetId") final Long distributionSetId, - @RequestBody final List metadataRest) { + @RequestBody final List metadataRest) { // check if distribution set exists otherwise throw exception // immediately final DistributionSet ds = findDistributionSetWithExceptionIfNotFound(distributionSetId); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java index a100b6fb4..38b4ace75 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java @@ -14,7 +14,7 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifactHash; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; @@ -59,9 +59,9 @@ public final class MgmtSoftwareModuleMapper { } static List fromRequestSwMetadata(final SoftwareModule sw, - final List metadata) { + final List metadata) { final List mappedList = new ArrayList<>(metadata.size()); - for (final MetadataRest metadataRest : metadata) { + for (final MgmtMetadata metadataRest : metadata) { if (metadataRest.getKey() == null) { throw new IllegalArgumentException("the key of the metadata must be present"); } @@ -106,16 +106,16 @@ public final class MgmtSoftwareModuleMapper { return response; } - static List toResponseSwMetadata(final List metadata) { - final List mappedList = new ArrayList<>(metadata.size()); + static List toResponseSwMetadata(final List metadata) { + final List mappedList = new ArrayList<>(metadata.size()); for (final SoftwareModuleMetadata distributionSetMetadata : metadata) { mappedList.add(toResponseSwMetadata(distributionSetMetadata)); } return mappedList; } - static MetadataRest toResponseSwMetadata(final SoftwareModuleMetadata metadata) { - final MetadataRest metadataRest = new MetadataRest(); + static MgmtMetadata toResponseSwMetadata(final SoftwareModuleMetadata metadata) { + final MgmtMetadata metadataRest = new MgmtMetadata(); metadataRest.setKey(metadata.getId().getKey()); metadataRest.setValue(metadata.getValue()); return metadataRest; diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java index 866120c5b..75abe57f4 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java @@ -11,7 +11,7 @@ package org.eclipse.hawkbit.mgmt.rest.resource; import java.io.IOException; import java.util.List; -import org.eclipse.hawkbit.mgmt.json.model.MetadataRest; +import org.eclipse.hawkbit.mgmt.json.model.MgmtMetadata; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; @@ -199,7 +199,7 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity> getMetadata( + public ResponseEntity> getMetadata( @PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @@ -230,17 +230,17 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, + public ResponseEntity getMetadataValue(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("metadataKey") final String metadataKey) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final SoftwareModuleMetadata findOne = softwareManagement .findSoftwareModuleMetadata(new SwMetadataCompositeKey(sw, metadataKey)); - return ResponseEntity. ok(MgmtSoftwareModuleMapper.toResponseSwMetadata(findOne)); + return ResponseEntity. ok(MgmtSoftwareModuleMapper.toResponseSwMetadata(findOne)); } @Override - public ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("metadataKey") final String metadataKey, @RequestBody final MetadataRest metadata) { + public ResponseEntity updateMetadata(@PathVariable("softwareModuleId") final Long softwareModuleId, + @PathVariable("metadataKey") final String metadataKey, @RequestBody final MgmtMetadata metadata) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final SoftwareModuleMetadata updated = softwareManagement .updateSoftwareModuleMetadata(new SoftwareModuleMetadata(metadataKey, sw, metadata.getValue())); @@ -256,9 +256,9 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi { } @Override - public ResponseEntity> createMetadata( + public ResponseEntity> createMetadata( @PathVariable("softwareModuleId") final Long softwareModuleId, - @RequestBody final List metadataRest) { + @RequestBody final List metadataRest) { final SoftwareModule sw = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, null); final List created = softwareManagement From 8995195e443bf713623930d6d89e1241118da08d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 15:53:02 +0200 Subject: [PATCH 021/124] Add springfox Signed-off-by: SirWayne --- hawkbit-ddi-resource/pom.xml | 6 +++++- hawkbit-mgmt-resource/pom.xml | 5 +++++ hawkbit-system-resource/pom.xml | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index d5ba2c21c..7524bcaf3 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -36,7 +36,11 @@ hawkbit-repository ${project.version} - + + io.springfox + springfox-core + 2.0.3 + diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index db9535591..5d248e7c1 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -34,6 +34,11 @@ commons-io 2.4 + + io.springfox + springfox-core + 2.0.3 + diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml index 7c00b3fec..0c9fb5019 100644 --- a/hawkbit-system-resource/pom.xml +++ b/hawkbit-system-resource/pom.xml @@ -29,6 +29,11 @@ hawkbit-rest-core ${project.version} + + io.springfox + springfox-core + 2.0.3 + From 0c85f2bf8211739c82b92dc40c30c8e5e8ed371f Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 15:59:39 +0200 Subject: [PATCH 022/124] remove springfox and add spring-plugin-core Signed-off-by: SirWayne --- hawkbit-system-resource/pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml index 0c9fb5019..440e327a3 100644 --- a/hawkbit-system-resource/pom.xml +++ b/hawkbit-system-resource/pom.xml @@ -29,10 +29,9 @@ hawkbit-rest-core ${project.version} - - io.springfox - springfox-core - 2.0.3 + + org.springframework.plugin + spring-plugin-core From e8c8b4d1a6490715cde52e04b5285b230d67c19b Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 16:00:08 +0200 Subject: [PATCH 023/124] remove springfox and add spring-plugin-core Signed-off-by: SirWayne --- hawkbit-ddi-resource/pom.xml | 7 +++---- hawkbit-mgmt-resource/pom.xml | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index 7524bcaf3..1615cf697 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -36,10 +36,9 @@ hawkbit-repository ${project.version} - - io.springfox - springfox-core - 2.0.3 + + org.springframework.plugin + spring-plugin-core diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index 5d248e7c1..10ed70bbb 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -34,10 +34,9 @@ commons-io 2.4 - - io.springfox - springfox-core - 2.0.3 + + org.springframework.plugin + spring-plugin-core From e45306eafb92f302c37284f12dd2cfd50502c56d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 21 Apr 2016 16:43:38 +0200 Subject: [PATCH 024/124] Fix Default Port for PopertyHandler Signed-off-by: SirWayne --- .../eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java | 7 ++++--- .../hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java index a1cb8bbd9..98f1930a6 100644 --- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java +++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java @@ -17,7 +17,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties("hawkbit.artifact.url") public class ArtifactUrlHandlerProperties { private static final String DEFAULT_IP_LOCALHOST = "127.0.0.1"; - private static final String LOCALHOST = "localhost:8080"; + private static final String DEFAULT_PORT = "8080"; + private static final String LOCALHOST = "localhost"; private final Http http = new Http(); private final Https https = new Https(); @@ -86,7 +87,7 @@ public class ArtifactUrlHandlerProperties { public static class Http implements ProtocolProperties { private String hostname = LOCALHOST; private String ip = DEFAULT_IP_LOCALHOST; - private String port = ""; + private String port = DEFAULT_PORT; /** * An ant-URL pattern with placeholder to build the URL on. The URL can * have specific artifact placeholder. @@ -136,7 +137,7 @@ public class ArtifactUrlHandlerProperties { public static class Https implements ProtocolProperties { private String hostname = LOCALHOST; private String ip = DEFAULT_IP_LOCALHOST; - private String port = ""; + private String port = DEFAULT_PORT; /** * An ant-URL pattern with placeholder to build the URL on. The URL can * have specific artifact placeholder. diff --git a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java index bfc560c38..27021d265 100644 --- a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java +++ b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java @@ -69,7 +69,7 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash, UrlProtocol.HTTP); assertEquals("http is build incorrect", - "http://localhost/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/" + localArtifact.getFilename(), url); @@ -81,7 +81,7 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash, UrlProtocol.HTTPS); assertEquals("https is build incorrect", - "https://localhost/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/" + localArtifact.getFilename(), url); From a615317ba44cc0585e691952e90dba0b8e8156b1 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Fri, 22 Apr 2016 12:24:11 +0200 Subject: [PATCH 025/124] Add Managment Default Feign Client Signed-off-by: SirWayne --- examples/hawkbit-mgmt-api-client/pom.xml | 5 + .../mgmt/client/MgmtDefaultFeignClient.java | 141 ++++++++++++++++++ ...=> MgmtDistributionSetClientResource.java} | 5 +- ...MgmtDistributionSetTagClientResource.java} | 5 +- ...gmtDistributionSetTypeClientResource.java} | 5 +- .../MgmtDownloadArtifactClientResource.java | 22 +++ .../resource/MgmtDownloadClientResource.java | 22 +++ ...nt.java => MgmtRolloutClientResource.java} | 5 +- ... => MgmtSoftwareModuleClientResource.java} | 5 +- ...MgmtSoftwareModuleTypeClientResource.java} | 5 +- ...ent.java => MgmtTargetClientResource.java} | 5 +- ....java => MgmtTargetTagClientResource.java} | 6 +- .../CreateStartedRolloutExample.java | 24 +-- .../GettingStartedDefaultScenario.java | 16 +- .../resource/DdiArtifactStoreController.java | 44 +++--- 15 files changed, 256 insertions(+), 59 deletions(-) create mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{DistributionSetResourceClient.java => MgmtDistributionSetClientResource.java} (71%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{DistributionSetTagResourceClient.java => MgmtDistributionSetTagClientResource.java} (70%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{DistributionSetTypeResourceClient.java => MgmtDistributionSetTypeClientResource.java} (70%) create mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java create mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{RolloutResourceClient.java => MgmtRolloutClientResource.java} (73%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{SoftwareModuleResourceClient.java => MgmtSoftwareModuleClientResource.java} (71%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{SoftwareModuleTypeResourceClient.java => MgmtSoftwareModuleTypeClientResource.java} (70%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{TargetResourceClient.java => MgmtTargetClientResource.java} (74%) rename examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{TargetTagResourceClient.java => MgmtTargetTagClientResource.java} (73%) diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index 051252d12..75e520ea6 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -66,6 +66,11 @@ 8.14.2 + + com.netflix.feign + feign-jackson + 8.14.2 + hibernate-validator org.hibernate diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java new file mode 100644 index 000000000..8bfc2ec52 --- /dev/null +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java @@ -0,0 +1,141 @@ +/** + * 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.mgmt.client; + +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTagClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTypeClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDownloadArtifactClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDownloadClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtRolloutClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleTypeClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetTagClientResource; +import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; + +import feign.Feign; +import feign.Feign.Builder; +import feign.Logger; +import feign.Logger.Level; +import feign.jackson.JacksonDecoder; +import feign.jackson.JacksonEncoder; + +/** + * + */ +public class MgmtDefaultFeignClient { + + private MgmtDistributionSetClientResource mgmtDistributionSetClientResource; + private MgmtDistributionSetTagClientResource mgmtDistributionSetTagClientResource; + private MgmtDistributionSetTypeClientResource mgmtDistributionSetTypeClientResource; + private MgmtRolloutClientResource mgmtRolloutClientResource; + private MgmtSoftwareModuleClientResource mgmtSoftwareModuleClientResource; + private MgmtSoftwareModuleTypeClientResource mgmtSoftwareModuleTypeClientResource; + private MgmtTargetClientResource mgmtTargetClientResource; + private MgmtTargetTagClientResource mgmtTargetTagClientResource; + private MgmtDownloadClientResource mgmtDownloadClientResource; + private MgmtDownloadArtifactClientResource mgmtDownloadArtifactClientResource; + + private final Builder feignBuilder; + private final String baseUrl; + + public MgmtDefaultFeignClient(final String baseUrl) { + feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) + .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) + .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) + .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + this.baseUrl = baseUrl; + } + + public Builder getFeignBuilder() { + return feignBuilder; + } + + public MgmtDistributionSetClientResource getMgmtDistributionSetClientResource() { + if (mgmtDistributionSetClientResource == null) { + mgmtDistributionSetClientResource = feignBuilder.target(MgmtDistributionSetClientResource.class, + this.baseUrl + MgmtDistributionSetClientResource.PATH); + } + return mgmtDistributionSetClientResource; + } + + public MgmtDistributionSetTagClientResource getMgmtDistributionSetTagClientResource() { + if (mgmtDistributionSetTagClientResource == null) { + mgmtDistributionSetTagClientResource = feignBuilder.target(MgmtDistributionSetTagClientResource.class, + this.baseUrl + MgmtDistributionSetTagClientResource.PATH); + } + return mgmtDistributionSetTagClientResource; + } + + public MgmtDistributionSetTypeClientResource getMgmtDistributionSetTypeClientResource() { + if (mgmtDistributionSetTypeClientResource == null) { + mgmtDistributionSetTypeClientResource = feignBuilder.target(MgmtDistributionSetTypeClientResource.class, + this.baseUrl + MgmtDistributionSetTypeClientResource.PATH); + } + return mgmtDistributionSetTypeClientResource; + } + + public MgmtRolloutClientResource getMgmtRolloutClientResource() { + if (mgmtRolloutClientResource == null) { + mgmtRolloutClientResource = feignBuilder.target(MgmtRolloutClientResource.class, + this.baseUrl + MgmtRolloutClientResource.PATH); + } + return mgmtRolloutClientResource; + } + + public MgmtSoftwareModuleClientResource getMgmtSoftwareModuleClientResource() { + if (mgmtSoftwareModuleClientResource == null) { + mgmtSoftwareModuleClientResource = feignBuilder.target(MgmtSoftwareModuleClientResource.class, + MgmtSoftwareModuleClientResource.PATH); + } + return mgmtSoftwareModuleClientResource; + } + + public MgmtSoftwareModuleTypeClientResource getMgmtSoftwareModuleTypeClientResource() { + if (mgmtSoftwareModuleTypeClientResource == null) { + mgmtSoftwareModuleTypeClientResource = feignBuilder.target(MgmtSoftwareModuleTypeClientResource.class, + this.baseUrl + MgmtSoftwareModuleTypeClientResource.PATH); + } + return mgmtSoftwareModuleTypeClientResource; + } + + public MgmtTargetClientResource getMgmtTargetClientResource() { + if (mgmtTargetClientResource == null) { + mgmtTargetClientResource = feignBuilder.target(MgmtTargetClientResource.class, + this.baseUrl + MgmtTargetClientResource.PATH); + } + return mgmtTargetClientResource; + } + + public MgmtTargetTagClientResource getMgmtTargetTagClientResource() { + if (mgmtTargetTagClientResource == null) { + mgmtTargetTagClientResource = feignBuilder.target(MgmtTargetTagClientResource.class, + this.baseUrl + MgmtTargetTagClientResource.PATH); + } + return mgmtTargetTagClientResource; + } + + public MgmtDownloadClientResource getMgmtDownloadClientResource() { + if (mgmtDownloadClientResource == null) { + mgmtDownloadClientResource = feignBuilder.target(MgmtDownloadClientResource.class, + this.baseUrl + MgmtDownloadClientResource.PATH); + } + return mgmtDownloadClientResource; + } + + public MgmtDownloadArtifactClientResource getMgmtDownloadArtifactClientResource() { + if (mgmtDownloadArtifactClientResource == null) { + mgmtDownloadArtifactClientResource = feignBuilder.target(MgmtDownloadArtifactClientResource.class, + this.baseUrl + MgmtDownloadArtifactClientResource.PATH); + } + return mgmtDownloadArtifactClientResource; + } + +} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java similarity index 71% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java index 11df8c323..b513f43f1 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the DistributionSet resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsets") -public interface DistributionSetResourceClient extends MgmtDistributionSetRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDistributionSetClientResource.PATH) +public interface MgmtDistributionSetClientResource extends MgmtDistributionSetRestApi { + static String PATH = "rest/v1/distributionsets"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java similarity index 70% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java index 628304e26..6d4f60bb7 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTagResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the DistributionSetTag resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettags") -public interface DistributionSetTagResourceClient extends MgmtDistributionSetTagRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDistributionSetTagClientResource.PATH) +public interface MgmtDistributionSetTagClientResource extends MgmtDistributionSetTagRestApi { + static String PATH = "rest/v1/distributionsettags"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java similarity index 70% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java index 871f79beb..fe745968f 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/DistributionSetTypeResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java @@ -15,7 +15,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; * Client binding for the DistributionSetType resource of the management API. * */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/distributionsettypes") -public interface DistributionSetTypeResourceClient extends MgmtDistributionSetTypeRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDistributionSetTypeClientResource.PATH) +public interface MgmtDistributionSetTypeClientResource extends MgmtDistributionSetTypeRestApi { + static String PATH = "rest/v1/distributionsettypes"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java new file mode 100644 index 000000000..3f7917f22 --- /dev/null +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java @@ -0,0 +1,22 @@ +/** + * 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.mgmt.client.resource; + +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadArtifactRestApi; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDownloadArtifactClientResource.PATH) +public interface MgmtDownloadArtifactClientResource extends MgmtDownloadArtifactRestApi { + + static String PATH = "rest/v1/softwaremodules"; + +} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java new file mode 100644 index 000000000..2626b8a90 --- /dev/null +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java @@ -0,0 +1,22 @@ +/** + * 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.mgmt.client.resource; + +import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadRestApi; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDownloadClientResource.PATH) +public interface MgmtDownloadClientResource extends MgmtDownloadRestApi { + + static String PATH = "api/v1/downloadserver/"; + +} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java similarity index 73% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java index 0a40ab107..430550b3a 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/RolloutResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the Rollout resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/rollouts") -public interface RolloutResourceClient extends MgmtRolloutRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRolloutClientResource.PATH) +public interface MgmtRolloutClientResource extends MgmtRolloutRestApi { + static String PATH = "rest/v1/rollouts"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java similarity index 71% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java index 80fcf734e..d89f7e5f3 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the SoftwareModule resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremodules") -public interface SoftwareModuleResourceClient extends MgmtSoftwareModuleRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtSoftwareModuleClientResource.PATH) +public interface MgmtSoftwareModuleClientResource extends MgmtSoftwareModuleRestApi { + static String PATH = "rest/v1/softwaremodules"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java similarity index 70% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java index 5fe0012f6..6d5ca476c 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SoftwareModuleTypeResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the oftwareModuleType resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/softwaremoduletypes") -public interface SoftwareModuleTypeResourceClient extends MgmtSoftwareModuleTypeRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtSoftwareModuleTypeClientResource.PATH) +public interface MgmtSoftwareModuleTypeClientResource extends MgmtSoftwareModuleTypeRestApi { + static String PATH = "rest/v1/softwaremoduletypes"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java similarity index 74% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java index 920666dd1..5d043afe2 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java @@ -14,7 +14,8 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the Target resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/targets") -public interface TargetResourceClient extends MgmtTargetRestApi { +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtTargetClientResource.PATH) +public interface MgmtTargetClientResource extends MgmtTargetRestApi { + static String PATH = "/rest/v1/targets"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java similarity index 73% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java rename to examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java index ad6a1dab9..475008cf3 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/TargetTagResourceClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java @@ -14,7 +14,7 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the TargetTag resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/rest/v1/targettags") -public interface TargetTagResourceClient extends MgmtTargetTagRestApi { - +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtTargetTagClientResource.PATH) +public interface MgmtTargetTagClientResource extends MgmtTargetTagRestApi { + static String PATH = "rest/v1/targettags"; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java index 0e1093f1d..2fd81736c 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java @@ -10,12 +10,12 @@ package org.eclipse.hawkbit.mgmt.client.scenarios; import java.util.List; -import org.eclipse.hawkbit.mgmt.client.resource.DistributionSetResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.DistributionSetTypeResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.RolloutResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.SoftwareModuleResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.SoftwareModuleTypeResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.TargetResourceClient; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTypeClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtRolloutClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleTypeClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetClientResource; import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetTypeBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.RolloutBuilder; @@ -44,22 +44,22 @@ public class CreateStartedRolloutExample { private static final String DS_MODULE_TYPE = SM_MODULE_TYPE; @Autowired - private DistributionSetResourceClient distributionSetResource; + private MgmtDistributionSetClientResource distributionSetResource; @Autowired - private SoftwareModuleResourceClient softwareModuleResource; + private MgmtSoftwareModuleClientResource softwareModuleResource; @Autowired - private TargetResourceClient targetResource; + private MgmtTargetClientResource targetResource; @Autowired - private RolloutResourceClient rolloutResource; + private MgmtRolloutClientResource rolloutResource; @Autowired - private DistributionSetTypeResourceClient distributionSetTypeResource; + private MgmtDistributionSetTypeClientResource distributionSetTypeResource; @Autowired - private SoftwareModuleTypeResourceClient softwareModuleTypeResource; + private MgmtSoftwareModuleTypeClientResource softwareModuleTypeResource; /** * Run the Rollout scenario. diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java index 43a98aff4..77b426a2f 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java @@ -10,10 +10,10 @@ package org.eclipse.hawkbit.mgmt.client.scenarios; import java.util.List; -import org.eclipse.hawkbit.mgmt.client.resource.DistributionSetResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.DistributionSetTypeResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.SoftwareModuleResourceClient; -import org.eclipse.hawkbit.mgmt.client.resource.SoftwareModuleTypeResourceClient; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTypeClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleClientResource; +import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleTypeClientResource; import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.DistributionSetTypeBuilder; import org.eclipse.hawkbit.mgmt.client.resource.builder.SoftwareModuleAssigmentBuilder; @@ -50,16 +50,16 @@ public class GettingStartedDefaultScenario { private static final String DS_EXAMPLE_NAME = SM_EXAMPLE_NAME; @Autowired - private DistributionSetResourceClient distributionSetResource; + private MgmtDistributionSetClientResource distributionSetResource; @Autowired - private DistributionSetTypeResourceClient distributionSetTypeResource; + private MgmtDistributionSetTypeClientResource distributionSetTypeResource; @Autowired - private SoftwareModuleResourceClient softwareModuleResource; + private MgmtSoftwareModuleClientResource softwareModuleResource; @Autowired - private SoftwareModuleTypeResourceClient softwareModuleTypeResource; + private MgmtSoftwareModuleTypeClientResource softwareModuleTypeResource; /** * Run the default getting started scenario. diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index 024a32454..5c1fbf561 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -65,39 +65,39 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, final HttpServletResponse response, final HttpServletRequest request, @AuthenticationPrincipal final String targetid) { - ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); if (foundArtifacts.isEmpty()) { LOG.warn("Software artifact with name {} could not be found.", fileName); - result = new ResponseEntity<>(HttpStatus.NOT_FOUND); + return new ResponseEntity<>(HttpStatus.NOT_FOUND); + } + + if (foundArtifacts.size() > 1) { + LOG.warn("Software artifact name {} is not unique. We will use the first entry.", fileName); + } + ResponseEntity result; + final LocalArtifact artifact = foundArtifacts.get(0); + + final String ifMatch = request.getHeader("If-Match"); + if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { + result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } else { - if (foundArtifacts.size() > 1) { - LOG.warn("Software artifact name {} is not unique. We will use the first entry.", fileName); - } + final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); - final LocalArtifact artifact = foundArtifacts.get(0); - - final String ifMatch = request.getHeader("If-Match"); - if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { - result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); + // we set a download status only if we are aware of the + // targetid, i.e. authenticated and not anonymous + if (targetid != null && !"anonymous".equals(targetid)) { + final Action action = checkAndReportDownloadByTarget(request, targetid, artifact); + result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, + cacheWriteNotify, action.getId()); } else { - final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); - - // we set a download status only if we are aware of the - // targetid, i.e. authenticated and not anonymous - if (targetid != null && !"anonymous".equals(targetid)) { - final Action action = checkAndReportDownloadByTarget(request, targetid, artifact); - result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, - cacheWriteNotify, action.getId()); - } else { - result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file); - } - + result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file); } + } return result; + } @Override From 810900eee7c72e695b0af067721b8c3c81975439 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Fri, 22 Apr 2016 13:36:21 +0200 Subject: [PATCH 026/124] Removed http servlet response and request form method signature Signed-off-by: Jonathan Philip Knoblauch --- .../java/org/eclipse/hawkbit/app/Start.java | 2 +- .../hawkbit/ddi/client/Application.java | 27 +++++++++ .../eclipse/hawkbit/ddi/client/DdiClient.java | 23 ++------ .../hawkbit/example/ddi/client/AppTest.java | 2 +- .../ResourceControllerAutoConfiguration.java | 2 +- .../DdiArtifactStoreControllerRestApi.java | 15 ++--- .../rest/api/DdiRootControllerRestApi.java | 23 +++----- .../ddi/{annotation => }/EnableDdiApi.java | 2 +- .../rest/resource/DataConversionHelper.java | 8 +-- .../resource/DdiArtifactStoreController.java | 26 +++++--- .../ddi/rest/resource/DdiRootController.java | 59 +++++++++++-------- 11 files changed, 105 insertions(+), 84 deletions(-) rename hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/{annotation => }/EnableDdiApi.java (95%) diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index 76d89af33..a8f2bc645 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -10,7 +10,7 @@ package org.eclipse.hawkbit.app; import org.eclipse.hawkbit.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration; -import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi; +import org.eclipse.hawkbit.ddi.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.SpringApplication; diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java index e230a77da..d8810f48b 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java @@ -3,9 +3,13 @@ */ package org.eclipse.hawkbit.ddi.client; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.cloud.netflix.feign.EnableFeignClients; +import org.springframework.context.annotation.Bean; + +import feign.Contract; /** * @author Jonathan Knoblauch @@ -15,8 +19,31 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients; @EnableFeignClients public class Application { + @Autowired + private DdiClient ddiClient; + public static void main(final String[] args) { new SpringApplicationBuilder().showBanner(false).sources(Application.class).run(args); + + // TODO .encoder(new JacksonEncoder()) + // .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + + } + + // @Bean + // public BasicAuthRequestInterceptor basicAuthRequestInterceptor() { + // return new BasicAuthRequestInterceptor(configuration.getUsername(), + // configuration.getPassword()); + // } + + @Bean + public ApplicationJsonRequestHeaderInterceptor jsonHeaderInterceptor() { + return new ApplicationJsonRequestHeaderInterceptor(); + } + + @Bean + public Contract feignContract() { + return new IgnoreMultipleConsumersProducersSpringMvcContract(); } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java index 08b398b0f..22101681e 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java @@ -3,15 +3,12 @@ */ package org.eclipse.hawkbit.ddi.client; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Component; import feign.Feign; import feign.Logger; @@ -19,13 +16,12 @@ import feign.Logger.Level; import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; +@Component public class DdiClient { - @Autowired - private HttpServletRequest request; - - @Autowired - private HttpServletResponse response; + // + // @Autowired + // private HttpServletResponse response; private final String controllerId; private final String name; @@ -65,14 +61,7 @@ public class DdiClient { public void startDdiClient() { - // final HttpServletRequest request; - - // final HttpSession mySession = request.getSession(); - - // final HttpServletRequest request = new; - - final ResponseEntity response = rootControllerResourceClient.getControllerBase("test", - request); + final ResponseEntity response = rootControllerResourceClient.getControllerBase("test"); final DdiControllerBase controllerBase = response.getBody(); // TODO notify every 10 seconds on the rollout server diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index 64f34c8ff..bb74c5dee 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -11,7 +11,7 @@ public class AppTest { @Test public void AppTest() { - final DdiClient ddiClient = new DdiClient("localhost:8080", "mytest", "mytest", "desc", "DEFAULT"); + final DdiClient ddiClient = new DdiClient("http://localhost:8080", "mytest", "mytest", "desc", "DEFAULT"); ddiClient.startDdiClient(); } diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index 34ed5ddcd..afb90bd13 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -8,7 +8,7 @@ */ package org.eclipse.hawkbit.autoconfigure.web; -import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi; +import org.eclipse.hawkbit.ddi.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java index ffeef732f..ab49be1c1 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java @@ -8,9 +8,6 @@ */ package org.eclipse.hawkbit.ddi.rest.api; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -43,11 +40,10 @@ public interface DdiArtifactStoreControllerRestApi { * {@link HttpStatus#OK} or in case of partial download * {@link HttpStatus#PARTIAL_CONTENT}. */ - @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME - + "/{fileName}") + @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}") @ResponseBody public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, - final HttpServletResponse response, final HttpServletRequest request, + @AuthenticationPrincipal final String targetid); /** @@ -60,10 +56,9 @@ public interface DdiArtifactStoreControllerRestApi { * * @return response of the servlet */ - @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME - + "/{fileName}" + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX) + @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}" + + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX) @ResponseBody - public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, - final HttpServletResponse response); + public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName); } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index febdaa6b4..8ba4068a7 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -6,8 +6,6 @@ package org.eclipse.hawkbit.ddi.rest.api; import java.lang.annotation.Target; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; @@ -60,8 +58,7 @@ public interface DdiRootControllerRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, - final HttpServletRequest request); + ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid); /** * Handles GET {@link DdiArtifact} download request. This could be full or @@ -85,8 +82,7 @@ public interface DdiRootControllerRestApi { @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request); + @PathVariable("fileName") final String fileName); /** * Handles GET {@link DdiArtifact} MD5 checksum file download request. @@ -109,8 +105,7 @@ public interface DdiRootControllerRestApi { + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX, produces = MediaType.TEXT_PLAIN_VALUE) ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request); + @PathVariable("fileName") final String fileName); /** * Resource for {@link SoftwareModule} {@link UpdateAction}s. @@ -134,8 +129,7 @@ public interface DdiRootControllerRestApi { ResponseEntity getControllerBasedeploymentAction( @PathVariable("targetid") @NotEmpty final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, - @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, - final HttpServletRequest request); + @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource); /** * This is the feedback channel for the {@link DdiDeploymentBase} action. @@ -155,8 +149,7 @@ public interface DdiRootControllerRestApi { @RequestMapping(value = "/{targetid}/" + DdiRestConstants.DEPLOYMENT_BASE_ACTION + "/{actionId}/" + DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, - @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, - final HttpServletRequest request); + @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId); /** * This is the feedback channel for the config data action. @@ -173,7 +166,7 @@ public interface DdiRootControllerRestApi { @RequestMapping(value = "/{targetid}/" + DdiRestConstants.CONFIG_DATA_ACTION, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, - @PathVariable("targetid") final String targetid, final HttpServletRequest request); + @PathVariable("targetid") final String targetid); /** * {@link RequestMethod.GET} method for the {@link DdiCancel} action. @@ -190,7 +183,7 @@ public interface DdiRootControllerRestApi { @RequestMapping(value = "/{targetid}/" + DdiRestConstants.CANCEL_ACTION + "/{actionId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) ResponseEntity getControllerCancelAction(@PathVariable("targetid") @NotEmpty final String targetid, - @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); + @PathVariable("actionId") @NotEmpty final Long actionId); /** * {@link RequestMethod.POST} method receiving the {@link DdiActionFeedback} @@ -212,6 +205,6 @@ public interface DdiRootControllerRestApi { + DdiRestConstants.FEEDBACK, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) ResponseEntity postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable("targetid") @NotEmpty final String targetid, - @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request); + @PathVariable("actionId") @NotEmpty final Long actionId); } diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java similarity index 95% rename from hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java rename to hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java index 1c41debc7..1d1e0a259 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/annotation/EnableDdiApi.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.annotation; +package org.eclipse.hawkbit.ddi; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index b662f2b5f..576e11348 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -118,12 +118,12 @@ public final class DataConversionHelper { // change the payload of the // response because of eTags. result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant()) - .getControllerBasedeploymentAction(target.getControllerId(), action.getId(), actions.hashCode(), - null)).withRel(DdiRestConstants.DEPLOYMENT_BASE_ACTION)); + .getControllerBasedeploymentAction(target.getControllerId(), action.getId(), + actions.hashCode())).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(), null)) + .getControllerCancelAction(target.getControllerId(), action.getId())) .withRel(DdiRestConstants.CANCEL_ACTION)); addedCancel = true; } @@ -131,7 +131,7 @@ public final class DataConversionHelper { if (target.getTargetInfo().isRequestControllerAttributes()) { result.add(linkTo(methodOn(DdiRootController.class, tenantAware.getCurrentTenant()).putConfigData(null, - target.getControllerId(), null)).withRel(DdiRestConstants.CONFIG_DATA_ACTION)); + target.getControllerId())).withRel(DdiRestConstants.CONFIG_DATA_ACTION)); } return result; } diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index 024a32454..e45d3f5c8 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -35,6 +35,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; /** * The {@link DdiArtifactStoreController} of the HawkBit server controller API @@ -61,10 +63,18 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes @Autowired private HawkbitSecurityProperties securityProperties; + private HttpServletResponse getResponse() { + return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getResponse(); + } + + private HttpServletRequest getRequest() { + return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); + } + @Override public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, - final HttpServletResponse response, final HttpServletRequest request, @AuthenticationPrincipal final String targetid) { + ResponseEntity result; final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -79,7 +89,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes final LocalArtifact artifact = foundArtifacts.get(0); - final String ifMatch = request.getHeader("If-Match"); + final String ifMatch = getRequest().getHeader("If-Match"); if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } else { @@ -88,11 +98,12 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes // we set a download status only if we are aware of the // targetid, i.e. authenticated and not anonymous if (targetid != null && !"anonymous".equals(targetid)) { - final Action action = checkAndReportDownloadByTarget(request, targetid, artifact); - result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, + final Action action = checkAndReportDownloadByTarget(getRequest(), targetid, artifact); + result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), file, cacheWriteNotify, action.getId()); } else { - result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file); + result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), + file); } } @@ -101,8 +112,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes } @Override - public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName, - final HttpServletResponse response) { + public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName) { final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); if (foundArtifacts.isEmpty()) { @@ -113,7 +123,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes } try { - DataConversionHelper.writeMD5FileResponse(fileName, response, foundArtifacts.get(0)); + DataConversionHelper.writeMD5FileResponse(fileName, getResponse(), foundArtifacts.get(0)); } catch (final IOException e) { LOG.error("Failed to stream MD5 File", e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index c9c4f1d92..7ef4f343d 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -54,6 +54,8 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; /** * The {@link DdiRootController} of the hawkBit server DDI API that is queried @@ -89,12 +91,22 @@ public class DdiRootController implements DdiRootControllerRestApi { @Autowired private ArtifactUrlHandler artifactUrlHandler; + private HttpServletResponse getResponse() { + return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getResponse(); + } + + private HttpServletRequest getRequest() { + return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); + } + @Override public ResponseEntity> getSoftwareModulesArtifacts( @PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); + // SecurityContextHolder.getContext().getAuthentication(). + final SoftwareModule softwareModule = softwareManagement.findSoftwareModuleById(softwareModuleId); if (softwareModule == null) { @@ -108,18 +120,17 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid, - final HttpServletRequest request) { + public ResponseEntity getControllerBase(@PathVariable("targetid") final String targetid) { LOG.debug("getControllerBase({})", targetid); final Target target = controllerManagement.findOrRegisterTargetIfItDoesNotexist(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); if (target.getTargetInfo().getUpdateStatus() == TargetUpdateStatus.UNKNOWN) { LOG.debug("target with {} extsisted but was in status UNKNOWN -> REGISTERED)", targetid); controllerManagement.updateTargetStatus(target.getTargetInfo(), TargetUpdateStatus.REGISTERED, System.currentTimeMillis(), - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); } return new ResponseEntity<>( @@ -131,12 +142,11 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request) { + @PathVariable("fileName") final String fileName) { ResponseEntity result; final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); final SoftwareModule module = softwareManagement.findSoftwareModuleById(softwareModuleId); if (checkModule(fileName, module)) { @@ -146,12 +156,12 @@ public class DdiRootController implements DdiRootControllerRestApi { final LocalArtifact artifact = module.getLocalArtifactByFilename(fileName).get(); final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); - final String ifMatch = request.getHeader("If-Match"); + final String ifMatch = getRequest().getHeader("If-Match"); if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } else { - final Action action = checkAndLogDownload(request, target, module); - result = RestResourceConversionHelper.writeFileResponse(artifact, response, request, file, + final Action action = checkAndLogDownload(getRequest(), target, module); + result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), file, cacheWriteNotify, action.getId()); } } @@ -185,10 +195,9 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity downloadArtifactMd5(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("fileName") final String fileName, final HttpServletResponse response, - final HttpServletRequest request) { + @PathVariable("fileName") final String fileName) { controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); final SoftwareModule module = softwareManagement.findSoftwareModuleById(softwareModuleId); @@ -198,7 +207,7 @@ public class DdiRootController implements DdiRootControllerRestApi { } try { - DataConversionHelper.writeMD5FileResponse(fileName, response, + DataConversionHelper.writeMD5FileResponse(fileName, getResponse(), module.getLocalArtifactByFilename(fileName).get()); } catch (final IOException e) { LOG.error("Failed to stream MD5 File", e); @@ -211,12 +220,11 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity getControllerBasedeploymentAction( @PathVariable("targetid") final String targetid, @PathVariable("actionId") final Long actionId, - @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource, - final HttpServletRequest request) { + @RequestParam(value = "c", required = false, defaultValue = "-1") final int resource) { LOG.debug("getControllerBasedeploymentAction({},{})", targetid, resource); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); final Action action = findActionWithExceptionIfNotFound(actionId); if (!action.getTarget().getId().equals(target.getId())) { @@ -246,12 +254,11 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity postBasedeploymentActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, - @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId, - final HttpServletRequest request) { + @PathVariable("targetid") final String targetid, @PathVariable("actionId") @NotEmpty final Long actionId) { LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); if (!actionId.equals(feedback.getId())) { LOG.warn( @@ -343,9 +350,9 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, - @PathVariable("targetid") final String targetid, final HttpServletRequest request) { + @PathVariable("targetid") final String targetid) { controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); controllerManagement.updateControllerAttributes(targetid, configData.getData()); @@ -355,11 +362,11 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity getControllerCancelAction( @PathVariable("targetid") @NotEmpty final String targetid, - @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request) { + @PathVariable("actionId") @NotEmpty final Long actionId) { LOG.debug("getControllerCancelAction({})", targetid); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); final Action action = findActionWithExceptionIfNotFound(actionId); if (!action.getTarget().getId().equals(target.getId())) { @@ -385,11 +392,11 @@ public class DdiRootController implements DdiRootControllerRestApi { @Override public ResponseEntity postCancelActionFeedback(@Valid @RequestBody final DdiActionFeedback feedback, @PathVariable("targetid") @NotEmpty final String targetid, - @PathVariable("actionId") @NotEmpty final Long actionId, final HttpServletRequest request) { + @PathVariable("actionId") @NotEmpty final Long actionId) { LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(request, securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); if (!actionId.equals(feedback.getId())) { LOG.warn( From 89f64a2d44fa1e14ae18c8ed935917c56fc91d2c Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Fri, 22 Apr 2016 14:36:29 +0200 Subject: [PATCH 027/124] Added new default feign client Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/ddi/client/Application.java | 2 +- .../eclipse/hawkbit/ddi/client/DdiClient.java | 75 ------------------- .../ddi/client/DdiDefaultFeignClient.java | 53 +++++++++++++ .../hawkbit/ddi/client/DdiExampleClient.java | 45 +++++++++++ .../hawkbit/example/ddi/client/AppTest.java | 5 +- 5 files changed, 102 insertions(+), 78 deletions(-) delete mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java index d8810f48b..86ccf195e 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java @@ -20,7 +20,7 @@ import feign.Contract; public class Application { @Autowired - private DdiClient ddiClient; + private DdiExampleClient ddiClient; public static void main(final String[] args) { new SpringApplicationBuilder().showBanner(false).sources(Application.class).run(args); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java deleted file mode 100644 index 22101681e..000000000 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiClient.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. - */ -package org.eclipse.hawkbit.ddi.client; - -import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; -import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; -import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; -import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Component; - -import feign.Feign; -import feign.Logger; -import feign.Logger.Level; -import feign.jackson.JacksonDecoder; -import feign.jackson.JacksonEncoder; - -@Component -public class DdiClient { - - // - // @Autowired - // private HttpServletResponse response; - - private final String controllerId; - private final String name; - private final String description; - private RootControllerResourceClient rootControllerResourceClient; - private String rootControllerResourcePath; - - public DdiClient(final String rolloutsUrl, final String controllerId, final String name, final String description, - final String tenant) { - super(); - this.controllerId = controllerId; - this.name = name; - this.description = description; - rootControllerResourcePath = rolloutsUrl + DdiRestConstants.BASE_V1_REQUEST_MAPPING; - rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); - - createFeignClient(); - } - - private void createFeignClient() { - - // BasicAuthRequestInterceptor TODO - - final Feign.Builder feignBuilder = Feign.builder() - .contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) - .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) - .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) - .decoder(new ResponseEntityDecoder(new JacksonDecoder())); - // TODO implement feign client encoder to handle MultiPartFile - // .requestInterceptor(new BasicAuthRequestInterceptor(tenant + "\\" + - // user, password)) - - rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, - rootControllerResourcePath); - - } - - public void startDdiClient() { - - final ResponseEntity response = rootControllerResourceClient.getControllerBase("test"); - final DdiControllerBase controllerBase = response.getBody(); - - // TODO notify every 10 seconds on the rollout server - - // TODO if new update available -> start download and installation - // process - // report status messages - - } - -} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java new file mode 100644 index 000000000..4dd29d7c1 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client; + +import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; +import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; + +import feign.Feign; +import feign.Feign.Builder; +import feign.Logger; +import feign.Logger.Level; +import feign.jackson.JacksonDecoder; +import feign.jackson.JacksonEncoder; + +/** + * @author Jonathan Knoblauch + * + */ +public class DdiDefaultFeignClient { + + private RootControllerResourceClient rootControllerResourceClient; + + private final Builder feignBuilder; + private final String baseUrl; + private final String tenant; + + public DdiDefaultFeignClient(final String baseUrl, final String tenant) { + feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) + .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) + .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) + .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + this.baseUrl = baseUrl; + this.tenant = tenant; + } + + public Builder getFeignBuilder() { + return feignBuilder; + } + + public RootControllerResourceClient getRootControllerResourceClient() { + + String rootControllerResourcePath = this.baseUrl + RootControllerResourceClient.PATH; + rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); + // TODO tenant null throw exception + if (rootControllerResourceClient == null) { + rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, + rootControllerResourcePath); + } + return rootControllerResourceClient; + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java new file mode 100644 index 000000000..c7b81e4fe --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client; + +import org.springframework.stereotype.Component; + +@Component +public class DdiExampleClient { + + private final String controllerId; + private final String name; + private final String description; + private final String baseUrl; + final DdiDefaultFeignClient ddiDefaultFeignClient; + + public DdiExampleClient(final String baseUrl, final String controllerId, final String name, + final String description, final String tenant) { + super(); + this.controllerId = controllerId; + this.name = name; + this.description = description; + this.baseUrl = baseUrl; + ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); + } + + public void startDdiClient() { + + // final ResponseEntity response = + + ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); + + // final DdiControllerBase controllerBase = response.getBody(); + + System.out.println("test"); + + // TODO notify every 10 seconds on the rollout server + + // TODO if new update available -> start download and installation + // process + // report status messages + + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index bb74c5dee..bb369f478 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -1,6 +1,6 @@ package org.eclipse.hawkbit.example.ddi.client; -import org.eclipse.hawkbit.ddi.client.DdiClient; +import org.eclipse.hawkbit.ddi.client.DdiExampleClient; import org.junit.Test; /** @@ -11,7 +11,8 @@ public class AppTest { @Test public void AppTest() { - final DdiClient ddiClient = new DdiClient("http://localhost:8080", "mytest", "mytest", "desc", "DEFAULT"); + final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "mytest", "mytest", "desc", + "DEFAULT"); ddiClient.startDdiClient(); } From 5882c0444b8e379c116eab59e3f799946c976535 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Fri, 22 Apr 2016 15:18:17 +0200 Subject: [PATCH 028/124] Add baseUrl to Feign Client resource Signed-off-by: SirWayne --- .../org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java index 8bfc2ec52..ecd77f144 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java @@ -93,7 +93,7 @@ public class MgmtDefaultFeignClient { public MgmtSoftwareModuleClientResource getMgmtSoftwareModuleClientResource() { if (mgmtSoftwareModuleClientResource == null) { mgmtSoftwareModuleClientResource = feignBuilder.target(MgmtSoftwareModuleClientResource.class, - MgmtSoftwareModuleClientResource.PATH); + this.baseUrl + MgmtSoftwareModuleClientResource.PATH); } return mgmtSoftwareModuleClientResource; } From 946befb03882a54b0cdd85ee67189accd9d87dd1 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Fri, 22 Apr 2016 16:59:54 +0200 Subject: [PATCH 029/124] Add Jackson2HalModule module Signed-off-by: SirWayne --- .../hawkbit/mgmt/client/MgmtDefaultFeignClient.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java index ecd77f144..6425bad4d 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java @@ -19,6 +19,10 @@ import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleTypeClientReso import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetClientResource; import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetTagClientResource; import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; +import org.springframework.hateoas.hal.Jackson2HalModule; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import feign.Feign; import feign.Feign.Builder; @@ -47,10 +51,14 @@ public class MgmtDefaultFeignClient { private final String baseUrl; public MgmtDefaultFeignClient(final String baseUrl) { + final ObjectMapper mapper = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .registerModule(new Jackson2HalModule()); + feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) - .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + .decoder(new ResponseEntityDecoder(new JacksonDecoder(mapper))); this.baseUrl = baseUrl; } From c17bc98ecb20577df81594777765f442a2bf923b Mon Sep 17 00:00:00 2001 From: SirWayne Date: Fri, 22 Apr 2016 17:49:33 +0200 Subject: [PATCH 030/124] Add RequestResponseContextHolder which hold the current response and request. Signed-off-by: SirWayne --- .../ResourceControllerAutoConfiguration.java | 33 +++++++++++ .../rest/api/MgmtDownloadArtifactRestApi.java | 6 +- .../MgmtDownloadArtifactResource.java | 13 +++-- .../resource/MgmtSoftwareModuleMapper.java | 11 ++-- .../hawkbit/rest/util/FilterHttpResponse.java | 54 ++++++++++++++++++ .../rest/util/HttpResponseFactoryBean.java | 55 +++++++++++++++++++ .../util/RequestResponseContextHolder.java | 35 ++++++++++++ 7 files changed, 191 insertions(+), 16 deletions(-) create mode 100644 hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FilterHttpResponse.java create mode 100644 hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/HttpResponseFactoryBean.java create mode 100644 hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index 34ed5ddcd..41a06522b 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -8,12 +8,20 @@ */ package org.eclipse.hawkbit.autoconfigure.web; +import javax.servlet.http.HttpServletResponse; + import org.eclipse.hawkbit.ddi.annotation.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; +import org.eclipse.hawkbit.rest.util.FilterHttpResponse; +import org.eclipse.hawkbit.rest.util.HttpResponseFactoryBean; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.context.annotation.Scope; +import org.springframework.web.context.WebApplicationContext; /** * Auto-Configuration for enabling the REST-Resources. @@ -24,4 +32,29 @@ import org.springframework.context.annotation.Import; @Import({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) public class ResourceControllerAutoConfiguration { + /** + * Create filter for {@link HttpServletResponse}. + */ + @Bean + public FilterHttpResponse filterHttpResponse() { + return new FilterHttpResponse(); + } + + /** + * Create factory bean for {@link HttpServletResponse}. + */ + @Bean + public HttpResponseFactoryBean httpResponseFactoryBean() { + return new HttpResponseFactoryBean(); + } + + /** + * Create factory bean for {@link HttpServletResponse}. + */ + @Bean + @Scope(value = WebApplicationContext.SCOPE_REQUEST) + public RequestResponseContextHolder requestResponseContextHolder() { + return new RequestResponseContextHolder(); + } + } diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java index e07d77f2f..4b50dc8f5 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java @@ -8,9 +8,6 @@ */ package org.eclipse.hawkbit.mgmt.rest.api; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -40,7 +37,6 @@ public interface MgmtDownloadArtifactRestApi { @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}/download") @ResponseBody ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse, - final HttpServletRequest request); + @PathVariable("artifactId") final Long artifactId); } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index ddd7180cf..bef76d32f 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -9,7 +9,6 @@ package org.eclipse.hawkbit.mgmt.rest.resource; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadArtifactRestApi; @@ -18,6 +17,7 @@ import org.eclipse.hawkbit.repository.SoftwareManagement; import org.eclipse.hawkbit.repository.exception.EntityNotFoundException; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -38,6 +38,9 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi @Autowired private ArtifactManagement artifactManagement; + @Autowired + private RequestResponseContextHolder requestResponseContextHolder; + /** * Handles the GET request for downloading an artifact. * @@ -55,8 +58,7 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi @Override @ResponseBody public ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, - @PathVariable("artifactId") final Long artifactId, final HttpServletResponse servletResponse, - final HttpServletRequest request) { + @PathVariable("artifactId") final Long artifactId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); if (null == module || !module.getLocalArtifact(artifactId).isPresent()) { @@ -65,13 +67,14 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi final LocalArtifact artifact = module.getLocalArtifact(artifactId).get(); final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); - + final HttpServletRequest request = requestResponseContextHolder.getHttpServletRequest(); final String ifMatch = request.getHeader("If-Match"); if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { return new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } - return RestResourceConversionHelper.writeFileResponse(artifact, servletResponse, request, file); + return RestResourceConversionHelper.writeFileResponse(artifact, + requestResponseContextHolder.getHttpServletResponse(), request, file); } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java index 38b4ace75..5ca100ca9 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleMapper.java @@ -145,8 +145,8 @@ public final class MgmtSoftwareModuleMapper { response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getSoftwareModule(response.getModuleId())) .withRel("self")); - response.add(linkTo( - methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(baseSofwareModule.getType().getId())) + response.add(linkTo(methodOn(MgmtSoftwareModuleTypeRestApi.class) + .getSoftwareModuleType(baseSofwareModule.getType().getId())) .withRel(MgmtRestConstants.SOFTWAREMODULE_V1_TYPE)); response.add(linkTo(methodOn(MgmtSoftwareModuleResource.class).getMetadata(response.getModuleId(), @@ -176,13 +176,12 @@ public final class MgmtSoftwareModuleMapper { MgmtRestModelMapper.mapBaseToBase(artifactRest, artifact); - artifactRest.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getArtifact(artifact.getSoftwareModule().getId(), - artifact.getId())).withRel("self")); + artifactRest.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class) + .getArtifact(artifact.getSoftwareModule().getId(), artifact.getId())).withRel("self")); if (artifact instanceof LocalArtifact) { artifactRest.add(linkTo(methodOn(MgmtDownloadArtifactResource.class) - .downloadArtifact(artifact.getSoftwareModule().getId(), artifact.getId(), null, null)) - .withRel("download")); + .downloadArtifact(artifact.getSoftwareModule().getId(), artifact.getId())).withRel("download")); } return artifactRest; diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FilterHttpResponse.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FilterHttpResponse.java new file mode 100644 index 000000000..7620e7404 --- /dev/null +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FilterHttpResponse.java @@ -0,0 +1,54 @@ +/** + * 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.rest.util; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletResponse; + +/** + * Filter is needed to autowire the {@link HttpServletResponse}. + * + */ +public class FilterHttpResponse implements Filter { + + private ThreadLocal threadLocalResponse = new ThreadLocal<>(); + + @Override + public void init(final FilterConfig filterConfig) throws ServletException { + // not needed + } + + @Override + public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) + throws IOException, ServletException { + try { + threadLocalResponse.set((HttpServletResponse) response); + chain.doFilter(request, response); + } finally { + threadLocalResponse.remove(); + } + } + + public HttpServletResponse getHttpServletReponse() { + return threadLocalResponse.get(); + } + + @Override + public void destroy() { + threadLocalResponse = null; + } + +} diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/HttpResponseFactoryBean.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/HttpResponseFactoryBean.java new file mode 100644 index 000000000..6df7987e6 --- /dev/null +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/HttpResponseFactoryBean.java @@ -0,0 +1,55 @@ +/** + * 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.rest.util; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.NamedBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; + +/** + * + * Factory bean to autowire the {@link HttpServletResponse}. + * + */ +public class HttpResponseFactoryBean implements FactoryBean, ApplicationContextAware, NamedBean { + + public static final String FACTORY_BEAN_NAME = "httpResponseFactoryBean"; + + private ApplicationContext applicationContext; + + @Override + public HttpServletResponse getObject() throws Exception { + return applicationContext.getBean(FilterHttpResponse.class).getHttpServletReponse(); + } + + @Override + public Class getObjectType() { + return HttpServletResponse.class; + } + + @Override + public boolean isSingleton() { + return false; + } + + @Override + public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + + @Override + public String getBeanName() { + return FACTORY_BEAN_NAME; + } + +} diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java new file mode 100644 index 000000000..4c2dc5c5a --- /dev/null +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.rest.util; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 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 + */ +public class RequestResponseContextHolder { + + @Autowired + private HttpServletRequest httpServletRequest; + + @Resource(name = HttpResponseFactoryBean.FACTORY_BEAN_NAME) + private HttpServletResponse httpServletResponse; + + public HttpServletRequest getHttpServletRequest() { + return httpServletRequest; + } + + public HttpServletResponse getHttpServletResponse() { + return httpServletResponse; + } +} From 1f5a27a2a879c5bb06ebb8c4767b68252ec701c6 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Fri, 22 Apr 2016 18:03:39 +0200 Subject: [PATCH 031/124] Add Scope and jackson dependency Signed-off-by: SirWayne --- examples/hawkbit-mgmt-api-client/pom.xml | 5 +++++ .../mgmt/rest/resource/MgmtDownloadArtifactResource.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index 75e520ea6..70b394ac4 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -71,6 +71,11 @@ feign-jackson 8.14.2 + + com.fasterxml.jackson.core + jackson-databind + 2.5.5 + hibernate-validator org.hibernate diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index bef76d32f..de01a917a 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -20,16 +20,19 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.WebApplicationContext; /** * */ @RestController +@Scope(value = WebApplicationContext.SCOPE_REQUEST) public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi { @Autowired From 0ea9e84322d20ba2b6eeb500224fef3138f543a7 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Fri, 22 Apr 2016 18:06:01 +0200 Subject: [PATCH 032/124] Implementation of controller example client Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 10 ++- ...plicationJsonRequestHeaderInterceptor.java | 2 + .../ddi/client/DdiDefaultFeignClient.java | 12 ++- .../hawkbit/ddi/client/DdiExampleClient.java | 83 +++++++++++++++---- .../RootControllerResourceClient.java | 1 + .../hawkbit/example/ddi/client/AppTest.java | 7 +- .../hawkbit/ddi/json/model/DdiChunk.java | 12 ++- .../hawkbit/ddi/json/model/DdiConfig.java | 14 +++- .../ddi/json/model/DdiControllerBase.java | 14 +++- .../hawkbit/ddi/json/model/DdiDeployment.java | 10 ++- .../ddi/json/model/DdiDeploymentBase.java | 8 +- .../hawkbit/ddi/json/model/DdiPolling.java | 13 ++- 12 files changed, 150 insertions(+), 36 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 8ce1749dd..bd87a65bc 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -37,19 +37,25 @@ com.netflix.feign feign-core - 8.16.0 + + 8.14.2 com.netflix.feign feign-jackson - 8.16.0 + + 8.14.2 javax.servlet javax.servlet-api + + org.springframework.plugin + spring-plugin-core + junit diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java index 680da74f1..df43444d6 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java @@ -22,6 +22,8 @@ public class ApplicationJsonRequestHeaderInterceptor implements RequestIntercept @Override public void apply(final RequestTemplate template) { template.header("Accept", MediaType.APPLICATION_JSON_VALUE); + // template.header("Accept", + // EnableHypermediaSupport.HypermediaType.HAL); template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index 4dd29d7c1..73b1d4f81 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -5,6 +5,10 @@ package org.eclipse.hawkbit.ddi.client; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; +import org.springframework.hateoas.hal.Jackson2HalModule; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import feign.Feign; import feign.Feign.Builder; @@ -26,12 +30,18 @@ public class DdiDefaultFeignClient { private final String tenant; public DdiDefaultFeignClient(final String baseUrl, final String tenant) { + + final ObjectMapper mapper = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .registerModule(new Jackson2HalModule()); + feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) - .decoder(new ResponseEntityDecoder(new JacksonDecoder())); + .decoder(new ResponseEntityDecoder(new JacksonDecoder(mapper))); this.baseUrl = baseUrl; this.tenant = tenant; + } public Builder getFeignBuilder() { diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index c7b81e4fe..c0fb6ff9c 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -3,36 +3,55 @@ */ package org.eclipse.hawkbit.ddi.client; -import org.springframework.stereotype.Component; +import java.util.regex.Pattern; -@Component -public class DdiExampleClient { +import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; +import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase; +import org.springframework.hateoas.Link; +import org.springframework.http.ResponseEntity; + +//@Component +public class DdiExampleClient implements Runnable { private final String controllerId; - private final String name; - private final String description; - private final String baseUrl; + final DdiDefaultFeignClient ddiDefaultFeignClient; - public DdiExampleClient(final String baseUrl, final String controllerId, final String name, - final String description, final String tenant) { + public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant) { super(); this.controllerId = controllerId; - this.name = name; - this.description = description; - this.baseUrl = baseUrl; ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); } + @Override + public void run() { + + ResponseEntity response; + + for (int i = 0; i < 20; i++) { + + response = ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); + final DdiControllerBase controllerBase = response.getBody(); + final Link controllerDeploymentBaseLink = controllerBase.getLink("deploymentBase"); + + if (controllerDeploymentBaseLink != null) { + // TOD actung download nur einmal starten + startDownload(controllerDeploymentBaseLink); + } + + try { + Thread.sleep(2000); + } catch (final InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + } + public void startDdiClient() { - // final ResponseEntity response = - - ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); - - // final DdiControllerBase controllerBase = response.getBody(); - - System.out.println("test"); + // // TODO notify every 10 seconds on the rollout server @@ -42,4 +61,32 @@ public class DdiExampleClient { } + private void startDownload(final Link controllerDeploymentBaseLink) { + + // controllerDeploymentBaseLink. + + // final List varibles = controllerDeploymentBaseLink.get + + final String link = controllerDeploymentBaseLink.getHref(); + final String[] segs = link.split(Pattern.quote("/")); + final String[] ending = segs[8].split(Pattern.quote("?")); + final String actionId = ending[0]; + final String resource = ending[1].substring(2); + + final ResponseEntity respone = ddiDefaultFeignClient.getRootControllerResourceClient() + .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); + + final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); + + final Link downloadLink = ddiDeploymentBase.getDeployment().getChunks().get(0).getArtifacts().get(0) + .getLink("download"); + + System.out.println("download startet ...."); + + } + + private void startSimulatedInstalltion() { + + } + } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java index 80b71dda9..69ae96d84 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java @@ -9,6 +9,7 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the Rootcontroller resource of the DDI API. */ + @FeignClient(url = "${hawkbit.url:localhost:8080}/" + RootControllerResourceClient.PATH) public interface RootControllerResourceClient extends DdiRootControllerRestApi { diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index bb369f478..78608b11d 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -11,9 +11,10 @@ public class AppTest { @Test public void AppTest() { - final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "mytest", "mytest", "desc", - "DEFAULT"); - ddiClient.startDdiClient(); + final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "jktest", "DEFAULT"); + ddiClient.run(); + + System.out.println("next steps........................"); } } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java index 4ff9debe4..78de8591d 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiChunk.java @@ -18,15 +18,19 @@ import javax.validation.constraints.NotNull; public class DdiChunk { @NotNull - private final String part; + private String part; @NotNull - private final String version; + private String version; @NotNull - private final String name; + private String name; - private final List artifacts; + private List artifacts; + + public DdiChunk() { + + } /** * Constructor. diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java index fa4f19882..5ec1b4dde 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiConfig.java @@ -8,12 +8,20 @@ */ package org.eclipse.hawkbit.ddi.json.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * Standard configuration for the target. */ +@JsonInclude(Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public class DdiConfig { - private final DdiPolling polling; + @JsonProperty + private DdiPolling polling; /** * Constructor. @@ -26,6 +34,10 @@ public class DdiConfig { this.polling = polling; } + public DdiConfig() { + + } + public DdiPolling getPolling() { return polling; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java index b044c3537..3f160157c 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiControllerBase.java @@ -10,12 +10,20 @@ package org.eclipse.hawkbit.ddi.json.model; import org.springframework.hateoas.ResourceSupport; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * {@link DdiControllerBase} resource content. */ +@JsonInclude(Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public class DdiControllerBase extends ResourceSupport { - private final DdiConfig config; + @JsonProperty + private DdiConfig config; /** * Constructor. @@ -28,6 +36,10 @@ public class DdiControllerBase extends ResourceSupport { this.config = config; } + public DdiControllerBase() { + + } + public DdiConfig getConfig() { return config; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java index 55538f8e2..7f8c84d39 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java @@ -17,11 +17,15 @@ import com.fasterxml.jackson.annotation.JsonValue; */ public class DdiDeployment { - private final HandlingType download; + private HandlingType download; - private final HandlingType update; + private HandlingType update; - private final List chunks; + private List chunks; + + public DdiDeployment() { + + } /** * Constructor. diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java index 25c7a62ed..4d89f759b 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java @@ -21,10 +21,10 @@ public class DdiDeploymentBase extends ResourceSupport { @JsonProperty("id") @NotNull - private final String deplyomentId; + private String deplyomentId; @NotNull - private final DdiDeployment deployment; + private DdiDeployment deployment; /** * Constructor. @@ -39,6 +39,10 @@ public class DdiDeploymentBase extends ResourceSupport { this.deployment = deployment; } + public DdiDeploymentBase() { + + } + public DdiDeployment getDeployment() { return deployment; } diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java index 4ad67d340..489178be8 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiPolling.java @@ -8,12 +8,20 @@ */ package org.eclipse.hawkbit.ddi.json.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * Polling interval for the SP target. */ +@JsonInclude(Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) public class DdiPolling { - private final String sleep; + @JsonProperty + private String sleep; /** * Constructor. @@ -26,6 +34,9 @@ public class DdiPolling { this.sleep = sleep; } + public DdiPolling() { + } + public String getSleep() { return sleep; } From 347fb8d5fef2f55d727cbcd8f674a09544176e68 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Mon, 25 Apr 2016 09:15:23 +0200 Subject: [PATCH 033/124] Added new RequestResponseContextHolder to HTTP resources. Signed-off-by: Jonathan Philip Knoblauch --- .../resource/DdiArtifactStoreController.java | 33 +++++------ .../ddi/rest/resource/DdiRootController.java | 55 +++++++++++-------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index e14522b28..b2954d363 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -12,7 +12,6 @@ import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; @@ -24,19 +23,20 @@ import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.ActionStatus; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.util.IpUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.context.WebApplicationContext; /** * The {@link DdiArtifactStoreController} of the HawkBit server controller API @@ -47,6 +47,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; * for legacy controllers that can not be fed with a download URI at runtime. */ @RestController +@Scope(value = WebApplicationContext.SCOPE_REQUEST) public class DdiArtifactStoreController implements DdiArtifactStoreControllerRestApi { private static final Logger LOG = LoggerFactory.getLogger(DdiArtifactStoreController.class); @@ -63,13 +64,8 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes @Autowired private HawkbitSecurityProperties securityProperties; - private HttpServletResponse getResponse() { - return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getResponse(); - } - - private HttpServletRequest getRequest() { - return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); - } + @Autowired + private RequestResponseContextHolder requestResponseContextHolder; @Override public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, @@ -87,7 +83,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes ResponseEntity result; final LocalArtifact artifact = foundArtifacts.get(0); - final String ifMatch = getRequest().getHeader("If-Match"); + final String ifMatch = requestResponseContextHolder.getHttpServletRequest().getHeader("If-Match"); if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } else { @@ -96,11 +92,15 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes // we set a download status only if we are aware of the // targetid, i.e. authenticated and not anonymous if (targetid != null && !"anonymous".equals(targetid)) { - final Action action = checkAndReportDownloadByTarget(getRequest(), targetid, artifact); - result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), file, - cacheWriteNotify, action.getId()); + final Action action = checkAndReportDownloadByTarget( + requestResponseContextHolder.getHttpServletRequest(), targetid, artifact); + result = RestResourceConversionHelper.writeFileResponse(artifact, + requestResponseContextHolder.getHttpServletResponse(), + requestResponseContextHolder.getHttpServletRequest(), file, cacheWriteNotify, action.getId()); } else { - result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), file); + result = RestResourceConversionHelper.writeFileResponse(artifact, + requestResponseContextHolder.getHttpServletResponse(), + requestResponseContextHolder.getHttpServletRequest(), file); } } @@ -119,7 +119,8 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes } try { - DataConversionHelper.writeMD5FileResponse(fileName, getResponse(), foundArtifacts.get(0)); + DataConversionHelper.writeMD5FileResponse(fileName, requestResponseContextHolder.getHttpServletResponse(), + foundArtifacts.get(0)); } catch (final IOException e) { LOG.error("Failed to stream MD5 File", e); return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index 7ef4f343d..3df0916c0 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -12,7 +12,6 @@ import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.eclipse.hawkbit.api.ArtifactUrlHandler; @@ -40,6 +39,7 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.rest.util.RestResourceConversionHelper; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.tenancy.TenantAware; @@ -48,14 +48,14 @@ import org.hibernate.validator.constraints.NotEmpty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; import org.springframework.http.HttpStatus; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.context.WebApplicationContext; /** * The {@link DdiRootController} of the hawkBit server DDI API that is queried @@ -65,6 +65,7 @@ import org.springframework.web.context.request.ServletRequestAttributes; * Transactional (read-write) as all queries at least update the last poll time. */ @RestController +@Scope(value = WebApplicationContext.SCOPE_REQUEST) public class DdiRootController implements DdiRootControllerRestApi { private static final Logger LOG = LoggerFactory.getLogger(DdiRootController.class); @@ -91,13 +92,8 @@ public class DdiRootController implements DdiRootControllerRestApi { @Autowired private ArtifactUrlHandler artifactUrlHandler; - private HttpServletResponse getResponse() { - return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getResponse(); - } - - private HttpServletRequest getRequest() { - return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest(); - } + @Autowired + private RequestResponseContextHolder requestResponseContextHolder; @Override public ResponseEntity> getSoftwareModulesArtifacts( @@ -124,13 +120,15 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("getControllerBase({})", targetid); final Target target = controllerManagement.findOrRegisterTargetIfItDoesNotexist(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); if (target.getTargetInfo().getUpdateStatus() == TargetUpdateStatus.UNKNOWN) { LOG.debug("target with {} extsisted but was in status UNKNOWN -> REGISTERED)", targetid); controllerManagement.updateTargetStatus(target.getTargetInfo(), TargetUpdateStatus.REGISTERED, System.currentTimeMillis(), - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); } return new ResponseEntity<>( @@ -146,7 +144,8 @@ public class DdiRootController implements DdiRootControllerRestApi { ResponseEntity result; final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); final SoftwareModule module = softwareManagement.findSoftwareModuleById(softwareModuleId); if (checkModule(fileName, module)) { @@ -156,13 +155,15 @@ public class DdiRootController implements DdiRootControllerRestApi { final LocalArtifact artifact = module.getLocalArtifactByFilename(fileName).get(); final DbArtifact file = artifactManagement.loadLocalArtifactBinary(artifact); - final String ifMatch = getRequest().getHeader("If-Match"); + final String ifMatch = requestResponseContextHolder.getHttpServletRequest().getHeader("If-Match"); if (ifMatch != null && !RestResourceConversionHelper.matchesHttpHeader(ifMatch, artifact.getSha1Hash())) { result = new ResponseEntity<>(HttpStatus.PRECONDITION_FAILED); } else { - final Action action = checkAndLogDownload(getRequest(), target, module); - result = RestResourceConversionHelper.writeFileResponse(artifact, getResponse(), getRequest(), file, - cacheWriteNotify, action.getId()); + final Action action = checkAndLogDownload(requestResponseContextHolder.getHttpServletRequest(), target, + module); + result = RestResourceConversionHelper.writeFileResponse(artifact, + requestResponseContextHolder.getHttpServletResponse(), + requestResponseContextHolder.getHttpServletRequest(), file, cacheWriteNotify, action.getId()); } } return result; @@ -197,7 +198,8 @@ public class DdiRootController implements DdiRootControllerRestApi { @PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("fileName") final String fileName) { controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); final SoftwareModule module = softwareManagement.findSoftwareModuleById(softwareModuleId); @@ -207,7 +209,7 @@ public class DdiRootController implements DdiRootControllerRestApi { } try { - DataConversionHelper.writeMD5FileResponse(fileName, getResponse(), + DataConversionHelper.writeMD5FileResponse(fileName, requestResponseContextHolder.getHttpServletResponse(), module.getLocalArtifactByFilename(fileName).get()); } catch (final IOException e) { LOG.error("Failed to stream MD5 File", e); @@ -224,7 +226,8 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("getControllerBasedeploymentAction({},{})", targetid, resource); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); final Action action = findActionWithExceptionIfNotFound(actionId); if (!action.getTarget().getId().equals(target.getId())) { @@ -258,7 +261,8 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("provideBasedeploymentActionFeedback for target [{},{}]: {}", targetid, actionId, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); if (!actionId.equals(feedback.getId())) { LOG.warn( @@ -352,7 +356,8 @@ public class DdiRootController implements DdiRootControllerRestApi { public ResponseEntity putConfigData(@Valid @RequestBody final DdiConfigData configData, @PathVariable("targetid") final String targetid) { controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); controllerManagement.updateControllerAttributes(targetid, configData.getData()); @@ -366,7 +371,8 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("getControllerCancelAction({})", targetid); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); final Action action = findActionWithExceptionIfNotFound(actionId); if (!action.getTarget().getId().equals(target.getId())) { @@ -396,7 +402,8 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("provideCancelActionFeedback for target [{}]: {}", targetid, feedback); final Target target = controllerManagement.updateLastTargetQuery(targetid, - IpUtil.getClientIpFromRequest(getRequest(), securityProperties.getClients().getRemoteIpHeader())); + IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), + securityProperties.getClients().getRemoteIpHeader())); if (!actionId.equals(feedback.getId())) { LOG.warn( From 5cfb933ca1f8e39a70cf6decb4a471a36303847d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Mon, 25 Apr 2016 10:45:48 +0200 Subject: [PATCH 034/124] Add Rest configuration for test Signed-off-by: SirWayne --- .../ResourceControllerAutoConfiguration.java | 33 ------------ .../org/eclipse/hawkbit/ddi/EnableDdiApi.java | 3 ++ .../resource/DdiArtifactDownloadTest.java | 6 +-- .../rest/resource/DdiCancelActionTest.java | 6 +-- .../rest/resource/DdiDeploymentBaseTest.java | 6 +-- .../rest/resource/DdiRootControllerTest.java | 6 +-- .../mgmt/annotation/EnableMgmtApi.java | 3 ++ .../MgmtDistributionSetResourceTest.java | 4 +- .../MgmtDistributionSetTypeResourceTest.java | 4 +- .../resource/MgmtDownloadResourceTest.java | 23 ++++---- .../resource/MgmtRolloutResourceTest.java | 4 +- .../MgmtSoftwareModuleResourceTest.java | 4 +- .../MgmtSoftwareModuleTypeResourceTest.java | 4 +- .../rest/resource/MgmtTargetResourceTest.java | 4 +- .../hawkbit/AbstractIntegrationTest.java | 19 ++++--- .../rest/configuration/RestConfiguration.java | 52 +++++++++++++++++++ .../util/RequestResponseContextHolder.java | 12 ++++- .../rest/AbstractRestIntegrationTest.java | 32 ++++++++++++ ...bstractRestIntegrationTestWithMongoDB.java | 31 +++++++++++ .../system/annotation/EnableSystemApi.java | 3 ++ 20 files changed, 175 insertions(+), 84 deletions(-) create mode 100644 hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/configuration/RestConfiguration.java create mode 100644 hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java create mode 100644 hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index ae92d3200..afb90bd13 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -8,20 +8,12 @@ */ package org.eclipse.hawkbit.autoconfigure.web; -import javax.servlet.http.HttpServletResponse; - import org.eclipse.hawkbit.ddi.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; -import org.eclipse.hawkbit.rest.util.FilterHttpResponse; -import org.eclipse.hawkbit.rest.util.HttpResponseFactoryBean; -import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; -import org.springframework.context.annotation.Scope; -import org.springframework.web.context.WebApplicationContext; /** * Auto-Configuration for enabling the REST-Resources. @@ -32,29 +24,4 @@ import org.springframework.web.context.WebApplicationContext; @Import({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) public class ResourceControllerAutoConfiguration { - /** - * Create filter for {@link HttpServletResponse}. - */ - @Bean - public FilterHttpResponse filterHttpResponse() { - return new FilterHttpResponse(); - } - - /** - * Create factory bean for {@link HttpServletResponse}. - */ - @Bean - public HttpResponseFactoryBean httpResponseFactoryBean() { - return new HttpResponseFactoryBean(); - } - - /** - * Create factory bean for {@link HttpServletResponse}. - */ - @Bean - @Scope(value = WebApplicationContext.SCOPE_REQUEST) - public RequestResponseContextHolder requestResponseContextHolder() { - return new RequestResponseContextHolder(); - } - } diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java index 1d1e0a259..d9572166a 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/EnableDdiApi.java @@ -13,8 +13,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.eclipse.hawkbit.rest.configuration.RestConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.stereotype.Controller; /** @@ -25,6 +27,7 @@ import org.springframework.stereotype.Controller; @Retention(RetentionPolicy.RUNTIME) @Configuration @ComponentScan +@Import(RestConfiguration.class) public @interface EnableDdiApi { } diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java index af65b1351..6c3bdea4e 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactDownloadTest.java @@ -26,7 +26,6 @@ import java.util.Arrays; import java.util.List; import org.apache.commons.lang3.RandomUtils; -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.eventbus.event.DownloadProgressEvent; @@ -36,13 +35,13 @@ import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB; import org.junit.Test; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort.Direction; import org.springframework.http.MediaType; -import org.springframework.test.context.ActiveProfiles; import org.springframework.test.web.servlet.MvcResult; import com.google.common.base.Charsets; @@ -57,10 +56,9 @@ import ru.yandex.qatools.allure.annotations.Stories; /** * Test artifact downloads from the controller. */ -@ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Artifact Download Resource") -public class DdiArtifactDownloadTest extends AbstractIntegrationTestWithMongoDB { +public class DdiArtifactDownloadTest extends AbstractRestIntegrationTestWithMongoDB { public DdiArtifactDownloadTest() { LOG = LoggerFactory.getLogger(DdiArtifactDownloadTest.class); diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java index ddd826e8a..9913d5e51 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiCancelActionTest.java @@ -22,18 +22,17 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.Status; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; -import org.springframework.test.context.ActiveProfiles; import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; @@ -42,10 +41,9 @@ import ru.yandex.qatools.allure.annotations.Stories; /** * Test cancel action from the controller. */ -@ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Cancel Action Resource") -public class DdiCancelActionTest extends AbstractIntegrationTest { +public class DdiCancelActionTest extends AbstractRestIntegrationTest { @Test @Description("Test of the controller can continue a started update even after a cancel command if it so desires.") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java index 5c89291cc..df75bc6b3 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java @@ -25,7 +25,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.RandomUtils; -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.Action.ActionType; @@ -35,6 +34,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.fest.assertions.core.Condition; @@ -45,7 +45,6 @@ import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort.Direction; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; -import org.springframework.test.context.ActiveProfiles; import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; @@ -54,10 +53,9 @@ import ru.yandex.qatools.allure.annotations.Stories; /** * Test deployment base from the controller. */ -@ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Deployment Action Resource") -public class DdiDeploymentBaseTest extends AbstractIntegrationTestWithMongoDB { +public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoDB { @Test() @Description("Ensures that artifacts are not found, when softare module does not exists.") diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java index 407ff63d0..8041e8b36 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootControllerTest.java @@ -22,7 +22,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithSpringAuthorityRule; import org.eclipse.hawkbit.WithUser; @@ -32,6 +31,7 @@ import org.eclipse.hawkbit.repository.model.Action; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; @@ -39,7 +39,6 @@ import org.eclipse.hawkbit.util.IpUtil; import org.junit.Test; import org.springframework.hateoas.MediaTypes; import org.springframework.http.MediaType; -import org.springframework.test.context.ActiveProfiles; import ru.yandex.qatools.allure.annotations.Description; import ru.yandex.qatools.allure.annotations.Features; @@ -48,10 +47,9 @@ import ru.yandex.qatools.allure.annotations.Stories; /** * Test the root controller resources. */ -@ActiveProfiles({ "im", "test" }) @Features("Component Tests - Direct Device Integration API") @Stories("Root Poll Resource") -public class DdiRootControllerTest extends AbstractIntegrationTestWithMongoDB { +public class DdiRootControllerTest extends AbstractRestIntegrationTestWithMongoDB { @Test @Description("Ensures that targets cannot be created e.g. in plug'n play scenarios when tenant does not exists but can be created if the tenant exists.") diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java index ee34a3988..2b7f754a8 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java @@ -13,8 +13,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.eclipse.hawkbit.rest.configuration.RestConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.stereotype.Controller; /** @@ -29,6 +31,7 @@ import org.springframework.stereotype.Controller; @Retention(RetentionPolicy.RUNTIME) @Configuration @ComponentScan +@Import(RestConfiguration.class) public @interface EnableMgmtApi { } diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java index 5017d4ff6..8cfef095e 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetResourceTest.java @@ -26,7 +26,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -37,6 +36,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetMetadata; import org.eclipse.hawkbit.repository.model.DsMetadataCompositeKey; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONArray; @@ -55,7 +55,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @Features("Component Tests - Management API") @Stories("Distribution Set Resource") -public class MgmtDistributionSetResourceTest extends AbstractIntegrationTest { +public class MgmtDistributionSetResourceTest extends AbstractRestIntegrationTest { @Test @Description("This test verifies the call of all Software Modules that are assiged to a Distribution Set through the RESTful API.") diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java index 8bc8c6ca9..dcd78513b 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResourceTest.java @@ -23,13 +23,13 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONException; @@ -51,7 +51,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @Features("Component Tests - Management API") @Stories("Distribution Set Type Resource") -public class MgmtDistributionSetTypeResourceTest extends AbstractIntegrationTest { +public class MgmtDistributionSetTypeResourceTest extends AbstractRestIntegrationTest { @Test @WithUser(principal = "uploadTester", allSpPermissions = true) diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java index 1122f3ed4..17f23f888 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResourceTest.java @@ -11,7 +11,6 @@ package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.cache.CacheConstants; import org.eclipse.hawkbit.cache.DownloadArtifactCache; @@ -20,6 +19,7 @@ import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.junit.Before; import org.junit.Test; @@ -33,7 +33,7 @@ import ru.yandex.qatools.allure.annotations.Stories; @Features("Component Tests - Management API") @Stories("Download Resource") -public class MgmtDownloadResourceTest extends AbstractIntegrationTestWithMongoDB { +public class MgmtDownloadResourceTest extends AbstractRestIntegrationTestWithMongoDB { @Autowired @Qualifier(CacheConstants.DOWNLOAD_ID_CACHE) @@ -58,9 +58,8 @@ public class MgmtDownloadResourceTest extends AbstractIntegrationTestWithMongoDB @Test @Description("This test verifies the call of download artifact without a valid download id fails.") public void testNoDownloadIdAvailable() throws Exception { - mvc.perform( - get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, - downloadIdNotAvailable)) + mvc.perform(get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdNotAvailable)) .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); } @@ -68,16 +67,14 @@ public class MgmtDownloadResourceTest extends AbstractIntegrationTestWithMongoDB @Test @Description("This test verifies the call of download artifact works and the download id will be removed.") public void testDownload() throws Exception { - mvc.perform( - get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, - downloadIdSha1)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); + mvc.perform(get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdSha1)).andDo(MockMvcResultPrinter.print()) + .andExpect(status().isOk()); // because cache is empty - mvc.perform( - get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, - downloadIdSha1)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isNotFound()); + mvc.perform(get(MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE + + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING, downloadIdSha1)).andDo(MockMvcResultPrinter.print()) + .andExpect(status().isNotFound()); } diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java index 35ab7a786..09281721c 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java @@ -21,7 +21,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.List; import java.util.concurrent.Callable; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -34,6 +33,7 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupConditionBuilder; import org.eclipse.hawkbit.repository.model.RolloutGroup.RolloutGroupSuccessCondition; import org.eclipse.hawkbit.repository.model.Target; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.eclipse.hawkbit.rest.util.SuccessCondition; @@ -52,7 +52,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @Features("Component Tests - Management API") @Stories("Rollout Resource") -public class MgmtRolloutResourceTest extends AbstractIntegrationTest { +public class MgmtRolloutResourceTest extends AbstractRestIntegrationTest { @Autowired private RolloutManagement rolloutManagement; diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java index dbce7d90e..a63dd754f 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResourceTest.java @@ -32,7 +32,6 @@ import java.util.List; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.RandomStringUtils; -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; import org.eclipse.hawkbit.HashGeneratorUtils; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; @@ -46,6 +45,7 @@ import org.eclipse.hawkbit.repository.model.LocalArtifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleMetadata; import org.eclipse.hawkbit.repository.model.SwMetadataCompositeKey; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; @@ -71,7 +71,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @Features("Component Tests - Management API") @Stories("Software Module Resource") -public class MgmtSoftwareModuleResourceTest extends AbstractIntegrationTestWithMongoDB { +public class MgmtSoftwareModuleResourceTest extends AbstractRestIntegrationTestWithMongoDB { @Before public void assertPreparationOfRepo() { diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java index aa2cd68e2..b69558e59 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleTypeResourceTest.java @@ -23,11 +23,11 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import java.util.ArrayList; import java.util.List; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.util.JsonBuilder; import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; import org.json.JSONException; @@ -48,7 +48,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @Features("Component Tests - Management API") @Stories("Software Module Type Resource") -public class MgmtSoftwareModuleTypeResourceTest extends AbstractIntegrationTest { +public class MgmtSoftwareModuleTypeResourceTest extends AbstractRestIntegrationTest { @Test @WithUser(principal = "uploadTester", allSpPermissions = true) diff --git a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java index fff9d8d2e..c8d33edc9 100644 --- a/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java +++ b/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetResourceTest.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithUser; import org.eclipse.hawkbit.exception.SpServerError; @@ -46,6 +45,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.repository.model.SoftwareModule; import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetInfo; +import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest; import org.eclipse.hawkbit.rest.exception.MessageNotReadableException; import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; import org.eclipse.hawkbit.rest.util.JsonBuilder; @@ -76,7 +76,7 @@ import ru.yandex.qatools.allure.annotations.Stories; */ @Features("Component Tests - Management API") @Stories("Target Resource") -public class MgmtTargetResourceTest extends AbstractIntegrationTest { +public class MgmtTargetResourceTest extends AbstractRestIntegrationTest { private static final String TARGET_DESCRIPTION_TEST = "created in test"; diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java index b7091edf8..060ce2402 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java @@ -73,6 +73,7 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.context.WebApplicationContext; @@ -181,11 +182,10 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { @Autowired protected TenantAwareCacheManager cacheManager; - + @Autowired protected TenantConfigurationManagement tenantConfigurationManagement; - @Autowired protected RolloutManagement rolloutManagement; @@ -223,12 +223,7 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { @Before public void before() throws Exception { - mvc = MockMvcBuilders.webAppContextSetup(context) - .addFilter(new DosFilter(100, 10, "127\\.0\\.0\\.1|\\[0:0:0:0:0:0:0:1\\]", "(^192\\.168\\.)", - "X-Forwarded-For")) - .addFilter(new ExcludePathAwareShallowETagFilter( - "/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download", "/*/controller/artifacts/**")) - .build(); + mvc = createMvcWebAppContext().build(); standardDsType = securityRule.runAsPrivileged(() -> systemManagement.getTenantMetadata().getDefaultDsType()); @@ -245,6 +240,14 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { runtimeType = securityRule.runAsPrivileged(() -> softwareManagement.updateSoftwareModuleType(runtimeType)); } + protected DefaultMockMvcBuilder createMvcWebAppContext() { + return MockMvcBuilders.webAppContextSetup(context) + .addFilter(new DosFilter(100, 10, "127\\.0\\.0\\.1|\\[0:0:0:0:0:0:0:1\\]", "(^192\\.168\\.)", + "X-Forwarded-For")) + .addFilter(new ExcludePathAwareShallowETagFilter( + "/rest/v1/softwaremodules/{smId}/artifacts/{artId}/download", "/*/controller/artifacts/**")); + } + @BeforeClass public static void beforeClass() { createTestdatabaseAndStart(); diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/configuration/RestConfiguration.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/configuration/RestConfiguration.java new file mode 100644 index 000000000..e2c4ec2a1 --- /dev/null +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/configuration/RestConfiguration.java @@ -0,0 +1,52 @@ +/** + * 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.rest.configuration; + +import javax.servlet.http.HttpServletResponse; + +import org.eclipse.hawkbit.rest.util.FilterHttpResponse; +import org.eclipse.hawkbit.rest.util.HttpResponseFactoryBean; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; +import org.springframework.web.context.WebApplicationContext; + +/** + * Configuration for Rest api. + */ +@Configuration +public class RestConfiguration { + + /** + * Create filter for {@link HttpServletResponse}. + */ + @Bean + public FilterHttpResponse filterHttpResponse() { + return new FilterHttpResponse(); + } + + /** + * Create factory bean for {@link HttpServletResponse}. + */ + @Bean + public FactoryBean httpResponseFactoryBean() { + return new HttpResponseFactoryBean(); + } + + /** + * Create factory bean for {@link HttpServletResponse}. + */ + @Bean + @Scope(value = WebApplicationContext.SCOPE_REQUEST) + public RequestResponseContextHolder requestResponseContextHolder() { + return new RequestResponseContextHolder(); + } +} diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java index 4c2dc5c5a..07b6af58d 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java @@ -19,10 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired; */ public class RequestResponseContextHolder { - @Autowired private HttpServletRequest httpServletRequest; - @Resource(name = HttpResponseFactoryBean.FACTORY_BEAN_NAME) private HttpServletResponse httpServletResponse; public HttpServletRequest getHttpServletRequest() { @@ -32,4 +30,14 @@ public class RequestResponseContextHolder { public HttpServletResponse getHttpServletResponse() { return httpServletResponse; } + + @Autowired + public void setHttpServletRequest(final HttpServletRequest httpServletRequest) { + this.httpServletRequest = httpServletRequest; + } + + @Resource(name = HttpResponseFactoryBean.FACTORY_BEAN_NAME) + public void setHttpServletResponse(final HttpServletResponse httpServletResponse) { + this.httpServletResponse = httpServletResponse; + } } diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java new file mode 100644 index 000000000..763643ce1 --- /dev/null +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java @@ -0,0 +1,32 @@ +/** + * 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.rest; + +import org.eclipse.hawkbit.AbstractIntegrationTest; +import org.eclipse.hawkbit.rest.configuration.RestConfiguration; +import org.eclipse.hawkbit.rest.util.FilterHttpResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; + +/** + * Abstract Test for Rest tests. + */ +@SpringApplicationConfiguration(classes = { RestConfiguration.class }) +public abstract class AbstractRestIntegrationTest extends AbstractIntegrationTest { + + @Autowired + private FilterHttpResponse filterHttpResponse; + + @Override + protected DefaultMockMvcBuilder createMvcWebAppContext() { + return super.createMvcWebAppContext().addFilter(filterHttpResponse); + } + +} diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java new file mode 100644 index 000000000..893955f77 --- /dev/null +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java @@ -0,0 +1,31 @@ +/** + * 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.rest; + +import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; +import org.eclipse.hawkbit.rest.configuration.RestConfiguration; +import org.eclipse.hawkbit.rest.util.FilterHttpResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder; + +/** + * Abstract Test for Rest tests. + */ +@SpringApplicationConfiguration(classes = { RestConfiguration.class }) +public abstract class AbstractRestIntegrationTestWithMongoDB extends AbstractIntegrationTestWithMongoDB { + + @Autowired + private FilterHttpResponse filterHttpResponse; + + @Override + protected DefaultMockMvcBuilder createMvcWebAppContext() { + return super.createMvcWebAppContext().addFilter(filterHttpResponse); + } +} diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java index 209dfdd95..bf706bdc4 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java +++ b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java @@ -13,8 +13,10 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.eclipse.hawkbit.rest.configuration.RestConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.stereotype.Controller; /** @@ -25,6 +27,7 @@ import org.springframework.stereotype.Controller; @Retention(RetentionPolicy.RUNTIME) @Configuration @ComponentScan +@Import(RestConfiguration.class) public @interface EnableSystemApi { } From 0fd2f7200f4e7920f9e9fbef6755211b76201a52 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Mon, 25 Apr 2016 11:12:04 +0200 Subject: [PATCH 035/124] Add test dependency Signed-off-by: SirWayne --- hawkbit-rest-core/pom.xml | 6 ++++++ .../eclipse/hawkbit/rest/AbstractRestIntegrationTest.java | 3 ++- .../rest/AbstractRestIntegrationTestWithMongoDB.java | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml index 6cc9d432b..2275a74a1 100644 --- a/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest-core/pom.xml @@ -50,6 +50,12 @@ fest-assert test + + org.eclipse.hawkbit + hawkbit-repository + ${project.version} + tests + ru.yandex.qatools.allure allure-junit-adaptor diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java index 763643ce1..38f36859b 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTest.java @@ -26,7 +26,8 @@ public abstract class AbstractRestIntegrationTest extends AbstractIntegrationTes @Override protected DefaultMockMvcBuilder createMvcWebAppContext() { - return super.createMvcWebAppContext().addFilter(filterHttpResponse); + final DefaultMockMvcBuilder createMvcWebAppContext = super.createMvcWebAppContext(); + return createMvcWebAppContext.addFilter(filterHttpResponse); } } diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java index 893955f77..9a25eb631 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/AbstractRestIntegrationTestWithMongoDB.java @@ -26,6 +26,7 @@ public abstract class AbstractRestIntegrationTestWithMongoDB extends AbstractInt @Override protected DefaultMockMvcBuilder createMvcWebAppContext() { - return super.createMvcWebAppContext().addFilter(filterHttpResponse); + DefaultMockMvcBuilder createMvcWebAppContext = super.createMvcWebAppContext(); + return createMvcWebAppContext.addFilter(filterHttpResponse); } } From a065a81aeddc0c54cac6003817230afbee16d404 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 10:56:33 +0200 Subject: [PATCH 036/124] Solvend maven depenency and added new DDI client functions Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 78 +++++--- .../hawkbit/ddi/client/Application.java | 49 ----- ...plicationJsonRequestHeaderInterceptor.java | 7 +- .../hawkbit/ddi/client/DdiDecoder.java | 55 +++++ .../ddi/client/DdiDefaultFeignClient.java | 36 ++-- .../hawkbit/ddi/client/DdiExampleClient.java | 189 +++++++++++++----- .../RootControllerResourceClient.java | 7 +- .../strategy/DoNotSaveArtifactsStrategy.java | 29 +++ .../client/strategy/PersistenceStrategy.java | 23 +++ .../strategy/SaveArtifactsStrategy.java | 45 +++++ .../DdiArtifactStoreControllerRestApi.java | 4 +- .../rest/api/DdiRootControllerRestApi.java | 3 +- .../resource/DdiArtifactStoreController.java | 5 +- .../ddi/rest/resource/DdiRootController.java | 5 +- .../rest/api/MgmtDownloadArtifactRestApi.java | 4 +- .../MgmtDownloadArtifactResource.java | 4 +- .../util/RestResourceConversionHelper.java | 10 +- 17 files changed, 396 insertions(+), 157 deletions(-) delete mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index bd87a65bc..d2e9f7f72 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -1,17 +1,17 @@ - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-examples-parent - 0.2.0-SNAPSHOT - - hawkbit-example-ddi-client + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-examples-parent + 0.2.0-SNAPSHOT + + hawkbit-example-ddi-client - hawkbit-example-ddi-client - - + hawkbit-example-ddi-client + + org.springframework.cloud @@ -22,32 +22,32 @@ - - - - org.eclipse.hawkbit + + + + org.eclipse.hawkbit hawkbit-ddi-api ${project.version} - + org.springframework.cloud spring-cloud-starter-feign - + com.netflix.feign feign-core - + 8.14.2 - + com.netflix.feign feign-jackson - - 8.14.2 + + 8.14.2 - + javax.servlet javax.servlet-api @@ -56,11 +56,29 @@ org.springframework.plugin spring-plugin-core - - - junit - junit - test - - + + com.fasterxml.jackson.core + jackson-databind + + + + + commons-io + commons-io + 2.5 + + + + + + junit + junit + test + + + ru.yandex.qatools.allure + allure-junit-adaptor + test + + diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java deleted file mode 100644 index 86ccf195e..000000000 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/Application.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. - */ -package org.eclipse.hawkbit.ddi.client; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.cloud.netflix.feign.EnableFeignClients; -import org.springframework.context.annotation.Bean; - -import feign.Contract; - -/** - * @author Jonathan Knoblauch - * - */ -@SpringBootApplication -@EnableFeignClients -public class Application { - - @Autowired - private DdiExampleClient ddiClient; - - public static void main(final String[] args) { - new SpringApplicationBuilder().showBanner(false).sources(Application.class).run(args); - - // TODO .encoder(new JacksonEncoder()) - // .decoder(new ResponseEntityDecoder(new JacksonDecoder())); - - } - - // @Bean - // public BasicAuthRequestInterceptor basicAuthRequestInterceptor() { - // return new BasicAuthRequestInterceptor(configuration.getUsername(), - // configuration.getPassword()); - // } - - @Bean - public ApplicationJsonRequestHeaderInterceptor jsonHeaderInterceptor() { - return new ApplicationJsonRequestHeaderInterceptor(); - } - - @Bean - public Contract feignContract() { - return new IgnoreMultipleConsumersProducersSpringMvcContract(); - } - -} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java index df43444d6..97a3e4395 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java @@ -21,10 +21,11 @@ public class ApplicationJsonRequestHeaderInterceptor implements RequestIntercept @Override public void apply(final RequestTemplate template) { - template.header("Accept", MediaType.APPLICATION_JSON_VALUE); - // template.header("Accept", - // EnableHypermediaSupport.HypermediaType.HAL); + template.header("Accept", MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE, + MediaType.TEXT_PLAIN_VALUE); + // template.header("Accept", MediaType.APPLICATION_OCTET_STREAM_VALUE); template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); + } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java new file mode 100644 index 000000000..90fc0e7bd --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java @@ -0,0 +1,55 @@ +/** + * 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.client; + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.Collection; +import java.util.Map; + +import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; +import org.springframework.hateoas.hal.Jackson2HalModule; +import org.springframework.http.ResponseEntity; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +import feign.FeignException; +import feign.Response; +import feign.codec.DecodeException; +import feign.codec.Decoder; +import feign.jackson.JacksonDecoder; + +/** + * Decoder for DDI client. + * + */ +public class DdiDecoder implements Decoder { + + ObjectMapper mapper; + + public DdiDecoder() { + mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .registerModule(new Jackson2HalModule()); + } + + @Override + public Object decode(final Response response, final Type type) throws IOException, DecodeException, FeignException { + + final Map> header = response.headers(); + final String contentType = String.valueOf(header.get("Content-Type")); + // TODO parameter verwenden + if (contentType.equals("[application/octet-stream]")) { + return ResponseEntity.ok(response.body().asInputStream()); + } + final ResponseEntityDecoder responseEntityDecoder = new ResponseEntityDecoder(new JacksonDecoder(mapper)); + return responseEntityDecoder.decode(response, type); + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index 73b1d4f81..d6e9dde96 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -1,20 +1,19 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.client; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; -import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; -import org.springframework.hateoas.hal.Jackson2HalModule; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; import feign.Feign; import feign.Feign.Builder; import feign.Logger; import feign.Logger.Level; -import feign.jackson.JacksonDecoder; import feign.jackson.JacksonEncoder; /** @@ -30,15 +29,18 @@ public class DdiDefaultFeignClient { private final String tenant; public DdiDefaultFeignClient(final String baseUrl, final String tenant) { - - final ObjectMapper mapper = new ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .registerModule(new Jackson2HalModule()); - feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) - .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) - .decoder(new ResponseEntityDecoder(new JacksonDecoder(mapper))); + .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); + + if (baseUrl == null) { + throw new IllegalStateException("A baseUrl has to be set"); + } + + if (tenant == null) { + throw new IllegalStateException("A tenant has to be set"); + } + this.baseUrl = baseUrl; this.tenant = tenant; @@ -50,10 +52,12 @@ public class DdiDefaultFeignClient { public RootControllerResourceClient getRootControllerResourceClient() { - String rootControllerResourcePath = this.baseUrl + RootControllerResourceClient.PATH; - rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); // TODO tenant null throw exception if (rootControllerResourceClient == null) { + + String rootControllerResourcePath = this.baseUrl + RootControllerResourceClient.PATH; + rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); + rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, rootControllerResourcePath); } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index c0fb6ff9c..e0a01e814 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -1,26 +1,51 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.client; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; import java.util.regex.Pattern; +import org.eclipse.hawkbit.ddi.client.strategy.PersistenceStrategy; +import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; +import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; +import org.eclipse.hawkbit.ddi.json.model.DdiChunk; import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase; +import org.eclipse.hawkbit.ddi.json.model.DdiResult; +import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult; +import org.eclipse.hawkbit.ddi.json.model.DdiStatus; +import org.eclipse.hawkbit.ddi.json.model.DdiStatus.ExecutionStatus; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.hateoas.Link; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -//@Component public class DdiExampleClient implements Runnable { + private static final Logger LOGGER = LoggerFactory.getLogger(DdiExampleClient.class); + private final String controllerId; + private Long actionIdOfLastInstalltion; + private final DdiDefaultFeignClient ddiDefaultFeignClient; + private final long pollingIntervalInMillis; + private final PersistenceStrategy persistenceStrategy; - final DdiDefaultFeignClient ddiDefaultFeignClient; - - public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant) { - super(); + public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, + final long pollingIntervalInMillis, final PersistenceStrategy persistenceStrategy) { this.controllerId = controllerId; - ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); + this.ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); + this.actionIdOfLastInstalltion = null; + this.pollingIntervalInMillis = pollingIntervalInMillis; + this.persistenceStrategy = persistenceStrategy; } @Override @@ -28,65 +53,139 @@ public class DdiExampleClient implements Runnable { ResponseEntity response; - for (int i = 0; i < 20; i++) { - + while (!Thread.currentThread().isInterrupted()) { response = ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); final DdiControllerBase controllerBase = response.getBody(); final Link controllerDeploymentBaseLink = controllerBase.getLink("deploymentBase"); if (controllerDeploymentBaseLink != null) { - // TOD actung download nur einmal starten - startDownload(controllerDeploymentBaseLink); + final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); + final Integer resource = getResourceOutOfLink(controllerDeploymentBaseLink); + if (actionId != actionIdOfLastInstalltion) { + + startDownload(actionId, resource); + + simulateSuccessfulInstallation(actionId); + + actionIdOfLastInstalltion = actionId; + } } try { - Thread.sleep(2000); + Thread.sleep(pollingIntervalInMillis); + System.out.println("polling ..."); } catch (final InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + LOGGER.error("Error during sleep"); } } } - public void startDdiClient() { - - // - - // TODO notify every 10 seconds on the rollout server - - // TODO if new update available -> start download and installation - // process - // report status messages - - } - - private void startDownload(final Link controllerDeploymentBaseLink) { - - // controllerDeploymentBaseLink. - - // final List varibles = controllerDeploymentBaseLink.get - - final String link = controllerDeploymentBaseLink.getHref(); - final String[] segs = link.split(Pattern.quote("/")); - final String[] ending = segs[8].split(Pattern.quote("?")); - final String actionId = ending[0]; - final String resource = ending[1].substring(2); + private void startDownload(final Long actionId, final Integer resource) { + // resource has not been downloaded and installed final ResponseEntity respone = ddiDefaultFeignClient.getRootControllerResourceClient() .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); - final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); - - final Link downloadLink = ddiDeploymentBase.getDeployment().getChunks().get(0).getArtifacts().get(0) - .getLink("download"); - - System.out.println("download startet ...."); - + final List chunks = ddiDeploymentBase.getDeployment().getChunks(); + for (final DdiChunk chunk : chunks) { + final List artifactList = chunk.getArtifacts(); + final Link downloadLink = ddiDeploymentBase.getDeployment().getChunks().get(0).getArtifacts().get(0) + .getLink("download-http"); + final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); + final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); + // download all artifacts + for (final DdiArtifact ddiArtifact : artifactList) { + downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); + } + } } - private void startSimulatedInstalltion() { + private void downloadArtifact(final Long actionId, final Long softwareModuleId, final String artifact) { + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, + "Starting download of artifact " + artifact); + System.out.println("Starting download for artifact " + artifact); + + final ResponseEntity responseDownloadArtifact = ddiDefaultFeignClient + .getRootControllerResourceClient().downloadArtifact(controllerId, softwareModuleId, artifact); + final HttpStatus statsuCode = responseDownloadArtifact.getStatusCode(); + System.out.println("Finished download with stataus " + statsuCode); + persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); + + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Downloaded artifact " + artifact); } + private void sendFeedBackMessage(final Long actionId, final ExecutionStatus executionStatus, + final FinalResult finalResult, final String message) { + + final DdiResult result = new DdiResult(finalResult, null); + final List details = new ArrayList<>(); + details.add(message); + final DdiStatus ddiStatus = new DdiStatus(executionStatus, result, details); + final String time = null; + final DdiActionFeedback feedback = new DdiActionFeedback(actionId, time, ddiStatus); + final ResponseEntity response = ddiDefaultFeignClient.getRootControllerResourceClient() + .postBasedeploymentActionFeedback(feedback, controllerId, actionId); + + final HttpStatus statsuCode = response.getStatusCode(); + System.out.println("Message send with stataus " + statsuCode); + } + + private void simulateSuccessfulInstallation(final Long actionId) { + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.SUCESS, + "Simulated installation successful"); + } + + private Long getActionIdOutOfLink(final Link controllerDeploymentBaseLink) { + final String[] ending = splitControllerDeploymentBaseLinkInActionIdAndResource(controllerDeploymentBaseLink); + return Long.valueOf(ending[0]); + } + + private Integer getResourceOutOfLink(final Link controllerDeploymentBaseLink) { + final String[] ending = splitControllerDeploymentBaseLinkInActionIdAndResource(controllerDeploymentBaseLink); + return Integer.valueOf(ending[1].substring(2)); + } + + private String[] splitControllerDeploymentBaseLinkInActionIdAndResource(final Link controllerDeploymentBaseLink) { + final String link = controllerDeploymentBaseLink.getHref(); + final String[] segments = link.split(Pattern.quote("/")); + return segments[8].split(Pattern.quote("?")); + } + + // private RootControllerResourceClient getDownloadFeignClient() { + // + // final Builder feignBuilder = Feign.builder().contract(new + // IgnoreMultipleConsumersProducersSpringMvcContract()) + // .requestInterceptor(new + // ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) + // .logger(new Logger.ErrorLogger()).encoder(new + // JacksonEncoder()).decoder(new Decoder() { + // @Override + // public Object decode(final Response response, final Type type) + // throws IOException, DecodeException, FeignException { + // + // // TODO download + // final InputStream stream = response.body().asInputStream(); + // + // final FileSystem local = FileSystems.getDefault(); + // + // System.out.println("Status is " + response.status()); + // + // final ResponseEntity test = new ResponseEntity( + // HttpStatus.valueOf(response.status())); + // + // return test; + // } + // }); + // + // final RootControllerResourceClient rootControllerResourceClient = + // feignBuilder + // .target(RootControllerResourceClient.class, + // "http://localhost:8080/DEFAULT/controller/v1"); + // + // return rootControllerResourceClient; + // + // } + } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java index 69ae96d84..76867af98 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java @@ -1,5 +1,10 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.client.resource; diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java new file mode 100644 index 000000000..15ea10829 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java @@ -0,0 +1,29 @@ +/** + * 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.client.strategy; + +import java.io.InputStream; + +/** + * @author Jonathan Knoblauch + * + */ +public class DoNotSaveArtifactsStrategy implements PersistenceStrategy { + + @Override + public String getPersistenceStrategy() { + return "nosave"; + } + + @Override + public void handleInputStream(final InputStream in, final String artifactName) { + // down but do not save + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java new file mode 100644 index 000000000..1c5c309e1 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java @@ -0,0 +1,23 @@ +/** + * 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.client.strategy; + +import java.io.InputStream; + +/** + * @author Jonathan Knoblauch + * + */ +public interface PersistenceStrategy { + + public String getPersistenceStrategy(); + + public void handleInputStream(InputStream in, String artifactName); + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java new file mode 100644 index 000000000..ad1c573b1 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java @@ -0,0 +1,45 @@ +/** + * 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.client.strategy; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import com.google.common.io.ByteStreams; + +/** + * @author Jonathan Knoblauch + * + */ +public class SaveArtifactsStrategy implements PersistenceStrategy { + + @Override + public String getPersistenceStrategy() { + + return "save"; + } + + @Override + public void handleInputStream(final InputStream in, final String artifactName) { + + final File file = new File("C:\\testdownload\\" + artifactName); + + try { + final OutputStream out = new FileOutputStream(file); + ByteStreams.copy(in, out); + } catch (final IOException e) { + e.printStackTrace(); + // TODO throw + } + } + +} diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java index ab49be1c1..dc8b4bf96 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java @@ -8,6 +8,8 @@ */ package org.eclipse.hawkbit.ddi.rest.api; +import java.io.InputStream; + import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -42,7 +44,7 @@ public interface DdiArtifactStoreControllerRestApi { */ @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}") @ResponseBody - public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, + public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, @AuthenticationPrincipal final String targetid); diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index 8ba4068a7..45382faf5 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -3,6 +3,7 @@ */ package org.eclipse.hawkbit.ddi.rest.api; +import java.io.InputStream; import java.lang.annotation.Target; import java.util.List; @@ -80,7 +81,7 @@ public interface DdiRootControllerRestApi { * {@link HttpStatus#PARTIAL_CONTENT}. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts/{fileName}") - ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, + ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("fileName") final String fileName); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index b2954d363..8552e686d 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -9,6 +9,7 @@ package org.eclipse.hawkbit.ddi.rest.resource; import java.io.IOException; +import java.io.InputStream; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -68,7 +69,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes private RequestResponseContextHolder requestResponseContextHolder; @Override - public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, + public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, @AuthenticationPrincipal final String targetid) { final List foundArtifacts = artifactManagement.findLocalArtifactByFilename(fileName); @@ -80,7 +81,7 @@ public class DdiArtifactStoreController implements DdiArtifactStoreControllerRes if (foundArtifacts.size() > 1) { LOG.warn("Software artifact name {} is not unique. We will use the first entry.", fileName); } - ResponseEntity result; + ResponseEntity result; final LocalArtifact artifact = foundArtifacts.get(0); final String ifMatch = requestResponseContextHolder.getHttpServletRequest().getHeader("If-Match"); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index 3df0916c0..c3aea102e 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -9,6 +9,7 @@ package org.eclipse.hawkbit.ddi.rest.resource; import java.io.IOException; +import java.io.InputStream; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -138,10 +139,10 @@ public class DdiRootController implements DdiRootControllerRestApi { } @Override - public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, + public ResponseEntity downloadArtifact(@PathVariable("targetid") final String targetid, @PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("fileName") final String fileName) { - ResponseEntity result; + ResponseEntity result; final Target target = controllerManagement.updateLastTargetQuery(targetid, IpUtil.getClientIpFromRequest(requestResponseContextHolder.getHttpServletRequest(), diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java index 4b50dc8f5..ea6dccc7e 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadArtifactRestApi.java @@ -8,6 +8,8 @@ */ package org.eclipse.hawkbit.mgmt.rest.api; +import java.io.InputStream; + import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -36,7 +38,7 @@ public interface MgmtDownloadArtifactRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}/artifacts/{artifactId}/download") @ResponseBody - ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("artifactId") final Long artifactId); } diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index de01a917a..077efa84c 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -8,6 +8,8 @@ */ package org.eclipse.hawkbit.mgmt.rest.resource; +import java.io.InputStream; + import javax.servlet.http.HttpServletRequest; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; @@ -60,7 +62,7 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi */ @Override @ResponseBody - public ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + public ResponseEntity downloadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @PathVariable("artifactId") final Long artifactId) { final SoftwareModule module = findSoftwareModuleWithExceptionIfNotFound(softwareModuleId, artifactId); diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java index 827506048..96f30cc87 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java @@ -61,7 +61,7 @@ public final class RestResourceConversionHelper { * * @return http code */ - public static ResponseEntity writeFileResponse(final LocalArtifact artifact, + public static ResponseEntity writeFileResponse(final LocalArtifact artifact, final HttpServletResponse servletResponse, final HttpServletRequest request, final DbArtifact file) { return writeFileResponse(artifact, servletResponse, request, file, null, null); } @@ -96,11 +96,11 @@ public final class RestResourceConversionHelper { * * @see https://tools.ietf.org/html/rfc7233 */ - public static ResponseEntity writeFileResponse(final LocalArtifact artifact, + public static ResponseEntity writeFileResponse(final LocalArtifact artifact, final HttpServletResponse response, final HttpServletRequest request, final DbArtifact file, final CacheWriteNotify cacheWriteNotify, final Long statusId) { - ResponseEntity result = null; + ResponseEntity result = null; final String etag = artifact.getSha1Hash(); final Long lastModified = artifact.getLastModifiedAt() != null ? artifact.getLastModifiedAt() @@ -181,9 +181,9 @@ public final class RestResourceConversionHelper { } } - private static ResponseEntity extractRange(final HttpServletResponse response, final long length, + private static ResponseEntity extractRange(final HttpServletResponse response, final long length, final List ranges, final String range) { - ResponseEntity result = null; + ResponseEntity result = null; if (ranges.isEmpty()) { for (final String part : range.substring(6).split(",")) { long start = sublong(part, 0, part.indexOf('-')); From d67e0c6381535716c23aaa5bff06bd3720a9bcf0 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 11:06:28 +0200 Subject: [PATCH 037/124] Added maven dependency guava to pom Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index d2e9f7f72..7aa779493 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -67,6 +67,10 @@ commons-io 2.5 + + com.google.guava + guava + From 05d9536caef5374bb3eb383ee2dcb51d83b84357 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 11:14:23 +0200 Subject: [PATCH 038/124] Comment test out and add null check for tenant and baseUrl Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 6 ++++++ .../ddi/client/DdiDefaultFeignClient.java | 18 ++++-------------- .../hawkbit/example/ddi/client/AppTest.java | 14 ++++++++------ 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 7aa779493..f2eb9bb16 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -71,6 +71,12 @@ com.google.guava guava + + commons-lang + commons-lang + 2.3 + + diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index d6e9dde96..7a042d7eb 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -8,6 +8,7 @@ */ package org.eclipse.hawkbit.ddi.client; +import org.apache.commons.lang.Validate; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import feign.Feign; @@ -17,7 +18,7 @@ import feign.Logger.Level; import feign.jackson.JacksonEncoder; /** - * @author Jonathan Knoblauch + * TODO * */ public class DdiDefaultFeignClient { @@ -32,18 +33,10 @@ public class DdiDefaultFeignClient { feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); - - if (baseUrl == null) { - throw new IllegalStateException("A baseUrl has to be set"); - } - - if (tenant == null) { - throw new IllegalStateException("A tenant has to be set"); - } - + Validate.notNull(baseUrl, "A baseUrl has to be set"); + Validate.notNull(tenant, "A tenant has to be set"); this.baseUrl = baseUrl; this.tenant = tenant; - } public Builder getFeignBuilder() { @@ -52,12 +45,9 @@ public class DdiDefaultFeignClient { public RootControllerResourceClient getRootControllerResourceClient() { - // TODO tenant null throw exception if (rootControllerResourceClient == null) { - String rootControllerResourcePath = this.baseUrl + RootControllerResourceClient.PATH; rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); - rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, rootControllerResourcePath); } diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index 78608b11d..09f82fa6d 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -1,6 +1,5 @@ package org.eclipse.hawkbit.example.ddi.client; -import org.eclipse.hawkbit.ddi.client.DdiExampleClient; import org.junit.Test; /** @@ -10,11 +9,14 @@ public class AppTest { @Test public void AppTest() { - - final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "jktest", "DEFAULT"); - ddiClient.run(); - - System.out.println("next steps........................"); + // final DdiExampleClient ddiClient = new + // DdiExampleClient("http://localhost:8080/", "Einstein1", "DEFAULT", + // 2000, + // new SaveArtifactsStrategy()); + // final Thread thread = new Thread(ddiClient); + // thread.run(); + // + // System.out.println("next steps........................"); } } From 99f0a4e882d01716bc5fd96691fc61def98c82fa Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 14:08:42 +0200 Subject: [PATCH 039/124] Extenden functions of DDI client - polling time is taken form server - client can be stopped my call from out side Signed-off-by: Jonathan Philip Knoblauch --- ...plicationJsonRequestHeaderInterceptor.java | 2 - .../hawkbit/ddi/client/DdiDecoder.java | 4 +- .../hawkbit/ddi/client/DdiExampleClient.java | 82 ++++++++----------- .../strategy/DoNotSaveArtifactsStrategy.java | 7 +- .../client/strategy/PersistenceStrategy.java | 5 +- .../strategy/SaveArtifactsStrategy.java | 23 ++---- 6 files changed, 43 insertions(+), 80 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java index 97a3e4395..5f7f46013 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java @@ -23,9 +23,7 @@ public class ApplicationJsonRequestHeaderInterceptor implements RequestIntercept public void apply(final RequestTemplate template) { template.header("Accept", MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE, MediaType.TEXT_PLAIN_VALUE); - // template.header("Accept", MediaType.APPLICATION_OCTET_STREAM_VALUE); template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); - } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java index 90fc0e7bd..47a59a667 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java @@ -33,6 +33,7 @@ import feign.jackson.JacksonDecoder; public class DdiDecoder implements Decoder { ObjectMapper mapper; + private final String octentTypeOctetStream = "[application/octet-stream]"; public DdiDecoder() { mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -44,8 +45,7 @@ public class DdiDecoder implements Decoder { final Map> header = response.headers(); final String contentType = String.valueOf(header.get("Content-Type")); - // TODO parameter verwenden - if (contentType.equals("[application/octet-stream]")) { + if (contentType.equals(octentTypeOctetStream)) { return ResponseEntity.ok(response.body().asInputStream()); } final ResponseEntityDecoder responseEntityDecoder = new ResponseEntityDecoder(new JacksonDecoder(mapper)); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index e0a01e814..ae33f1c39 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -8,7 +8,9 @@ */ package org.eclipse.hawkbit.ddi.client; +import java.io.IOException; import java.io.InputStream; +import java.time.LocalTime; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; @@ -36,9 +38,11 @@ public class DdiExampleClient implements Runnable { private final String controllerId; private Long actionIdOfLastInstalltion; private final DdiDefaultFeignClient ddiDefaultFeignClient; - private final long pollingIntervalInMillis; + private long pollingIntervalInMillis; private final PersistenceStrategy persistenceStrategy; + private STATUS clientStatus; + public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, final long pollingIntervalInMillis, final PersistenceStrategy persistenceStrategy) { this.controllerId = controllerId; @@ -46,27 +50,28 @@ public class DdiExampleClient implements Runnable { this.actionIdOfLastInstalltion = null; this.pollingIntervalInMillis = pollingIntervalInMillis; this.persistenceStrategy = persistenceStrategy; + this.clientStatus = STATUS.DOWN; } @Override public void run() { + clientStatus = STATUS.UP; + ResponseEntity response = ddiDefaultFeignClient.getRootControllerResourceClient() + .getControllerBase(controllerId); + final String pollingTime = response.getBody().getConfig().getPolling().getSleep(); + final LocalTime localtime = LocalTime.parse(pollingTime); + pollingIntervalInMillis = localtime.toNanoOfDay(); - ResponseEntity response; - - while (!Thread.currentThread().isInterrupted()) { + while (clientStatus == STATUS.UP) { response = ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); - final DdiControllerBase controllerBase = response.getBody(); - final Link controllerDeploymentBaseLink = controllerBase.getLink("deploymentBase"); + // final DdiControllerBase controllerBase = response.getBody(); + final Link controllerDeploymentBaseLink = response.getBody().getLink("deploymentBase"); if (controllerDeploymentBaseLink != null) { final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); final Integer resource = getResourceOutOfLink(controllerDeploymentBaseLink); if (actionId != actionIdOfLastInstalltion) { - startDownload(actionId, resource); - - simulateSuccessfulInstallation(actionId); - actionIdOfLastInstalltion = actionId; } } @@ -81,9 +86,12 @@ public class DdiExampleClient implements Runnable { } + public void stop() { + clientStatus = STATUS.DOWN; + } + private void startDownload(final Long actionId, final Integer resource) { - // resource has not been downloaded and installed final ResponseEntity respone = ddiDefaultFeignClient.getRootControllerResourceClient() .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); @@ -94,7 +102,6 @@ public class DdiExampleClient implements Runnable { .getLink("download-http"); final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); - // download all artifacts for (final DdiArtifact ddiArtifact : artifactList) { downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); } @@ -111,9 +118,17 @@ public class DdiExampleClient implements Runnable { .getRootControllerResourceClient().downloadArtifact(controllerId, softwareModuleId, artifact); final HttpStatus statsuCode = responseDownloadArtifact.getStatusCode(); System.out.println("Finished download with stataus " + statsuCode); - persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); + try { + persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); + } catch (final IOException e) { + sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.FAILURE, + "Downloaded of artifact " + artifact + " failed"); + return; + } sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Downloaded artifact " + artifact); + + simulateSuccessfulInstallation(actionId); } private void sendFeedBackMessage(final Long actionId, final ExecutionStatus executionStatus, @@ -127,14 +142,12 @@ public class DdiExampleClient implements Runnable { final DdiActionFeedback feedback = new DdiActionFeedback(actionId, time, ddiStatus); final ResponseEntity response = ddiDefaultFeignClient.getRootControllerResourceClient() .postBasedeploymentActionFeedback(feedback, controllerId, actionId); - final HttpStatus statsuCode = response.getStatusCode(); System.out.println("Message send with stataus " + statsuCode); } private void simulateSuccessfulInstallation(final Long actionId) { - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.SUCESS, - "Simulated installation successful"); + sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.SUCESS, "Simulated installation successful"); } private Long getActionIdOutOfLink(final Link controllerDeploymentBaseLink) { @@ -153,39 +166,8 @@ public class DdiExampleClient implements Runnable { return segments[8].split(Pattern.quote("?")); } - // private RootControllerResourceClient getDownloadFeignClient() { - // - // final Builder feignBuilder = Feign.builder().contract(new - // IgnoreMultipleConsumersProducersSpringMvcContract()) - // .requestInterceptor(new - // ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) - // .logger(new Logger.ErrorLogger()).encoder(new - // JacksonEncoder()).decoder(new Decoder() { - // @Override - // public Object decode(final Response response, final Type type) - // throws IOException, DecodeException, FeignException { - // - // // TODO download - // final InputStream stream = response.body().asInputStream(); - // - // final FileSystem local = FileSystems.getDefault(); - // - // System.out.println("Status is " + response.status()); - // - // final ResponseEntity test = new ResponseEntity( - // HttpStatus.valueOf(response.status())); - // - // return test; - // } - // }); - // - // final RootControllerResourceClient rootControllerResourceClient = - // feignBuilder - // .target(RootControllerResourceClient.class, - // "http://localhost:8080/DEFAULT/controller/v1"); - // - // return rootControllerResourceClient; - // - // } + public enum STATUS { + UP, DOWN; + } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java index 15ea10829..0e9ea82e1 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java @@ -16,14 +16,9 @@ import java.io.InputStream; */ public class DoNotSaveArtifactsStrategy implements PersistenceStrategy { - @Override - public String getPersistenceStrategy() { - return "nosave"; - } - @Override public void handleInputStream(final InputStream in, final String artifactName) { - // down but do not save + // do nothing } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java index 1c5c309e1..c8080a1d6 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java @@ -8,6 +8,7 @@ */ package org.eclipse.hawkbit.ddi.client.strategy; +import java.io.IOException; import java.io.InputStream; /** @@ -16,8 +17,6 @@ import java.io.InputStream; */ public interface PersistenceStrategy { - public String getPersistenceStrategy(); - - public void handleInputStream(InputStream in, String artifactName); + public void handleInputStream(InputStream in, String artifactName) throws IOException; } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java index ad1c573b1..dbf13ef9c 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java @@ -15,6 +15,7 @@ import java.io.InputStream; import java.io.OutputStream; import com.google.common.io.ByteStreams; +import com.google.common.io.Files; /** * @author Jonathan Knoblauch @@ -23,23 +24,11 @@ import com.google.common.io.ByteStreams; public class SaveArtifactsStrategy implements PersistenceStrategy { @Override - public String getPersistenceStrategy() { - - return "save"; - } - - @Override - public void handleInputStream(final InputStream in, final String artifactName) { - - final File file = new File("C:\\testdownload\\" + artifactName); - - try { - final OutputStream out = new FileOutputStream(file); - ByteStreams.copy(in, out); - } catch (final IOException e) { - e.printStackTrace(); - // TODO throw - } + public void handleInputStream(final InputStream in, final String artifactName) throws IOException { + final File tempDir = Files.createTempDir(); + final File file = new File(tempDir + "\\" + artifactName); + final OutputStream out = new FileOutputStream(file); + ByteStreams.copy(in, out); } } From 8addb05f090f687b0847df861ebd0b8c24d53018 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 14:57:39 +0200 Subject: [PATCH 040/124] Added javadoc and logger to ddi client Signed-off-by: Jonathan Philip Knoblauch --- .../ddi/client/DdiDefaultFeignClient.java | 13 ++++- .../hawkbit/ddi/client/DdiExampleClient.java | 54 ++++++++++++------- .../strategy/DoNotSaveArtifactsStrategy.java | 7 +-- .../client/strategy/PersistenceStrategy.java | 12 ++++- .../strategy/SaveArtifactsStrategy.java | 4 +- 5 files changed, 61 insertions(+), 29 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index 7a042d7eb..7c4c87708 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -18,8 +18,7 @@ import feign.Logger.Level; import feign.jackson.JacksonEncoder; /** - * TODO - * + * Default implementation of DDI client. */ public class DdiDefaultFeignClient { @@ -39,10 +38,20 @@ public class DdiDefaultFeignClient { this.tenant = tenant; } + /** + * Get the feign builder. + * + * @return the feign builder + */ public Builder getFeignBuilder() { return feignBuilder; } + /** + * Get the rootController resource client. + * + * @return the rootController resource client + */ public RootControllerResourceClient getRootControllerResourceClient() { if (rootControllerResourceClient == null) { diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index ae33f1c39..ad9f086bb 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -10,6 +10,7 @@ package org.eclipse.hawkbit.ddi.client; import java.io.IOException; import java.io.InputStream; +import java.time.LocalDateTime; import java.time.LocalTime; import java.util.ArrayList; import java.util.List; @@ -31,6 +32,9 @@ import org.springframework.hateoas.Link; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +/** + * DDI example client based on defualt DDI feign client. + */ public class DdiExampleClient implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(DdiExampleClient.class); @@ -38,17 +42,26 @@ public class DdiExampleClient implements Runnable { private final String controllerId; private Long actionIdOfLastInstalltion; private final DdiDefaultFeignClient ddiDefaultFeignClient; - private long pollingIntervalInMillis; private final PersistenceStrategy persistenceStrategy; - private STATUS clientStatus; + /** + * Constructor for the DDI example client. + * + * @param baseUrl + * the base url of the hawkBit server + * @param controllerId + * the controller id that will be simulated + * @param tenant + * the tenant + * @param persistenceStrategy + * the persistence strategy for downloading artifacts + */ public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final long pollingIntervalInMillis, final PersistenceStrategy persistenceStrategy) { + final PersistenceStrategy persistenceStrategy) { this.controllerId = controllerId; this.ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); this.actionIdOfLastInstalltion = null; - this.pollingIntervalInMillis = pollingIntervalInMillis; this.persistenceStrategy = persistenceStrategy; this.clientStatus = STATUS.DOWN; } @@ -56,15 +69,13 @@ public class DdiExampleClient implements Runnable { @Override public void run() { clientStatus = STATUS.UP; - ResponseEntity response = ddiDefaultFeignClient.getRootControllerResourceClient() - .getControllerBase(controllerId); - final String pollingTime = response.getBody().getConfig().getPolling().getSleep(); - final LocalTime localtime = LocalTime.parse(pollingTime); - pollingIntervalInMillis = localtime.toNanoOfDay(); - + ResponseEntity response; while (clientStatus == STATUS.UP) { + LOGGER.info(" Controller {} polling from hawkBit server", controllerId); response = ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); - // final DdiControllerBase controllerBase = response.getBody(); + final String pollingTime = response.getBody().getConfig().getPolling().getSleep(); + final LocalTime localtime = LocalTime.parse(pollingTime); + final long pollingIntervalInMillis = localtime.toNanoOfDay(); final Link controllerDeploymentBaseLink = response.getBody().getLink("deploymentBase"); if (controllerDeploymentBaseLink != null) { @@ -78,14 +89,15 @@ public class DdiExampleClient implements Runnable { try { Thread.sleep(pollingIntervalInMillis); - System.out.println("polling ..."); } catch (final InterruptedException e) { LOGGER.error("Error during sleep"); } } - } + /** + * Stop the DDI example client + */ public void stop() { clientStatus = STATUS.DOWN; } @@ -112,12 +124,12 @@ public class DdiExampleClient implements Runnable { sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Starting download of artifact " + artifact); - System.out.println("Starting download for artifact " + artifact); + LOGGER.info("Starting download of artifact " + artifact); final ResponseEntity responseDownloadArtifact = ddiDefaultFeignClient .getRootControllerResourceClient().downloadArtifact(controllerId, softwareModuleId, artifact); final HttpStatus statsuCode = responseDownloadArtifact.getStatusCode(); - System.out.println("Finished download with stataus " + statsuCode); + LOGGER.info("Finished download with stataus {}", statsuCode); try { persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); @@ -138,12 +150,11 @@ public class DdiExampleClient implements Runnable { final List details = new ArrayList<>(); details.add(message); final DdiStatus ddiStatus = new DdiStatus(executionStatus, result, details); - final String time = null; + final String time = String.valueOf(LocalDateTime.now()); final DdiActionFeedback feedback = new DdiActionFeedback(actionId, time, ddiStatus); - final ResponseEntity response = ddiDefaultFeignClient.getRootControllerResourceClient() - .postBasedeploymentActionFeedback(feedback, controllerId, actionId); - final HttpStatus statsuCode = response.getStatusCode(); - System.out.println("Message send with stataus " + statsuCode); + ddiDefaultFeignClient.getRootControllerResourceClient().postBasedeploymentActionFeedback(feedback, controllerId, + actionId); + LOGGER.info("Sent feedback message to HaktBit"); } private void simulateSuccessfulInstallation(final Long actionId) { @@ -166,6 +177,9 @@ public class DdiExampleClient implements Runnable { return segments[8].split(Pattern.quote("?")); } + /** + * Enum for DDI running status. + */ public enum STATUS { UP, DOWN; diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java index 0e9ea82e1..80743c99e 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java @@ -8,16 +8,17 @@ */ package org.eclipse.hawkbit.ddi.client.strategy; +import java.io.IOException; import java.io.InputStream; /** - * @author Jonathan Knoblauch - * + * Implementation of {@link PersistenceStrategy} for not downloading any + * artifacts. */ public class DoNotSaveArtifactsStrategy implements PersistenceStrategy { @Override - public void handleInputStream(final InputStream in, final String artifactName) { + public void handleInputStream(final InputStream in, final String artifactName) throws IOException { // do nothing } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java index c8080a1d6..e5a3a60d0 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java @@ -12,11 +12,19 @@ import java.io.IOException; import java.io.InputStream; /** - * @author Jonathan Knoblauch - * + * Interface of persistence strategy. */ public interface PersistenceStrategy { + /** + * Method handling the artifact download. + * + * @param in + * the input stream + * @param artifactName + * the name of the artifact + * @throws IOException + */ public void handleInputStream(InputStream in, String artifactName) throws IOException; } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java index dbf13ef9c..2ae7987cb 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java @@ -18,8 +18,8 @@ import com.google.common.io.ByteStreams; import com.google.common.io.Files; /** - * @author Jonathan Knoblauch - * + * Implementation of {@link PersistenceStrategy} for downloading artifacts to + * the temp directory. */ public class SaveArtifactsStrategy implements PersistenceStrategy { From c2649b4b54dbeb7eaee7c3a4b6e5b7d0301aafaf Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 26 Apr 2016 16:19:37 +0200 Subject: [PATCH 041/124] Add example feign core project add system client api Signed-off-by: SirWayne --- examples/hawkbit-example-ddi-client/pom.xml | 5 + ...ava => DdiAcceptedRequestInterceptor.java} | 56 ++++--- .../ddi/client/DdiDefaultFeignClient.java | 5 +- .../hawkbit-example-feign-core-client/pom.xml | 47 ++++++ ...plicationJsonRequestHeaderInterceptor.java | 56 +++---- .../core/client/FeignClientConfiguration.java | 32 ++++ ...leConsumersProducersSpringMvcContract.java | 86 +++++----- examples/hawkbit-mgmt-api-client/pom.xml | 10 ++ .../hawkbit/mgmt/client/Application.java | 13 +- ...leConsumersProducersSpringMvcContract.java | 43 ----- .../mgmt/client/MgmtDefaultFeignClient.java | 149 ------------------ .../MgmtSoftwareModuleClientResource.java | 16 ++ .../client/resource/SystemClientResource.java | 21 +++ .../SystemManagementClientResource.java | 22 +++ .../json/model/artifact/MgmtArtifact.java | 7 +- ...Rest.java => MgmtDistributionSetType.java} | 2 +- .../api/MgmtDistributionSetTypeRestApi.java | 10 +- .../mgmt/rest/api/MgmtDownloadRestApi.java | 5 +- .../rest/api/MgmtSoftwareModuleRestApi.java | 3 +- .../MgmtDistributionSetTypeMapper.java | 14 +- .../MgmtDistributionSetTypeResource.java | 12 +- .../rest/resource/MgmtDownloadResource.java | 15 +- hawkbit-repository/pom.xml | 6 - pom.xml | 2 +- 24 files changed, 294 insertions(+), 343 deletions(-) rename examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/{ApplicationJsonRequestHeaderInterceptor.java => DdiAcceptedRequestInterceptor.java} (69%) create mode 100644 examples/hawkbit-example-feign-core-client/pom.xml rename examples/{hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt => hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core}/client/ApplicationJsonRequestHeaderInterceptor.java (92%) create mode 100644 examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java rename examples/{hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi => hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core}/client/IgnoreMultipleConsumersProducersSpringMvcContract.java (94%) delete mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/IgnoreMultipleConsumersProducersSpringMvcContract.java delete mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java create mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java create mode 100644 examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java rename hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/{MgmtDistributionSetTypeRest.java => MgmtDistributionSetType.java} (95%) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index f2eb9bb16..c6acefb00 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -24,6 +24,11 @@ + + org.eclipse.hawkbit + hawkbit-example-feign-core-client + ${project.version} + org.eclipse.hawkbit hawkbit-ddi-api diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java similarity index 69% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java rename to examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java index 5f7f46013..962ffd7a6 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/ApplicationJsonRequestHeaderInterceptor.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java @@ -1,29 +1,27 @@ -/** - * 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.client; - -import org.springframework.http.MediaType; - -import feign.RequestInterceptor; -import feign.RequestTemplate; - -/** - * An feign request interceptor to set the defined {@code Accept} and - * {@code Content-Type} headers for each request to {@code application/json}. - */ -public class ApplicationJsonRequestHeaderInterceptor implements RequestInterceptor { - - @Override - public void apply(final RequestTemplate template) { - template.header("Accept", MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE, - MediaType.TEXT_PLAIN_VALUE); - template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); - } - -} +/** + * 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.client; + +import org.springframework.http.MediaType; + +import feign.RequestInterceptor; +import feign.RequestTemplate; + +/** + * + * + */ +public class DdiAcceptedRequestInterceptor implements RequestInterceptor { + + @Override + public void apply(final RequestTemplate template) { + template.header("Accept", MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE, + MediaType.TEXT_PLAIN_VALUE); + } +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index 7c4c87708..c9af1cb09 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -10,6 +10,8 @@ package org.eclipse.hawkbit.ddi.client; import org.apache.commons.lang.Validate; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; +import org.eclipse.hawkbit.feign.core.client.ApplicationJsonRequestHeaderInterceptor; +import org.eclipse.hawkbit.feign.core.client.IgnoreMultipleConsumersProducersSpringMvcContract; import feign.Feign; import feign.Feign.Builder; @@ -30,7 +32,8 @@ public class DdiDefaultFeignClient { public DdiDefaultFeignClient(final String baseUrl, final String tenant) { feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) - .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) + .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()) + .requestInterceptor(new DdiAcceptedRequestInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); Validate.notNull(baseUrl, "A baseUrl has to be set"); Validate.notNull(tenant, "A tenant has to be set"); diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml new file mode 100644 index 000000000..e9981829c --- /dev/null +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-examples-parent + 0.2.0-SNAPSHOT + + + hawkbit-example-feign-core-client + hawkbit-example-feign-core-client + + + + + org.springframework.cloud + spring-cloud-netflix + 1.0.7.RELEASE + pom + import + + + + + + + com.netflix.feign + feign-core + + + 8.14.2 + + + com.netflix.feign + feign-jackson + 8.14.2 + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.cloud + spring-cloud-starter-feign + + + diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java similarity index 92% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ApplicationJsonRequestHeaderInterceptor.java rename to examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java index 75f3b0dd1..ac1353fa1 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ApplicationJsonRequestHeaderInterceptor.java +++ b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java @@ -1,28 +1,28 @@ -/** - * 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.mgmt.client; - -import org.springframework.http.MediaType; - -import feign.RequestInterceptor; -import feign.RequestTemplate; - -/** - * An feign request interceptor to set the defined {@code Accept} and - * {@code Content-Type} headers for each request to {@code application/json}. - */ -public class ApplicationJsonRequestHeaderInterceptor implements RequestInterceptor { - - @Override - public void apply(final RequestTemplate template) { - template.header("Accept", MediaType.APPLICATION_JSON_VALUE); - template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); - } - -} +/** + * 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.feign.core.client; + +import org.springframework.http.MediaType; + +import feign.RequestInterceptor; +import feign.RequestTemplate; + +/** + * An feign request interceptor to set the defined {@code Accept} and + * {@code Content-Type} headers for each request to {@code application/json}. + */ +public class ApplicationJsonRequestHeaderInterceptor implements RequestInterceptor { + + @Override + public void apply(final RequestTemplate template) { + template.header("Accept", MediaType.APPLICATION_JSON_VALUE); + template.header("Content-Type", MediaType.APPLICATION_JSON_VALUE); + } + +} diff --git a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java new file mode 100644 index 000000000..83bee36b1 --- /dev/null +++ b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java @@ -0,0 +1,32 @@ +/** + * 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.feign.core.client; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import feign.Contract; + +/** + * + * + */ +@Configuration +public class FeignClientConfiguration { + + @Bean + public ApplicationJsonRequestHeaderInterceptor jsonHeaderInterceptor() { + return new ApplicationJsonRequestHeaderInterceptor(); + } + + @Bean + public Contract feignContract() { + return new IgnoreMultipleConsumersProducersSpringMvcContract(); + } +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java similarity index 94% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java rename to examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java index c1c24b9ec..e7d8890b1 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/IgnoreMultipleConsumersProducersSpringMvcContract.java +++ b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java @@ -1,43 +1,43 @@ -/** - * 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.client; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cloud.netflix.feign.support.SpringMvcContract; - -import feign.MethodMetadata; - -/** - * Own implementation of the {@link SpringMvcContract} which catches the - * {@link IllegalStateException} which occurs due multiple produces and consumes - * values in the request-mapping - * annoation.https://github.com/spring-cloud/spring-cloud-netflix/issues/808 - */ -public class IgnoreMultipleConsumersProducersSpringMvcContract extends SpringMvcContract { - - private static final Logger LOGGER = LoggerFactory - .getLogger(IgnoreMultipleConsumersProducersSpringMvcContract.class); - - @Override - protected void processAnnotationOnMethod(final MethodMetadata data, final Annotation methodAnnotation, - final Method method) { - try { - super.processAnnotationOnMethod(data, methodAnnotation, method); - } catch (final IllegalStateException e) { - // ignore illegalstateexception here because it's thrown because of - // multiple consumers and produces, see - // https://github.com/spring-cloud/spring-cloud-netflix/issues/808 - LOGGER.trace(e.getMessage(), e); - } - } -} +/** + * 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.feign.core.client; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.cloud.netflix.feign.support.SpringMvcContract; + +import feign.MethodMetadata; + +/** + * Own implementation of the {@link SpringMvcContract} which catches the + * {@link IllegalStateException} which occurs due multiple produces and consumes + * values in the request-mapping + * annoation.https://github.com/spring-cloud/spring-cloud-netflix/issues/808 + */ +public class IgnoreMultipleConsumersProducersSpringMvcContract extends SpringMvcContract { + + private static final Logger LOGGER = LoggerFactory + .getLogger(IgnoreMultipleConsumersProducersSpringMvcContract.class); + + @Override + protected void processAnnotationOnMethod(final MethodMetadata data, final Annotation methodAnnotation, + final Method method) { + try { + super.processAnnotationOnMethod(data, methodAnnotation, method); + } catch (final IllegalStateException e) { + // ignore illegalstateexception here because it's thrown because of + // multiple consumers and produces, see + // https://github.com/spring-cloud/spring-cloud-netflix/issues/808 + LOGGER.trace(e.getMessage(), e); + } + } +} diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index 70b394ac4..1b7ff72ec 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -55,11 +55,21 @@ + + org.eclipse.hawkbit + hawkbit-example-feign-core-client + ${project.version} + org.eclipse.hawkbit hawkbit-mgmt-api ${project.version} + + org.eclipse.hawkbit + hawkbit-system-api + ${project.version} + com.netflix.feign feign-core diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java index 27584b50a..15d6ff10a 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java @@ -17,13 +17,14 @@ import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.netflix.feign.EnableFeignClients; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -import feign.Contract; import feign.auth.BasicAuthRequestInterceptor; @SpringBootApplication @EnableFeignClients @EnableConfigurationProperties(ClientConfigurationProperties.class) +@Configuration public class Application implements CommandLineRunner { @Autowired @@ -56,16 +57,6 @@ public class Application implements CommandLineRunner { return new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword()); } - @Bean - public ApplicationJsonRequestHeaderInterceptor jsonHeaderInterceptor() { - return new ApplicationJsonRequestHeaderInterceptor(); - } - - @Bean - public Contract feignContract() { - return new IgnoreMultipleConsumersProducersSpringMvcContract(); - } - private boolean containsArg(final String containsArg, final String... args) { for (final String arg : args) { if (arg.equalsIgnoreCase(containsArg)) { diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/IgnoreMultipleConsumersProducersSpringMvcContract.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/IgnoreMultipleConsumersProducersSpringMvcContract.java deleted file mode 100644 index c796aa019..000000000 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/IgnoreMultipleConsumersProducersSpringMvcContract.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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.mgmt.client; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.cloud.netflix.feign.support.SpringMvcContract; - -import feign.MethodMetadata; - -/** - * Own implementation of the {@link SpringMvcContract} which catches the - * {@link IllegalStateException} which occurs due multiple produces and consumes - * values in the request-mapping - * annoation.https://github.com/spring-cloud/spring-cloud-netflix/issues/808 - */ -public class IgnoreMultipleConsumersProducersSpringMvcContract extends SpringMvcContract { - - private static final Logger LOGGER = LoggerFactory - .getLogger(IgnoreMultipleConsumersProducersSpringMvcContract.class); - - @Override - protected void processAnnotationOnMethod(final MethodMetadata data, final Annotation methodAnnotation, - final Method method) { - try { - super.processAnnotationOnMethod(data, methodAnnotation, method); - } catch (final IllegalStateException e) { - // ignore illegalstateexception here because it's thrown because of - // multiple consumers and produces, see - // https://github.com/spring-cloud/spring-cloud-netflix/issues/808 - LOGGER.trace(e.getMessage(), e); - } - } -} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java deleted file mode 100644 index 6425bad4d..000000000 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/MgmtDefaultFeignClient.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * 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.mgmt.client; - -import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTagClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtDistributionSetTypeClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtDownloadArtifactClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtDownloadClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtRolloutClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtSoftwareModuleTypeClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetClientResource; -import org.eclipse.hawkbit.mgmt.client.resource.MgmtTargetTagClientResource; -import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; -import org.springframework.hateoas.hal.Jackson2HalModule; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -import feign.Feign; -import feign.Feign.Builder; -import feign.Logger; -import feign.Logger.Level; -import feign.jackson.JacksonDecoder; -import feign.jackson.JacksonEncoder; - -/** - * - */ -public class MgmtDefaultFeignClient { - - private MgmtDistributionSetClientResource mgmtDistributionSetClientResource; - private MgmtDistributionSetTagClientResource mgmtDistributionSetTagClientResource; - private MgmtDistributionSetTypeClientResource mgmtDistributionSetTypeClientResource; - private MgmtRolloutClientResource mgmtRolloutClientResource; - private MgmtSoftwareModuleClientResource mgmtSoftwareModuleClientResource; - private MgmtSoftwareModuleTypeClientResource mgmtSoftwareModuleTypeClientResource; - private MgmtTargetClientResource mgmtTargetClientResource; - private MgmtTargetTagClientResource mgmtTargetTagClientResource; - private MgmtDownloadClientResource mgmtDownloadClientResource; - private MgmtDownloadArtifactClientResource mgmtDownloadArtifactClientResource; - - private final Builder feignBuilder; - private final String baseUrl; - - public MgmtDefaultFeignClient(final String baseUrl) { - final ObjectMapper mapper = new ObjectMapper() - .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .registerModule(new Jackson2HalModule()); - - feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) - .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) - .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()) - .decoder(new ResponseEntityDecoder(new JacksonDecoder(mapper))); - this.baseUrl = baseUrl; - } - - public Builder getFeignBuilder() { - return feignBuilder; - } - - public MgmtDistributionSetClientResource getMgmtDistributionSetClientResource() { - if (mgmtDistributionSetClientResource == null) { - mgmtDistributionSetClientResource = feignBuilder.target(MgmtDistributionSetClientResource.class, - this.baseUrl + MgmtDistributionSetClientResource.PATH); - } - return mgmtDistributionSetClientResource; - } - - public MgmtDistributionSetTagClientResource getMgmtDistributionSetTagClientResource() { - if (mgmtDistributionSetTagClientResource == null) { - mgmtDistributionSetTagClientResource = feignBuilder.target(MgmtDistributionSetTagClientResource.class, - this.baseUrl + MgmtDistributionSetTagClientResource.PATH); - } - return mgmtDistributionSetTagClientResource; - } - - public MgmtDistributionSetTypeClientResource getMgmtDistributionSetTypeClientResource() { - if (mgmtDistributionSetTypeClientResource == null) { - mgmtDistributionSetTypeClientResource = feignBuilder.target(MgmtDistributionSetTypeClientResource.class, - this.baseUrl + MgmtDistributionSetTypeClientResource.PATH); - } - return mgmtDistributionSetTypeClientResource; - } - - public MgmtRolloutClientResource getMgmtRolloutClientResource() { - if (mgmtRolloutClientResource == null) { - mgmtRolloutClientResource = feignBuilder.target(MgmtRolloutClientResource.class, - this.baseUrl + MgmtRolloutClientResource.PATH); - } - return mgmtRolloutClientResource; - } - - public MgmtSoftwareModuleClientResource getMgmtSoftwareModuleClientResource() { - if (mgmtSoftwareModuleClientResource == null) { - mgmtSoftwareModuleClientResource = feignBuilder.target(MgmtSoftwareModuleClientResource.class, - this.baseUrl + MgmtSoftwareModuleClientResource.PATH); - } - return mgmtSoftwareModuleClientResource; - } - - public MgmtSoftwareModuleTypeClientResource getMgmtSoftwareModuleTypeClientResource() { - if (mgmtSoftwareModuleTypeClientResource == null) { - mgmtSoftwareModuleTypeClientResource = feignBuilder.target(MgmtSoftwareModuleTypeClientResource.class, - this.baseUrl + MgmtSoftwareModuleTypeClientResource.PATH); - } - return mgmtSoftwareModuleTypeClientResource; - } - - public MgmtTargetClientResource getMgmtTargetClientResource() { - if (mgmtTargetClientResource == null) { - mgmtTargetClientResource = feignBuilder.target(MgmtTargetClientResource.class, - this.baseUrl + MgmtTargetClientResource.PATH); - } - return mgmtTargetClientResource; - } - - public MgmtTargetTagClientResource getMgmtTargetTagClientResource() { - if (mgmtTargetTagClientResource == null) { - mgmtTargetTagClientResource = feignBuilder.target(MgmtTargetTagClientResource.class, - this.baseUrl + MgmtTargetTagClientResource.PATH); - } - return mgmtTargetTagClientResource; - } - - public MgmtDownloadClientResource getMgmtDownloadClientResource() { - if (mgmtDownloadClientResource == null) { - mgmtDownloadClientResource = feignBuilder.target(MgmtDownloadClientResource.class, - this.baseUrl + MgmtDownloadClientResource.PATH); - } - return mgmtDownloadClientResource; - } - - public MgmtDownloadArtifactClientResource getMgmtDownloadArtifactClientResource() { - if (mgmtDownloadArtifactClientResource == null) { - mgmtDownloadArtifactClientResource = feignBuilder.target(MgmtDownloadArtifactClientResource.class, - this.baseUrl + MgmtDownloadArtifactClientResource.PATH); - } - return mgmtDownloadArtifactClientResource; - } - -} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java index d89f7e5f3..cc6dbd477 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java @@ -8,8 +8,17 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; +import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleRestApi; import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +import feign.Param; /** * Client binding for the SoftwareModule resource of the management API. @@ -18,4 +27,11 @@ import org.springframework.cloud.netflix.feign.FeignClient; public interface MgmtSoftwareModuleClientResource extends MgmtSoftwareModuleRestApi { static String PATH = "rest/v1/softwaremodules"; + + @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts") + ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, + @Param("file") final MultipartFile file, + @RequestParam(value = "filename", required = false) final String optionalFileName, + @RequestParam(value = "md5sum", required = false) final String md5Sum, + @RequestParam(value = "sha1sum", required = false) final String sha1Sum); } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java new file mode 100644 index 000000000..01510e279 --- /dev/null +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java @@ -0,0 +1,21 @@ +/** + * 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.mgmt.client.resource; + +import org.eclipse.hawkbit.system.rest.api.SystemRestApi; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * Client binding for the {@link SystemRestApi}. + * + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemClientResource.PATH) +public interface SystemClientResource extends SystemRestApi { + static String PATH = "rest/v1/system"; +} diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java new file mode 100644 index 000000000..5047619bc --- /dev/null +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java @@ -0,0 +1,22 @@ +/** + * 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.mgmt.client.resource; + +import org.eclipse.hawkbit.system.rest.api.SystemManagementRestApi; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * Client binding for the {@link SystemManagementRestApi}. + * + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemManagementClientResource.PATH) +public interface SystemManagementClientResource extends SystemManagementRestApi { + static String PATH = "system/admin"; + +} diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java index 0d9e83690..2bcf3c059 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java @@ -15,7 +15,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRootName; import com.fasterxml.jackson.annotation.JsonValue; /** @@ -23,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonValue; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -@JsonRootName(value = "") public class MgmtArtifact extends MgmtBaseEntity { @JsonProperty(required = true) @@ -41,6 +39,11 @@ public class MgmtArtifact extends MgmtBaseEntity { @JsonProperty private Long size; + public MgmtArtifact() { + super(); + // need for json encoder + } + /** * @param type * the type to set diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java similarity index 95% rename from hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java index 5717863d1..acc4dbb59 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetTypeRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionsettype/MgmtDistributionSetType.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class MgmtDistributionSetTypeRest extends MgmtNamedEntity { +public class MgmtDistributionSetType extends MgmtNamedEntity { @JsonProperty(value = "id", required = true) private Long moduleId; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index 28af107f7..84fe8c4e7 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -14,7 +14,7 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut; -import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetType; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -54,7 +54,7 @@ public interface MgmtDistributionSetTypeRestApi { * response. */ @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity> getDistributionSetTypes( + ResponseEntity> getDistributionSetTypes( @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -73,7 +73,7 @@ public interface MgmtDistributionSetTypeRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getDistributionSetType( + ResponseEntity getDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId); /** @@ -99,7 +99,7 @@ public interface MgmtDistributionSetTypeRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionSetTypeId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity updateDistributionSetType( + ResponseEntity updateDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType); @@ -116,7 +116,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> createDistributionSetTypes( + ResponseEntity> createDistributionSetTypes( @RequestBody final List distributionSetTypes); /** diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java index 85c498296..52cd1c991 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDownloadRestApi.java @@ -8,8 +8,6 @@ */ package org.eclipse.hawkbit.mgmt.rest.api; -import javax.servlet.http.HttpServletResponse; - import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -36,7 +34,6 @@ public interface MgmtDownloadRestApi { */ @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING) @ResponseBody - ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId, - final HttpServletResponse response); + ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId); } diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index dab8cc594..eb601487b 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -53,8 +53,7 @@ public interface MgmtSoftwareModuleRestApi { * failure the JsonResponseExceptionHandler is handling the * response. */ - @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts", produces = { - "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) + @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts") ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam("file") final MultipartFile file, @RequestParam(value = "filename", required = false) final String optionalFileName, diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java index 244f07095..d3046f149 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeMapper.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; -import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetType; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.SoftwareManagement; @@ -76,24 +76,24 @@ final class MgmtDistributionSetTypeMapper { return result; } - static List toTypesResponse(final List types) { - final List response = new ArrayList<>(); + static List toTypesResponse(final List types) { + final List response = new ArrayList<>(); for (final DistributionSetType dsType : types) { response.add(toResponse(dsType)); } return response; } - static List toListResponse(final List types) { - final List response = new ArrayList<>(); + static List toListResponse(final List types) { + final List response = new ArrayList<>(); for (final DistributionSetType dsType : types) { response.add(toResponse(dsType)); } return response; } - static MgmtDistributionSetTypeRest toResponse(final DistributionSetType type) { - final MgmtDistributionSetTypeRest result = new MgmtDistributionSetTypeRest(); + static MgmtDistributionSetType toResponse(final DistributionSetType type) { + final MgmtDistributionSetType result = new MgmtDistributionSetType(); MgmtRestModelMapper.mapNamedToNamed(result, type); result.setKey(type.getKey()); diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java index 8d5239d9e..baa6f2955 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDistributionSetTypeResource.java @@ -14,7 +14,7 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut; -import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRest; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetType; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDistributionSetTypeRestApi; import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; @@ -56,7 +56,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR private DistributionSetManagement distributionSetManagement; @Override - public ResponseEntity> getDistributionSetTypes( + public ResponseEntity> getDistributionSetTypes( @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET) final int pagingOffsetParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_LIMIT, defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT) final int pagingLimitParam, @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SORTING, required = false) final String sortParam, @@ -79,13 +79,13 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR countModulesAll = distributionSetManagement.countDistributionSetTypesAll(); } - final List rest = MgmtDistributionSetTypeMapper + final List rest = MgmtDistributionSetTypeMapper .toListResponse(findModuleTypessAll.getContent()); return new ResponseEntity<>(new PagedList<>(rest, countModulesAll), HttpStatus.OK); } @Override - public ResponseEntity getDistributionSetType( + public ResponseEntity getDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId) { final DistributionSetType foundType = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -103,7 +103,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity updateDistributionSetType( + public ResponseEntity updateDistributionSetType( @PathVariable("distributionSetTypeId") final Long distributionSetTypeId, @RequestBody final MgmtDistributionSetTypeRequestBodyPut restDistributionSetType) { final DistributionSetType type = findDistributionSetTypeWithExceptionIfNotFound(distributionSetTypeId); @@ -121,7 +121,7 @@ public class MgmtDistributionSetTypeResource implements MgmtDistributionSetTypeR } @Override - public ResponseEntity> createDistributionSetTypes( + public ResponseEntity> createDistributionSetTypes( @RequestBody final List distributionSetTypes) { final List createdSoftwareModules = distributionSetManagement.createDistributionSetTypes( diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java index ca4959810..10cd2db3b 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java @@ -10,25 +10,26 @@ package org.eclipse.hawkbit.mgmt.rest.resource; import java.io.IOException; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheConstants; import org.eclipse.hawkbit.cache.DownloadArtifactCache; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadRestApi; +import org.eclipse.hawkbit.rest.util.RequestResponseContextHolder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cache.Cache; import org.springframework.cache.Cache.ValueWrapper; +import org.springframework.context.annotation.Scope; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.context.WebApplicationContext; /** * A resource for download artifacts. @@ -37,6 +38,7 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController +@Scope(value = WebApplicationContext.SCOPE_REQUEST) public class MgmtDownloadResource implements MgmtDownloadRestApi { private static final Logger LOGGER = LoggerFactory.getLogger(MgmtDownloadResource.class); @@ -48,6 +50,9 @@ public class MgmtDownloadResource implements MgmtDownloadRestApi { @Qualifier(CacheConstants.DOWNLOAD_ID_CACHE) private Cache cache; + @Autowired + private RequestResponseContextHolder requestResponseContextHolder; + /** * Handles the GET request for downloading an artifact. * @@ -60,8 +65,7 @@ public class MgmtDownloadResource implements MgmtDownloadRestApi { */ @Override @ResponseBody - public ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId, - final HttpServletResponse response) { + public ResponseEntity downloadArtifactByDownloadId(@PathVariable("downloadId") final String downloadId) { try { final ValueWrapper cacheWrapper = cache.get(downloadId); if (cacheWrapper == null) { @@ -87,7 +91,8 @@ public class MgmtDownloadResource implements MgmtDownloadRestApi { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } try { - IOUtils.copy(artifact.getFileInputStream(), response.getOutputStream()); + IOUtils.copy(artifact.getFileInputStream(), + requestResponseContextHolder.getHttpServletResponse().getOutputStream()); } catch (final IOException e) { LOGGER.error("Cannot copy streams", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build(); diff --git a/hawkbit-repository/pom.xml b/hawkbit-repository/pom.xml index b70e00f28..28d20af3e 100644 --- a/hawkbit-repository/pom.xml +++ b/hawkbit-repository/pom.xml @@ -130,12 +130,6 @@ spring-context-support test - - org.eclipse.hawkbit - hawkbit-rest-api - ${project.version} - test - ru.yandex.qatools.allure allure-junit-adaptor diff --git a/pom.xml b/pom.xml index 0260683ba..a95832c79 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ hawkbit-autoconfigure hawkbit-cache-redis hawkbit-test-report - examples + From fd2312f0ffa7a94e60c66c16b029c42d56ca6119 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 26 Apr 2016 16:57:40 +0200 Subject: [PATCH 042/124] Changed feign client calls to keep client up when download failed Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/ddi/client/DdiExampleClient.java | 69 +++++++++++-------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index ad9f086bb..0303fe627 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -16,6 +16,7 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import org.eclipse.hawkbit.ddi.client.strategy.PersistenceStrategy; import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; @@ -41,9 +42,11 @@ public class DdiExampleClient implements Runnable { private final String controllerId; private Long actionIdOfLastInstalltion; - private final DdiDefaultFeignClient ddiDefaultFeignClient; + private final RootControllerResourceClient rootControllerResourceClient; private final PersistenceStrategy persistenceStrategy; - private STATUS clientStatus; + private DdiClientStatus clientStatus; + + private FinalResult finalReusltOfCurrentUpdate; /** * Constructor for the DDI example client. @@ -60,33 +63,34 @@ public class DdiExampleClient implements Runnable { public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, final PersistenceStrategy persistenceStrategy) { this.controllerId = controllerId; - this.ddiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); + this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant) + .getRootControllerResourceClient(); this.actionIdOfLastInstalltion = null; this.persistenceStrategy = persistenceStrategy; - this.clientStatus = STATUS.DOWN; + this.clientStatus = DdiClientStatus.DOWN; } @Override public void run() { - clientStatus = STATUS.UP; + clientStatus = DdiClientStatus.UP; ResponseEntity response; - while (clientStatus == STATUS.UP) { + while (clientStatus == DdiClientStatus.UP) { LOGGER.info(" Controller {} polling from hawkBit server", controllerId); - response = ddiDefaultFeignClient.getRootControllerResourceClient().getControllerBase(controllerId); - final String pollingTime = response.getBody().getConfig().getPolling().getSleep(); - final LocalTime localtime = LocalTime.parse(pollingTime); + response = rootControllerResourceClient.getControllerBase(controllerId); + final String pollingTimeFormReponse = response.getBody().getConfig().getPolling().getSleep(); + final LocalTime localtime = LocalTime.parse(pollingTimeFormReponse); final long pollingIntervalInMillis = localtime.toNanoOfDay(); final Link controllerDeploymentBaseLink = response.getBody().getLink("deploymentBase"); - if (controllerDeploymentBaseLink != null) { final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); final Integer resource = getResourceOutOfLink(controllerDeploymentBaseLink); if (actionId != actionIdOfLastInstalltion) { + finalReusltOfCurrentUpdate = FinalResult.NONE; startDownload(actionId, resource); + finishUpdateProcess(actionId); actionIdOfLastInstalltion = actionId; } } - try { Thread.sleep(pollingIntervalInMillis); } catch (final InterruptedException e) { @@ -99,12 +103,12 @@ public class DdiExampleClient implements Runnable { * Stop the DDI example client */ public void stop() { - clientStatus = STATUS.DOWN; + clientStatus = DdiClientStatus.DOWN; } private void startDownload(final Long actionId, final Integer resource) { - final ResponseEntity respone = ddiDefaultFeignClient.getRootControllerResourceClient() + final ResponseEntity respone = rootControllerResourceClient .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); final List chunks = ddiDeploymentBase.getDeployment().getChunks(); @@ -115,7 +119,9 @@ public class DdiExampleClient implements Runnable { final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); for (final DdiArtifact ddiArtifact : artifactList) { - downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); + if (finalReusltOfCurrentUpdate != FinalResult.FAILURE) { + downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); + } } } } @@ -126,39 +132,46 @@ public class DdiExampleClient implements Runnable { "Starting download of artifact " + artifact); LOGGER.info("Starting download of artifact " + artifact); - final ResponseEntity responseDownloadArtifact = ddiDefaultFeignClient - .getRootControllerResourceClient().downloadArtifact(controllerId, softwareModuleId, artifact); + final ResponseEntity responseDownloadArtifact = rootControllerResourceClient + .downloadArtifact(controllerId, softwareModuleId, artifact); final HttpStatus statsuCode = responseDownloadArtifact.getStatusCode(); LOGGER.info("Finished download with stataus {}", statsuCode); try { persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, + "Downloaded artifact " + artifact); } catch (final IOException e) { - sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.FAILURE, - "Downloaded of artifact " + artifact + " failed"); - return; + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, + "Downloaded of artifact " + artifact + "failed"); + finalReusltOfCurrentUpdate = FinalResult.FAILURE; } - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Downloaded artifact " + artifact); - simulateSuccessfulInstallation(actionId); } private void sendFeedBackMessage(final Long actionId, final ExecutionStatus executionStatus, final FinalResult finalResult, final String message) { - final DdiResult result = new DdiResult(finalResult, null); final List details = new ArrayList<>(); details.add(message); final DdiStatus ddiStatus = new DdiStatus(executionStatus, result, details); final String time = String.valueOf(LocalDateTime.now()); final DdiActionFeedback feedback = new DdiActionFeedback(actionId, time, ddiStatus); - ddiDefaultFeignClient.getRootControllerResourceClient().postBasedeploymentActionFeedback(feedback, controllerId, - actionId); + rootControllerResourceClient.postBasedeploymentActionFeedback(feedback, controllerId, actionId); LOGGER.info("Sent feedback message to HaktBit"); } - private void simulateSuccessfulInstallation(final Long actionId) { - sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.SUCESS, "Simulated installation successful"); + private void finishUpdateProcess(final Long actionId) { + + if (finalReusltOfCurrentUpdate == FinalResult.FAILURE) { + sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.FAILURE, "Error during update process"); + } + + if (finalReusltOfCurrentUpdate == FinalResult.NONE) { + sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.SUCESS, + "Simulated installation successful"); + } + } private Long getActionIdOutOfLink(final Link controllerDeploymentBaseLink) { @@ -180,8 +193,8 @@ public class DdiExampleClient implements Runnable { /** * Enum for DDI running status. */ - public enum STATUS { - + public enum DdiClientStatus { UP, DOWN; } + } From e5ddf075be5384d6fe828cf8c3e9b1503d5bad07 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 27 Apr 2016 08:39:12 +0200 Subject: [PATCH 043/124] remove leading slash of path, because other resources also don't have the leading slash Signed-off-by: Michael Hirsch --- .../hawkbit/mgmt/client/resource/MgmtTargetClientResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java index 5d043afe2..19f78a12f 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java @@ -17,5 +17,5 @@ import org.springframework.cloud.netflix.feign.FeignClient; @FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtTargetClientResource.PATH) public interface MgmtTargetClientResource extends MgmtTargetRestApi { - static String PATH = "/rest/v1/targets"; + static String PATH = "rest/v1/targets"; } From 3574bdcc585abcf4bf986f567a0cfbbf3a049a49 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 27 Apr 2016 11:22:42 +0200 Subject: [PATCH 044/124] add authentication intercepter for ddi-client to authenticate e.g. via security token, correct parsing server poll time Signed-off-by: Michael Hirsch --- .../ddi/client/DdiDefaultFeignClient.java | 11 ++++++ .../hawkbit/ddi/client/DdiExampleClient.java | 26 ++++++++++++-- .../AuthenticationInterceptor.java | 19 ++++++++++ .../AuthenticationInterceptorFactory.java | 34 ++++++++++++++++++ ...ecurityTokenAuthenticationInterceptor.java | 35 +++++++++++++++++++ 5 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index c9af1cb09..d156e8eb5 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -9,6 +9,7 @@ package org.eclipse.hawkbit.ddi.client; import org.apache.commons.lang.Validate; +import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import org.eclipse.hawkbit.feign.core.client.ApplicationJsonRequestHeaderInterceptor; import org.eclipse.hawkbit.feign.core.client.IgnoreMultipleConsumersProducersSpringMvcContract; @@ -31,10 +32,20 @@ public class DdiDefaultFeignClient { private final String tenant; public DdiDefaultFeignClient(final String baseUrl, final String tenant) { + this(baseUrl, tenant, null); + } + + public DdiDefaultFeignClient(final String baseUrl, final String tenant, + final AuthenticationInterceptor authenticationInterceptor) { feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()) .requestInterceptor(new DdiAcceptedRequestInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); + + if (authenticationInterceptor != null) { + feignBuilder.requestInterceptor(authenticationInterceptor); + } + Validate.notNull(baseUrl, "A baseUrl has to be set"); Validate.notNull(tenant, "A tenant has to be set"); this.baseUrl = baseUrl; diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index 0303fe627..6b407f74d 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -12,10 +12,12 @@ import java.io.IOException; import java.io.InputStream; import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.temporal.ChronoField; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; import org.eclipse.hawkbit.ddi.client.strategy.PersistenceStrategy; import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; @@ -62,8 +64,28 @@ public class DdiExampleClient implements Runnable { */ public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, final PersistenceStrategy persistenceStrategy) { + this(baseUrl, controllerId, tenant, persistenceStrategy, null); + } + + /** + * Constructor for the DDI example client. + * + * @param baseUrl + * the base url of the hawkBit server + * @param controllerId + * the controller id that will be simulated + * @param tenant + * the tenant + * @param persistenceStrategy + * the persistence strategy for downloading artifacts + * @param authenticationInterceptor + * the authentication intercepter to authenticate the DDI client, + * might be {@code null} + */ + public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, + final PersistenceStrategy persistenceStrategy, final AuthenticationInterceptor authenticationInterceptor) { this.controllerId = controllerId; - this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant) + this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant, authenticationInterceptor) .getRootControllerResourceClient(); this.actionIdOfLastInstalltion = null; this.persistenceStrategy = persistenceStrategy; @@ -79,7 +101,7 @@ public class DdiExampleClient implements Runnable { response = rootControllerResourceClient.getControllerBase(controllerId); final String pollingTimeFormReponse = response.getBody().getConfig().getPolling().getSleep(); final LocalTime localtime = LocalTime.parse(pollingTimeFormReponse); - final long pollingIntervalInMillis = localtime.toNanoOfDay(); + final long pollingIntervalInMillis = localtime.getLong(ChronoField.MILLI_OF_DAY); final Link controllerDeploymentBaseLink = response.getBody().getLink("deploymentBase"); if (controllerDeploymentBaseLink != null) { final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java new file mode 100644 index 000000000..f1a746c1b --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java @@ -0,0 +1,19 @@ +/** + * 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.client.authenctication; + +import feign.RequestInterceptor; + +/** + * An DdiClient authentication intercepter to provide credential information + * e.g. in http-headers. + */ +public interface AuthenticationInterceptor extends RequestInterceptor { + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java new file mode 100644 index 000000000..5d2fb6706 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java @@ -0,0 +1,34 @@ +/** + * 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.client.authenctication; + +/** + * A factory to create {@link AuthenticationInterceptor}s. + */ +public class AuthenticationInterceptorFactory { + + private AuthenticationInterceptorFactory() { + // factory class no public constructor + } + + /** + * Creates a new {@link AuthenticationInterceptor} to authenticate a + * Ddi-Client via a target-security-token HTTP authorization header. + * + * @param targetSecurityToken + * the target-security-token to be added to the HTTP + * 'TargetToken' authorization header + * @return the authentication interceptor which can be used to authenticate + * an Ddi-Client + */ + public static AuthenticationInterceptor createTargetSecurityAuthenticator(final String targetSecurityToken) { + return new TargetSecurityTokenAuthenticationInterceptor(targetSecurityToken); + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java new file mode 100644 index 000000000..93559dd6d --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java @@ -0,0 +1,35 @@ +/** + * 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.client.authenctication; + +import com.google.common.net.HttpHeaders; + +import feign.RequestTemplate; + +/** + * Implementation of the {@link AuthenticationInterceptor} to add a given + * target-security-token to the HTTP authorization header. + */ +class TargetSecurityTokenAuthenticationInterceptor implements AuthenticationInterceptor { + + private final String targetSecurityToken; + + /** + * @param targetSecurityToken + * the security token to add to the authorization header + */ + TargetSecurityTokenAuthenticationInterceptor(final String targetSecurityToken) { + this.targetSecurityToken = targetSecurityToken; + } + + @Override + public void apply(final RequestTemplate template) { + template.header(HttpHeaders.AUTHORIZATION, "TargetToken " + targetSecurityToken); + } +} From 6cbbcffc9d036ca59c00392d265e973bc078d12c Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 27 Apr 2016 11:38:50 +0200 Subject: [PATCH 045/124] Added inputstream download not on disk and final result validation. Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/ddi/client/DdiExampleClient.java | 23 +++++++++++-------- .../strategy/DoNotSaveArtifactsStrategy.java | 5 +++- .../strategy/SaveArtifactsStrategy.java | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index 0303fe627..129fd422d 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -45,8 +45,8 @@ public class DdiExampleClient implements Runnable { private final RootControllerResourceClient rootControllerResourceClient; private final PersistenceStrategy persistenceStrategy; private DdiClientStatus clientStatus; - - private FinalResult finalReusltOfCurrentUpdate; + private final DdiDefaultFeignClient sdiDefaultFeignClient; + private FinalResult finalResultOfCurrentUpdate; /** * Constructor for the DDI example client. @@ -63,13 +63,18 @@ public class DdiExampleClient implements Runnable { public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, final PersistenceStrategy persistenceStrategy) { this.controllerId = controllerId; - this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant) - .getRootControllerResourceClient(); + sdiDefaultFeignClient = new DdiDefaultFeignClient(baseUrl, tenant); + + this.rootControllerResourceClient = sdiDefaultFeignClient.getRootControllerResourceClient(); this.actionIdOfLastInstalltion = null; this.persistenceStrategy = persistenceStrategy; this.clientStatus = DdiClientStatus.DOWN; } + public DdiDefaultFeignClient getSdiDefaultFeignClient() { + return sdiDefaultFeignClient; + } + @Override public void run() { clientStatus = DdiClientStatus.UP; @@ -85,7 +90,7 @@ public class DdiExampleClient implements Runnable { final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); final Integer resource = getResourceOutOfLink(controllerDeploymentBaseLink); if (actionId != actionIdOfLastInstalltion) { - finalReusltOfCurrentUpdate = FinalResult.NONE; + finalResultOfCurrentUpdate = FinalResult.NONE; startDownload(actionId, resource); finishUpdateProcess(actionId); actionIdOfLastInstalltion = actionId; @@ -119,7 +124,7 @@ public class DdiExampleClient implements Runnable { final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); for (final DdiArtifact ddiArtifact : artifactList) { - if (finalReusltOfCurrentUpdate != FinalResult.FAILURE) { + if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); } } @@ -144,7 +149,7 @@ public class DdiExampleClient implements Runnable { } catch (final IOException e) { sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Downloaded of artifact " + artifact + "failed"); - finalReusltOfCurrentUpdate = FinalResult.FAILURE; + finalResultOfCurrentUpdate = FinalResult.FAILURE; } } @@ -163,11 +168,11 @@ public class DdiExampleClient implements Runnable { private void finishUpdateProcess(final Long actionId) { - if (finalReusltOfCurrentUpdate == FinalResult.FAILURE) { + if (finalResultOfCurrentUpdate == FinalResult.FAILURE) { sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.FAILURE, "Error during update process"); } - if (finalReusltOfCurrentUpdate == FinalResult.NONE) { + if (finalResultOfCurrentUpdate == FinalResult.NONE) { sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.SUCESS, "Simulated installation successful"); } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java index 80743c99e..447885715 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java @@ -19,7 +19,10 @@ public class DoNotSaveArtifactsStrategy implements PersistenceStrategy { @Override public void handleInputStream(final InputStream in, final String artifactName) throws IOException { - // do nothing + + while (in.read() != -1) { + ; + } } } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java index 2ae7987cb..2908ee29f 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java @@ -26,7 +26,7 @@ public class SaveArtifactsStrategy implements PersistenceStrategy { @Override public void handleInputStream(final InputStream in, final String artifactName) throws IOException { final File tempDir = Files.createTempDir(); - final File file = new File(tempDir + "\\" + artifactName); + final File file = new File(tempDir, artifactName); final OutputStream out = new FileOutputStream(file); ByteStreams.copy(in, out); } From a288fb1476991179b4cf4f2e47214243d631438f Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 27 Apr 2016 15:02:09 +0200 Subject: [PATCH 046/124] New names for persistenceArtifactStrategy interfaces and implementations Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/ddi/client/DdiExampleClient.java | 36 +++++++++++-------- ...java => ArtifactsPersistenceStrategy.java} | 2 +- ...sStrategy.java => DoNotSaveArtifacts.java} | 4 +-- ... SaveArtifactsToLocalTempDirectories.java} | 4 +-- .../hawkbit/example/ddi/client/AppTest.java | 6 ++-- 5 files changed, 29 insertions(+), 23 deletions(-) rename examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/{PersistenceStrategy.java => ArtifactsPersistenceStrategy.java} (94%) rename examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/{DoNotSaveArtifactsStrategy.java => DoNotSaveArtifacts.java} (80%) rename examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/{SaveArtifactsStrategy.java => SaveArtifactsToLocalTempDirectories.java} (84%) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index 190ea622b..5945fef5d 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -19,7 +19,7 @@ import java.util.regex.Pattern; import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; -import org.eclipse.hawkbit.ddi.client.strategy.PersistenceStrategy; +import org.eclipse.hawkbit.ddi.client.strategy.ArtifactsPersistenceStrategy; import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.eclipse.hawkbit.ddi.json.model.DdiChunk; @@ -45,12 +45,12 @@ public class DdiExampleClient implements Runnable { private final String controllerId; private Long actionIdOfLastInstalltion; private final RootControllerResourceClient rootControllerResourceClient; - private final PersistenceStrategy persistenceStrategy; + private final ArtifactsPersistenceStrategy persistenceStrategy; private DdiClientStatus clientStatus; - + private FinalResult finalResultOfCurrentUpdate; - /** + /** * Constructor for the DDI example client. * * @param baseUrl @@ -63,7 +63,7 @@ public class DdiExampleClient implements Runnable { * the persistence strategy for downloading artifacts */ public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final PersistenceStrategy persistenceStrategy) { + final ArtifactsPersistenceStrategy persistenceStrategy) { this(baseUrl, controllerId, tenant, persistenceStrategy, null); } @@ -83,7 +83,7 @@ public class DdiExampleClient implements Runnable { * might be {@code null} */ public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final PersistenceStrategy persistenceStrategy, final AuthenticationInterceptor authenticationInterceptor) { + final ArtifactsPersistenceStrategy persistenceStrategy, final AuthenticationInterceptor authenticationInterceptor) { this.controllerId = controllerId; this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant, authenticationInterceptor) .getRootControllerResourceClient(); @@ -129,26 +129,32 @@ public class DdiExampleClient implements Runnable { } private void startDownload(final Long actionId, final Integer resource) { - final ResponseEntity respone = rootControllerResourceClient .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); final List chunks = ddiDeploymentBase.getDeployment().getChunks(); for (final DdiChunk chunk : chunks) { final List artifactList = chunk.getArtifacts(); - final Link downloadLink = ddiDeploymentBase.getDeployment().getChunks().get(0).getArtifacts().get(0) - .getLink("download-http"); - final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); - final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); - for (final DdiArtifact ddiArtifact : artifactList) { - if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { - downloadArtifact(actionId, softwareModuleId, ddiArtifact.getFilename()); + if (artifactList.isEmpty()) { + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, + "No artifacts to download for softwaremodule " + chunk.getName()); + } else { + for (final DdiArtifact ddiArtifact : artifactList) { + if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { + downloadArtifact(actionId, ddiArtifact); + } } } + } } - private void downloadArtifact(final Long actionId, final Long softwareModuleId, final String artifact) { + private void downloadArtifact(final Long actionId, final DdiArtifact ddiArtifact) { + + final String artifact = ddiArtifact.getFilename(); + final Link downloadLink = ddiArtifact.getLink("download-http"); + final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); + final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Starting download of artifact " + artifact); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java similarity index 94% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java rename to examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java index e5a3a60d0..347b01bcc 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/PersistenceStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java @@ -14,7 +14,7 @@ import java.io.InputStream; /** * Interface of persistence strategy. */ -public interface PersistenceStrategy { +public interface ArtifactsPersistenceStrategy { /** * Method handling the artifact download. diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java similarity index 80% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java rename to examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java index 447885715..7e5d72c4a 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java @@ -12,10 +12,10 @@ import java.io.IOException; import java.io.InputStream; /** - * Implementation of {@link PersistenceStrategy} for not downloading any + * Implementation of {@link ArtifactsPersistenceStrategy} for not downloading any * artifacts. */ -public class DoNotSaveArtifactsStrategy implements PersistenceStrategy { +public class DoNotSaveArtifacts implements ArtifactsPersistenceStrategy { @Override public void handleInputStream(final InputStream in, final String artifactName) throws IOException { diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java similarity index 84% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java rename to examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java index 2908ee29f..11ac5698b 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java @@ -18,10 +18,10 @@ import com.google.common.io.ByteStreams; import com.google.common.io.Files; /** - * Implementation of {@link PersistenceStrategy} for downloading artifacts to + * Implementation of {@link ArtifactsPersistenceStrategy} for downloading artifacts to * the temp directory. */ -public class SaveArtifactsStrategy implements PersistenceStrategy { +public class SaveArtifactsToLocalTempDirectories implements ArtifactsPersistenceStrategy { @Override public void handleInputStream(final InputStream in, final String artifactName) throws IOException { diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index 2644f9d28..13eaa66d3 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -1,7 +1,7 @@ package org.eclipse.hawkbit.example.ddi.client; import org.eclipse.hawkbit.ddi.client.DdiExampleClient; -import org.eclipse.hawkbit.ddi.client.strategy.SaveArtifactsStrategy; +import org.eclipse.hawkbit.ddi.client.strategy.SaveArtifactsToLocalTempDirectories; import org.junit.Test; /** @@ -11,8 +11,8 @@ public class AppTest { @Test public void AppTest() { - final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "Einstein15", "DEFAULT", - new SaveArtifactsStrategy()); + final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "Einstein17", "DEFAULT", + new SaveArtifactsToLocalTempDirectories()); final Thread thread = new Thread(ddiClient); thread.run(); From 906321218d79b99f7de87392526322000ae7aa4a Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 27 Apr 2016 15:25:39 +0200 Subject: [PATCH 047/124] Extend rest enitity builder Signed-off-by: SirWayne --- .../builder/DistributionSetBuilder.java | 16 +++++++-- .../builder/DistributionSetTypeBuilder.java | 27 ++++++++++---- .../resource/builder/RolloutBuilder.java | 14 +++++++- .../builder/SoftwareModuleBuilder.java | 36 +++++++++++++++---- 4 files changed, 77 insertions(+), 16 deletions(-) diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java index 56c0ddbf8..d1b3fad35 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java @@ -24,6 +24,7 @@ public class DistributionSetBuilder { private String name; private String version; private String type; + private String description; private final List modules = new ArrayList<>(); /** @@ -63,10 +64,20 @@ public class DistributionSetBuilder { return this; } + /** + * @param description + * the description + * @return the builder itself + */ + public DistributionSetBuilder description(final String description) { + this.description = description; + return this; + } + /** * Builds a list with a single entry of - * {@link MgmtDistributionSetRequestBodyPost} which can directly be used to post - * on the RESTful-API. + * {@link MgmtDistributionSetRequestBodyPost} which can directly be used to + * post on the RESTful-API. * * @return a single entry list of {@link MgmtDistributionSetRequestBodyPost} */ @@ -98,6 +109,7 @@ public class DistributionSetBuilder { body.setName(prefixName); body.setVersion(version); body.setType(type); + body.setDescription(description); body.setModules(modules); return body; } diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java index 909e08470..e08240de3 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java @@ -25,6 +25,7 @@ public class DistributionSetTypeBuilder { private String key; private String name; + private String description; private final List mandatorymodules = Lists.newArrayList(); private final List optionalmodules = Lists.newArrayList(); @@ -48,6 +49,16 @@ public class DistributionSetTypeBuilder { return this; } + /** + * @param description + * the description + * @return the builder itself + */ + public DistributionSetTypeBuilder description(final String description) { + this.description = description; + return this; + } + /** * @param softwareModuleTypeIds * the IDs of the software module types which should be mandatory @@ -81,20 +92,21 @@ public class DistributionSetTypeBuilder { /** * Builds a list with a single entry of - * {@link MgmtDistributionSetTypeRequestBodyPost} which can directly be used in - * the RESTful-API. + * {@link MgmtDistributionSetTypeRequestBodyPost} which can directly be used + * in the RESTful-API. * - * @return a single entry list of {@link MgmtDistributionSetTypeRequestBodyPost} + * @return a single entry list of + * {@link MgmtDistributionSetTypeRequestBodyPost} */ public List build() { return Lists.newArrayList(doBuild(name, key)); } /** - * Builds a list of multiple {@link MgmtDistributionSetTypeRequestBodyPost} to - * create multiple distribution set types at once. An increasing number will - * be added to the name and key of the distribution set type. The optional - * and mandatory software module types will remain the same. + * Builds a list of multiple {@link MgmtDistributionSetTypeRequestBodyPost} + * to create multiple distribution set types at once. An increasing number + * will be added to the name and key of the distribution set type. The + * optional and mandatory software module types will remain the same. * * @param count * the amount of distribution sets type body which should be @@ -114,6 +126,7 @@ public class DistributionSetTypeBuilder { final MgmtDistributionSetTypeRequestBodyPost body = new MgmtDistributionSetTypeRequestBodyPost(); body.setKey(prefixKey); body.setName(prefixName); + body.setDescription(description); body.setMandatorymodules(mandatorymodules); body.setOptionalmodules(optionalmodules); return body; diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java index e9f8431d8..9ba378192 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java @@ -9,8 +9,8 @@ package org.eclipse.hawkbit.mgmt.client.resource.builder; import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition; -import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutCondition.Condition; +import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; /** * @@ -25,6 +25,7 @@ public class RolloutBuilder { private long distributionSetId; private String successThreshold; private String errorThreshold; + private String description; /** * @param name @@ -57,6 +58,16 @@ public class RolloutBuilder { return this; } + /** + * @param description + * the description + * @return the builder itself + */ + public RolloutBuilder description(final String description) { + this.description = description; + return this; + } + /** * @param distributionSetId * the ID of the distribution set to assign to the target in the @@ -105,6 +116,7 @@ public class RolloutBuilder { body.setAmountGroups(groupSize); body.setTargetFilterQuery(targetFilterQuery); body.setDistributionSetId(distributionSetId); + body.setDescription(description); body.setSuccessCondition(new MgmtRolloutCondition(Condition.THRESHOLD, successThreshold)); body.setErrorCondition(new MgmtRolloutCondition(Condition.THRESHOLD, errorThreshold)); return body; diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java index d1b38b2b6..6f243d08a 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java @@ -26,6 +26,8 @@ public class SoftwareModuleBuilder { private String name; private String version; private String type; + private String vendor; + private String description; /** * @param name @@ -58,10 +60,30 @@ public class SoftwareModuleBuilder { return this; } + /** + * @param vendor + * the vendor + * @return the builder itself + */ + public SoftwareModuleBuilder vendor(final String vendor) { + this.vendor = vendor; + return this; + } + + /** + * @param description + * the description + * @return the builder itself + */ + public SoftwareModuleBuilder description(final String description) { + this.description = description; + return this; + } + /** * Builds a list with a single entry of - * {@link MgmtSoftwareModuleRequestBodyPost} which can directly be used in the - * RESTful-API. + * {@link MgmtSoftwareModuleRequestBodyPost} which can directly be used in + * the RESTful-API. * * @return a single entry list of {@link MgmtSoftwareModuleRequestBodyPost} */ @@ -70,10 +92,10 @@ public class SoftwareModuleBuilder { } /** - * Builds a list of multiple {@link MgmtSoftwareModuleRequestBodyPost} to create - * multiple software module at once. An increasing number will be added to - * the name of the software module. The version and type will remain the - * same. + * Builds a list of multiple {@link MgmtSoftwareModuleRequestBodyPost} to + * create multiple software module at once. An increasing number will be + * added to the name of the software module. The version and type will + * remain the same. * * @param count * the amount of software module body which should be created @@ -93,6 +115,8 @@ public class SoftwareModuleBuilder { body.setName(prefixName); body.setVersion(version); body.setType(type); + body.setVendor(vendor); + body.setDescription(description); return body; } From 3851a6c1dfae45511d407ec03efdcfea55da99cb Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 27 Apr 2016 16:47:14 +0200 Subject: [PATCH 048/124] Fixed sonar issues and added javadoc Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 18 +++++----- .../client/DdiAcceptedRequestInterceptor.java | 27 --------------- .../hawkbit/ddi/client/DdiDecoder.java | 11 +++--- .../ddi/client/DdiDefaultFeignClient.java | 26 ++++++++++---- .../hawkbit/ddi/client/DdiExampleClient.java | 34 +++++++++++-------- .../RootControllerResourceClient.java | 5 +-- ...RootControllerResourceClientConstants.java | 21 ++++++++++++ .../ArtifactsPersistenceStrategy.java | 1 + 8 files changed, 75 insertions(+), 68 deletions(-) delete mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index c6acefb00..661d59f8f 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -73,16 +73,14 @@ 2.5 - com.google.guava - guava - - - commons-lang - commons-lang - 2.3 - - - + com.google.guava + guava + + + commons-lang + commons-lang + 2.3 + diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java deleted file mode 100644 index 3e82618c0..000000000 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiAcceptedRequestInterceptor.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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.client; - -import org.springframework.http.MediaType; - -import feign.RequestInterceptor; -import feign.RequestTemplate; - -/** - * - * - */ -public class DdiAcceptedRequestInterceptor implements RequestInterceptor { - - @Override - public void apply(final RequestTemplate template) { - template.header("Accept", MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_OCTET_STREAM_VALUE, - MediaType.TEXT_PLAIN_VALUE); - } -} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java index 47a59a667..79f0758e0 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java @@ -20,9 +20,7 @@ import org.springframework.http.ResponseEntity; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import feign.FeignException; import feign.Response; -import feign.codec.DecodeException; import feign.codec.Decoder; import feign.jackson.JacksonDecoder; @@ -32,8 +30,9 @@ import feign.jackson.JacksonDecoder; */ public class DdiDecoder implements Decoder { - ObjectMapper mapper; - private final String octentTypeOctetStream = "[application/octet-stream]"; + private static final String OCTET_STREAM = "[application/octet-stream]"; + + private final ObjectMapper mapper; public DdiDecoder() { mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -41,11 +40,11 @@ public class DdiDecoder implements Decoder { } @Override - public Object decode(final Response response, final Type type) throws IOException, DecodeException, FeignException { + public Object decode(final Response response, final Type type) throws IOException { final Map> header = response.headers(); final String contentType = String.valueOf(header.get("Content-Type")); - if (contentType.equals(octentTypeOctetStream)) { + if (contentType.equals(OCTET_STREAM)) { return ResponseEntity.ok(response.body().asInputStream()); } final ResponseEntityDecoder responseEntityDecoder = new ResponseEntityDecoder(new JacksonDecoder(mapper)); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java index d156e8eb5..e579c07b5 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java @@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ddi.client; import org.apache.commons.lang.Validate; import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; +import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClientConstants; import org.eclipse.hawkbit.feign.core.client.ApplicationJsonRequestHeaderInterceptor; import org.eclipse.hawkbit.feign.core.client.IgnoreMultipleConsumersProducersSpringMvcContract; @@ -26,26 +27,39 @@ import feign.jackson.JacksonEncoder; public class DdiDefaultFeignClient { private RootControllerResourceClient rootControllerResourceClient; - private final Builder feignBuilder; private final String baseUrl; private final String tenant; + /** + * Constructor for default DDI feign client with no authentication. + * + * @param baseUrl + * the base url of the client + * @param tenant + * the tenant + */ public DdiDefaultFeignClient(final String baseUrl, final String tenant) { this(baseUrl, tenant, null); } + /** + * Constructor for default DDI feign client with authentication. + * + * @param baseUrl + * the base url of the client + * @param tenant + * the tenant + * @param authenticationInterceptor + */ public DdiDefaultFeignClient(final String baseUrl, final String tenant, final AuthenticationInterceptor authenticationInterceptor) { feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) - .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()) - .requestInterceptor(new DdiAcceptedRequestInterceptor()).logLevel(Level.FULL) + .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); - if (authenticationInterceptor != null) { feignBuilder.requestInterceptor(authenticationInterceptor); } - Validate.notNull(baseUrl, "A baseUrl has to be set"); Validate.notNull(tenant, "A tenant has to be set"); this.baseUrl = baseUrl; @@ -69,7 +83,7 @@ public class DdiDefaultFeignClient { public RootControllerResourceClient getRootControllerResourceClient() { if (rootControllerResourceClient == null) { - String rootControllerResourcePath = this.baseUrl + RootControllerResourceClient.PATH; + String rootControllerResourcePath = this.baseUrl + RootControllerResourceClientConstants.PATH; rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, rootControllerResourcePath); diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java index 5945fef5d..2c0421067 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java @@ -47,7 +47,6 @@ public class DdiExampleClient implements Runnable { private final RootControllerResourceClient rootControllerResourceClient; private final ArtifactsPersistenceStrategy persistenceStrategy; private DdiClientStatus clientStatus; - private FinalResult finalResultOfCurrentUpdate; /** @@ -83,7 +82,8 @@ public class DdiExampleClient implements Runnable { * might be {@code null} */ public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final ArtifactsPersistenceStrategy persistenceStrategy, final AuthenticationInterceptor authenticationInterceptor) { + final ArtifactsPersistenceStrategy persistenceStrategy, + final AuthenticationInterceptor authenticationInterceptor) { this.controllerId = controllerId; this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant, authenticationInterceptor) .getRootControllerResourceClient(); @@ -130,22 +130,25 @@ public class DdiExampleClient implements Runnable { private void startDownload(final Long actionId, final Integer resource) { final ResponseEntity respone = rootControllerResourceClient - .getControllerBasedeploymentAction(controllerId, Long.valueOf(actionId), Integer.valueOf(resource)); + .getControllerBasedeploymentAction(controllerId, actionId, resource); final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); final List chunks = ddiDeploymentBase.getDeployment().getChunks(); for (final DdiChunk chunk : chunks) { - final List artifactList = chunk.getArtifacts(); - if (artifactList.isEmpty()) { - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "No artifacts to download for softwaremodule " + chunk.getName()); - } else { - for (final DdiArtifact ddiArtifact : artifactList) { - if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { - downloadArtifact(actionId, ddiArtifact); - } - } - } + downloadArtifacts(chunk, actionId); + } + } + private void downloadArtifacts(final DdiChunk chunk, final Long actionId) { + final List artifactList = chunk.getArtifacts(); + if (artifactList.isEmpty()) { + sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, + "No artifacts to download for softwaremodule " + chunk.getName()); + return; + } + for (final DdiArtifact ddiArtifact : artifactList) { + if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { + downloadArtifact(actionId, ddiArtifact); + } } } @@ -170,8 +173,9 @@ public class DdiExampleClient implements Runnable { sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, "Downloaded artifact " + artifact); } catch (final IOException e) { + LOGGER.error("Download of artifact failed", e); sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "Downloaded of artifact " + artifact + "failed"); + "Download of artifact " + artifact + "failed"); finalResultOfCurrentUpdate = FinalResult.FAILURE; } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java index 76867af98..db41a6e86 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java @@ -14,10 +14,7 @@ import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the Rootcontroller resource of the DDI API. */ - -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + RootControllerResourceClient.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + RootControllerResourceClientConstants.PATH) public interface RootControllerResourceClient extends DdiRootControllerRestApi { - static String PATH = "{tenant}/controller/v1"; - } diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java new file mode 100644 index 000000000..d902c2da0 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + */ +package org.eclipse.hawkbit.ddi.client.resource; + +/** + * + * Constants for RootController resource client. + */ +public class RootControllerResourceClientConstants { + + public static final String PATH = "{tenant}/controller/v1"; + + /** + * Default constructor. + */ + private RootControllerResourceClientConstants() { + + } + +} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java index 347b01bcc..d7e99522e 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java @@ -14,6 +14,7 @@ import java.io.InputStream; /** * Interface of persistence strategy. */ +@FunctionalInterface public interface ArtifactsPersistenceStrategy { /** From f86f615c917dc334c28dd20858f340ac594e9b10 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 27 Apr 2016 17:34:07 +0200 Subject: [PATCH 049/124] Set MediaTye json for file upload Signed-off-by: SirWayne --- .../hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index eb601487b..dab8cc594 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -53,7 +53,8 @@ public interface MgmtSoftwareModuleRestApi { * failure the JsonResponseExceptionHandler is handling the * response. */ - @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts") + @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts", produces = { + "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @RequestParam("file") final MultipartFile file, @RequestParam(value = "filename", required = false) final String optionalFileName, From a958576e2e2aae05ee49773fecc735ab189ebcaf Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 28 Apr 2016 07:39:36 +0200 Subject: [PATCH 050/124] Moved dependencies to parent pom and added missing dependency Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/pom.xml | 1 - .../resource/RootControllerResourceClientConstants.java | 2 +- .../org/eclipse/hawkbit/example/ddi/client/AppTest.java | 2 +- pom.xml | 8 ++++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 661d59f8f..88e262d79 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -79,7 +79,6 @@ commons-lang commons-lang - 2.3 diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java index d902c2da0..0611c4a09 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java @@ -12,7 +12,7 @@ public class RootControllerResourceClientConstants { public static final String PATH = "{tenant}/controller/v1"; /** - * Default constructor. + * Private constructor to prevent instantiation. */ private RootControllerResourceClientConstants() { diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java index 13eaa66d3..92bd7c75b 100644 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java @@ -11,7 +11,7 @@ public class AppTest { @Test public void AppTest() { - final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "Einstein17", "DEFAULT", + final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "Einstein21", "DEFAULT", new SaveArtifactsToLocalTempDirectories()); final Thread thread = new Thread(ddiClient); thread.run(); diff --git a/pom.xml b/pom.xml index a95832c79..69a49a042 100644 --- a/pom.xml +++ b/pom.xml @@ -106,6 +106,7 @@ 1.1 1.1.1 3.4 + 2.3 20141113 2.0.0 @@ -552,13 +553,16 @@ - org.apache.commons commons-lang3 ${commons-lang3.version} - + + commons-lang + commons-lang + ${commons.lang} + org.springframework.boot spring-boot-starter-test From f5ee78bb954c221c23d1c9208fe18c4344d95eed Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 28 Apr 2016 07:44:14 +0200 Subject: [PATCH 051/124] Removed test class and added missing dependency Signed-off-by: Jonathan Philip Knoblauch --- .../hawkbit/example/ddi/client/AppTest.java | 22 ------------------- .../hawkbit-example-feign-core-client/pom.xml | 4 ++++ 2 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java diff --git a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java b/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java deleted file mode 100644 index 92bd7c75b..000000000 --- a/examples/hawkbit-example-ddi-client/src/test/java/org/eclipse/hawkbit/example/ddi/client/AppTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.hawkbit.example.ddi.client; - -import org.eclipse.hawkbit.ddi.client.DdiExampleClient; -import org.eclipse.hawkbit.ddi.client.strategy.SaveArtifactsToLocalTempDirectories; -import org.junit.Test; - -/** - * Unit test for simple App. - */ -public class AppTest { - - @Test - public void AppTest() { - final DdiExampleClient ddiClient = new DdiExampleClient("http://localhost:8080/", "Einstein21", "DEFAULT", - new SaveArtifactsToLocalTempDirectories()); - final Thread thread = new Thread(ddiClient); - thread.run(); - - System.out.println("next steps........................"); - } - -} diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 91f6c53c1..0c08fa774 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -43,5 +43,9 @@ org.springframework.cloud spring-cloud-starter-feign + + org.slf4j + slf4j-api + From d7d48df47d8f579c0bb2c0df5aeced0cfc87855b Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 09:50:48 +0200 Subject: [PATCH 052/124] Fix dependencies Signed-off-by: SirWayne --- examples/hawkbit-mgmt-api-client/pom.xml | 5 ----- examples/pom.xml | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index 1b7ff72ec..b42f1c335 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -102,11 +102,6 @@ org.springframework.boot spring-boot-starter-logging - - com.google.collections - google-collections - 1.0-rc2 - org.springframework.boot spring-boot-configuration-processor diff --git a/examples/pom.xml b/examples/pom.xml index ae10dac0c..df660580a 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -22,10 +22,11 @@ pom + hawkbit-example-feign-core-client hawkbit-device-simulator hawkbit-example-app hawkbit-mgmt-api-client - hawkbit-example-ddi-client + hawkbit-example-ddi-client \ No newline at end of file From 306b0ae8058ce82420ce052042960123ee7deb94 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 10:35:20 +0200 Subject: [PATCH 053/124] Fix dependencies Signed-off-by: SirWayne --- examples/hawkbit-mgmt-api-client/pom.xml | 8 ++++---- .../java/org/eclipse/hawkbit/mgmt/client/Application.java | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-mgmt-api-client/pom.xml index b42f1c335..1ea36626b 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-mgmt-api-client/pom.xml @@ -98,10 +98,10 @@ org.springframework.cloud spring-cloud-starter-feign - - org.springframework.boot - spring-boot-starter-logging - + + + + org.springframework.boot spring-boot-configuration-processor diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java index 15d6ff10a..74f9deda0 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java +++ b/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java @@ -8,6 +8,7 @@ */ package org.eclipse.hawkbit.mgmt.client; +import org.eclipse.hawkbit.feign.core.client.FeignClientConfiguration; import org.eclipse.hawkbit.mgmt.client.scenarios.CreateStartedRolloutExample; import org.eclipse.hawkbit.mgmt.client.scenarios.GettingStartedDefaultScenario; import org.springframework.beans.factory.annotation.Autowired; @@ -18,6 +19,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.cloud.netflix.feign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import feign.auth.BasicAuthRequestInterceptor; @@ -25,6 +27,7 @@ import feign.auth.BasicAuthRequestInterceptor; @EnableFeignClients @EnableConfigurationProperties(ClientConfigurationProperties.class) @Configuration +@Import(FeignClientConfiguration.class) public class Application implements CommandLineRunner { @Autowired From a23da8202f6788ce53507414ae06d6bc433db5b5 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 12:44:13 +0200 Subject: [PATCH 054/124] 1. Rename mgmt api client 2. Split the spring boot application and the client api resources to 2 projects Signed-off-by: SirWayne --- .../core/client/FeignClientConfiguration.java | 6 ++ .../.gitignore | 0 examples/hawkbit-example-mgmt-client/pom.xml | 59 +++++++++++++++++++ .../MgmtDistributionSetClientResource.java | 0 .../MgmtDistributionSetTagClientResource.java | 0 ...MgmtDistributionSetTypeClientResource.java | 0 .../MgmtDownloadArtifactClientResource.java | 0 .../resource/MgmtDownloadClientResource.java | 0 .../resource/MgmtRolloutClientResource.java | 0 .../MgmtSoftwareModuleClientResource.java | 0 .../MgmtSoftwareModuleTypeClientResource.java | 0 .../resource/MgmtTargetClientResource.java | 0 .../resource/MgmtTargetTagClientResource.java | 0 .../client/resource/SystemClientResource.java | 0 .../SystemManagementClientResource.java | 0 .../builder/DistributionSetBuilder.java | 0 .../builder/DistributionSetTypeBuilder.java | 0 .../resource/builder/RolloutBuilder.java | 0 .../SoftwareModuleAssigmentBuilder.java | 0 .../builder/SoftwareModuleBuilder.java | 0 .../builder/SoftwareModuleTypeBuilder.java | 0 .../client/resource/builder/TagBuilder.java | 0 .../resource/builder/TargetBuilder.java | 0 .../CreateStartedRolloutExample.java | 2 - .../GettingStartedDefaultScenario.java | 2 - .../.gitignore | 3 + .../README.md | 0 .../pom.xml | 22 ++----- .../hawkbit/mgmt/client/Application.java | 12 ++++ .../client/ClientConfigurationProperties.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 0 examples/pom.xml | 3 +- 33 files changed, 88 insertions(+), 21 deletions(-) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/.gitignore (100%) create mode 100644 examples/hawkbit-example-mgmt-client/pom.xml rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java (98%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java (99%) create mode 100644 examples/hawkbit-example-mgmt-spring-client/.gitignore rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/README.md (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/pom.xml (84%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java (87%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/src/main/resources/application.properties (100%) rename examples/{hawkbit-mgmt-api-client => hawkbit-example-mgmt-spring-client}/src/main/resources/logback.xml (100%) diff --git a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java index dc926cdbf..2723a251e 100644 --- a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java +++ b/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java @@ -8,16 +8,22 @@ */ package org.eclipse.hawkbit.feign.core.client; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.cloud.netflix.feign.FeignClientsConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import feign.Contract; +import feign.Feign; /** * * */ @Configuration +@ConditionalOnClass(Feign.class) +@Import(FeignClientsConfiguration.class) public class FeignClientConfiguration { @Bean diff --git a/examples/hawkbit-mgmt-api-client/.gitignore b/examples/hawkbit-example-mgmt-client/.gitignore similarity index 100% rename from examples/hawkbit-mgmt-api-client/.gitignore rename to examples/hawkbit-example-mgmt-client/.gitignore diff --git a/examples/hawkbit-example-mgmt-client/pom.xml b/examples/hawkbit-example-mgmt-client/pom.xml new file mode 100644 index 000000000..c566441de --- /dev/null +++ b/examples/hawkbit-example-mgmt-client/pom.xml @@ -0,0 +1,59 @@ + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-examples-parent + 0.2.0-SNAPSHOT + + jar + hawkbit-example-mgmt-client + hawkBit Management client API + + + + org.eclipse.hawkbit + hawkbit-example-feign-core-client + ${project.version} + + + org.eclipse.hawkbit + hawkbit-mgmt-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-system-api + ${project.version} + + + com.netflix.feign + feign-core + + 8.14.2 + + + com.netflix.feign + feign-jackson + 8.14.2 + + + com.fasterxml.jackson.core + jackson-databind + + + hibernate-validator + org.hibernate + + + \ No newline at end of file diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java similarity index 98% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java index 2fd81736c..90d61471e 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java @@ -28,13 +28,11 @@ 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.stereotype.Component; /** * Example for creating and starting a Rollout. * */ -@Component public class CreateStartedRolloutExample { /* known software module type name and key */ diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java similarity index 99% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java rename to examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java index 77b426a2f..fdb824e8e 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java @@ -25,14 +25,12 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModule import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; /** * * Default getting started scenario. * */ -@Component public class GettingStartedDefaultScenario { private static final Logger LOGGER = LoggerFactory.getLogger(GettingStartedDefaultScenario.class); diff --git a/examples/hawkbit-example-mgmt-spring-client/.gitignore b/examples/hawkbit-example-mgmt-spring-client/.gitignore new file mode 100644 index 000000000..4b9b73073 --- /dev/null +++ b/examples/hawkbit-example-mgmt-spring-client/.gitignore @@ -0,0 +1,3 @@ +/target/ +/bin/ +/.apt_generated/ diff --git a/examples/hawkbit-mgmt-api-client/README.md b/examples/hawkbit-example-mgmt-spring-client/README.md similarity index 100% rename from examples/hawkbit-mgmt-api-client/README.md rename to examples/hawkbit-example-mgmt-spring-client/README.md diff --git a/examples/hawkbit-mgmt-api-client/pom.xml b/examples/hawkbit-example-mgmt-spring-client/pom.xml similarity index 84% rename from examples/hawkbit-mgmt-api-client/pom.xml rename to examples/hawkbit-example-mgmt-spring-client/pom.xml index 1ea36626b..975423a7f 100644 --- a/examples/hawkbit-mgmt-api-client/pom.xml +++ b/examples/hawkbit-example-mgmt-spring-client/pom.xml @@ -17,7 +17,7 @@ 0.2.0-SNAPSHOT jar - hawkbit-mgmt-api-client + hawkbit-example-mgmt-spring-client hawkBit Management API example client @@ -57,17 +57,7 @@ org.eclipse.hawkbit - hawkbit-example-feign-core-client - ${project.version} - - - org.eclipse.hawkbit - hawkbit-mgmt-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-system-api + hawkbit-example-mgmt-client ${project.version} @@ -98,10 +88,10 @@ org.springframework.cloud spring-cloud-starter-feign - - - - + + org.springframework.boot + spring-boot-starter-logging + org.springframework.boot spring-boot-configuration-processor diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java b/examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java similarity index 87% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java rename to examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java index 74f9deda0..7e1f191a9 100644 --- a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java +++ b/examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java @@ -13,6 +13,7 @@ import org.eclipse.hawkbit.mgmt.client.scenarios.CreateStartedRolloutExample; import org.eclipse.hawkbit.mgmt.client.scenarios.GettingStartedDefaultScenario; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -27,6 +28,7 @@ import feign.auth.BasicAuthRequestInterceptor; @EnableFeignClients @EnableConfigurationProperties(ClientConfigurationProperties.class) @Configuration +@AutoConfigureAfter(FeignClientConfiguration.class) @Import(FeignClientConfiguration.class) public class Application implements CommandLineRunner { @@ -60,6 +62,16 @@ public class Application implements CommandLineRunner { return new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword()); } + @Bean + public GettingStartedDefaultScenario gettingStartedDefaultScenario() { + return new GettingStartedDefaultScenario(); + } + + @Bean + public CreateStartedRolloutExample createStartedRolloutExample() { + return new CreateStartedRolloutExample(); + } + private boolean containsArg(final String containsArg, final String... args) { for (final String arg : args) { if (arg.equalsIgnoreCase(containsArg)) { diff --git a/examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java b/examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java rename to examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java diff --git a/examples/hawkbit-mgmt-api-client/src/main/resources/application.properties b/examples/hawkbit-example-mgmt-spring-client/src/main/resources/application.properties similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/resources/application.properties rename to examples/hawkbit-example-mgmt-spring-client/src/main/resources/application.properties diff --git a/examples/hawkbit-mgmt-api-client/src/main/resources/logback.xml b/examples/hawkbit-example-mgmt-spring-client/src/main/resources/logback.xml similarity index 100% rename from examples/hawkbit-mgmt-api-client/src/main/resources/logback.xml rename to examples/hawkbit-example-mgmt-spring-client/src/main/resources/logback.xml diff --git a/examples/pom.xml b/examples/pom.xml index df660580a..3006c6f31 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -25,7 +25,8 @@ hawkbit-example-feign-core-client hawkbit-device-simulator hawkbit-example-app - hawkbit-mgmt-api-client + hawkbit-example-mgmt-client + hawkbit-example-mgmt-spring-client hawkbit-example-ddi-client From 3c46c8902fbebed7f428a248e00df062641a3db6 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 12:58:27 +0200 Subject: [PATCH 055/124] Add examples to pom Signed-off-by: SirWayne --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a49a042..479bb074e 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ hawkbit-autoconfigure hawkbit-cache-redis hawkbit-test-report - + examples From 1e6f9b5747b41cb0d1e81782597f3e5ed797af52 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 13:18:27 +0200 Subject: [PATCH 056/124] Add dependency Signed-off-by: SirWayne --- examples/hawkbit-example-mgmt-client/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/hawkbit-example-mgmt-client/pom.xml b/examples/hawkbit-example-mgmt-client/pom.xml index c566441de..77b914696 100644 --- a/examples/hawkbit-example-mgmt-client/pom.xml +++ b/examples/hawkbit-example-mgmt-client/pom.xml @@ -36,6 +36,10 @@ hawkbit-system-api ${project.version} + + com.google.guava + guava + com.netflix.feign feign-core From 474a496e8dbd7cfaf5f1625a6969a8c45be26ef1 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 28 Apr 2016 14:18:26 +0200 Subject: [PATCH 057/124] Added README.md Signed-off-by: Jonathan Philip Knoblauch --- examples/hawkbit-example-ddi-client/README.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/hawkbit-example-ddi-client/README.md diff --git a/examples/hawkbit-example-ddi-client/README.md b/examples/hawkbit-example-ddi-client/README.md new file mode 100644 index 000000000..7463e5fd0 --- /dev/null +++ b/examples/hawkbit-example-ddi-client/README.md @@ -0,0 +1,30 @@ +# Eclipse.IoT hawkBit - Example DDI Client + +The hawkBit Example DDI Client is an implementation of a simulated device/controller that communicates with the hawkBit server via the DDI API. + +# Compile, Run and Getting Started + +#### Build hawkbit-example-ddi-client + +``` +$ cd hawkbit/examples/hawkbit-example-ddi-client +$ mvn clean install +``` + +#### Run hawkBit Example DDI Client + +Start the [hawkBit example app](../hawkbit-example-app). + +Create an instance of the hawkBit Example DDI Client and run it as thread e.g. in the ExecutorService. + +``` +DdiExampleClient ddiExampleClient = new DdiExampleClient("http://localhost:8080/", "controllerIdName", "DEFAULT", new DoNotSaveArtifacts()); +ExecutorService executorService = Executors.newFixedThreadPool(1); +executorService.execute(ddiExampleClient); +``` + +#### Getting started with hawkBit Example DDI Client + +After the hawkBit Example DDI Client has started it will poll once against the given hawkBit server and form then on depending on your polling configuration. +Once the hawkBit Example DDI Client has polled successful your will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. + From 8e8545092f7240a0ef0a09687e0a0b4fd558e4df Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 28 Apr 2016 14:42:04 +0200 Subject: [PATCH 058/124] Updated README.md for examples Signed-off-by: Jonathan Philip Knoblauch --- examples/README.md | 7 +++++-- examples/hawkbit-example-ddi-client/README.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index 0d6e0c18a..de9cbcab8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,8 +2,11 @@ Example projects that show how _hawkBit_ can be used to create, run or access an _hawkBit_ empowered update server. +- `hawkbit-custom-theme-example` : Example for a customized theme for Management UI. - `hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options. - `hawkbit-example-app` : Allows you to run a Spring Boot and hawkBit based update server. Includes all _hawkBit_ interfaces, i.e. DDI, DMF, Mgmt-API, Mgmt-UI. -- `hawkbit-custom-theme-example` : Example for a customized theme for Management UI. -- `hawkbit-mgmt-api-client` : Example client for the _hawkBit_ Management API. +- `hawkbit-example-ddi-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API. +- `hawkbit-example-feign-core-client` : Core resources for the examples. +- `hawkbit-example-mgmt-client` : Example client for the _hawkBit_ Management API +- `hawkbit-example-mgmt-spring-client` : Example client for the _hawkBit_ Management API based on Spring boot. diff --git a/examples/hawkbit-example-ddi-client/README.md b/examples/hawkbit-example-ddi-client/README.md index 7463e5fd0..7d4301fbb 100644 --- a/examples/hawkbit-example-ddi-client/README.md +++ b/examples/hawkbit-example-ddi-client/README.md @@ -26,5 +26,5 @@ executorService.execute(ddiExampleClient); #### Getting started with hawkBit Example DDI Client After the hawkBit Example DDI Client has started it will poll once against the given hawkBit server and form then on depending on your polling configuration. -Once the hawkBit Example DDI Client has polled successful your will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. +After the hawkBit Example DDI Client has polled successful your will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. From a6386ecdff8f9a382d9cec816737d7e747c31e02 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 16:20:14 +0200 Subject: [PATCH 059/124] Remove unused dependencies Signed-off-by: SirWayne --- hawkbit-rest-core/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml index 2275a74a1..ab322d6e9 100644 --- a/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest-core/pom.xml @@ -35,14 +35,6 @@ tomcat-embed-core provided - - org.springframework.data - spring-data-commons - - - org.springframework - spring-web - From f5cf4d811fd70f6b0a262c9dc59a6d94d187c83c Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 16:23:07 +0200 Subject: [PATCH 060/124] Remove unused dependencies Signed-off-by: SirWayne --- .../hawkbit-example-feign-core-client/pom.xml | 69 +++++++------------ hawkbit-rest-core/pom.xml | 13 +++- 2 files changed, 34 insertions(+), 48 deletions(-) diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 0c08fa774..5aca58f05 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -1,51 +1,30 @@ + - 4.0.0 - - org.eclipse.hawkbit - hawkbit-examples-parent - 0.2.0-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.eclipse.hawkbit + hawkbit-examples-parent + 0.2.0-SNAPSHOT + - hawkbit-example-feign-core-client - hawkbit-example-feign-core-client + hawkbit-example-feign-core-client + hawkbit-example-feign-core-client - - - - org.springframework.cloud - spring-cloud-netflix - 1.0.7.RELEASE - pom - import - - - - - - com.netflix.feign - feign-core - - - 8.14.2 - - - com.netflix.feign - feign-jackson - 8.14.2 - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.cloud - spring-cloud-starter-feign - - - org.slf4j - slf4j-api + + + com.netflix.feign + feign-core - + diff --git a/hawkbit-rest-core/pom.xml b/hawkbit-rest-core/pom.xml index ab322d6e9..a4a421f0d 100644 --- a/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest-core/pom.xml @@ -1,6 +1,13 @@ - + 4.0.0 From 5b9e6ddb9df47d1eacbfa56cebd86af86b423267 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Thu, 28 Apr 2016 16:26:44 +0200 Subject: [PATCH 061/124] Updates Readme.md Signed-off-by: Jonathan Philip Knoblauch --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0a9b0b4c6..ee6c27c3d 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,29 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v # Modules -`hawkbit-core` : core elements. -`hawkbit-security-core` : core security elements. -`hawkbit-security-integration` : security integration elements to integrate security into hawkbit. -`hawkbit-artifact-repository-mongo` : artifact repository implementation to mongoDB. -`hawkbit-autoconfigure` : spring-boot auto-configuration. + +`examples` : HawkBit examples +`hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. +`hawkbit-autoconfigure` : Spring-boot auto-configuration. +`hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. +`hawkbit-core` : Core elements. +`hawkbit-ddi-api` : The hawkBit DDI API. +`hawkbit-ddi-resource` : Implementation of the hawkBit DDI API +`hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. `hawkbit-dmf-api` : API for the Device Management Integration. -`hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. -`hawkbit-repository` : repository implemenation based on SQL for all meta-data. -`hawkbit-http-security` : implementation for security filters for HTTP. -`hawkbit-rest-api` : API classes for the REST Management API. -`hawkbit-rest-resource` : HTTP REST endpoints for the Management and the Direct Device API. +`hawkbit-http-security` : Implementation for security filters for HTTP. +`hawkbit-mgmt-api` : The hawkBit Management API +`hawkbit-mgmt-resource` : Implementation of the hawkBit Management API +`hawkbit-repository` : Repository implementation based on SQL for all meta-data. +`hawkbit-rest-core` : Core elements for the rest modules. +`hawkbit-security-core` : Core security elements. +`hawkbit-security-integration` : Security integration elements to integrate security into hawkbit. +`hawkbit-system-api` : The hawkBit System API +`hawkbit-system-resource` : Implementation of the hawkBit System API +`hawkbit-test-report` : Test reports `hawkbit-ui` : Vaadin UI. -`hawkbit-cache-redis` : spring cache manager configuration and implementation with redis, distributed cache and distributed events. + + + + + From aefdcdfbcdc60c3d652dde41893df4f966bf63c5 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 16:42:20 +0200 Subject: [PATCH 062/124] Remove unused dependencies Signed-off-by: SirWayne --- .../hawkbit-example-feign-core-client/pom.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 5aca58f05..5fb983236 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -25,6 +25,21 @@ com.netflix.feign feign-core + + 8.14.2 + + + org.springframework + spring-web + + + org.springframework.cloud + spring-cloud-netflix-core + 1.0.7.RELEASE + + + org.slf4j + slf4j-api From 2b1bfd83ab11c5a846c6c61dda7cc4c935fcfc35 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 18:17:11 +0200 Subject: [PATCH 063/124] Add feign slf4j Signed-off-by: SirWayne --- examples/hawkbit-example-feign-core-client/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 5fb983236..4f29a198d 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -38,8 +38,9 @@ 1.0.7.RELEASE - org.slf4j - slf4j-api + com.netflix.feign + feign-slf4j + 8.14.2 From 4560856e895defb6acb676e4f57f5380f2ca923c Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 18:30:31 +0200 Subject: [PATCH 064/124] Add feign version into examples parent pom Signed-off-by: SirWayne --- examples/hawkbit-example-ddi-client/pom.xml | 6 ---- .../hawkbit-example-feign-core-client/pom.xml | 3 -- examples/hawkbit-example-mgmt-client/pom.xml | 2 -- .../pom.xml | 4 --- examples/pom.xml | 29 +++++++++++++++++++ 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 88e262d79..02841d0c6 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -41,16 +41,10 @@ com.netflix.feign feign-core - - - 8.14.2 com.netflix.feign feign-jackson - - - 8.14.2 javax.servlet diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 4f29a198d..49c08fd9c 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -25,8 +25,6 @@ com.netflix.feign feign-core - - 8.14.2 org.springframework @@ -40,7 +38,6 @@ com.netflix.feign feign-slf4j - 8.14.2 diff --git a/examples/hawkbit-example-mgmt-client/pom.xml b/examples/hawkbit-example-mgmt-client/pom.xml index 77b914696..446ee55da 100644 --- a/examples/hawkbit-example-mgmt-client/pom.xml +++ b/examples/hawkbit-example-mgmt-client/pom.xml @@ -44,12 +44,10 @@ com.netflix.feign feign-core - 8.14.2 com.netflix.feign feign-jackson - 8.14.2 com.fasterxml.jackson.core diff --git a/examples/hawkbit-example-mgmt-spring-client/pom.xml b/examples/hawkbit-example-mgmt-spring-client/pom.xml index 975423a7f..73f7ba248 100644 --- a/examples/hawkbit-example-mgmt-spring-client/pom.xml +++ b/examples/hawkbit-example-mgmt-spring-client/pom.xml @@ -63,18 +63,14 @@ com.netflix.feign feign-core - - 8.14.2 com.netflix.feign feign-jackson - 8.14.2 com.fasterxml.jackson.core jackson-databind - 2.5.5 hibernate-validator diff --git a/examples/pom.xml b/examples/pom.xml index 3006c6f31..32356e8a6 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -29,5 +29,34 @@ hawkbit-example-mgmt-spring-client hawkbit-example-ddi-client + + + + 8.14.2 + + + + + + com.netflix.feign + feign-core + + + ${feign.version} + + + com.netflix.feign + feign-jackson + + + ${feign.version} + + + com.netflix.feign + feign-slf4j + ${feign.version} + + + \ No newline at end of file From 37e576103a3a16630372b9196265d1dbfad58a09 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 28 Apr 2016 18:38:19 +0200 Subject: [PATCH 065/124] Add feign version into examples parent pom Signed-off-by: SirWayne --- examples/hawkbit-example-feign-core-client/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 49c08fd9c..5514db95d 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -34,6 +34,10 @@ org.springframework.cloud spring-cloud-netflix-core 1.0.7.RELEASE + + + org.slf4j + slf4j-api com.netflix.feign From f33c8c05e2c33ba07b870014e6601bd60afc3dae Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 3 May 2016 12:52:53 +0200 Subject: [PATCH 066/124] Add download server api Signed-off-by: SirWayne --- examples/hawkbit-custom-theme-example/pom.xml | 2 +- examples/hawkbit-example-app/pom.xml | 2 +- hawkbit-autoconfigure/pom.xml | 2 +- hawkbit-ddi-api/pom.xml | 5 --- .../ddi/rest/api/DdiRestConstants.java | 28 +++--------- hawkbit-ddi-dl-api/pom.xml | 29 +++++++++++++ .../DdiDlArtifactStoreControllerRestApi.java | 26 ++++-------- .../ddi/dl/rest/api/DdiDlRestConstants.java | 40 ++++++++++++++++++ hawkbit-ddi-resource/pom.xml | 5 +++ .../rest/resource/DataConversionHelper.java | 7 +-- .../resource/DdiArtifactStoreController.java | 4 +- {hawkbit-ui => hawkbit-mgmt-ui}/.gitignore | 0 {hawkbit-ui => hawkbit-mgmt-ui}/pom.xml | 2 +- .../src/main/.gitignore | 0 .../push/AsyncVaadinServletConfiguration.java | 0 .../SpringSecurityAtmosphereInterceptor.java | 0 .../repository/OffsetBasedPageRequest.java | 0 .../repository/SpPermissionChecker.java | 0 .../eclipse/hawkbit/ui/AppWidgetSet.gwt.xml | 0 .../eclipse/hawkbit/ui/DefaultHawkbitUI.java | 0 .../hawkbit/ui/DispatcherRunnable.java | 0 .../org/eclipse/hawkbit/ui/ErrorView.java | 0 .../hawkbit/ui/HawkbitEventProvider.java | 0 .../org/eclipse/hawkbit/ui/HawkbitUI.java | 0 .../eclipse/hawkbit/ui/UIEventProvider.java | 0 .../org/eclipse/hawkbit/ui/UiProperties.java | 0 .../ui/artifacts/UploadArtifactView.java | 0 .../artifacts/UploadArtifactViewMenuItem.java | 0 .../artifacts/details/ArtifactBeanQuery.java | 0 .../details/ArtifactDetailsLayout.java | 0 .../artifacts/event/ArtifactDetailsEvent.java | 0 .../ui/artifacts/event/SMFilterEvent.java | 0 .../artifacts/event/SoftwareModuleEvent.java | 0 .../event/SoftwareModuleTypeEvent.java | 0 .../event/UploadArtifactUIEvent.java | 0 .../event/UploadViewAcceptCriteria.java | 0 .../footer/SMDeleteActionsLayout.java | 0 .../UploadViewConfirmationWindowLayout.java | 0 .../smtable/BaseSwModuleBeanQuery.java | 0 .../smtable/ProxyBaseSoftwareModuleItem.java | 0 .../SoftwareModuleAddUpdateWindow.java | 0 .../smtable/SoftwareModuleDetails.java | 0 .../smtable/SoftwareModuleTable.java | 0 .../smtable/SoftwareModuleTableHeader.java | 0 .../smtable/SoftwareModuleTableLayout.java | 0 .../CreateUpdateSoftwareTypeLayout.java | 0 .../smtype/SMTypeFilterButtonClick.java | 0 .../artifacts/smtype/SMTypeFilterButtons.java | 0 .../artifacts/smtype/SMTypeFilterHeader.java | 0 .../artifacts/smtype/SMTypeFilterLayout.java | 0 .../artifacts/state/ArtifactUploadState.java | 0 .../ui/artifacts/state/CustomFile.java | 0 .../state/SoftwareModuleFilters.java | 0 .../upload/UploadConfirmationwindow.java | 0 .../ui/artifacts/upload/UploadHandler.java | 0 .../ui/artifacts/upload/UploadLayout.java | 0 .../artifacts/upload/UploadResultWindow.java | 0 .../ui/artifacts/upload/UploadStatus.java | 0 .../upload/UploadStatusInfoWindow.java | 0 .../ui/common/AbstractAcceptCriteria.java | 0 .../hawkbit/ui/common/ConfirmationDialog.java | 0 .../hawkbit/ui/common/CoordinatesToColor.java | 0 .../common/DistributionSetTypeBeanQuery.java | 0 .../ui/common/ManagmentEntityState.java | 0 .../common/SoftwareModuleTypeBeanQuery.java | 0 .../AbstractConfirmationWindowLayout.java | 0 .../confirmwindow/layout/ConfirmationTab.java | 0 .../layout/ConfirmationWindowEvents.java | 0 ...amedVersionedEntityTableDetailsLayout.java | 0 .../AbstractTableDetailsLayout.java | 0 .../SoftwareModuleDetailsTable.java | 0 .../AbstractFilterButtonClickBehaviour.java | 0 .../filterlayout/AbstractFilterButtons.java | 0 .../filterlayout/AbstractFilterHeader.java | 0 .../filterlayout/AbstractFilterLayout.java | 0 .../AbstractFilterMultiButtonClick.java | 0 .../AbstractFilterSingleButtonClick.java | 0 .../footer/AbstractDeleteActionsLayout.java | 0 .../hawkbit/ui/common/grid/AbstractGrid.java | 0 .../ui/common/grid/AbstractGridHeader.java | 0 .../ui/common/grid/AbstractGridLayout.java | 0 .../table/AbstractNamedVersionTable.java | 0 .../ui/common/table/AbstractTable.java | 0 .../ui/common/table/AbstractTableHeader.java | 0 .../ui/common/table/AbstractTableLayout.java | 0 .../ui/common/table/BaseEntityEvent.java | 0 .../ui/common/table/BaseEntityEventType.java | 0 .../common/tagdetails/AbstractTagToken.java | 0 .../tagdetails/AbstractTargetTagToken.java | 0 .../tagdetails/DistributionTagToken.java | 0 .../ui/common/tagdetails/TargetTagToken.java | 0 .../components/DistributionSetInfoPanel.java | 0 .../ui/components/ProxyDistribution.java | 0 .../hawkbit/ui/components/ProxyTarget.java | 0 .../ui/components/ProxyTargetFilter.java | 0 .../ui/components/SPNotificationMessage.java | 0 .../components/SPTargetAttributesLayout.java | 0 .../hawkbit/ui/components/SPUIButton.java | 0 .../hawkbit/ui/components/SPUICheckBox.java | 0 .../ui/components/SPUIComponentProvider.java | 0 .../ui/components/SPUIErrorHandler.java | 0 .../ui/components/SPUIHorizontalLayout.java | 0 .../hawkbit/ui/components/SPUITabSheet.java | 0 .../components/SPUITableHorizonatlLayout.java | 0 .../ui/components/SPUIUpdateLogLayout.java | 0 .../CustomRendererWidgetSet.gwt.xml | 0 .../client/HtmlButtonRendererConnector.java | 0 .../client/HtmlLabelRendererConnector.java | 0 .../client/LinkRendererConnector.java | 0 .../client/renderers/HtmlButtonRenderer.java | 0 .../client/renderers/HtmlLabelRenderer.java | 0 .../client/renderers/LinkRenderer.java | 0 .../renderers/HtmlButtonRenderer.java | 0 .../renderers/HtmlLabelRenderer.java | 0 .../renderers/LinkRenderer.java | 0 .../ui/decorators/SPUIButtonDecorator.java | 0 .../SPUIButtonStyleLargeIconNoBorder.java | 0 .../SPUIButtonStylePrimarySmall.java | 0 .../ui/decorators/SPUIButtonStyleSmall.java | 0 .../SPUIButtonStyleSmallNoBorder.java | 0 .../SPUIButtonStyleSmallNoBorderUH.java | 0 .../SPUIButtonStyleSmallNoBorderUHS.java | 0 .../ui/decorators/SPUIButtonStyleTiny.java | 0 .../ui/decorators/SPUIComboBoxDecorator.java | 0 .../ui/decorators/SPUIEmbedDecorator.java | 0 .../hawkbit/ui/decorators/SPUIEmbedValue.java | 0 .../decorators/SPUIHeaderLayoutDecorator.java | 0 .../ui/decorators/SPUILabelDecorator.java | 0 .../ui/decorators/SPUITagButtonStyle.java | 0 .../ui/decorators/SPUITextAreaDecorator.java | 0 .../ui/decorators/SPUITextFieldDecorator.java | 0 .../ui/decorators/SPUIWindowDecorator.java | 0 .../ui/distributions/DistributionsView.java | 0 .../DistributionsViewMenuItem.java | 0 .../CreateUpdateDistSetTypeLayout.java | 0 .../disttype/DSTypeFilterButtonClick.java | 0 .../disttype/DSTypeFilterButtons.java | 0 .../disttype/DSTypeFilterHeader.java | 0 .../disttype/DSTypeFilterLayout.java | 0 .../dstable/DistributionSetDetails.java | 0 .../dstable/DistributionSetTable.java | 0 .../dstable/DistributionSetTableHeader.java | 0 .../dstable/DistributionSetTableLayout.java | 0 .../dstable/ManageDistBeanQuery.java | 0 .../event/DistributionSetTypeEvent.java | 0 .../event/DistributionsUIEvent.java | 0 .../DistributionsViewAcceptCriteria.java | 0 .../ui/distributions/event/DragEvent.java | 0 .../event/SaveActionWindowEvent.java | 0 .../SoftwareModuleAssignmentDiscardEvent.java | 0 .../distributions/event/SwModuleUIEvent.java | 0 .../footer/DSDeleteActionsLayout.java | 0 ...DistributionsConfirmationWindowLayout.java | 0 .../smtable/ProxyBaseSwModuleItem.java | 0 .../smtable/SwModuleBeanQuery.java | 0 .../smtable/SwModuleDetails.java | 0 .../distributions/smtable/SwModuleTable.java | 0 .../smtable/SwModuleTableHeader.java | 0 .../smtable/SwModuleTableLayout.java | 0 .../smtype/DistSMTypeFilterButtonClick.java | 0 .../smtype/DistSMTypeFilterButtons.java | 0 .../smtype/DistSMTypeFilterHeader.java | 0 .../smtype/DistSMTypeFilterLayout.java | 0 .../state/ManageDistFilters.java | 0 .../state/ManageDistUIState.java | 0 .../state/ManageSoftwareModuleFilters.java | 0 .../hawkbit/ui/filter/FilterExpression.java | 0 .../eclipse/hawkbit/ui/filter/Filters.java | 0 .../ui/filter/target/CustomTargetFilter.java | 0 .../filter/target/TargetSearchTextFilter.java | 0 .../ui/filter/target/TargetStatusFilter.java | 0 .../ui/filter/target/TargetTagFilter.java | 0 .../CreateOrUpdateFilterHeader.java | 0 .../CreateOrUpdateFilterTable.java | 0 .../CustomTargetBeanQuery.java | 0 .../FilterManagementView.java | 0 .../FilterManagementViewMenuItem.java | 0 .../FilterQueryValidation.java | 0 .../TargetFilterBeanQuery.java | 0 .../filtermanagement/TargetFilterHeader.java | 0 .../filtermanagement/TargetFilterTable.java | 0 .../ui/filtermanagement/TokenDescription.java | 0 .../ui/filtermanagement/ValidationResult.java | 0 .../event/CustomFilterUIEvent.java | 0 .../footer/TargetFilterCountMessageLabel.java | 0 .../state/FilterManagementUIState.java | 0 .../hawkbit/ui/login/HawkbitLoginUI.java | 0 .../eclipse/hawkbit/ui/login/LoginView.java | 0 .../hawkbit/ui/management/DeploymentView.java | 0 .../ui/management/DeploymentViewMenuItem.java | 0 .../actionhistory/ActionHistoryComponent.java | 0 .../actionhistory/ActionHistoryHeader.java | 0 .../actionhistory/ActionHistoryTable.java | 0 .../DistributionAddUpdateWindowLayout.java | 0 .../dstable/DistributionBeanQuery.java | 0 .../dstable/DistributionDetails.java | 0 .../management/dstable/DistributionTable.java | 0 .../dstable/DistributionTableHeader.java | 0 .../dstable/DistributionTableLayout.java | 0 ...eateUpdateDistributionTagLayoutWindow.java | 0 .../dstag/DistributionTagBeanQuery.java | 0 .../dstag/DistributionTagButtonClick.java | 0 .../dstag/DistributionTagButtons.java | 0 .../dstag/DistributionTagHeader.java | 0 .../dstag/DistributionTagLayout.java | 0 .../event/BulkUploadPopupEvent.java | 0 .../BulkUploadValidationMessageEvent.java | 0 .../event/DistributionTableEvent.java | 0 .../event/DistributionTableFilterEvent.java | 0 .../event/DistributionTagDropEvent.java | 0 .../ui/management/event/DragEvent.java | 0 .../management/event/ManagementUIEvent.java | 0 .../event/ManagementViewAcceptCriteria.java | 0 .../ui/management/event/PinUnpinEvent.java | 0 .../event/SaveActionWindowEvent.java | 0 .../event/TargetAddUpdateWindowEvent.java | 0 .../management/event/TargetFilterEvent.java | 0 .../ui/management/event/TargetTableEvent.java | 0 .../footer/ActionTypeOptionGroupLayout.java | 0 .../management/footer/CountMessageLabel.java | 0 .../footer/DeleteActionsLayout.java | 0 .../footer/DeleteActionsLayoutHelper.java | 0 .../ManangementConfirmationWindowLayout.java | 0 .../state/DistributionTableFilters.java | 0 .../management/state/ManagementUIState.java | 0 .../ui/management/state/TargetBulkUpload.java | 0 .../state/TargetFilterParameters.java | 0 .../management/state/TargetTableFilters.java | 0 .../management/tag/CreateUpdateTagLayout.java | 0 .../hawkbit/ui/management/tag/ProxyTag.java | 0 .../management/tag/SpColorPickerPreview.java | 0 .../hawkbit/ui/management/tag/TagIdName.java | 0 .../targettable/BulkUploadHandler.java | 0 .../TargetAddUpdateWindowLayout.java | 0 .../targettable/TargetBeanQuery.java | 0 .../targettable/TargetBulkTokenTags.java | 0 .../TargetBulkUpdateWindowLayout.java | 0 .../management/targettable/TargetDetails.java | 0 .../management/targettable/TargetTable.java | 0 .../targettable/TargetTableHeader.java | 0 .../targettable/TargetTableLayout.java | 0 .../AbstractTargetTagFilterLayout.java | 0 .../CreateUpdateTargetTagLayout.java | 0 .../CustomTargetTagFilterButtonClick.java | 0 .../targettag/FilterByStatusLayout.java | 0 .../targettag/MultipleTargetFilter.java | 0 .../targettag/TargetFilterQueryButtons.java | 0 .../targettag/TargetTagBeanQuery.java | 0 .../targettag/TargetTagFilterButtonClick.java | 0 .../targettag/TargetTagFilterButtons.java | 0 .../targettag/TargetTagFilterHeader.java | 0 .../targettag/TargetTagFilterLayout.java | 0 .../hawkbit/ui/menu/DashboardEvent.java | 0 .../hawkbit/ui/menu/DashboardMenu.java | 0 .../hawkbit/ui/menu/DashboardMenuItem.java | 0 .../ui/push/DelayedEventBusPushStrategy.java | 0 .../hawkbit/ui/push/EventPushStrategy.java | 0 .../ui/rollout/DistributionBarHelper.java | 0 .../hawkbit/ui/rollout/RolloutView.java | 0 .../ui/rollout/RolloutViewMenuItem.java | 0 .../hawkbit/ui/rollout/StatusFontIcon.java | 0 .../ui/rollout/event/RolloutEvent.java | 0 .../rollout/AddUpdateRolloutWindowLayout.java | 0 .../rollout/DistributionBeanQuery.java | 0 .../ui/rollout/rollout/ProxyRollout.java | 0 .../ui/rollout/rollout/RolloutBeanQuery.java | 0 .../ui/rollout/rollout/RolloutListGrid.java | 0 .../ui/rollout/rollout/RolloutListHeader.java | 0 .../ui/rollout/rollout/RolloutListView.java | 0 .../rolloutgroup/ProxyRolloutGroup.java | 0 .../rolloutgroup/RolloutGroupBeanQuery.java | 0 .../rolloutgroup/RolloutGroupListGrid.java | 0 .../rolloutgroup/RolloutGroupsListHeader.java | 0 .../rolloutgroup/RolloutGroupsListView.java | 0 .../RolloutGroupTargetsBeanQuery.java | 0 .../RolloutGroupTargetsCountLabelMessage.java | 0 .../RolloutGroupTargetsListGrid.java | 0 .../RolloutGroupTargetsListHeader.java | 0 .../RolloutGroupTargetsListView.java | 0 .../ui/rollout/state/RolloutUIState.java | 0 .../AuthenticationConfigurationView.java | 0 .../BaseConfigurationView.java | 0 .../ConfigurationGroup.java | 0 .../ConfigurationItem.java | 0 .../DefaultDistributionSetTypeLayout.java | 0 .../PollingConfigurationView.java | 0 .../TenantConfigurationDashboardView.java | 0 ...antConfigurationDashboardViewMenuItem.java | 0 ...AuthenticationTenantConfigurationItem.java | 0 ...wnloadAuthenticationConfigurationItem.java | 0 .../AuthenticationConfigurationItem.java | 0 ...ficateAuthenticationConfigurationItem.java | 0 ...yTokenAuthenticationConfigurationItem.java | 0 ...yTokenAuthenticationConfigurationItem.java | 0 .../polling/DurationConfigField.java | 0 .../polling/DurationField.java | 0 .../hawkbit/ui/themes/HawkbitTheme.java | 0 .../hawkbit/ui/utils/HawkbitCommonUtil.java | 0 .../org/eclipse/hawkbit/ui/utils/I18N.java | 0 .../hawkbit/ui/utils/NamingThreadFactory.java | 0 .../hawkbit/ui/utils/NotificationMessage.java | 0 .../hawkbit/ui/utils/SPDateTimeUtil.java | 0 .../ui/utils/SPUIButtonDefinitions.java | 0 .../ui/utils/SPUIComponetIdProvider.java | 0 .../hawkbit/ui/utils/SPUIDefinitions.java | 0 .../ui/utils/SPUILabelDefinitions.java | 0 .../ui/utils/SPUIStyleDefinitions.java | 0 .../ui/utils/SPUITargetDefinitions.java | 0 .../hawkbit/ui/utils/SpringContextHelper.java | 0 .../eclipse/hawkbit/ui/utils/TableColumn.java | 0 .../hawkbit/ui/utils/UINotification.java | 0 .../src/main/resources/VAADIN/.gitignore | 0 .../VAADIN/themes/hawkbit/.gitignore | 0 .../hawkbit/customstyles/accordion.scss | 0 .../hawkbit/customstyles/action-history.scss | 0 .../hawkbit/customstyles/artifact-upload.scss | 0 .../hawkbit/customstyles/colorpicker.scss | 0 .../themes/hawkbit/customstyles/common.scss | 0 .../hawkbit/customstyles/dashboardview.scss | 0 .../hawkbit/customstyles/drop-hint.scss | 0 .../customstyles/filter-layout-styles.scss | 0 .../hawkbit/customstyles/filter-status.scss | 0 .../hawkbit/customstyles/footer-common.scss | 0 .../hawkbit/customstyles/generic-styles.scss | 0 .../customstyles/hawkbitvariables.scss | 0 .../themes/hawkbit/customstyles/login.scss | 0 .../themes/hawkbit/customstyles/others.scss | 0 .../hawkbit/customstyles/popup-common.scss | 0 .../hawkbit/customstyles/popup-window.scss | 0 .../themes/hawkbit/customstyles/rollout.scss | 0 .../customstyles/statusprogressbar.scss | 0 .../hawkbit/customstyles/systemconfig.scss | 0 .../hawkbit/customstyles/table-common.scss | 0 .../hawkbit/customstyles/table-content.scss | 0 .../customstyles/table-header-common.scss | 0 .../themes/hawkbit/customstyles/table.scss | 0 .../themes/hawkbit/customstyles/tags.scss | 0 .../customstyles/target-filter-query.scss | 0 .../VAADIN/themes/hawkbit/hawkbittheme.scss | 0 .../hawkbit/images/lightCorner_selected1.png | Bin .../themes/hawkbit/images/lightCorner_top.png | Bin .../hawkbit/images/profile-pic-57px.jpg | Bin .../VAADIN/themes/hawkbit/layouts/footer.html | 0 .../VAADIN/themes/hawkbit/styles.scss | 0 .../src/main/resources/messages.properties | 0 .../src/main/resources/messages_de.properties | 0 .../src/main/resources/messages_en.properties | 0 ...ringSecurityAtmosphereInterceptorTest.java | 0 .../ui/utils/NamingThreadFactoryTest.java | 0 .../ui/utils/SPUIComponentProviderTest.java | 0 pom.xml | 3 +- 351 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 hawkbit-ddi-dl-api/pom.xml rename hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java => hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java (66%) create mode 100644 hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlRestConstants.java rename {hawkbit-ui => hawkbit-mgmt-ui}/.gitignore (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/pom.xml (99%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/.gitignore (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/LinkRendererConnector.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/LinkRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/LinkRenderer.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/.gitignore (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/.gitignore (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/VAADIN/themes/hawkbit/styles.scss (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/messages.properties (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/messages_de.properties (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/main/resources/messages_en.properties (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java (100%) rename {hawkbit-ui => hawkbit-mgmt-ui}/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java (100%) diff --git a/examples/hawkbit-custom-theme-example/pom.xml b/examples/hawkbit-custom-theme-example/pom.xml index 7caa99ba2..2cbee5c0a 100644 --- a/examples/hawkbit-custom-theme-example/pom.xml +++ b/examples/hawkbit-custom-theme-example/pom.xml @@ -66,7 +66,7 @@ org.eclipse.hawkbit - hawkbit-ui + hawkbit-mgmt-ui ${project.version} diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index 86ce5d9eb..efbcf9e9e 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -84,7 +84,7 @@ org.eclipse.hawkbit - hawkbit-ui + hawkbit-mgmt-ui ${project.version} diff --git a/hawkbit-autoconfigure/pom.xml b/hawkbit-autoconfigure/pom.xml index 3fb623978..446fb3f56 100644 --- a/hawkbit-autoconfigure/pom.xml +++ b/hawkbit-autoconfigure/pom.xml @@ -40,7 +40,7 @@ org.eclipse.hawkbit - hawkbit-ui + hawkbit-mgmt-ui ${project.version} true diff --git a/hawkbit-ddi-api/pom.xml b/hawkbit-ddi-api/pom.xml index e91053fc5..969f0d930 100644 --- a/hawkbit-ddi-api/pom.xml +++ b/hawkbit-ddi-api/pom.xml @@ -33,11 +33,6 @@ javax.validation validation-api - - javax.servlet - javax.servlet-api - provided - org.hibernate hibernate-validator diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java index f6356c466..25be5b1f8 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRestConstants.java @@ -18,11 +18,6 @@ public final class DdiRestConstants { */ public static final String BASE_V1_REQUEST_MAPPING = "/{tenant}/controller/v1"; - /** - * The base URL mapping of the artifact repository rest resources. - */ - public static final String ARTIFACTS_V1_REQUEST_MAPPING = "/{tenant}/controller/artifacts/v1"; - /** * Deployment action resources. */ @@ -38,28 +33,17 @@ public final class DdiRestConstants { */ public static final String FEEDBACK = "feedback"; - /** - * Config data action resources. - */ - public static final String CONFIG_DATA_ACTION = "configData"; - - /** - * The artifact URL mapping rest resource. - */ - public static final String ARTIFACT_DOWNLOAD = "artifact"; - - /** - * The artifact by filename URL mapping rest resource. - */ - public static final String ARTIFACT_DOWNLOAD_BY_FILENAME = "/filename"; - /** * File suffix for MDH hash download (see Linux md5sum). */ public static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM"; - // constant class, private constructor. - private DdiRestConstants() { + /** + * Config data action resources. + */ + public static final String CONFIG_DATA_ACTION = "configData"; + private DdiRestConstants() { + // constant class, private constructor. } } diff --git a/hawkbit-ddi-dl-api/pom.xml b/hawkbit-ddi-dl-api/pom.xml new file mode 100644 index 000000000..f53b4e0d1 --- /dev/null +++ b/hawkbit-ddi-dl-api/pom.xml @@ -0,0 +1,29 @@ + + + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + 0.2.0-SNAPSHOT + + hawkbit-ddi-dl-api + hawkBit :: DDI Download Server (DL) API + + + + org.springframework.security + spring-security-web + + + diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java similarity index 66% rename from hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java rename to hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java index dc8b4bf96..da938b2d1 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiArtifactStoreControllerRestApi.java +++ b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java @@ -6,11 +6,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.ddi.rest.api; +package org.eclipse.hawkbit.ddi.dl.rest.api; import java.io.InputStream; -import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; @@ -22,19 +21,15 @@ import org.springframework.web.bind.annotation.ResponseBody; /** * REST resource handling for artifact download operations. */ -@RequestMapping(DdiRestConstants.ARTIFACTS_V1_REQUEST_MAPPING) -public interface DdiArtifactStoreControllerRestApi { +@RequestMapping(DdiDlRestConstants.ARTIFACTS_V1_REQUEST_MAPPING) +public interface DdiDlArtifactStoreControllerRestApi { /** - * Handles GET {@link DdiArtifact} download request. This could be full or - * partial download request. + * Handles GET download request. This could be full or partial download + * request. * * @param fileName * to search for - * @param response - * to write to - * @param request - * from the client * @param targetid * of authenticated target * @@ -42,24 +37,21 @@ public interface DdiArtifactStoreControllerRestApi { * {@link HttpStatus#OK} or in case of partial download * {@link HttpStatus#PARTIAL_CONTENT}. */ - @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}") + @RequestMapping(method = RequestMethod.GET, value = DdiDlRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}") @ResponseBody public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, - @AuthenticationPrincipal final String targetid); /** - * Handles GET {@link DdiArtifact} MD5 checksum file download request. + * Handles GET MD5 checksum file download request. * * @param fileName * to search for - * @param response - * to write to * * @return response of the servlet */ - @RequestMapping(method = RequestMethod.GET, value = DdiRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}" - + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX) + @RequestMapping(method = RequestMethod.GET, value = DdiDlRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}" + + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX) @ResponseBody public ResponseEntity downloadArtifactMD5ByFilename(@PathVariable("fileName") final String fileName); diff --git a/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlRestConstants.java b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlRestConstants.java new file mode 100644 index 000000000..40ba5050f --- /dev/null +++ b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlRestConstants.java @@ -0,0 +1,40 @@ +/** + * 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.dl.rest.api; + +/** + * Constants for the direct device integration rest resources. + */ +public final class DdiDlRestConstants { + + /** + * The base URL mapping of the artifact repository rest resources. + */ + public static final String ARTIFACTS_V1_REQUEST_MAPPING = "/{tenant}/controller/artifacts/v1"; + + /** + * The artifact URL mapping rest resource. + */ + public static final String ARTIFACT_DOWNLOAD = "artifact"; + + /** + * The artifact by filename URL mapping rest resource. + */ + public static final String ARTIFACT_DOWNLOAD_BY_FILENAME = "/filename"; + + /** + * File suffix for MDH hash download (see Linux md5sum). + */ + public static final String ARTIFACT_MD5_DWNL_SUFFIX = ".MD5SUM"; + + // constant class, private constructor. + private DdiDlRestConstants() { + + } +} diff --git a/hawkbit-ddi-resource/pom.xml b/hawkbit-ddi-resource/pom.xml index 1615cf697..f3eb5c2c7 100644 --- a/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-ddi-resource/pom.xml @@ -26,6 +26,11 @@ hawkbit-ddi-api ${project.version} + + org.eclipse.hawkbit + hawkbit-ddi-dl-api + ${project.version} + org.eclipse.hawkbit hawkbit-rest-core diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index 576e11348..f05bb6d98 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.hawkbit.api.ArtifactUrlHandler; import org.eclipse.hawkbit.api.UrlProtocol; +import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlRestConstants; import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.eclipse.hawkbit.ddi.json.model.DdiArtifactHash; import org.eclipse.hawkbit.ddi.json.model.DdiChunk; @@ -93,9 +94,9 @@ public final class DataConversionHelper { final String linkHttps = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(), artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTPS); file.add(new Link(linkHttps).withRel("download")); - file.add(new Link(linkHttps + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum")); + file.add(new Link(linkHttps + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum")); file.add(new Link(linkHttp).withRel("download-http")); - file.add(new Link(linkHttp + DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); + file.add(new Link(linkHttp + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); files.add(file); }); @@ -147,7 +148,7 @@ public final class DataConversionHelper { final StringBuilder header = new StringBuilder(); header.append("attachment;filename="); header.append(fileName); - header.append(DdiRestConstants.ARTIFACT_MD5_DWNL_SUFFIX); + header.append(DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX); response.setContentLength(content.length); response.setHeader("Content-Disposition", header.toString()); diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index 8552e686d..ede05d685 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletRequest; import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; import org.eclipse.hawkbit.cache.CacheWriteNotify; -import org.eclipse.hawkbit.ddi.rest.api.DdiArtifactStoreControllerRestApi; +import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlArtifactStoreControllerRestApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.model.Action; @@ -49,7 +49,7 @@ import org.springframework.web.context.WebApplicationContext; */ @RestController @Scope(value = WebApplicationContext.SCOPE_REQUEST) -public class DdiArtifactStoreController implements DdiArtifactStoreControllerRestApi { +public class DdiArtifactStoreController implements DdiDlArtifactStoreControllerRestApi { private static final Logger LOG = LoggerFactory.getLogger(DdiArtifactStoreController.class); diff --git a/hawkbit-ui/.gitignore b/hawkbit-mgmt-ui/.gitignore similarity index 100% rename from hawkbit-ui/.gitignore rename to hawkbit-mgmt-ui/.gitignore diff --git a/hawkbit-ui/pom.xml b/hawkbit-mgmt-ui/pom.xml similarity index 99% rename from hawkbit-ui/pom.xml rename to hawkbit-mgmt-ui/pom.xml index e0bde576a..1c8b8e1ea 100644 --- a/hawkbit-ui/pom.xml +++ b/hawkbit-mgmt-ui/pom.xml @@ -16,7 +16,7 @@ hawkbit-parent 0.2.0-SNAPSHOT - hawkbit-ui + hawkbit-mgmt-ui hawkBit :: UI Bosch IoT Software Provisioning server web application diff --git a/hawkbit-ui/src/main/.gitignore b/hawkbit-mgmt-ui/src/main/.gitignore similarity index 100% rename from hawkbit-ui/src/main/.gitignore rename to hawkbit-mgmt-ui/src/main/.gitignore diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/LinkRendererConnector.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/LinkRendererConnector.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/LinkRendererConnector.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/LinkRendererConnector.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/LinkRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/LinkRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/LinkRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/LinkRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/LinkRenderer.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/LinkRenderer.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/LinkRenderer.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/LinkRenderer.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java b/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java similarity index 100% rename from hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java rename to hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java diff --git a/hawkbit-ui/src/main/resources/VAADIN/.gitignore b/hawkbit-mgmt-ui/src/main/resources/VAADIN/.gitignore similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/.gitignore rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/.gitignore diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss b/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss similarity index 100% rename from hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss rename to hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss diff --git a/hawkbit-ui/src/main/resources/messages.properties b/hawkbit-mgmt-ui/src/main/resources/messages.properties similarity index 100% rename from hawkbit-ui/src/main/resources/messages.properties rename to hawkbit-mgmt-ui/src/main/resources/messages.properties diff --git a/hawkbit-ui/src/main/resources/messages_de.properties b/hawkbit-mgmt-ui/src/main/resources/messages_de.properties similarity index 100% rename from hawkbit-ui/src/main/resources/messages_de.properties rename to hawkbit-mgmt-ui/src/main/resources/messages_de.properties diff --git a/hawkbit-ui/src/main/resources/messages_en.properties b/hawkbit-mgmt-ui/src/main/resources/messages_en.properties similarity index 100% rename from hawkbit-ui/src/main/resources/messages_en.properties rename to hawkbit-mgmt-ui/src/main/resources/messages_en.properties diff --git a/hawkbit-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java b/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java similarity index 100% rename from hawkbit-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java rename to hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java diff --git a/hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java b/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java similarity index 100% rename from hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java rename to hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java diff --git a/hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java b/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java similarity index 100% rename from hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java rename to hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java diff --git a/pom.xml b/pom.xml index 479bb074e..cb97ca6d4 100644 --- a/pom.xml +++ b/pom.xml @@ -32,13 +32,14 @@ hawkbit-mgmt-api hawkbit-mgmt-resource hawkbit-ddi-api + hawkbit-ddi-dl-api hawkbit-ddi-resource hawkbit-dmf-api hawkbit-dmf-amqp hawkbit-repository hawkbit-security-integration hawkbit-http-security - hawkbit-ui + hawkbit-mgmt-ui hawkbit-artifact-repository-mongo hawkbit-autoconfigure hawkbit-cache-redis From 36d43d1e620f424a2fb9a2d76aa246901a168c58 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 3 May 2016 13:06:42 +0200 Subject: [PATCH 067/124] Update description Signed-off-by: SirWayne --- hawkbit-mgmt-resource/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index 10ed70bbb..4e5302e23 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -10,7 +10,7 @@ 0.2.0-SNAPSHOT hawkbit-mgmt-resource - hawkBit :: REST Managment Resources + hawkBit :: REST Mgmt Resources From 07d55a78af0540728d54c0472ad8f2c248801ee0 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 3 May 2016 13:33:56 +0200 Subject: [PATCH 068/124] Update dependencies Signed-off-by: SirWayne --- examples/hawkbit-example-ddi-client/pom.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 02841d0c6..3da11adaf 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -61,11 +61,6 @@ - - commons-io - commons-io - 2.5 - com.google.guava guava @@ -75,16 +70,5 @@ commons-lang - - - junit - junit - test - - - ru.yandex.qatools.allure - allure-junit-adaptor - test - From 1086f29e5aff34d275b022fe19bb870cafce53fe Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 3 May 2016 13:35:29 +0200 Subject: [PATCH 069/124] Fix #99 split rest modules Signed-off-by: SirWayne --- hawkbit-ddi-dl-api/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/hawkbit-ddi-dl-api/pom.xml b/hawkbit-ddi-dl-api/pom.xml index f53b4e0d1..704267927 100644 --- a/hawkbit-ddi-dl-api/pom.xml +++ b/hawkbit-ddi-dl-api/pom.xml @@ -8,7 +8,6 @@ http://www.eclipse.org/legal/epl-v10.html --> - 4.0.0 From 2341bc8737734c571cb5f9b0cc38387c25664216 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 3 May 2016 13:46:10 +0200 Subject: [PATCH 070/124] Update Readme.md and added new Readme.md to new modules. Signed-off-by: Jonathan Philip Knoblauch --- README.md | 40 +++++++++---------- examples/README.md | 6 +-- examples/hawkbit-example-ddi-client/README.md | 5 +-- .../README.md | 13 ++++++ .../hawkbit-example-mgmt-client/README.md | 15 +++++++ .../README.md | 4 +- hawkbit-ddi-api/README.md | 12 ++++++ hawkbit-ddi-resource/README.md | 13 ++++++ hawkbit-mgmt-api/README.md | 14 +++++++ hawkbit-mgmt-resource/README.md | 13 ++++++ hawkbit-system-api/README.md | 14 +++++++ hawkbit-system-resource/README.md | 13 ++++++ 12 files changed, 134 insertions(+), 28 deletions(-) create mode 100644 examples/hawkbit-example-feign-core-client/README.md create mode 100644 examples/hawkbit-example-mgmt-client/README.md create mode 100644 hawkbit-ddi-api/README.md create mode 100644 hawkbit-ddi-resource/README.md create mode 100644 hawkbit-mgmt-api/README.md create mode 100644 hawkbit-mgmt-resource/README.md create mode 100644 hawkbit-system-api/README.md create mode 100644 hawkbit-system-resource/README.md diff --git a/README.md b/README.md index ee6c27c3d..ab90e4263 100644 --- a/README.md +++ b/README.md @@ -58,26 +58,26 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v # Modules -`examples` : HawkBit examples -`hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. -`hawkbit-autoconfigure` : Spring-boot auto-configuration. -`hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. -`hawkbit-core` : Core elements. -`hawkbit-ddi-api` : The hawkBit DDI API. -`hawkbit-ddi-resource` : Implementation of the hawkBit DDI API -`hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. -`hawkbit-dmf-api` : API for the Device Management Integration. -`hawkbit-http-security` : Implementation for security filters for HTTP. -`hawkbit-mgmt-api` : The hawkBit Management API -`hawkbit-mgmt-resource` : Implementation of the hawkBit Management API -`hawkbit-repository` : Repository implementation based on SQL for all meta-data. -`hawkbit-rest-core` : Core elements for the rest modules. -`hawkbit-security-core` : Core security elements. -`hawkbit-security-integration` : Security integration elements to integrate security into hawkbit. -`hawkbit-system-api` : The hawkBit System API -`hawkbit-system-resource` : Implementation of the hawkBit System API -`hawkbit-test-report` : Test reports -`hawkbit-ui` : Vaadin UI. +* `examples` : HawkBit examples +* `hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. +* `hawkbit-autoconfigure` : Spring-boot auto-configuration. +* `hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. +* `hawkbit-core` : Core elements. +* `hawkbit-ddi-api` : The hawkBit DDI API. +* `hawkbit-ddi-resource` : Implementation of the hawkBit DDI API +* `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. +* `hawkbit-dmf-api` : API for the Device Management Integration. +* `hawkbit-http-security` : Implementation for security filters for HTTP. +* `hawkbit-mgmt-api` : The hawkBit Management API +* `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API +* `hawkbit-repository` : Repository implementation based on SQL for all meta-data. +* `hawkbit-rest-core` : Core elements for the rest modules. +* `hawkbit-security-core` : Core security elements. +* `hawkbit-security-integration` : Security integration elements to integrate security into hawkbit. +* `hawkbit-system-api` : The hawkBit System API +* `hawkbit-system-resource` : Implementation of the hawkBit System API +* `hawkbit-test-report` : Test reports +* `hawkbit-ui` : Vaadin UI. diff --git a/examples/README.md b/examples/README.md index de9cbcab8..ce8d26962 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,9 +4,9 @@ Example projects that show how _hawkBit_ can be used to create, run or access an - `hawkbit-custom-theme-example` : Example for a customized theme for Management UI. - `hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options. -- `hawkbit-example-app` : Allows you to run a Spring Boot and hawkBit based update server. Includes all _hawkBit_ interfaces, i.e. DDI, DMF, Mgmt-API, Mgmt-UI. -- `hawkbit-example-ddi-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API. +- `hawkbit-example-app` : Allows you to run the Spring Boot hawkBit app. Includes all _hawkBit_ interfaces, i.e. DDI, DMF, Mgmt-API, Mgmt-UI. +- `hawkbit-example-ddi-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API. Includes simulation of target. - `hawkbit-example-feign-core-client` : Core resources for the examples. - `hawkbit-example-mgmt-client` : Example client for the _hawkBit_ Management API -- `hawkbit-example-mgmt-spring-client` : Example client for the _hawkBit_ Management API based on Spring boot. +- `hawkbit-example-mgmt-spring-client` : Example client for the _hawkBit_ Management API based on Spring Boot. diff --git a/examples/hawkbit-example-ddi-client/README.md b/examples/hawkbit-example-ddi-client/README.md index 7d4301fbb..8b016ed5e 100644 --- a/examples/hawkbit-example-ddi-client/README.md +++ b/examples/hawkbit-example-ddi-client/README.md @@ -1,6 +1,6 @@ # Eclipse.IoT hawkBit - Example DDI Client -The hawkBit Example DDI Client is an implementation of a simulated device/controller that communicates with the hawkBit server via the DDI API. +The hawkBit Example DDI Client is an implementation of a simulated device/target that communicates with the hawkBit server via the DDI API. # Compile, Run and Getting Started @@ -25,6 +25,5 @@ executorService.execute(ddiExampleClient); #### Getting started with hawkBit Example DDI Client -After the hawkBit Example DDI Client has started it will poll once against the given hawkBit server and form then on depending on your polling configuration. -After the hawkBit Example DDI Client has polled successful your will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. +After the hawkBit Example DDI Client has started it will poll once against the given hawkBit server and form then depending on your polling configuration. After the hawkBit Example DDI Client has polled successful you will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. You can know assign a distributionSet to the target and let the hawkBit Example DDI Client simulated an update. diff --git a/examples/hawkbit-example-feign-core-client/README.md b/examples/hawkbit-example-feign-core-client/README.md new file mode 100644 index 000000000..27d1ea04e --- /dev/null +++ b/examples/hawkbit-example-feign-core-client/README.md @@ -0,0 +1,13 @@ +# Eclipse.IoT hawkBit - Example Feign Core Client + +This modules contains core resources that are needed by the hawkBit Example DDI Client and the hawkBit Example Management Spring Client. + +# Compile + +#### Build hawkbit-example-feign-core-client + +``` +$ cd hawkbit/examples/hawkbit-example-feign-core-client +$ mvn clean install +``` + diff --git a/examples/hawkbit-example-mgmt-client/README.md b/examples/hawkbit-example-mgmt-client/README.md new file mode 100644 index 000000000..b73ddd96b --- /dev/null +++ b/examples/hawkbit-example-mgmt-client/README.md @@ -0,0 +1,15 @@ +# Eclipse.IoT hawkBit - Example Management Client + +This modules contains an example feign client implementation based on the Mgmt API. + +Powered by [Feign](https://github.com/Netflix/feign). + +# Compile + +#### Build hawkbit-example-mgmt-client + +``` +$ cd hawkbit/examples/hawkbit-example-mgmt-client +$ mvn clean install +``` + diff --git a/examples/hawkbit-example-mgmt-spring-client/README.md b/examples/hawkbit-example-mgmt-spring-client/README.md index ac8e7a4cd..9e11e212d 100644 --- a/examples/hawkbit-example-mgmt-spring-client/README.md +++ b/examples/hawkbit-example-mgmt-spring-client/README.md @@ -1,6 +1,6 @@ -# hawkBit Management API example client +# Eclipse.IoT hawkBit - Management API Example Client -Example client that shows how to efficiently use the hawkBit management API. +Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Client and the hawkBit Management API. Powered by [Feign](https://github.com/Netflix/feign). diff --git a/hawkbit-ddi-api/README.md b/hawkbit-ddi-api/README.md new file mode 100644 index 000000000..b47b74895 --- /dev/null +++ b/hawkbit-ddi-api/README.md @@ -0,0 +1,12 @@ +# Eclipse.IoT hawkBit - DDI API + +The Direct Device Integration (DDI) API is used by devices for communicating with the HawkBit Update Server through HTTP. + +# Compile + +#### Build hawkbit-ddi-api + +``` +$ cd hawkbit/hawkbit-ddi-api +$ mvn clean install +``` diff --git a/hawkbit-ddi-resource/README.md b/hawkbit-ddi-resource/README.md new file mode 100644 index 000000000..865b2946f --- /dev/null +++ b/hawkbit-ddi-resource/README.md @@ -0,0 +1,13 @@ +# Eclipse.IoT hawkBit - DDI Resource + +This is the server-side implementation of the hawkBit DDI API that is used by devices for communicating with the HawkBit Update Server through HTTP. + +# Compile + +#### Build hawkbit-ddi-resource + +``` +$ cd hawkbit/hawkbit-ddi-resource +$ mvn clean install +``` + diff --git a/hawkbit-mgmt-api/README.md b/hawkbit-mgmt-api/README.md new file mode 100644 index 000000000..eeb51c145 --- /dev/null +++ b/hawkbit-mgmt-api/README.md @@ -0,0 +1,14 @@ +# Eclipse.IoT hawkBit - Mgmt API + +This Management (Mgmt) API is used to manage and monitor the HawkBit Update Server via HTTP. This API allows Create/Read/Update/Delete operations for provisioning targets (i.e. devices) and repository content (i.e. software). + + +# Compile + +#### Build hawkbit-mgmt-api + +``` +$ cd hawkbit/hawkbit-mgmt-api +$ mvn clean install +``` + diff --git a/hawkbit-mgmt-resource/README.md b/hawkbit-mgmt-resource/README.md new file mode 100644 index 000000000..3bad53d61 --- /dev/null +++ b/hawkbit-mgmt-resource/README.md @@ -0,0 +1,13 @@ +# Eclipse.IoT hawkBit - Mgmt Resource + +This is the server-side implementation of the hawkBit Mgmt API that is used to manage and monitor the HawkBit Update Server via HTTP. + +# Compile + +#### Build hawkbit-mgmt-resource + +``` +$ cd hawkbit/hawkbit-mgmt-resource +$ mvn clean install +``` + diff --git a/hawkbit-system-api/README.md b/hawkbit-system-api/README.md new file mode 100644 index 000000000..41b1a8416 --- /dev/null +++ b/hawkbit-system-api/README.md @@ -0,0 +1,14 @@ +# Eclipse.IoT hawkBit - System API + +The System API is used to configurate the hawkBit Update Server. This includes tenants specific operations as well as system wide operations. + + +# Compile + +#### Build hawkbit-system-api + +``` +$ cd hawkbit/hawkbit-system-api +$ mvn clean install +``` + diff --git a/hawkbit-system-resource/README.md b/hawkbit-system-resource/README.md new file mode 100644 index 000000000..20eaf5c6b --- /dev/null +++ b/hawkbit-system-resource/README.md @@ -0,0 +1,13 @@ +# Eclipse.IoT hawkBit - System Resource + +This is the server-side implementation of the hawkBit System API that is used to configurate the hawkBit Update Server + +# Compile + +#### Build hawkbit-system-resource + +``` +$ cd hawkbit/hawkbit-system-resource +$ mvn clean install +``` + From 3299906d4d5d64a1509dbf616bd9ce89a4543049 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 3 May 2016 14:01:42 +0200 Subject: [PATCH 071/124] Added new readme.md for DDI download API and updated existing readme.md Signed-off-by: Jonathan Philip Knoblauch --- README.md | 7 ++++--- hawkbit-ddi-dl-api/README.md | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 hawkbit-ddi-dl-api/README.md diff --git a/README.md b/README.md index ab90e4263..31d853dc8 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v # Modules -* `examples` : HawkBit examples +* `examples` : hawkBit examples * `hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. * `hawkbit-autoconfigure` : Spring-boot auto-configuration. * `hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. @@ -70,14 +70,15 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v * `hawkbit-http-security` : Implementation for security filters for HTTP. * `hawkbit-mgmt-api` : The hawkBit Management API * `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API +* `hawkbit-mgmt-ui` : Vaadin UI. * `hawkbit-repository` : Repository implementation based on SQL for all meta-data. * `hawkbit-rest-core` : Core elements for the rest modules. * `hawkbit-security-core` : Core security elements. -* `hawkbit-security-integration` : Security integration elements to integrate security into hawkbit. +* `hawkbit-security-integration` : Security integration elements to integrate security into hawkBit. * `hawkbit-system-api` : The hawkBit System API * `hawkbit-system-resource` : Implementation of the hawkBit System API * `hawkbit-test-report` : Test reports -* `hawkbit-ui` : Vaadin UI. + diff --git a/hawkbit-ddi-dl-api/README.md b/hawkbit-ddi-dl-api/README.md new file mode 100644 index 000000000..703ef2916 --- /dev/null +++ b/hawkbit-ddi-dl-api/README.md @@ -0,0 +1,12 @@ +# Eclipse.IoT hawkBit - DDI Download API + +This module is part of the Direct Device Integration (DDI) API and is used by devices/targets for downloading artifacts through HTTP. + +# Compile + +#### Build hawkbit-ddi-dl-api + +``` +$ cd hawkbit/hawkbit-ddi-dl-api +$ mvn clean install +``` From a1edaf2be95ae2eeb5013318eb4f2e83486ebc73 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 3 May 2016 14:07:25 +0200 Subject: [PATCH 072/124] Fix #99 split rest modules and ddi-dl client resource Signed-off-by: SirWayne --- examples/hawkbit-example-ddi-client/pom.xml | 5 +++++ ...ArtifactStoreControllerResourceClient.java | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index 3da11adaf..cd9613457 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -34,6 +34,11 @@ hawkbit-ddi-api ${project.version} + + org.eclipse.hawkbit + hawkbit-ddi-dl-api + ${project.version} + org.springframework.cloud spring-cloud-starter-feign diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java new file mode 100644 index 000000000..c37602d7a --- /dev/null +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java @@ -0,0 +1,21 @@ +/** + * 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.client.resource; + +import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlArtifactStoreControllerRestApi; +import org.eclipse.hawkbit.ddi.dl.rest.api.DdiDlRestConstants; +import org.springframework.cloud.netflix.feign.FeignClient; + +/** + * Client binding for the artifact store controller resource of the DDI-DL API. + */ +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + DdiDlRestConstants.ARTIFACTS_V1_REQUEST_MAPPING) +public interface DdiDlArtifactStoreControllerResourceClient extends DdiDlArtifactStoreControllerRestApi { + +} From 51466967bd222b9236d205e1a120802cba766d50 Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 3 May 2016 14:13:26 +0200 Subject: [PATCH 073/124] Updated readme.me showing new module in parent and in ddi-resource Signed-off-by: Jonathan Philip Knoblauch --- README.md | 1 + hawkbit-ddi-resource/README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31d853dc8..a6928b3f2 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v * `hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. * `hawkbit-core` : Core elements. * `hawkbit-ddi-api` : The hawkBit DDI API. +* `hawkbit-ddi-dl-api` : The hawkBit DDI Download API. * `hawkbit-ddi-resource` : Implementation of the hawkBit DDI API * `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. * `hawkbit-dmf-api` : API for the Device Management Integration. diff --git a/hawkbit-ddi-resource/README.md b/hawkbit-ddi-resource/README.md index 865b2946f..3cfb443cd 100644 --- a/hawkbit-ddi-resource/README.md +++ b/hawkbit-ddi-resource/README.md @@ -1,6 +1,6 @@ # Eclipse.IoT hawkBit - DDI Resource -This is the server-side implementation of the hawkBit DDI API that is used by devices for communicating with the HawkBit Update Server through HTTP. +This is the server-side implementation of the hawkBit DDI API and the hawkBit DDI Download API that is used by devices for communicating with the HawkBit Update Server through HTTP. # Compile From a18bd9ac219c563fcc31ca6af4f783baa1481a90 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 4 May 2016 12:50:15 +0200 Subject: [PATCH 074/124] Modify module name Signed-off-by: SirWayne --- hawkbit-mgmt-ui/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawkbit-mgmt-ui/pom.xml b/hawkbit-mgmt-ui/pom.xml index 1c8b8e1ea..7b79b9008 100644 --- a/hawkbit-mgmt-ui/pom.xml +++ b/hawkbit-mgmt-ui/pom.xml @@ -17,7 +17,7 @@ 0.2.0-SNAPSHOT hawkbit-mgmt-ui - hawkBit :: UI + hawkBit :: Mgmt UI Bosch IoT Software Provisioning server web application From 36e9746ae20c6ac1d5b35c1da08cc26ba690b718 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Wed, 4 May 2016 13:33:29 +0200 Subject: [PATCH 075/124] Improvement of breadcrumb target filter management. Signed-off-by: Melanie Retter --- .../ui/filtermanagement/CreateOrUpdateFilterHeader.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index 684321a2a..ab01d0b8d 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -97,6 +97,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button private Button breadcrumbButton; + private Label breadcrumbName; + private Label headerCaption; private TextField queryTextField; @@ -173,6 +175,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button oldFilterName = filterManagementUIState.getTfQuery().get().getName(); oldFilterQuery = filterManagementUIState.getTfQuery().get().getQuery(); } + breadcrumbName.setValue(nameLabel.getValue()); showValidationSuccesIcon(); titleFilterIconsLayout.addStyleName(SPUIStyleDefinitions.TARGET_FILTER_CAPTION_LAYOUT); headerCaption.setVisible(false); @@ -181,6 +184,7 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button private void resetComponents() { headerCaption.setVisible(true); + breadcrumbName.setValue(headerCaption.getValue()); nameLabel.setValue(""); queryTextField.setValue(""); setInitialStatusIconStyle(validationIcon); @@ -298,8 +302,9 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button breadcrumbLayout = new HorizontalLayout(); breadcrumbLayout.addComponent(breadcrumbButton); breadcrumbLayout.addComponent(new Label(">")); - headerCaption.addStyleName("breadcrumbPaddingLeft"); - breadcrumbLayout.addComponent(headerCaption); + breadcrumbName = SPUIComponentProvider.getLabel(null, SPUILabelDefinitions.SP_WIDGET_CAPTION); + breadcrumbLayout.addComponent(breadcrumbName); + breadcrumbName.addStyleName("breadcrumbPaddingLeft"); final HorizontalLayout titleFilterLayout = new HorizontalLayout(); titleFilterLayout.setSizeFull(); From 653eb2de43023ef9d41bae2b088c5381aef63883 Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Wed, 4 May 2016 17:31:46 +0200 Subject: [PATCH 076/124] review pull request Signed-off-by: Melanie Retter --- .../ui/filtermanagement/CreateOrUpdateFilterHeader.java | 6 ++++-- .../hawkbit/ui/filtermanagement/FilterManagementView.java | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index ab01d0b8d..17c1410d3 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -68,6 +68,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button private static final long serialVersionUID = 7474232427119031474L; + private static final String breadcrumbCustomFilters = "breadcrumb.target.filter.custom.filters"; + @Autowired private I18N i18n; @@ -237,8 +239,8 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button final Button createFilterViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, SPUIButtonStyleSmallNoBorder.class); createFilterViewLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); - createFilterViewLink.setDescription(i18n.get("breadcrumb.target.filter.custom.filters")); - createFilterViewLink.setCaption(i18n.get("breadcrumb.target.filter.custom.filters")); + createFilterViewLink.setDescription(i18n.get(breadcrumbCustomFilters)); + createFilterViewLink.setCaption(i18n.get(breadcrumbCustomFilters)); createFilterViewLink.addClickListener(value -> showCustomFiltersView()); return createFilterViewLink; diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java index 414dee239..ef759aa5f 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java @@ -122,11 +122,11 @@ public class FilterManagementView extends VerticalLayout implements View { tableHeaderLayout.setComponentAlignment(createNewFilterHeader, Alignment.TOP_CENTER); tableHeaderLayout.addComponent(createNewFilterTable); tableHeaderLayout.setComponentAlignment(createNewFilterTable, Alignment.TOP_CENTER); - tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0f); + tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0F); addComponent(tableHeaderLayout); setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER); - setExpandRatio(tableHeaderLayout, 1.0f); + setExpandRatio(tableHeaderLayout, 1.0F); final HorizontalLayout targetsCountmessageLabelLayout = addTargetFilterMessageLabel(); addComponent(targetsCountmessageLabelLayout); @@ -145,7 +145,7 @@ public class FilterManagementView extends VerticalLayout implements View { tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER); tableListViewLayout.addComponent(targetFilterTable); tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER); - tableListViewLayout.setExpandRatio(targetFilterTable, 1.0f); + tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F); addComponent(tableListViewLayout); } From 205216f7dda581a6d3ef1788e74592bc8c07c28b Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Fri, 6 May 2016 16:08:16 +0200 Subject: [PATCH 077/124] Added @SuppressWarnings annotation and reseted readme.md in hawkbit parent Signed-off-by: Jonathan Philip Knoblauch --- README.md | 43 ++++++------------- .../java/org/eclipse/hawkbit/app/Start.java | 2 + .../builder/DistributionSetBuilder.java | 2 + .../builder/DistributionSetTypeBuilder.java | 2 + .../resource/builder/RolloutBuilder.java | 2 + .../SoftwareModuleAssigmentBuilder.java | 2 + .../builder/SoftwareModuleBuilder.java | 2 + .../builder/SoftwareModuleTypeBuilder.java | 15 ++++--- .../client/resource/builder/TagBuilder.java | 12 +++--- .../resource/builder/TargetBuilder.java | 12 +++--- 10 files changed, 49 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index a6928b3f2..e61e5e9d1 100644 --- a/README.md +++ b/README.md @@ -52,36 +52,21 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v * The master branch contains future development towards 0.2. We are currently focusing on: * Rollout Management for large scale rollouts. * Clustering capabilities for the update server. - * Upgrade of Spring Boot and Vaadin depedencies. + * Upgrade of Spring Boot and Vaadin dependencies. * And of course tons of usability improvements and bug fixes. # Modules - -* `examples` : hawkBit examples -* `hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. -* `hawkbit-autoconfigure` : Spring-boot auto-configuration. -* `hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. -* `hawkbit-core` : Core elements. -* `hawkbit-ddi-api` : The hawkBit DDI API. -* `hawkbit-ddi-dl-api` : The hawkBit DDI Download API. -* `hawkbit-ddi-resource` : Implementation of the hawkBit DDI API -* `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. -* `hawkbit-dmf-api` : API for the Device Management Integration. -* `hawkbit-http-security` : Implementation for security filters for HTTP. -* `hawkbit-mgmt-api` : The hawkBit Management API -* `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API -* `hawkbit-mgmt-ui` : Vaadin UI. -* `hawkbit-repository` : Repository implementation based on SQL for all meta-data. -* `hawkbit-rest-core` : Core elements for the rest modules. -* `hawkbit-security-core` : Core security elements. -* `hawkbit-security-integration` : Security integration elements to integrate security into hawkBit. -* `hawkbit-system-api` : The hawkBit System API -* `hawkbit-system-resource` : Implementation of the hawkBit System API -* `hawkbit-test-report` : Test reports - - - - - - +`hawkbit-core` : internal interfaces and utility classes.. +`hawkbit-security-core` : authentication and authorization. +`hawkbit-security-integration` : authentication and authorization integrated with the APIs. +`hawkbit-artifact-repository-mongo` : artifact repository implementation to MongoDB. +`hawkbit-autoconfigure` : spring-boot auto-configuration. +`hawkbit-dmf-api` : API for the Device Management Integration. +`hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. +`hawkbit-repository` : repository implementation based on SQL for all meta-data. +`hawkbit-http-security` : implementation for security filters for HTTP. +`hawkbit-rest-api` : API classes for the REST Management API. +`hawkbit-rest-resource` : HTTP REST endpoints for the Management and the Direct Device API. +`hawkbit-ui` : Vaadin UI. +`hawkbit-cache-redis` : spring cache manager configuration and implementation with redis, distributed cache and distributed events. diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index a8f2bc645..7a8e0814d 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -28,6 +28,8 @@ import org.springframework.context.annotation.Import; @EnableMgmtApi @EnableDdiApi @EnableSystemApi +// Exception squid:S1118 - Spring boot standard behavior +@SuppressWarnings({ "squid:S1118" }) public class Start { /** diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java index d1b3fad35..1e58b8415 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java @@ -19,6 +19,8 @@ import com.google.common.collect.Lists; /** * Builder pattern for building {@link MgmtDistributionSetRequestBodyPost}. */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class DistributionSetBuilder { private String name; diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java index e08240de3..1ce2ff270 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java @@ -21,6 +21,8 @@ import com.google.common.collect.Lists; * Builder pattern for building {@link MgmtDistributionSetTypeRequestBodyPost}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class DistributionSetTypeBuilder { private String key; diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java index 9ba378192..02ebe2de3 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java @@ -17,6 +17,8 @@ import org.eclipse.hawkbit.mgmt.json.model.rollout.MgmtRolloutRestRequestBody; * Builder pattern for building {@link MgmtRolloutRestRequestBody}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class RolloutBuilder { private String name; diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java index a6003e2c5..b9fbcb498 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java @@ -18,6 +18,8 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModuleAssi * Builder pattern for building {@link MgmtSoftwareModuleAssigment}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class SoftwareModuleAssigmentBuilder { private final List ids; diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java index 6f243d08a..b2e544f88 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java @@ -21,6 +21,8 @@ import com.google.common.collect.Lists; * Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class SoftwareModuleBuilder { private String name; diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java index 749546442..7981e61cf 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java @@ -21,6 +21,8 @@ import com.google.common.collect.Lists; * Builder pattern for building {@link MgmtSoftwareModuleRequestBodyPost}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class SoftwareModuleTypeBuilder { private String key; @@ -60,19 +62,20 @@ public class SoftwareModuleTypeBuilder { /** * Builds a list with a single entry of - * {@link MgmtSoftwareModuleTypeRequestBodyPost} which can directly be used in - * the RESTful-API. + * {@link MgmtSoftwareModuleTypeRequestBodyPost} which can directly be used + * in the RESTful-API. * - * @return a single entry list of {@link MgmtSoftwareModuleTypeRequestBodyPost} + * @return a single entry list of + * {@link MgmtSoftwareModuleTypeRequestBodyPost} */ public List build() { return Lists.newArrayList(doBuild(key, name)); } /** - * Builds a list of multiple {@link MgmtSoftwareModuleTypeRequestBodyPost} to - * create multiple software module types at once. An increasing number will - * be added to the name and key of the software module type. + * Builds a list of multiple {@link MgmtSoftwareModuleTypeRequestBodyPost} + * to create multiple software module types at once. An increasing number + * will be added to the name and key of the software module type. * * @param count * the amount of software module type bodies which should be diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java index 6718e631e..ce13602df 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java @@ -19,6 +19,8 @@ import com.google.common.collect.Lists; * Builder pattern for building {@link MgmtTagRequestBodyPut}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class TagBuilder { private String name; @@ -56,8 +58,8 @@ public class TagBuilder { } /** - * Builds a list with a single entry of {@link MgmtTagRequestBodyPut} which can - * directly be used in the RESTful-API. + * Builds a list with a single entry of {@link MgmtTagRequestBodyPut} which + * can directly be used in the RESTful-API. * * @return a single entry list of {@link MgmtTagRequestBodyPut} */ @@ -66,9 +68,9 @@ public class TagBuilder { } /** - * Builds a list of multiple {@link MgmtTagRequestBodyPut} to create multiple - * tags at once. An increasing number will be added to the name of the tag. - * The color and description will remain the same. + * Builds a list of multiple {@link MgmtTagRequestBodyPut} to create + * multiple tags at once. An increasing number will be added to the name of + * the tag. The color and description will remain the same. * * @param count * the amount of distribution sets body which should be created diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java index 09b20339b..7bcc0af09 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java +++ b/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java @@ -21,6 +21,8 @@ import com.google.common.collect.Lists; * Builder pattern for building {@link MgmtTargetRequestBody}. * */ +// Exception squid:S1701 - builder pattern +@SuppressWarnings({ "squid:S1701" }) public class TargetBuilder { private String controllerId; @@ -58,8 +60,8 @@ public class TargetBuilder { } /** - * Builds a list with a single entry of {@link MgmtTargetRequestBody} which can - * directly be used in the RESTful-API. + * Builds a list with a single entry of {@link MgmtTargetRequestBody} which + * can directly be used in the RESTful-API. * * @return a single entry list of {@link MgmtTargetRequestBody} */ @@ -68,9 +70,9 @@ public class TargetBuilder { } /** - * Builds a list of multiple {@link MgmtTargetRequestBody} to create multiple - * targets at once. An increasing number will be added to the controllerId - * of the target. The name and description will remain. + * Builds a list of multiple {@link MgmtTargetRequestBody} to create + * multiple targets at once. An increasing number will be added to the + * controllerId of the target. The name and description will remain. * * @param count * the amount of software module type bodies which should be From 7d81054d4c7ddb6bad743d5589ae8d8052a6885c Mon Sep 17 00:00:00 2001 From: Melanie Retter Date: Tue, 10 May 2016 10:21:40 +0200 Subject: [PATCH 078/124] remove methods and use the constant name. Signed-off-by: Melanie Retter --- .../ui/filtermanagement/TargetFilterHeader.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java index 12b4311f1..79877f299 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java @@ -78,9 +78,8 @@ public class TargetFilterHeader extends VerticalLayout { } private Label createHeaderCaption() { - final Label captionLabel = SPUIComponentProvider.getLabel(getHeaderCaption(), + return SPUIComponentProvider.getLabel(SPUIDefinitions.TARGET_FILTER_LIST_HEADER_CAPTION, SPUILabelDefinitions.SP_WIDGET_CAPTION); - return captionLabel; } private void buildLayout() { @@ -109,8 +108,8 @@ public class TargetFilterHeader extends VerticalLayout { } private Button createAddButton() { - final Button button = SPUIComponentProvider.getButton(getAddIconId(), "", "", null, false, FontAwesome.PLUS, - SPUIButtonStyleSmallNoBorder.class); + final Button button = SPUIComponentProvider.getButton(SPUIComponetIdProvider.TARGET_FILTER_ADD_ICON_ID, "", "", + null, false, FontAwesome.PLUS, SPUIButtonStyleSmallNoBorder.class); button.addClickListener(event -> addNewFilter()); return button; } @@ -185,11 +184,4 @@ public class TargetFilterHeader extends VerticalLayout { eventBus.publish(this, CustomFilterUIEvent.FILTER_BY_CUST_FILTER_TEXT_REMOVE); } - protected String getAddIconId() { - return SPUIComponetIdProvider.TARGET_FILTER_ADD_ICON_ID; - } - - protected String getHeaderCaption() { - return SPUIDefinitions.TARGET_FILTER_LIST_HEADER_CAPTION; - } } From 2c49fc8f77a21dee74e36c4d1b75da21606c4164 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Thu, 12 May 2016 11:55:25 +0200 Subject: [PATCH 079/124] Fix action message. --- .../eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java | 3 --- .../src/main/java/org/eclipse/hawkbit/app/MyLoginUI.java | 6 +++--- .../src/main/java/org/eclipse/hawkbit/app/MyUI.java | 3 +++ .../org/eclipse/hawkbit/controller/RootController.java | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java index 3704b9854..e7b81b017 100644 --- a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java +++ b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java @@ -118,9 +118,6 @@ public class DeviceSimulatorUpdater { } private static final class DeviceSimulatorUpdateThread implements Runnable { - /** - * - */ private static final int MINIMUM_TOKENLENGTH_FOR_HINT = 6; private static final Random rndSleep = new SecureRandom(); diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyLoginUI.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyLoginUI.java index 763e8447e..d8c5c8493 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyLoginUI.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyLoginUI.java @@ -20,11 +20,11 @@ import com.vaadin.spring.annotation.SpringUI; * login path. The easiest way to get an hawkBit login UI running is to extend * the {@link HawkbitLoginUI} and to annotated it with {@link SpringUI} as in * this example to the defined {@link HawkbitTheme#LOGIN_UI_PATH}. - * - * - * */ @SpringUI(path = HawkbitTheme.LOGIN_UI_PATH) +// Exception squid:MaximumInheritanceDepth - Most of the inheritance comes from +// Vaadin. +@SuppressWarnings({ "squid:MaximumInheritanceDepth" }) public class MyLoginUI extends HawkbitLoginUI { private static final long serialVersionUID = 1L; diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyUI.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyUI.java index 68d3b2fd9..e5bc7535d 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyUI.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/MyUI.java @@ -29,6 +29,9 @@ import com.vaadin.spring.annotation.SpringUI; */ @SpringUI @Push(value = PushMode.AUTOMATIC, transport = Transport.WEBSOCKET) +// Exception squid:MaximumInheritanceDepth - Most of the inheritance comes from +// Vaadin. +@SuppressWarnings({ "squid:MaximumInheritanceDepth" }) public class MyUI extends HawkbitUI { private static final long serialVersionUID = 1L; diff --git a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java index 14383f30b..3969e1b83 100644 --- a/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java +++ b/hawkbit-rest-resource/src/main/java/org/eclipse/hawkbit/controller/RootController.java @@ -318,8 +318,8 @@ public class RootController { LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base); - controllerManagement.registerRetrieved(action, - "Controller retrieved update action and should start now the download."); + controllerManagement.registerRetrieved(action, ControllerManagement.SERVER_MESSAGE_PREFIX + + "Target retrieved update action and should start now the download."); return new ResponseEntity<>(base, HttpStatus.OK); } @@ -497,8 +497,8 @@ public class RootController { LOG.debug("Found an active CancelAction for target {}. returning cancel: {}", targetid, cancel); - controllerManagement.registerRetrieved(action, - "Controller retrieved cancel action and should start now the cancelation."); + controllerManagement.registerRetrieved(action, ControllerManagement.SERVER_MESSAGE_PREFIX + + "Target retrieved cancel action and should start now the cancelation."); return new ResponseEntity<>(cancel, HttpStatus.OK); } From 8b7f24e202e151b5c1367f6c6ffeaedfc8698575 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Thu, 12 May 2016 11:58:16 +0200 Subject: [PATCH 080/124] Add mysql profile --- .../resources/application-mysql.properties | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 examples/hawkbit-example-app/src/main/resources/application-mysql.properties diff --git a/examples/hawkbit-example-app/src/main/resources/application-mysql.properties b/examples/hawkbit-example-app/src/main/resources/application-mysql.properties new file mode 100644 index 000000000..fbb0fcbad --- /dev/null +++ b/examples/hawkbit-example-app/src/main/resources/application-mysql.properties @@ -0,0 +1,32 @@ +# +# 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 +# + +# This profile adds basic configurations for a MySQL DB usage. +# Keep in mind that you need the MaridDB driver in your classpath on compile. +# see https://github.com/eclipse/hawkbit/wiki/Run-hawkBit + +spring.jpa.database=MYSQL +spring.datasource.url=jdbc:mysql://localhost:3306/hawkbit +spring.datasource.username=root +spring.datasource.password= +spring.datasource.driverClassName=org.mariadb.jdbc.Driver + +spring.datasource.max-active=100 +spring.datasource.max-idle=10 +spring.datasource.min-idle=10 +spring.datasource.initial-size=10 +spring.datasource.validation-query=select 1 from dual +spring.datasource.validation-interval=30000 +spring.datasource.test-on-borrow=true +spring.datasource.test-on-return=false +spring.datasource.test-while-idle=true +spring.datasource.time-between-eviction-runs-millis=30000 +spring.datasource.min-evictable-idle-time-millis=60000 +spring.datasource.max-wait=10000 +spring.datasource.jmx-enabled=true \ No newline at end of file From 33a4ed117528c3789696974cf0004c3ab0071150 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 13 May 2016 09:30:22 +0200 Subject: [PATCH 081/124] fix typo of MariaDB --- .../src/main/resources/application-mysql.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hawkbit-example-app/src/main/resources/application-mysql.properties b/examples/hawkbit-example-app/src/main/resources/application-mysql.properties index fbb0fcbad..202500245 100644 --- a/examples/hawkbit-example-app/src/main/resources/application-mysql.properties +++ b/examples/hawkbit-example-app/src/main/resources/application-mysql.properties @@ -8,7 +8,7 @@ # # This profile adds basic configurations for a MySQL DB usage. -# Keep in mind that you need the MaridDB driver in your classpath on compile. +# Keep in mind that you need the MariaDB driver in your classpath on compile. # see https://github.com/eclipse/hawkbit/wiki/Run-hawkBit spring.jpa.database=MYSQL @@ -29,4 +29,4 @@ spring.datasource.test-while-idle=true spring.datasource.time-between-eviction-runs-millis=30000 spring.datasource.min-evictable-idle-time-millis=60000 spring.datasource.max-wait=10000 -spring.datasource.jmx-enabled=true \ No newline at end of file +spring.datasource.jmx-enabled=true From 7a281a8236d2440984ebf7c71e40a787cd19ac3e Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 13 May 2016 15:38:52 +0200 Subject: [PATCH 082/124] allow the getTargetSecurityToken can be called as system code Signed-off-by: Michael Hirsch --- .../repository/DeploymentManagement.java | 9 ++++++- .../hawkbit/repository/model/Target.java | 9 +++++-- .../security/SystemSecurityContext.java | 26 +++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java index 805b66d75..1e58ea938 100644 --- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java +++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java @@ -54,6 +54,7 @@ import org.eclipse.hawkbit.repository.model.Target; import org.eclipse.hawkbit.repository.model.TargetInfo; import org.eclipse.hawkbit.repository.model.TargetUpdateStatus; import org.eclipse.hawkbit.repository.specifications.TargetSpecifications; +import org.eclipse.hawkbit.security.SystemSecurityContext; import org.hibernate.validator.constraints.NotEmpty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -118,6 +119,9 @@ public class DeploymentManagement { @Autowired private AfterTransactionCommitExecutor afterCommit; + @Autowired + private SystemSecurityContext systemSecurityContext; + /** * method assigns the {@link DistributionSet} to all {@link Target}s. * @@ -422,11 +426,14 @@ public class DeploymentManagement { private void assignDistributionSetEvent(final Target target, final Long actionId, final List softwareModules) { target.getTargetInfo().setUpdateStatus(TargetUpdateStatus.PENDING); + final String targetSecurityToken = systemSecurityContext.runAsSystem(() -> { + return target.getSecurityToken(); + }); afterCommit.afterCommit(() -> { eventBus.post(new TargetInfoUpdateEvent(target.getTargetInfo())); eventBus.post(new TargetAssignDistributionSetEvent(target.getOptLockRevision(), target.getTenant(), target.getControllerId(), actionId, softwareModules, target.getTargetInfo().getAddress(), - target.getSecurityToken())); + targetSecurityToken)); }); } diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java index 5f37fb653..8947ea6c3 100644 --- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java +++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/model/Target.java @@ -38,6 +38,7 @@ import javax.validation.constraints.Size; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.model.helper.SecurityChecker; import org.eclipse.hawkbit.repository.model.helper.SecurityTokenGeneratorHolder; +import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder; import org.eclipse.persistence.annotations.CascadeOnDelete; import org.springframework.data.domain.Persistable; @@ -193,10 +194,14 @@ public class Target extends NamedEntity implements Persistable { } /** - * @return the securityToken + * @return the securityToken if the current security context contains the + * necessary permission {@link SpPermission#READ_TARGET_SEC_TOKEN} + * or the current context is executed as system code, otherwise + * {@code null}. */ public String getSecurityToken() { - if (SecurityChecker.hasPermission(SpPermission.READ_TARGET_SEC_TOKEN)) { + if (SystemSecurityContextHolder.getInstance().getSystemSecurityContext().isCurrentThreadSystemCode() + || SecurityChecker.hasPermission(SpPermission.READ_TARGET_SEC_TOKEN)) { return securityToken; } return null; diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java index b22b54e39..409e714a0 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java @@ -49,6 +49,21 @@ public class SystemSecurityContext { this.tenantAware = tenantAware; } + /** + * Runs a given {@link Callable} within a system security context, which is + * permitted to call secured system code. Often the system needs to call + * secured methods by it's own without relying on the current security + * context e.g. if the current security context does not contain the + * necessary permission it's necessary to execute code as system code to + * execute necessary methods and functionality. + * + * The security context will be switched to the system code and back after + * the callable is called. + * + * @param callable + * the callable to call within the system security context + * @return the return value of the {@link Callable#call()} method. + */ public T runAsSystem(final Callable callable) { final SecurityContext oldContext = SecurityContextHolder.getContext(); try { @@ -68,6 +83,17 @@ public class SystemSecurityContext { } } + /** + * @return {@code true} if the current running code is running as system + * code block. + */ + public boolean isCurrentThreadSystemCode() { + if (SecurityContextHolder.getContext().getAuthentication() instanceof SystemCodeAuthentication) { + return true; + } + return false; + } + private static void setSystemContext() { final SecurityContextImpl securityContextImpl = new SecurityContextImpl(); securityContextImpl.setAuthentication(new SystemCodeAuthentication()); From dcbf27e3ed3a076e9e5a6c94fc9df9a862b1d370 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 17 May 2016 08:04:33 +0200 Subject: [PATCH 083/124] add junit tests to security of getTargetSecurityToken Signed-off-by: Michael Hirsch --- .../hawkbit/AbstractIntegrationTest.java | 7 +++-- .../hawkbit/WithSpringAuthorityRule.java | 14 ++++++--- .../repository/TargetManagementTest.java | 31 +++++++++++++++++++ 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java index b7091edf8..ddd850df1 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/AbstractIntegrationTest.java @@ -48,6 +48,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType; import org.eclipse.hawkbit.repository.model.SoftwareModuleType; import org.eclipse.hawkbit.repository.utils.RepositoryDataGenerator.DatabaseCleanupUtil; import org.eclipse.hawkbit.security.DosFilter; +import org.eclipse.hawkbit.security.SystemSecurityContext; import org.eclipse.hawkbit.tenancy.TenantAware; import org.junit.After; import org.junit.AfterClass; @@ -181,11 +182,10 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { @Autowired protected TenantAwareCacheManager cacheManager; - + @Autowired protected TenantConfigurationManagement tenantConfigurationManagement; - @Autowired protected RolloutManagement rolloutManagement; @@ -198,6 +198,9 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware { @Autowired protected RolloutRepository rolloutRepository; + @Autowired + protected SystemSecurityContext systemSecurityContext; + protected MockMvc mvc; @Autowired diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/WithSpringAuthorityRule.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/WithSpringAuthorityRule.java index 15fda51b4..40f6a64c2 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/WithSpringAuthorityRule.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/WithSpringAuthorityRule.java @@ -160,19 +160,23 @@ public class WithSpringAuthorityRule implements TestRule { } public static WithUser withUser(final String principal, final String... authorities) { - return withUserAndTenant(principal, "default", true, authorities); + return withUserAndTenant(principal, "default", true, true, authorities); + } + + public static WithUser withUser(final String principal, final boolean allSpPermision, final String... authorities) { + return withUserAndTenant(principal, "default", true, allSpPermision, authorities); } public static WithUser withUser(final boolean autoCreateTenant) { - return withUserAndTenant("bumlux", "default", autoCreateTenant, new String[] {}); + return withUserAndTenant("bumlux", "default", autoCreateTenant, true, new String[] {}); } public static WithUser withUserAndTenant(final String principal, final String tenant, final String... authorities) { - return withUserAndTenant(principal, tenant, true, new String[] {}); + return withUserAndTenant(principal, tenant, true, true, new String[] {}); } public static WithUser withUserAndTenant(final String principal, final String tenant, - final boolean autoCreateTenant, final String... authorities) { + final boolean autoCreateTenant, final boolean allSpPermission, final String... authorities) { return new WithUser() { @Override @@ -197,7 +201,7 @@ public class WithSpringAuthorityRule implements TestRule { @Override public boolean allSpPermissions() { - return true; + return allSpPermission; } @Override diff --git a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TargetManagementTest.java b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TargetManagementTest.java index a223c25b4..1c039c8c8 100644 --- a/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TargetManagementTest.java +++ b/hawkbit-repository/src/test/java/org/eclipse/hawkbit/repository/TargetManagementTest.java @@ -32,6 +32,7 @@ import org.eclipse.hawkbit.AbstractIntegrationTest; import org.eclipse.hawkbit.TestDataUtil; import org.eclipse.hawkbit.WithSpringAuthorityRule; import org.eclipse.hawkbit.WithUser; +import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException; import org.eclipse.hawkbit.repository.exception.TenantNotExistException; import org.eclipse.hawkbit.repository.model.Action; @@ -56,6 +57,36 @@ import ru.yandex.qatools.allure.annotations.Stories; @Stories("Target Management") public class TargetManagementTest extends AbstractIntegrationTest { + @Test + @Description("Ensures that retrieving the target security is only permitted with the necessary permissions.") + public void getTargetSecurityTokenOnlyWithCorrectPermission() throws Exception { + final Target createdTarget = targetManagement.createTarget(new Target("targetWithSecurityToken")); + + // retrieve security token only with READ_TARGET_SEC_TOKEN permission + final String securityTokenWithReadPermission = securityRule.runAs(WithSpringAuthorityRule + .withUser("OnlyTargetReadPermission", false, SpPermission.READ_TARGET_SEC_TOKEN.toString()), () -> { + return createdTarget.getSecurityToken(); + }); + + // retrieve security token as system code execution + final String securityTokenAsSystemCode = systemSecurityContext.runAsSystem(() -> { + return createdTarget.getSecurityToken(); + }); + + // retrieve security token without any permissions + final String securityTokenWithoutPermission = securityRule + .runAs(WithSpringAuthorityRule.withUser("NoPermission", false), () -> { + return createdTarget.getSecurityToken(); + }); + + assertThat(createdTarget.getSecurityToken()).isNotNull(); + assertThat(securityTokenWithReadPermission).isNotNull(); + assertThat(securityTokenAsSystemCode).isNotNull(); + + assertThat(securityTokenWithoutPermission).isNull(); + + } + @Test @Description("Ensures that targets cannot be created e.g. in plug'n play scenarios when tenant does not exists.") @WithUser(tenantId = "tenantWhichDoesNotExists", allSpPermissions = true, autoCreateTenant = false) From 5eeac5cb382c1abece801858683189c4a16dd567 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 17 May 2016 08:37:04 +0200 Subject: [PATCH 084/124] remove create breadcumb comment --- .../hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java index 17c1410d3..eb809ff02 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java @@ -212,7 +212,6 @@ public class CreateOrUpdateFilterHeader extends VerticalLayout implements Button private void createComponents() { - // Breadcrumb breadcrumbButton = createBreadcrumbButton(); headerCaption = SPUIComponentProvider.getLabel(SPUILabelDefinitions.VAR_CREATE_FILTER, From 56487ad1b78af39487811fc8c99de4833a411519 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 17 May 2016 10:57:08 +0200 Subject: [PATCH 085/124] remove if-statement and return immediately the instanceof result Signed-off-by: Michael Hirsch --- .../org/eclipse/hawkbit/security/SystemSecurityContext.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java index 409e714a0..f849eb541 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java @@ -88,10 +88,7 @@ public class SystemSecurityContext { * code block. */ public boolean isCurrentThreadSystemCode() { - if (SecurityContextHolder.getContext().getAuthentication() instanceof SystemCodeAuthentication) { - return true; - } - return false; + return SecurityContextHolder.getContext().getAuthentication() instanceof SystemCodeAuthentication; } private static void setSystemContext() { From e658e7dac6175a030cac6022b7aff7563dc2cb6d Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 17 May 2016 12:49:32 +0200 Subject: [PATCH 086/124] Merged changes from master into ddi-resources Signed-off-by: Jonathan Philip Knoblauch --- .../rest/resource/DataConversionHelper.java | 37 +++++++++++-------- .../ddi/rest/resource/DdiRootController.java | 6 +-- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index f05bb6d98..b07e2557c 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -33,7 +33,6 @@ 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; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.Link; import com.google.common.base.Charsets; @@ -42,10 +41,6 @@ import com.google.common.base.Charsets; * Utility class for the DDI API. */ public final class DataConversionHelper { - - @Autowired - ArtifactUrlHandler artifactUrlHandler; - // utility class, private constructor. private DataConversionHelper() { @@ -84,23 +79,33 @@ public final class DataConversionHelper { final org.eclipse.hawkbit.repository.model.SoftwareModule module, final ArtifactUrlHandler artifactUrlHandler) { final List files = new ArrayList<>(); - module.getLocalArtifacts().forEach(artifact -> { - final DdiArtifact file = new DdiArtifact(); - file.setHashes(new DdiArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); - file.setFilename(artifact.getFilename()); - file.setSize(artifact.getSize()); + + module.getLocalArtifacts() + .forEach(artifact -> files.add(createArtifact(targetid, artifactUrlHandler, artifact))); + return files; + } + + private static DdiArtifact createArtifact(final String targetid, final ArtifactUrlHandler artifactUrlHandler, + final LocalArtifact artifact) { + final DdiArtifact file = new DdiArtifact(); + file.setHashes(new DdiArtifactHash(artifact.getSha1Hash(), artifact.getMd5Hash())); + file.setFilename(artifact.getFilename()); + file.setSize(artifact.getSize()); + + if (artifactUrlHandler.protocolSupported(UrlProtocol.HTTP)) { final String linkHttp = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(), artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTP); + file.add(new Link(linkHttp).withRel("download-http")); + file.add(new Link(linkHttp + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); + } + + if (artifactUrlHandler.protocolSupported(UrlProtocol.HTTPS)) { final String linkHttps = artifactUrlHandler.getUrl(targetid, artifact.getSoftwareModule().getId(), artifact.getFilename(), artifact.getSha1Hash(), UrlProtocol.HTTPS); file.add(new Link(linkHttps).withRel("download")); file.add(new Link(linkHttps + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum")); - file.add(new Link(linkHttp).withRel("download-http")); - file.add(new Link(linkHttp + DdiDlRestConstants.ARTIFACT_MD5_DWNL_SUFFIX).withRel("md5sum-http")); - - files.add(file); - }); - return files; + } + return file; } static DdiControllerBase fromTarget(final Target target, final List actions, diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index b614d70e2..3bf70ccfd 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -102,8 +102,6 @@ public class DdiRootController implements DdiRootControllerRestApi { @PathVariable("softwareModuleId") final Long softwareModuleId) { LOG.debug("getSoftwareModulesArtifacts({})", targetid); - // SecurityContextHolder.getContext().getAuthentication(). - final SoftwareModule softwareModule = softwareManagement.findSoftwareModuleById(softwareModuleId); if (softwareModule == null) { @@ -250,7 +248,8 @@ public class DdiRootController implements DdiRootControllerRestApi { LOG.debug("Found an active UpdateAction for target {}. returning deyploment: {}", targetid, base); controllerManagement.registerRetrieved(action, - "Controller retrieved update action and should start now the download."); + ControllerManagement.SERVER_MESSAGE_PREFIX + + "Target retrieved update action and should start now the download."); return new ResponseEntity<>(base, HttpStatus.OK); } @@ -287,7 +286,6 @@ public class DdiRootController implements DdiRootControllerRestApi { } controllerManagement.addUpdateActionStatus( - generateUpdateStatus(feedback, targetid, feedback.getId(), action), action); return new ResponseEntity<>(HttpStatus.OK); From 422918d9072a0ba1868c54341ac3d01039e5aeff Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Tue, 17 May 2016 13:12:01 +0200 Subject: [PATCH 087/124] Added module docu Signed-off-by: Jonathan Philip Knoblauch --- README.md | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e61e5e9d1..602d01a60 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,25 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v # Modules -`hawkbit-core` : internal interfaces and utility classes.. -`hawkbit-security-core` : authentication and authorization. -`hawkbit-security-integration` : authentication and authorization integrated with the APIs. -`hawkbit-artifact-repository-mongo` : artifact repository implementation to MongoDB. -`hawkbit-autoconfigure` : spring-boot auto-configuration. -`hawkbit-dmf-api` : API for the Device Management Integration. -`hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. -`hawkbit-repository` : repository implementation based on SQL for all meta-data. -`hawkbit-http-security` : implementation for security filters for HTTP. -`hawkbit-rest-api` : API classes for the REST Management API. -`hawkbit-rest-resource` : HTTP REST endpoints for the Management and the Direct Device API. -`hawkbit-ui` : Vaadin UI. -`hawkbit-cache-redis` : spring cache manager configuration and implementation with redis, distributed cache and distributed events. + +* `examples` : hawkBit examples +* `hawkbit-artifact-repository-mongo` : Artifact repository implementation to mongoDB. +* `hawkbit-autoconfigure` : Spring-boot auto-configuration. +* `hawkbit-cache-redis` : Spring cache manager configuration and implementation with redis, distributed cache and distributed events. +* `hawkbit-core` : Core elements for internal interfaces and utility classes. +* `hawkbit-ddi-api` : The hawkBit DDI API. +* `hawkbit-ddi-dl-api` : The hawkBit DDI Download API. +* `hawkbit-ddi-resource` : Implementation of the hawkBit DDI API +* `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. +* `hawkbit-dmf-api` : API for the Device Management Integration. +* `hawkbit-http-security` : Implementation for security filters for HTTP. +* `hawkbit-mgmt-api` : The hawkBit Management API +* `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API +* `hawkbit-mgmt-ui` : Vaadin UI. +* `hawkbit-repository` : Repository implementation based on SQL for all meta-data. +* `hawkbit-rest-core` : Core elements for the rest modules. +* `hawkbit-security-core` : Core security elements. +* `hawkbit-security-integration` : Security integration elements to integrate security into hawkBit. +* `hawkbit-system-api` : The hawkBit System API +* `hawkbit-system-resource` : Implementation of the hawkBit System API +* `hawkbit-test-report` : Test reports From 156da103b57be83cd529d24e44806a8b10984112 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 13:32:50 +0200 Subject: [PATCH 088/124] Modify readme Signed-off-by: SirWayne --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e61e5e9d1..d1cfabcfa 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v # Modules -`hawkbit-core` : internal interfaces and utility classes.. +`hawkbit-core` : internal interfaces and utility classes. `hawkbit-security-core` : authentication and authorization. `hawkbit-security-integration` : authentication and authorization integrated with the APIs. `hawkbit-artifact-repository-mongo` : artifact repository implementation to MongoDB. @@ -66,7 +66,13 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v `hawkbit-dmf-amqp` : AMQP endpoint implementation for the DMF API. `hawkbit-repository` : repository implementation based on SQL for all meta-data. `hawkbit-http-security` : implementation for security filters for HTTP. -`hawkbit-rest-api` : API classes for the REST Management API. -`hawkbit-rest-resource` : HTTP REST endpoints for the Management and the Direct Device API. -`hawkbit-ui` : Vaadin UI. +`hawkbit-rest-core` : internal utility classes for rest. +`hawkbit-ddi-api` : Rest interfaces for the Direct Device API. +`hawkbit-ddi-dl-api` : Rest interfaces for Direct Device download part. +`hawkbit-ddi-resource` : Rest implementation for the Direct Device API with download part. +`hawkbit-mgmt-api` : Rest interfaces for REST Management API. +`hawkbit-mgmt-resource` : Rest implementation for the REST Management API. +`hawkbit-mgmt-ui` : Vaadin UI for Management API. +`hawkbit-system-api` : internal rest system API. +`hawkbit-system-resource` : internal rest system implementation. `hawkbit-cache-redis` : spring cache manager configuration and implementation with redis, distributed cache and distributed events. From eb3f9f6f2d22a06c5c16c6897d079ca9e28866e2 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 16:24:14 +0200 Subject: [PATCH 089/124] Fix header Signed-off-by: SirWayne --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 81b246fa1..6fdab75b3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,8 @@ which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html ---> +--> + 4.0.0 From a47f7275eb98a30fea056bab60ca9874439d6613 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 16:43:59 +0200 Subject: [PATCH 090/124] Fix header Signed-off-by: SirWayne --- .../rest/util/RequestResponseContextHolder.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java index 07b6af58d..72f37d8cb 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java @@ -1,5 +1,10 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.rest.util; @@ -10,12 +15,7 @@ import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; /** - * 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 + * Store the request and response for the rest resources. */ public class RequestResponseContextHolder { From 5c233c628c95f0108a26adbb6eaffe58cad97806 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 17:02:10 +0200 Subject: [PATCH 091/124] Fix header Signed-off-by: SirWayne --- .../hawkbit/rest/util/RequestResponseContextHolder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java index 72f37d8cb..f25a98810 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RequestResponseContextHolder.java @@ -1,9 +1,9 @@ /** * 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 + * 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.rest.util; From a48460ee039e45af15ad36b2b72abc79073aba94 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 17:24:14 +0200 Subject: [PATCH 092/124] Fix header Signed-off-by: SirWayne --- hawkbit-system-resource/pom.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml index 440e327a3..3a2433366 100644 --- a/hawkbit-system-resource/pom.xml +++ b/hawkbit-system-resource/pom.xml @@ -1,6 +1,13 @@ - + 4.0.0 From e05b1bac592e6049feec416ef4497d1dc66ceaa4 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 17:24:58 +0200 Subject: [PATCH 093/124] Fix header Signed-off-by: SirWayne --- examples/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 32356e8a6..be54f149c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -1,4 +1,3 @@ - +--> + 4.0.0 From 8125caf1180207989b397d7aa06f1b45260bce42 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 17 May 2016 17:25:46 +0200 Subject: [PATCH 094/124] Fix header Signed-off-by: SirWayne --- examples/hawkbit-example-ddi-client/pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index cd9613457..e6a70b5d4 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -1,4 +1,13 @@ - + 4.0.0 From 677b35ef423d0f2405b05d21dd07418b34bc2bb1 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 08:32:33 +0200 Subject: [PATCH 095/124] Fix header Signed-off-by: SirWayne --- .../hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java | 3 +-- .../hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java | 2 +- .../hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java | 4 ++-- .../org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java | 2 +- .../hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java | 2 +- .../hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java | 2 +- .../org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java | 2 +- .../eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index 0b960543c..01ae4f93f 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -2,11 +2,10 @@ * 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 License v1.0 + * 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.mgmt.rest.api; import java.util.List; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java index 316f2a56e..761e803af 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index 84fe8c4e7..01aea87f1 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ @@ -12,9 +12,9 @@ import java.util.List; import org.eclipse.hawkbit.mgmt.json.model.MgmtId; import org.eclipse.hawkbit.mgmt.json.model.PagedList; +import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetType; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPost; import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetTypeRequestBodyPut; -import org.eclipse.hawkbit.mgmt.json.model.distributionsettype.MgmtDistributionSetType; import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModuleType; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java index ea4578cad..450d080d1 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index dab8cc594..54bf7b08b 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java index 6c7252d62..208162645 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java index 572dcf500..077c2c799 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java index 90646a562..132a9f939 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java @@ -2,7 +2,7 @@ * 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 License v1.0 + * 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 */ From c8d0424706eb1a8ef1b94fb55b670907c4f49e73 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 08:34:02 +0200 Subject: [PATCH 096/124] Fix header Signed-off-by: SirWayne --- .../hawkbit/ddi/rest/api/DdiRootControllerRestApi.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index 45382faf5..eaa879562 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -1,5 +1,10 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.rest.api; From 58648cb9b2c3b17289e76604a2d1090ce950c64d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 08:34:31 +0200 Subject: [PATCH 097/124] Fix header Signed-off-by: SirWayne --- .../dl/rest/api/DdiDlArtifactStoreControllerRestApi.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java index da938b2d1..53d5940fe 100644 --- a/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java +++ b/hawkbit-ddi-dl-api/src/main/java/org/eclipse/hawkbit/ddi/dl/rest/api/DdiDlArtifactStoreControllerRestApi.java @@ -1,6 +1,6 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. - * + * 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 @@ -37,7 +37,8 @@ public interface DdiDlArtifactStoreControllerRestApi { * {@link HttpStatus#OK} or in case of partial download * {@link HttpStatus#PARTIAL_CONTENT}. */ - @RequestMapping(method = RequestMethod.GET, value = DdiDlRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + "/{fileName}") + @RequestMapping(method = RequestMethod.GET, value = DdiDlRestConstants.ARTIFACT_DOWNLOAD_BY_FILENAME + + "/{fileName}") @ResponseBody public ResponseEntity downloadArtifactByFilename(@PathVariable("fileName") final String fileName, @AuthenticationPrincipal final String targetid); From 610daed845ac47d5de80823a60300a3f16f2b20e Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 08:37:31 +0200 Subject: [PATCH 098/124] Fix header Signed-off-by: SirWayne --- .../resource/RootControllerResourceClientConstants.java | 7 ++++++- .../hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java | 4 ++-- .../strategy/SaveArtifactsToLocalTempDirectories.java | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java index 0611c4a09..07d31337e 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java @@ -1,5 +1,10 @@ /** - * Copyright (c) 2011-2016 Bosch Software Innovations GmbH, Germany. All rights reserved. + * 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.client.resource; diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java index 7e5d72c4a..4d71528b2 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java @@ -12,8 +12,8 @@ import java.io.IOException; import java.io.InputStream; /** - * Implementation of {@link ArtifactsPersistenceStrategy} for not downloading any - * artifacts. + * Implementation of {@link ArtifactsPersistenceStrategy} for not downloading + * any artifacts. */ public class DoNotSaveArtifacts implements ArtifactsPersistenceStrategy { diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java index 11ac5698b..afcc01419 100644 --- a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java +++ b/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java @@ -18,8 +18,8 @@ import com.google.common.io.ByteStreams; import com.google.common.io.Files; /** - * Implementation of {@link ArtifactsPersistenceStrategy} for downloading artifacts to - * the temp directory. + * Implementation of {@link ArtifactsPersistenceStrategy} for downloading + * artifacts to the temp directory. */ public class SaveArtifactsToLocalTempDirectories implements ArtifactsPersistenceStrategy { From 9d6527a3e29567c0c0b55951121d1356a65d7a3b Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Wed, 18 May 2016 09:03:58 +0200 Subject: [PATCH 099/124] Switched back to Boots default logger: logback Signed-off-by: Kai Zimmermann --- examples/hawkbit-device-simulator/pom.xml | 26 +++++++++++++------ .../src/main/resources/logback.xml | 22 ++++++++++++++++ examples/hawkbit-example-app/pom.xml | 26 +++++++++++++------ .../src/main/resources/logback.xml | 22 ++++++++++++++++ pom.xml | 23 ---------------- 5 files changed, 80 insertions(+), 39 deletions(-) create mode 100644 examples/hawkbit-device-simulator/src/main/resources/logback.xml create mode 100644 examples/hawkbit-example-app/src/main/resources/logback.xml diff --git a/examples/hawkbit-device-simulator/pom.xml b/examples/hawkbit-device-simulator/pom.xml index 728fe0595..99ed154d9 100644 --- a/examples/hawkbit-device-simulator/pom.xml +++ b/examples/hawkbit-device-simulator/pom.xml @@ -82,16 +82,26 @@ org.springframework.boot spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - + - org.springframework.boot - spring-boot-starter-log4j2 + org.apache.logging.log4j + log4j-api + + + + org.slf4j + jul-to-slf4j + + + + org.slf4j + jcl-over-slf4j + + + + org.slf4j + log4j-over-slf4j com.vaadin diff --git a/examples/hawkbit-device-simulator/src/main/resources/logback.xml b/examples/hawkbit-device-simulator/src/main/resources/logback.xml new file mode 100644 index 000000000..0cdbf8ff6 --- /dev/null +++ b/examples/hawkbit-device-simulator/src/main/resources/logback.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index a5c0f864d..2f37a510e 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -96,16 +96,26 @@ org.springframework.boot spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - + - org.springframework.boot - spring-boot-starter-log4j2 + org.apache.logging.log4j + log4j-api + + + + org.slf4j + jul-to-slf4j + + + + org.slf4j + jcl-over-slf4j + + + + org.slf4j + log4j-over-slf4j org.springframework.security diff --git a/examples/hawkbit-example-app/src/main/resources/logback.xml b/examples/hawkbit-example-app/src/main/resources/logback.xml new file mode 100644 index 000000000..7470bb201 --- /dev/null +++ b/examples/hawkbit-example-app/src/main/resources/logback.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index b6d09758e..4ecf2497b 100644 --- a/pom.xml +++ b/pom.xml @@ -445,39 +445,16 @@ org.springframework.boot spring-boot-starter-actuator ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-log4j2 - ${spring.boot.version} org.springframework.boot spring-boot-starter-web ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-logging - - org.springframework.boot spring-boot-starter ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-logging - - org.springframework.boot From fd6de4496d30a67903e525c116be8149865649d0 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Wed, 18 May 2016 09:05:01 +0200 Subject: [PATCH 100/124] Improved simulator download case a bit. Added missing test asserts for target token in DMF. Signed-off-by: Kai Zimmermann --- .../eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java | 6 ++++++ .../hawkbit/amqp/AmqpMessageDispatcherServiceTest.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java index e7b81b017..5c6c0a3ea 100644 --- a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java +++ b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java @@ -149,6 +149,8 @@ public class DeviceSimulatorUpdater { eventbus.post(new ProgressUpdate(device)); return; } + // download is 80% of the game after all + device.setProgress(0.8); } final double newProgress = device.getProgress() + 0.2; @@ -272,6 +274,10 @@ public class DeviceSimulatorUpdater { } private static String hideTokenDetails(final String targetToken) { + if (targetToken == null) { + return ""; + } + if (targetToken.isEmpty()) { return ""; } diff --git a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java index c5cea9e05..9164e655d 100644 --- a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java +++ b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java @@ -100,6 +100,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTestWit amqpMessageDispatcherService.targetAssignDistributionSet(targetAssignDistributionSetEvent); final Message sendMessage = createArgumentCapture(targetAssignDistributionSetEvent.getTargetAdress()); final DownloadAndUpdateRequest downloadAndUpdateRequest = assertDownloadAndInstallMessage(sendMessage); + assertThat(downloadAndUpdateRequest.getTargetSecurityToken()).isEqualTo(TEST_TOKEN); assertTrue("No softwaremmodule should be contained in the request", downloadAndUpdateRequest.getSoftwareModules().isEmpty()); } @@ -116,6 +117,7 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTestWit final DownloadAndUpdateRequest downloadAndUpdateRequest = assertDownloadAndInstallMessage(sendMessage); assertEquals("Expecting a size of 3 software modules in the reuqest", 3, downloadAndUpdateRequest.getSoftwareModules().size()); + assertThat(downloadAndUpdateRequest.getTargetSecurityToken()).isEqualTo(TEST_TOKEN); for (final org.eclipse.hawkbit.dmf.json.model.SoftwareModule softwareModule : downloadAndUpdateRequest .getSoftwareModules()) { assertTrue("Artifact list for softwaremodule should be empty", softwareModule.getArtifacts().isEmpty()); @@ -155,6 +157,8 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTestWit final DownloadAndUpdateRequest downloadAndUpdateRequest = assertDownloadAndInstallMessage(sendMessage); assertEquals("DownloadAndUpdateRequest event should contains 3 software modules", 3, downloadAndUpdateRequest.getSoftwareModules().size()); + assertThat(downloadAndUpdateRequest.getTargetSecurityToken()).isEqualTo(TEST_TOKEN); + for (final org.eclipse.hawkbit.dmf.json.model.SoftwareModule softwareModule : downloadAndUpdateRequest .getSoftwareModules()) { if (!softwareModule.getModuleId().equals(module.getId())) { From 159fa3abb372f095a63d9048f1cd285f4505117f Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 09:06:55 +0200 Subject: [PATCH 101/124] Fix header Signed-off-by: SirWayne --- hawkbit-mgmt-resource/pom.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hawkbit-mgmt-resource/pom.xml b/hawkbit-mgmt-resource/pom.xml index 4e5302e23..160299651 100644 --- a/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-mgmt-resource/pom.xml @@ -1,6 +1,13 @@ - + 4.0.0 From e30748dd53fc0bcd73656332f961a3439a083fcb Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 09:24:33 +0200 Subject: [PATCH 102/124] Modify name of artifacts in pom Signed-off-by: SirWayne --- examples/hawkbit-device-simulator/pom.xml | 2 +- examples/hawkbit-example-app/pom.xml | 2 +- examples/hawkbit-example-ddi-client/pom.xml | 2 +- examples/hawkbit-example-feign-core-client/pom.xml | 3 +-- examples/hawkbit-example-mgmt-client/pom.xml | 2 +- examples/hawkbit-example-mgmt-spring-client/pom.xml | 2 +- examples/pom.xml | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/hawkbit-device-simulator/pom.xml b/examples/hawkbit-device-simulator/pom.xml index 728fe0595..b8539296a 100644 --- a/examples/hawkbit-device-simulator/pom.xml +++ b/examples/hawkbit-device-simulator/pom.xml @@ -19,7 +19,7 @@ hawkbit-device-simulator - hawkBit :: Device Simulator + hawkBit-example :: Device Simulator Device Management Federation API based simulator diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index efbcf9e9e..9fd0958ea 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -17,7 +17,7 @@ 0.2.0-SNAPSHOT hawkbit-example-app - hawkBit :: Example App + hawkBit-example :: UI Application diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-client/pom.xml index e6a70b5d4..629d1e988 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-client/pom.xml @@ -18,7 +18,7 @@ hawkbit-example-ddi-client - hawkbit-example-ddi-client + hawkBit-example :: DDI Feign Client diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-feign-core-client/pom.xml index 5514db95d..23d66e69d 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-feign-core-client/pom.xml @@ -18,8 +18,7 @@ hawkbit-example-feign-core-client - hawkbit-example-feign-core-client - + hawkBit-example :: Feign Core Client diff --git a/examples/hawkbit-example-mgmt-client/pom.xml b/examples/hawkbit-example-mgmt-client/pom.xml index 446ee55da..6bd360459 100644 --- a/examples/hawkbit-example-mgmt-client/pom.xml +++ b/examples/hawkbit-example-mgmt-client/pom.xml @@ -18,7 +18,7 @@ jar hawkbit-example-mgmt-client - hawkBit Management client API + hawkBit-example :: Management client API diff --git a/examples/hawkbit-example-mgmt-spring-client/pom.xml b/examples/hawkbit-example-mgmt-spring-client/pom.xml index 73f7ba248..afd7a6ec2 100644 --- a/examples/hawkbit-example-mgmt-spring-client/pom.xml +++ b/examples/hawkbit-example-mgmt-spring-client/pom.xml @@ -18,7 +18,7 @@ jar hawkbit-example-mgmt-spring-client - hawkBit Management API example client + hawkBit-example :: Management Feign Client diff --git a/examples/pom.xml b/examples/pom.xml index be54f149c..7bbe58848 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -18,7 +18,7 @@ hawkbit-examples-parent - hawkBit :: Examples Parent + hawkBit-example :: Parent pom From 40fa1325bde5308e0fc18f25540408e74263e86c Mon Sep 17 00:00:00 2001 From: venu1278 Date: Wed, 18 May 2016 14:07:52 +0530 Subject: [PATCH 103/124] fix_display_DSNameVersion_actionhistory_table. Signed-off-by: venu1278 --- .../actionhistory/ActionHistoryTable.java | 8 +++---- .../hawkbit/ui/utils/HawkbitCommonUtil.java | 22 +------------------ 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java index 834566f7e..be1a96c37 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java @@ -296,8 +296,8 @@ public class ActionHistoryTable extends TreeTable implements Handler { * add distribution name to the item which will be displayed in the * table. The name should not exceed certain limit. */ - item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(HawkbitCommonUtil - .getFormattedText(actionWithStatusCount.getDsName() + ":" + actionWithStatusCount.getDsVersion())); + item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(actionWithStatusCount.getDsName() + ":" + + actionWithStatusCount.getDsVersion()); item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).setValue(action); /* Default no child */ @@ -442,8 +442,8 @@ public class ActionHistoryTable extends TreeTable implements Handler { childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).setValue(""); childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST) - .setValue(HawkbitCommonUtil.getFormattedText(action.getDistributionSet().getName() + ":" - + action.getDistributionSet().getVersion())); + .setValue(action.getDistributionSet().getName() + ":" + + action.getDistributionSet().getVersion()); childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME) .setValue(SPDateTimeUtil.getFormattedDate(actionStatus.getCreatedAt())); diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java index 0e71567af..a1091cd8a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java @@ -431,27 +431,7 @@ public final class HawkbitCommonUtil { return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText; } - /** - * Format the lengthy text. - * - * @param orgText - * text to be formatted - * @return String formatted text - */ - public static String getFormattedText(final String orgText) { - if (orgText == null) { - return StringUtils.EMPTY; - } - - final int txtLengthAllowed = SPUIDefinitions.NAME_DESCRIPTION_LENGTH; - if (orgText.length() > txtLengthAllowed) { - return new StringBuilder(orgText.substring(0, txtLengthAllowed)).append("...").toString(); - } - - return orgText; - } - - /** + /** * Find extra height required to increase by all the components to utilize * the full height of browser for the responsive UI. * From b8936409fe60edfa3ddda3e0a8b4b3f1cdece1e5 Mon Sep 17 00:00:00 2001 From: venu1278 Date: Wed, 18 May 2016 14:17:29 +0530 Subject: [PATCH 104/124] fix_flashing_whitepage_on_login_application Signed-off-by: venu1278 --- .../resources/VAADIN/themes/hawkbit/hawkbittheme.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss index a344cb5ae..550a0479b 100644 --- a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss +++ b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss @@ -132,4 +132,14 @@ $v-included-components: remove($v-included-components, form); left: 50%; margin-left: -20px; } + .v-generated-body &.v-app , .v-generated-body .v-app { + background-color: rgba(0, 0, 0, 0); + background-image: $app-background-image, linear-gradient(to bottom, $app-background-image-gradient) !important; + background-image: $app-background-image, -webkit-linear-gradient(top, $app-background-image-gradient) !important; + background-image: $app-background-image, -moz-linear-gradient(top, $app-background-image-gradient) !important; + background-position: bottom; + background-repeat: no-repeat; + height:100%; + width:100%; + } } From b8a3dbdf62764b5719ee79b4fe54596af80f5941 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Wed, 18 May 2016 11:12:27 +0200 Subject: [PATCH 105/124] Fixed sonar issues. Signed-off-by: Kai Zimmermann --- .../org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java | 2 +- .../eclipse/hawkbit/api/PropertyBasedArtifactUrlHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java index 5c6c0a3ea..34c5f548e 100644 --- a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java +++ b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/DeviceSimulatorUpdater.java @@ -264,7 +264,7 @@ public class DeviceSimulatorUpdater { } } catch (IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) { - LOGGER.error("Failed to download {} with {}", url, e.getMessage()); + LOGGER.error("Failed to download" + url, e); return new UpdateStatus(ResponseStatus.ERROR, "Failed to download " + url + ": " + e.getMessage()); } diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandler.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandler.java index 0072f2fbd..d43d660ca 100644 --- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandler.java +++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandler.java @@ -61,7 +61,7 @@ public class PropertyBasedArtifactUrlHandler implements ArtifactUrlHandler { for (final Entry entry : entrySet) { if (entry.getKey().equals(PORT_PLACEHOLDER)) { urlPattern = urlPattern.replace(":{" + entry.getKey() + "}", - Strings.isNullOrEmpty(entry.getValue()) ? "" : ":" + entry.getValue()); + Strings.isNullOrEmpty(entry.getValue()) ? "" : (":" + entry.getValue())); } else { urlPattern = urlPattern.replace("{" + entry.getKey() + "}", entry.getValue()); } From b58ba745652e4fb435ddf0f5e3cacc2a85c4c8c9 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 18 May 2016 12:45:09 +0200 Subject: [PATCH 106/124] the column name must be the same as the bean attribute name otherwise NPE Signed-off-by: Michael Hirsch --- .../eclipse/hawkbit/simulator/ui/SimulatorView.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java index bd6ecbe8b..4834bece9 100644 --- a/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java +++ b/examples/hawkbit-device-simulator/src/main/java/org/eclipse/hawkbit/simulator/ui/SimulatorView.java @@ -53,11 +53,13 @@ import com.vaadin.ui.renderers.ProgressBarRenderer; * */ @SpringView(name = "") +// The inheritance comes from Vaadin +@SuppressWarnings("squid:MaximumInheritanceDepth") public class SimulatorView extends VerticalLayout implements View { private static final String NEXT_POLL_COUNTER_SEC_COL = "nextPollCounterSec"; - private static final String RESPONSE_STATUS_COL = "responseStatus"; + private static final String RESPONSE_STATUS_COL = "updateStatus"; private static final String PROTOCOL_COL = "protocol"; @@ -141,10 +143,9 @@ public class SimulatorView extends VerticalLayout implements View { responseComboBox.setItemIcon(ResponseStatus.ERROR, FontAwesome.EXCLAMATION_CIRCLE); responseComboBox.setNullSelectionAllowed(false); responseComboBox.setValue(ResponseStatus.SUCCESSFUL); - responseComboBox.addValueChangeListener(valueChangeEvent -> { - beanContainer.getItemIds().forEach(itemId -> beanContainer.getItem(itemId) - .getItemProperty(RESPONSE_STATUS_COL).setValue(valueChangeEvent.getProperty().getValue())); - }); + responseComboBox.addValueChangeListener( + valueChangeEvent -> beanContainer.getItemIds().forEach(itemId -> beanContainer.getItem(itemId) + .getItemProperty(RESPONSE_STATUS_COL).setValue(valueChangeEvent.getProperty().getValue()))); // add all components addComponent(caption); From 5bb24c78ade0714efed4fb45254d75f00994d7c8 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 13:48:04 +0200 Subject: [PATCH 107/124] Remove and Rename modules Signed-off-by: SirWayne --- examples/hawkbit-custom-theme-example/pom.xml | 2 +- examples/hawkbit-example-app/pom.xml | 7 +- .../java/org/eclipse/hawkbit/app/Start.java | 2 - .../README.md | 0 .../pom.xml | 2 +- ...plicationJsonRequestHeaderInterceptor.java | 0 .../core/client/FeignClientConfiguration.java | 0 ...leConsumersProducersSpringMvcContract.java | 0 .../README.md | 0 .../pom.xml | 4 +- .../hawkbit/ddi/client/DdiDecoder.java | 0 .../ddi/client/DdiDefaultFeignClient.java | 0 .../hawkbit/ddi/client/DdiExampleClient.java | 0 .../AuthenticationInterceptor.java | 0 .../AuthenticationInterceptorFactory.java | 0 ...ecurityTokenAuthenticationInterceptor.java | 0 ...ArtifactStoreControllerResourceClient.java | 0 .../RootControllerResourceClient.java | 0 ...RootControllerResourceClientConstants.java | 0 .../ArtifactsPersistenceStrategy.java | 0 .../client/strategy/DoNotSaveArtifacts.java | 0 .../SaveArtifactsToLocalTempDirectories.java | 0 .../.gitignore | 0 .../README.md | 0 .../pom.xml | 9 +- .../MgmtDistributionSetClientResource.java | 0 .../MgmtDistributionSetTagClientResource.java | 0 ...MgmtDistributionSetTypeClientResource.java | 0 .../MgmtDownloadArtifactClientResource.java | 0 .../resource/MgmtDownloadClientResource.java | 0 .../resource/MgmtRolloutClientResource.java | 0 .../MgmtSoftwareModuleClientResource.java | 0 .../MgmtSoftwareModuleTypeClientResource.java | 0 .../resource/MgmtTargetClientResource.java | 0 .../resource/MgmtTargetTagClientResource.java | 0 .../client/resource/SystemClientResource.java | 6 +- .../SystemManagementClientResource.java | 6 +- .../builder/DistributionSetBuilder.java | 0 .../builder/DistributionSetTypeBuilder.java | 0 .../resource/builder/RolloutBuilder.java | 0 .../SoftwareModuleAssigmentBuilder.java | 0 .../builder/SoftwareModuleBuilder.java | 0 .../builder/SoftwareModuleTypeBuilder.java | 0 .../client/resource/builder/TagBuilder.java | 0 .../resource/builder/TargetBuilder.java | 0 .../.gitignore | 0 .../README.md | 0 .../pom.xml | 4 +- .../hawkbit/mgmt/client/Application.java | 0 .../client/ClientConfigurationProperties.java | 0 .../CreateStartedRolloutExample.java | 0 .../GettingStartedDefaultScenario.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 0 examples/pom.xml | 8 +- hawkbit-autoconfigure/pom.xml | 8 +- .../SecurityManagedConfiguration.java | 6 +- .../ResourceControllerAutoConfiguration.java | 5 +- .../resource/DdiArtifactStoreController.java | 2 +- .../MgmtSystemTenantConfigurationValue.java | 4 +- ...SystemTenantConfigurationValueRequest.java | 8 +- .../systemmanagement/MgmtSystemCache.java | 8 +- .../MgmtSystemStatisticsRest.java | 20 +- .../MgmtSystemTenantServiceUsage.java | 6 +- .../mgmt/rest/api/MgmtRestConstants.java | 15 +- .../rest/api/MgmtSystemManagementRestApi.java | 14 +- .../mgmt/rest/api/MgmtSystemRestApi.java | 19 +- .../MgmtSystemManagementResource.java | 38 ++-- .../mgmt/rest/resource/MgmtSystemMapper.java | 20 +- .../rest/resource/MgmtSystemResource.java | 32 ++-- hawkbit-system-api/README.md | 14 -- hawkbit-system-api/pom.xml | 33 ---- .../system/rest/api/SystemRestConstant.java | 41 ---- hawkbit-system-resource/README.md | 13 -- hawkbit-system-resource/pom.xml | 157 ---------------- .../system/annotation/EnableSystemApi.java | 33 ---- .../system/rest/resource/ResourceUtility.java | 32 ---- .../SystemManagementResourceTest.java | 175 ------------------ .../rest/resource/SystemResourceTest.java | 147 --------------- {hawkbit-mgmt-ui => hawkbit-ui}/.gitignore | 0 {hawkbit-mgmt-ui => hawkbit-ui}/README.md | 0 {hawkbit-mgmt-ui => hawkbit-ui}/pom.xml | 2 +- .../src/main/.gitignore | 0 .../push/AsyncVaadinServletConfiguration.java | 0 .../SpringSecurityAtmosphereInterceptor.java | 0 .../repository/OffsetBasedPageRequest.java | 0 .../repository/SpPermissionChecker.java | 0 .../eclipse/hawkbit/ui/AppWidgetSet.gwt.xml | 0 .../eclipse/hawkbit/ui/DefaultHawkbitUI.java | 0 .../hawkbit/ui/DispatcherRunnable.java | 0 .../org/eclipse/hawkbit/ui/ErrorView.java | 0 .../hawkbit/ui/HawkbitEventProvider.java | 0 .../org/eclipse/hawkbit/ui/HawkbitUI.java | 0 .../eclipse/hawkbit/ui/UIEventProvider.java | 0 .../org/eclipse/hawkbit/ui/UiProperties.java | 0 .../ui/artifacts/UploadArtifactView.java | 0 .../artifacts/UploadArtifactViewMenuItem.java | 0 .../artifacts/details/ArtifactBeanQuery.java | 0 .../details/ArtifactDetailsLayout.java | 0 .../artifacts/event/ArtifactDetailsEvent.java | 0 .../ui/artifacts/event/SMFilterEvent.java | 0 .../artifacts/event/SoftwareModuleEvent.java | 0 .../event/SoftwareModuleTypeEvent.java | 0 .../event/UploadArtifactUIEvent.java | 0 .../event/UploadViewAcceptCriteria.java | 0 .../footer/SMDeleteActionsLayout.java | 0 .../UploadViewConfirmationWindowLayout.java | 0 .../smtable/BaseSwModuleBeanQuery.java | 0 .../smtable/ProxyBaseSoftwareModuleItem.java | 0 .../SoftwareModuleAddUpdateWindow.java | 0 .../smtable/SoftwareModuleDetails.java | 0 .../smtable/SoftwareModuleTable.java | 0 .../smtable/SoftwareModuleTableHeader.java | 0 .../smtable/SoftwareModuleTableLayout.java | 0 .../CreateUpdateSoftwareTypeLayout.java | 0 .../smtype/SMTypeFilterButtonClick.java | 0 .../artifacts/smtype/SMTypeFilterButtons.java | 0 .../artifacts/smtype/SMTypeFilterHeader.java | 0 .../artifacts/smtype/SMTypeFilterLayout.java | 0 .../artifacts/state/ArtifactUploadState.java | 0 .../ui/artifacts/state/CustomFile.java | 0 .../state/SoftwareModuleFilters.java | 0 .../upload/UploadConfirmationwindow.java | 0 .../ui/artifacts/upload/UploadHandler.java | 0 .../ui/artifacts/upload/UploadLayout.java | 0 .../artifacts/upload/UploadResultWindow.java | 0 .../ui/artifacts/upload/UploadStatus.java | 0 .../upload/UploadStatusInfoWindow.java | 0 .../ui/common/AbstractAcceptCriteria.java | 0 .../hawkbit/ui/common/ConfirmationDialog.java | 0 .../hawkbit/ui/common/CoordinatesToColor.java | 0 .../common/DistributionSetTypeBeanQuery.java | 0 .../ui/common/ManagmentEntityState.java | 0 .../common/SoftwareModuleTypeBeanQuery.java | 0 .../ui/common/UserDetailsFormatter.java | 0 .../AbstractConfirmationWindowLayout.java | 0 .../confirmwindow/layout/ConfirmationTab.java | 0 .../layout/ConfirmationWindowEvents.java | 0 ...amedVersionedEntityTableDetailsLayout.java | 0 .../AbstractTableDetailsLayout.java | 0 .../SoftwareModuleDetailsTable.java | 0 .../AbstractFilterButtonClickBehaviour.java | 0 .../filterlayout/AbstractFilterButtons.java | 0 .../filterlayout/AbstractFilterHeader.java | 0 .../filterlayout/AbstractFilterLayout.java | 0 .../AbstractFilterMultiButtonClick.java | 0 .../AbstractFilterSingleButtonClick.java | 0 .../footer/AbstractDeleteActionsLayout.java | 0 .../hawkbit/ui/common/grid/AbstractGrid.java | 0 .../ui/common/grid/AbstractGridHeader.java | 0 .../ui/common/grid/AbstractGridLayout.java | 0 .../table/AbstractNamedVersionTable.java | 0 .../ui/common/table/AbstractTable.java | 0 .../ui/common/table/AbstractTableHeader.java | 0 .../ui/common/table/AbstractTableLayout.java | 0 .../ui/common/table/BaseEntityEvent.java | 0 .../ui/common/table/BaseEntityEventType.java | 0 .../common/tagdetails/AbstractTagToken.java | 0 .../tagdetails/AbstractTargetTagToken.java | 0 .../tagdetails/DistributionTagToken.java | 0 .../ui/common/tagdetails/TargetTagToken.java | 0 .../components/DistributionSetInfoPanel.java | 0 .../ui/components/ProxyDistribution.java | 0 .../hawkbit/ui/components/ProxyTarget.java | 0 .../ui/components/ProxyTargetFilter.java | 0 .../ui/components/SPNotificationMessage.java | 0 .../components/SPTargetAttributesLayout.java | 0 .../hawkbit/ui/components/SPUIButton.java | 0 .../hawkbit/ui/components/SPUICheckBox.java | 0 .../ui/components/SPUIComponentProvider.java | 0 .../ui/components/SPUIErrorHandler.java | 0 .../ui/components/SPUIHorizontalLayout.java | 0 .../hawkbit/ui/components/SPUITabSheet.java | 0 .../components/SPUITableHorizonatlLayout.java | 0 .../ui/components/SPUIUpdateLogLayout.java | 0 .../CustomRendererWidgetSet.gwt.xml | 0 .../client/HtmlButtonRendererConnector.java | 0 .../client/HtmlLabelRendererConnector.java | 0 .../client/RolloutRendererConnector.java | 0 .../client/renderers/HtmlButtonRenderer.java | 0 .../client/renderers/HtmlLabelRenderer.java | 0 .../client/renderers/RolloutRenderer.java | 0 .../client/renderers/RolloutRendererData.java | 0 .../renderers/HtmlButtonRenderer.java | 0 .../renderers/HtmlLabelRenderer.java | 0 .../renderers/RolloutRenderer.java | 0 .../ui/decorators/SPUIButtonDecorator.java | 0 .../SPUIButtonStyleLargeIconNoBorder.java | 0 .../SPUIButtonStylePrimarySmall.java | 0 .../ui/decorators/SPUIButtonStyleSmall.java | 0 .../SPUIButtonStyleSmallNoBorder.java | 0 .../SPUIButtonStyleSmallNoBorderUH.java | 0 .../SPUIButtonStyleSmallNoBorderUHS.java | 0 .../ui/decorators/SPUIButtonStyleTiny.java | 0 .../ui/decorators/SPUIComboBoxDecorator.java | 0 .../ui/decorators/SPUIEmbedDecorator.java | 0 .../hawkbit/ui/decorators/SPUIEmbedValue.java | 0 .../decorators/SPUIHeaderLayoutDecorator.java | 0 .../ui/decorators/SPUILabelDecorator.java | 0 .../ui/decorators/SPUITagButtonStyle.java | 0 .../ui/decorators/SPUITextAreaDecorator.java | 0 .../ui/decorators/SPUITextFieldDecorator.java | 0 .../ui/decorators/SPUIWindowDecorator.java | 0 .../ui/distributions/DistributionsView.java | 0 .../DistributionsViewMenuItem.java | 0 .../CreateUpdateDistSetTypeLayout.java | 0 .../disttype/DSTypeFilterButtonClick.java | 0 .../disttype/DSTypeFilterButtons.java | 0 .../disttype/DSTypeFilterHeader.java | 0 .../disttype/DSTypeFilterLayout.java | 0 .../dstable/DistributionSetDetails.java | 0 .../dstable/DistributionSetTable.java | 0 .../dstable/DistributionSetTableHeader.java | 0 .../dstable/DistributionSetTableLayout.java | 0 .../dstable/ManageDistBeanQuery.java | 0 .../event/DistributionSetTypeEvent.java | 0 .../event/DistributionsUIEvent.java | 0 .../DistributionsViewAcceptCriteria.java | 0 .../ui/distributions/event/DragEvent.java | 0 .../event/SaveActionWindowEvent.java | 0 .../SoftwareModuleAssignmentDiscardEvent.java | 0 .../distributions/event/SwModuleUIEvent.java | 0 .../footer/DSDeleteActionsLayout.java | 0 ...DistributionsConfirmationWindowLayout.java | 0 .../smtable/ProxyBaseSwModuleItem.java | 0 .../smtable/SwModuleBeanQuery.java | 0 .../smtable/SwModuleDetails.java | 0 .../distributions/smtable/SwModuleTable.java | 0 .../smtable/SwModuleTableHeader.java | 0 .../smtable/SwModuleTableLayout.java | 0 .../smtype/DistSMTypeFilterButtonClick.java | 0 .../smtype/DistSMTypeFilterButtons.java | 0 .../smtype/DistSMTypeFilterHeader.java | 0 .../smtype/DistSMTypeFilterLayout.java | 0 .../state/ManageDistFilters.java | 0 .../state/ManageDistUIState.java | 0 .../state/ManageSoftwareModuleFilters.java | 0 .../hawkbit/ui/filter/FilterExpression.java | 0 .../eclipse/hawkbit/ui/filter/Filters.java | 0 .../ui/filter/target/CustomTargetFilter.java | 0 .../filter/target/TargetSearchTextFilter.java | 0 .../ui/filter/target/TargetStatusFilter.java | 0 .../ui/filter/target/TargetTagFilter.java | 0 .../CreateOrUpdateFilterHeader.java | 0 .../CreateOrUpdateFilterTable.java | 0 .../CustomTargetBeanQuery.java | 0 .../FilterManagementView.java | 0 .../FilterManagementViewMenuItem.java | 0 .../FilterQueryValidation.java | 0 .../TargetFilterBeanQuery.java | 0 .../filtermanagement/TargetFilterHeader.java | 0 .../filtermanagement/TargetFilterTable.java | 0 .../ui/filtermanagement/TokenDescription.java | 0 .../ui/filtermanagement/ValidationResult.java | 0 .../event/CustomFilterUIEvent.java | 0 .../footer/TargetFilterCountMessageLabel.java | 0 .../state/FilterManagementUIState.java | 0 .../hawkbit/ui/login/HawkbitLoginUI.java | 0 .../eclipse/hawkbit/ui/login/LoginView.java | 0 .../hawkbit/ui/management/DeploymentView.java | 0 .../ui/management/DeploymentViewMenuItem.java | 0 .../actionhistory/ActionHistoryComponent.java | 0 .../actionhistory/ActionHistoryHeader.java | 0 .../actionhistory/ActionHistoryTable.java | 0 .../DistributionAddUpdateWindowLayout.java | 0 .../dstable/DistributionBeanQuery.java | 0 .../dstable/DistributionDetails.java | 0 .../management/dstable/DistributionTable.java | 0 .../dstable/DistributionTableHeader.java | 0 .../dstable/DistributionTableLayout.java | 0 ...eateUpdateDistributionTagLayoutWindow.java | 0 .../dstag/DistributionTagBeanQuery.java | 0 .../dstag/DistributionTagButtonClick.java | 0 .../dstag/DistributionTagButtons.java | 0 .../dstag/DistributionTagHeader.java | 0 .../dstag/DistributionTagLayout.java | 0 .../event/BulkUploadPopupEvent.java | 0 .../BulkUploadValidationMessageEvent.java | 0 .../event/DistributionTableEvent.java | 0 .../event/DistributionTableFilterEvent.java | 0 .../event/DistributionTagDropEvent.java | 0 .../ui/management/event/DragEvent.java | 0 .../management/event/ManagementUIEvent.java | 0 .../event/ManagementViewAcceptCriteria.java | 0 .../ui/management/event/PinUnpinEvent.java | 0 .../event/SaveActionWindowEvent.java | 0 .../event/TargetAddUpdateWindowEvent.java | 0 .../management/event/TargetFilterEvent.java | 0 .../ui/management/event/TargetTableEvent.java | 0 .../footer/ActionTypeOptionGroupLayout.java | 0 .../management/footer/CountMessageLabel.java | 0 .../footer/DeleteActionsLayout.java | 0 .../footer/DeleteActionsLayoutHelper.java | 0 .../ManangementConfirmationWindowLayout.java | 0 .../state/DistributionTableFilters.java | 0 .../management/state/ManagementUIState.java | 0 .../ui/management/state/TargetBulkUpload.java | 0 .../state/TargetFilterParameters.java | 0 .../management/state/TargetTableFilters.java | 0 .../management/tag/CreateUpdateTagLayout.java | 0 .../hawkbit/ui/management/tag/ProxyTag.java | 0 .../management/tag/SpColorPickerPreview.java | 0 .../hawkbit/ui/management/tag/TagIdName.java | 0 .../targettable/BulkUploadHandler.java | 0 .../TargetAddUpdateWindowLayout.java | 0 .../targettable/TargetBeanQuery.java | 0 .../targettable/TargetBulkTokenTags.java | 0 .../TargetBulkUpdateWindowLayout.java | 0 .../management/targettable/TargetDetails.java | 0 .../management/targettable/TargetTable.java | 0 .../targettable/TargetTableHeader.java | 0 .../targettable/TargetTableLayout.java | 0 .../AbstractTargetTagFilterLayout.java | 0 .../CreateUpdateTargetTagLayout.java | 0 .../CustomTargetTagFilterButtonClick.java | 0 .../targettag/FilterByStatusLayout.java | 0 .../targettag/MultipleTargetFilter.java | 0 .../targettag/TargetFilterQueryButtons.java | 0 .../targettag/TargetTagBeanQuery.java | 0 .../targettag/TargetTagFilterButtonClick.java | 0 .../targettag/TargetTagFilterButtons.java | 0 .../targettag/TargetTagFilterHeader.java | 0 .../targettag/TargetTagFilterLayout.java | 0 .../hawkbit/ui/menu/DashboardEvent.java | 0 .../hawkbit/ui/menu/DashboardMenu.java | 0 .../hawkbit/ui/menu/DashboardMenuItem.java | 0 .../ui/push/DelayedEventBusPushStrategy.java | 0 .../hawkbit/ui/push/EventPushStrategy.java | 0 .../ui/rollout/DistributionBarHelper.java | 0 .../hawkbit/ui/rollout/RolloutView.java | 0 .../ui/rollout/RolloutViewMenuItem.java | 0 .../hawkbit/ui/rollout/StatusFontIcon.java | 0 .../ui/rollout/event/RolloutEvent.java | 0 .../rollout/AddUpdateRolloutWindowLayout.java | 0 .../rollout/DistributionBeanQuery.java | 0 .../ui/rollout/rollout/ProxyRollout.java | 0 .../ui/rollout/rollout/RolloutBeanQuery.java | 0 .../ui/rollout/rollout/RolloutListGrid.java | 0 .../ui/rollout/rollout/RolloutListHeader.java | 0 .../ui/rollout/rollout/RolloutListView.java | 0 .../rolloutgroup/ProxyRolloutGroup.java | 0 .../rolloutgroup/RolloutGroupBeanQuery.java | 0 .../rolloutgroup/RolloutGroupListGrid.java | 0 .../rolloutgroup/RolloutGroupsListHeader.java | 0 .../rolloutgroup/RolloutGroupsListView.java | 0 .../RolloutGroupTargetsBeanQuery.java | 0 .../RolloutGroupTargetsCountLabelMessage.java | 0 .../RolloutGroupTargetsListGrid.java | 0 .../RolloutGroupTargetsListHeader.java | 0 .../RolloutGroupTargetsListView.java | 0 .../ui/rollout/state/RolloutUIState.java | 0 .../AuthenticationConfigurationView.java | 0 .../BaseConfigurationView.java | 0 .../ConfigurationGroup.java | 0 .../ConfigurationItem.java | 0 .../DefaultDistributionSetTypeLayout.java | 0 .../PollingConfigurationView.java | 0 .../TenantConfigurationDashboardView.java | 0 ...antConfigurationDashboardViewMenuItem.java | 0 ...AuthenticationTenantConfigurationItem.java | 0 ...wnloadAuthenticationConfigurationItem.java | 0 .../AuthenticationConfigurationItem.java | 0 ...ficateAuthenticationConfigurationItem.java | 0 ...yTokenAuthenticationConfigurationItem.java | 0 ...yTokenAuthenticationConfigurationItem.java | 0 .../polling/DurationConfigField.java | 0 .../polling/DurationField.java | 0 .../hawkbit/ui/themes/HawkbitTheme.java | 0 .../AssignInstalledDSTooltipGenerator.java | 0 .../hawkbit/ui/utils/HawkbitCommonUtil.java | 0 .../org/eclipse/hawkbit/ui/utils/I18N.java | 0 .../hawkbit/ui/utils/NamingThreadFactory.java | 0 .../hawkbit/ui/utils/NotificationMessage.java | 0 .../hawkbit/ui/utils/SPDateTimeUtil.java | 0 .../ui/utils/SPUIButtonDefinitions.java | 0 .../ui/utils/SPUIComponetIdProvider.java | 0 .../hawkbit/ui/utils/SPUIDefinitions.java | 0 .../ui/utils/SPUILabelDefinitions.java | 0 .../ui/utils/SPUIStyleDefinitions.java | 0 .../ui/utils/SPUITargetDefinitions.java | 0 .../hawkbit/ui/utils/SpringContextHelper.java | 0 .../eclipse/hawkbit/ui/utils/TableColumn.java | 0 .../hawkbit/ui/utils/UINotification.java | 0 .../src/main/resources/VAADIN/.gitignore | 0 .../VAADIN/themes/hawkbit/.gitignore | 0 .../hawkbit/customstyles/accordion.scss | 0 .../hawkbit/customstyles/action-history.scss | 0 .../hawkbit/customstyles/artifact-upload.scss | 0 .../hawkbit/customstyles/colorpicker.scss | 0 .../themes/hawkbit/customstyles/common.scss | 0 .../hawkbit/customstyles/dashboardview.scss | 0 .../hawkbit/customstyles/drop-hint.scss | 0 .../customstyles/filter-layout-styles.scss | 0 .../hawkbit/customstyles/filter-status.scss | 0 .../hawkbit/customstyles/footer-common.scss | 0 .../hawkbit/customstyles/generic-styles.scss | 0 .../customstyles/hawkbitvariables.scss | 0 .../themes/hawkbit/customstyles/login.scss | 0 .../themes/hawkbit/customstyles/others.scss | 0 .../hawkbit/customstyles/popup-common.scss | 0 .../hawkbit/customstyles/popup-window.scss | 0 .../themes/hawkbit/customstyles/rollout.scss | 0 .../customstyles/statusprogressbar.scss | 0 .../hawkbit/customstyles/systemconfig.scss | 0 .../hawkbit/customstyles/table-common.scss | 0 .../hawkbit/customstyles/table-content.scss | 0 .../customstyles/table-header-common.scss | 0 .../themes/hawkbit/customstyles/table.scss | 0 .../themes/hawkbit/customstyles/tags.scss | 0 .../customstyles/target-filter-query.scss | 0 .../VAADIN/themes/hawkbit/hawkbittheme.scss | 0 .../hawkbit/images/lightCorner_selected1.png | Bin .../themes/hawkbit/images/lightCorner_top.png | Bin .../hawkbit/images/profile-pic-57px.jpg | Bin .../VAADIN/themes/hawkbit/layouts/footer.html | 0 .../VAADIN/themes/hawkbit/styles.scss | 0 .../src/main/resources/messages.properties | 0 .../src/main/resources/messages_de.properties | 0 .../src/main/resources/messages_en.properties | 0 ...ringSecurityAtmosphereInterceptorTest.java | 0 .../ui/utils/NamingThreadFactoryTest.java | 0 .../ui/utils/SPUIComponentProviderTest.java | 0 pom.xml | 4 +- 423 files changed, 124 insertions(+), 782 deletions(-) rename examples/{hawkbit-example-feign-core-client => hawkbit-example-core-feign-client}/README.md (100%) rename examples/{hawkbit-example-feign-core-client => hawkbit-example-core-feign-client}/pom.xml (96%) rename examples/{hawkbit-example-feign-core-client => hawkbit-example-core-feign-client}/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java (100%) rename examples/{hawkbit-example-feign-core-client => hawkbit-example-core-feign-client}/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java (100%) rename examples/{hawkbit-example-feign-core-client => hawkbit-example-core-feign-client}/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/README.md (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/pom.xml (95%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java (100%) rename examples/{hawkbit-example-ddi-client => hawkbit-example-ddi-feign-client}/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/.gitignore (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/README.md (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/pom.xml (86%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java (76%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java (72%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-feign-client}/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/.gitignore (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/README.md (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/pom.xml (96%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-simulator}/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java (100%) rename examples/{hawkbit-example-mgmt-client => hawkbit-example-mgmt-simulator}/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/src/main/resources/application.properties (100%) rename examples/{hawkbit-example-mgmt-spring-client => hawkbit-example-mgmt-simulator}/src/main/resources/logback.xml (100%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java (94%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java (80%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemCache.java (83%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemStatisticsRest.java (69%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemTenantServiceUsage.java (90%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java (80%) rename hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java => hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java (81%) rename hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemManagementResource.java (73%) rename hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemMapper.java (74%) rename hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java => hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java (76%) delete mode 100644 hawkbit-system-api/README.md delete mode 100644 hawkbit-system-api/pom.xml delete mode 100644 hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java delete mode 100644 hawkbit-system-resource/README.md delete mode 100644 hawkbit-system-resource/pom.xml delete mode 100644 hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java delete mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java delete mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java delete mode 100644 hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java rename {hawkbit-mgmt-ui => hawkbit-ui}/.gitignore (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/README.md (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/pom.xml (99%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/.gitignore (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/RolloutRendererConnector.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRendererData.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/RolloutRenderer.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/AssignInstalledDSTooltipGenerator.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/.gitignore (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/.gitignore (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/VAADIN/themes/hawkbit/styles.scss (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/messages.properties (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/messages_de.properties (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/main/resources/messages_en.properties (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java (100%) rename {hawkbit-mgmt-ui => hawkbit-ui}/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java (100%) diff --git a/examples/hawkbit-custom-theme-example/pom.xml b/examples/hawkbit-custom-theme-example/pom.xml index 2cbee5c0a..7caa99ba2 100644 --- a/examples/hawkbit-custom-theme-example/pom.xml +++ b/examples/hawkbit-custom-theme-example/pom.xml @@ -66,7 +66,7 @@ org.eclipse.hawkbit - hawkbit-mgmt-ui + hawkbit-ui ${project.version} diff --git a/examples/hawkbit-example-app/pom.xml b/examples/hawkbit-example-app/pom.xml index 9fd0958ea..721966026 100644 --- a/examples/hawkbit-example-app/pom.xml +++ b/examples/hawkbit-example-app/pom.xml @@ -67,11 +67,6 @@ hawkbit-mgmt-resource ${project.version} - - org.eclipse.hawkbit - hawkbit-system-resource - ${project.version} - org.eclipse.hawkbit hawkbit-ddi-resource @@ -84,7 +79,7 @@ org.eclipse.hawkbit - hawkbit-mgmt-ui + hawkbit-ui ${project.version} diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index 1f57e8dd3..197fc3218 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -12,7 +12,6 @@ import org.eclipse.hawkbit.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration; import org.eclipse.hawkbit.ddi.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; -import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; @@ -27,7 +26,6 @@ import org.springframework.context.annotation.Import; @EnableHawkbitManagedSecurityConfiguration @EnableMgmtApi @EnableDdiApi -@EnableSystemApi // Exception squid:S1118 - Spring boot standard behavior @SuppressWarnings({ "squid:S1118" }) public class Start { diff --git a/examples/hawkbit-example-feign-core-client/README.md b/examples/hawkbit-example-core-feign-client/README.md similarity index 100% rename from examples/hawkbit-example-feign-core-client/README.md rename to examples/hawkbit-example-core-feign-client/README.md diff --git a/examples/hawkbit-example-feign-core-client/pom.xml b/examples/hawkbit-example-core-feign-client/pom.xml similarity index 96% rename from examples/hawkbit-example-feign-core-client/pom.xml rename to examples/hawkbit-example-core-feign-client/pom.xml index 23d66e69d..5b3df2ef2 100644 --- a/examples/hawkbit-example-feign-core-client/pom.xml +++ b/examples/hawkbit-example-core-feign-client/pom.xml @@ -17,7 +17,7 @@ 0.2.0-SNAPSHOT - hawkbit-example-feign-core-client + hawkbit-example-core-feign-client hawkBit-example :: Feign Core Client diff --git a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java b/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java similarity index 100% rename from examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java rename to examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/ApplicationJsonRequestHeaderInterceptor.java diff --git a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java b/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java similarity index 100% rename from examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java rename to examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java diff --git a/examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java b/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java similarity index 100% rename from examples/hawkbit-example-feign-core-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java rename to examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/IgnoreMultipleConsumersProducersSpringMvcContract.java diff --git a/examples/hawkbit-example-ddi-client/README.md b/examples/hawkbit-example-ddi-feign-client/README.md similarity index 100% rename from examples/hawkbit-example-ddi-client/README.md rename to examples/hawkbit-example-ddi-feign-client/README.md diff --git a/examples/hawkbit-example-ddi-client/pom.xml b/examples/hawkbit-example-ddi-feign-client/pom.xml similarity index 95% rename from examples/hawkbit-example-ddi-client/pom.xml rename to examples/hawkbit-example-ddi-feign-client/pom.xml index 629d1e988..3450231cd 100644 --- a/examples/hawkbit-example-ddi-client/pom.xml +++ b/examples/hawkbit-example-ddi-feign-client/pom.xml @@ -16,7 +16,7 @@ hawkbit-examples-parent 0.2.0-SNAPSHOT - hawkbit-example-ddi-client + hawkbit-example-ddi-feign-client hawkBit-example :: DDI Feign Client @@ -35,7 +35,7 @@ org.eclipse.hawkbit - hawkbit-example-feign-core-client + hawkbit-example-core-feign-client ${project.version} diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/DdiDlArtifactStoreControllerResourceClient.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java diff --git a/examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java similarity index 100% rename from examples/hawkbit-example-ddi-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java rename to examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java diff --git a/examples/hawkbit-example-mgmt-client/.gitignore b/examples/hawkbit-example-mgmt-feign-client/.gitignore similarity index 100% rename from examples/hawkbit-example-mgmt-client/.gitignore rename to examples/hawkbit-example-mgmt-feign-client/.gitignore diff --git a/examples/hawkbit-example-mgmt-client/README.md b/examples/hawkbit-example-mgmt-feign-client/README.md similarity index 100% rename from examples/hawkbit-example-mgmt-client/README.md rename to examples/hawkbit-example-mgmt-feign-client/README.md diff --git a/examples/hawkbit-example-mgmt-client/pom.xml b/examples/hawkbit-example-mgmt-feign-client/pom.xml similarity index 86% rename from examples/hawkbit-example-mgmt-client/pom.xml rename to examples/hawkbit-example-mgmt-feign-client/pom.xml index 6bd360459..7e96e3b00 100644 --- a/examples/hawkbit-example-mgmt-client/pom.xml +++ b/examples/hawkbit-example-mgmt-feign-client/pom.xml @@ -17,13 +17,13 @@ 0.2.0-SNAPSHOT jar - hawkbit-example-mgmt-client + hawkbit-example-mgmt-feign-client hawkBit-example :: Management client API org.eclipse.hawkbit - hawkbit-example-feign-core-client + hawkbit-example-core-feign-client ${project.version} @@ -31,11 +31,6 @@ hawkbit-mgmt-api ${project.version} - - org.eclipse.hawkbit - hawkbit-system-api - ${project.version} - com.google.guava guava diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java similarity index 76% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java index 01510e279..8d94cddb9 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java @@ -8,14 +8,14 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.system.rest.api.SystemRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** - * Client binding for the {@link SystemRestApi}. + * Client binding for the {@link MgmtSystemRestApi}. * */ @FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemClientResource.PATH) -public interface SystemClientResource extends SystemRestApi { +public interface SystemClientResource extends MgmtSystemRestApi { static String PATH = "rest/v1/system"; } diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java similarity index 72% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java index 5047619bc..21aa7b7c1 100644 --- a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java @@ -8,15 +8,15 @@ */ package org.eclipse.hawkbit.mgmt.client.resource; -import org.eclipse.hawkbit.system.rest.api.SystemManagementRestApi; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemManagementRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** - * Client binding for the {@link SystemManagementRestApi}. + * Client binding for the {@link MgmtSystemManagementRestApi}. * */ @FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemManagementClientResource.PATH) -public interface SystemManagementClientResource extends SystemManagementRestApi { +public interface SystemManagementClientResource extends MgmtSystemManagementRestApi { static String PATH = "system/admin"; } diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/DistributionSetTypeBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/RolloutBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleAssigmentBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/SoftwareModuleTypeBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TagBuilder.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/builder/TargetBuilder.java diff --git a/examples/hawkbit-example-mgmt-spring-client/.gitignore b/examples/hawkbit-example-mgmt-simulator/.gitignore similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/.gitignore rename to examples/hawkbit-example-mgmt-simulator/.gitignore diff --git a/examples/hawkbit-example-mgmt-spring-client/README.md b/examples/hawkbit-example-mgmt-simulator/README.md similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/README.md rename to examples/hawkbit-example-mgmt-simulator/README.md diff --git a/examples/hawkbit-example-mgmt-spring-client/pom.xml b/examples/hawkbit-example-mgmt-simulator/pom.xml similarity index 96% rename from examples/hawkbit-example-mgmt-spring-client/pom.xml rename to examples/hawkbit-example-mgmt-simulator/pom.xml index afd7a6ec2..fbe099f40 100644 --- a/examples/hawkbit-example-mgmt-spring-client/pom.xml +++ b/examples/hawkbit-example-mgmt-simulator/pom.xml @@ -17,7 +17,7 @@ 0.2.0-SNAPSHOT jar - hawkbit-example-mgmt-spring-client + hawkbit-example-mgmt-simulator hawkBit-example :: Management Feign Client @@ -57,7 +57,7 @@ org.eclipse.hawkbit - hawkbit-example-mgmt-client + hawkbit-example-mgmt-feign-client ${project.version} diff --git a/examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java b/examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java rename to examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/Application.java diff --git a/examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java b/examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java rename to examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/ClientConfigurationProperties.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java b/examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java rename to examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/CreateStartedRolloutExample.java diff --git a/examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java b/examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java similarity index 100% rename from examples/hawkbit-example-mgmt-client/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java rename to examples/hawkbit-example-mgmt-simulator/src/main/java/org/eclipse/hawkbit/mgmt/client/scenarios/GettingStartedDefaultScenario.java diff --git a/examples/hawkbit-example-mgmt-spring-client/src/main/resources/application.properties b/examples/hawkbit-example-mgmt-simulator/src/main/resources/application.properties similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/src/main/resources/application.properties rename to examples/hawkbit-example-mgmt-simulator/src/main/resources/application.properties diff --git a/examples/hawkbit-example-mgmt-spring-client/src/main/resources/logback.xml b/examples/hawkbit-example-mgmt-simulator/src/main/resources/logback.xml similarity index 100% rename from examples/hawkbit-example-mgmt-spring-client/src/main/resources/logback.xml rename to examples/hawkbit-example-mgmt-simulator/src/main/resources/logback.xml diff --git a/examples/pom.xml b/examples/pom.xml index 7bbe58848..fb8ef3fc3 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -22,12 +22,12 @@ pom - hawkbit-example-feign-core-client hawkbit-device-simulator hawkbit-example-app - hawkbit-example-mgmt-client - hawkbit-example-mgmt-spring-client - hawkbit-example-ddi-client + hawkbit-example-core-feign-client + hawkbit-example-ddi-feign-client + hawkbit-example-mgmt-feign-client + hawkbit-example-mgmt-simulator diff --git a/hawkbit-autoconfigure/pom.xml b/hawkbit-autoconfigure/pom.xml index 446fb3f56..7ad0e0911 100644 --- a/hawkbit-autoconfigure/pom.xml +++ b/hawkbit-autoconfigure/pom.xml @@ -40,7 +40,7 @@ org.eclipse.hawkbit - hawkbit-mgmt-ui + hawkbit-ui ${project.version} true @@ -68,12 +68,6 @@ ${project.version} true - - org.eclipse.hawkbit - hawkbit-system-resource - ${project.version} - true - org.eclipse.hawkbit hawkbit-mgmt-resource diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java index d337658b8..825e21c12 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java @@ -26,6 +26,7 @@ import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions; import org.eclipse.hawkbit.im.authentication.TenantUserPasswordAuthenticationToken; import org.eclipse.hawkbit.im.authentication.UserAuthenticationFilter; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtRestConstants; import org.eclipse.hawkbit.repository.ControllerManagement; import org.eclipse.hawkbit.repository.SystemManagement; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; @@ -40,7 +41,6 @@ import org.eclipse.hawkbit.security.HttpControllerPreAuthenticatedSecurityHeader import org.eclipse.hawkbit.security.HttpDownloadAuthenticationFilter; import org.eclipse.hawkbit.security.PreAuthTokenSourceTrustAuthenticationProvider; import org.eclipse.hawkbit.security.SystemSecurityContext; -import org.eclipse.hawkbit.system.rest.api.SystemRestConstant; import org.eclipse.hawkbit.tenancy.TenantAware; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -292,9 +292,9 @@ public class SecurityManagedConfiguration { new AuthenticationSuccessTenantMetadataCreationFilter(tenantAware, systemManagement), RequestHeaderAuthenticationFilter.class) .authorizeRequests().anyRequest().authenticated() - .antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/admin/**") + .antMatchers(MgmtRestConstants.BASE_SYSTEM_MAPPING + "/admin/**") .hasAnyAuthority(SpPermission.SYSTEM_ADMIN) - .antMatchers(SystemRestConstant.BASE_SYSTEM_MAPPING + "/**") + .antMatchers(MgmtRestConstants.BASE_SYSTEM_MAPPING + "/**") .hasAnyAuthority(SpPermission.SYSTEM_DIAG); } } diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index afb90bd13..6684b700d 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -10,7 +10,6 @@ package org.eclipse.hawkbit.autoconfigure.web; import org.eclipse.hawkbit.ddi.EnableDdiApi; import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; -import org.eclipse.hawkbit.system.annotation.EnableSystemApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -20,8 +19,8 @@ import org.springframework.context.annotation.Import; * */ @Configuration -@ConditionalOnClass({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) -@Import({ EnableDdiApi.class, EnableMgmtApi.class, EnableSystemApi.class }) +@ConditionalOnClass({ EnableDdiApi.class, EnableMgmtApi.class }) +@Import({ EnableDdiApi.class, EnableMgmtApi.class }) public class ResourceControllerAutoConfiguration { } diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index a175ec6e5..e7a60f34a 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -48,7 +48,7 @@ import org.springframework.web.context.WebApplicationContext; * for legacy controllers that can not be fed with a download URI at runtime. */ @RestController -@Scope(value = WebApplicationContext.SCOPE_REQUEST) +@Scope(WebApplicationContext.SCOPE_REQUEST) public class DdiArtifactStoreController implements DdiDlArtifactStoreControllerRestApi { private static final Logger LOG = LoggerFactory.getLogger(DdiArtifactStoreController.class); diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java similarity index 94% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java index c152de0c3..776b69c09 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValue.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValue.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.json.model.system; +package org.eclipse.hawkbit.mgmt.json.model.system; import org.springframework.hateoas.ResourceSupport; @@ -22,7 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SystemTenantConfigurationValue extends ResourceSupport { +public class MgmtSystemTenantConfigurationValue extends ResourceSupport { @JsonInclude(Include.ALWAYS) private Object value; diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java similarity index 80% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java index 08bd06dd8..9a9aed209 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/system/SystemTenantConfigurationValueRequest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/system/MgmtSystemTenantConfigurationValueRequest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.json.model.system; +package org.eclipse.hawkbit.mgmt.json.model.system; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -18,21 +18,21 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SystemTenantConfigurationValueRequest { +public class MgmtSystemTenantConfigurationValueRequest { @JsonProperty(required = true) private Object value; /** * - * @return the value of the SystemTenantConfigurationValueRequest + * @return the value of the MgmtSystemTenantConfigurationValueRequest */ public Object getValue() { return value; } /** - * Sets the SystemTenantConfigurationValueRequest + * Sets the MgmtSystemTenantConfigurationValueRequest * * @param value */ diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemCache.java similarity index 83% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemCache.java index 428483be9..2876b11df 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemCache.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemCache.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.json.model.systemmanagement; +package org.eclipse.hawkbit.mgmt.json.model.systemmanagement; import java.util.Collection; @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SystemCache { +public class MgmtSystemCache { private final String name; private final Collection keys; @@ -31,7 +31,7 @@ public class SystemCache { * @param cacheKeys * the keys which contains in the cache */ - public SystemCache(final String name, final Collection cacheKeys) { + public MgmtSystemCache(final String name, final Collection cacheKeys) { this.name = name; this.keys = cacheKeys; } @@ -57,6 +57,6 @@ public class SystemCache { */ @Override public String toString() { - return "SystemCache [name=" + name + ", keys=" + keys + "]"; + return "MgmtSystemCache [name=" + name + ", keys=" + keys + "]"; } } diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemStatisticsRest.java similarity index 69% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemStatisticsRest.java index 8e1c80ded..0c1b12fde 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemStatisticsRest.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemStatisticsRest.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.json.model.systemmanagement; +package org.eclipse.hawkbit.mgmt.json.model.systemmanagement; import java.util.List; @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SystemStatisticsRest { +public class MgmtSystemStatisticsRest { private long overallTargets; private long overallArtifacts; @@ -28,13 +28,13 @@ public class SystemStatisticsRest { private long overallActions; private long overallTenants; - private List tenantStats; + private List tenantStats; public long getOverallTargets() { return overallTargets; } - public SystemStatisticsRest setOverallTargets(final long overallTargets) { + public MgmtSystemStatisticsRest setOverallTargets(final long overallTargets) { this.overallTargets = overallTargets; return this; } @@ -43,7 +43,7 @@ public class SystemStatisticsRest { return overallArtifacts; } - public SystemStatisticsRest setOverallArtifacts(final long overallArtifacts) { + public MgmtSystemStatisticsRest setOverallArtifacts(final long overallArtifacts) { this.overallArtifacts = overallArtifacts; return this; } @@ -52,7 +52,7 @@ public class SystemStatisticsRest { return overallArtifactVolumeInBytes; } - public SystemStatisticsRest setOverallArtifactVolumeInBytes(final long overallArtifactVolumeInBytes) { + public MgmtSystemStatisticsRest setOverallArtifactVolumeInBytes(final long overallArtifactVolumeInBytes) { this.overallArtifactVolumeInBytes = overallArtifactVolumeInBytes; return this; } @@ -61,7 +61,7 @@ public class SystemStatisticsRest { return overallActions; } - public SystemStatisticsRest setOverallActions(final long overallActions) { + public MgmtSystemStatisticsRest setOverallActions(final long overallActions) { this.overallActions = overallActions; return this; } @@ -70,16 +70,16 @@ public class SystemStatisticsRest { return overallTenants; } - public SystemStatisticsRest setOverallTenants(final long overallTenants) { + public MgmtSystemStatisticsRest setOverallTenants(final long overallTenants) { this.overallTenants = overallTenants; return this; } - public void setTenantStats(final List tenantStats) { + public void setTenantStats(final List tenantStats) { this.tenantStats = tenantStats; } - public List getTenantStats() { + public List getTenantStats() { return tenantStats; } diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemTenantServiceUsage.java similarity index 90% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemTenantServiceUsage.java index ab7b7e6b8..8cce4314b 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/json/model/systemmanagement/SystemTenantServiceUsage.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/systemmanagement/MgmtSystemTenantServiceUsage.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.json.model.systemmanagement; +package org.eclipse.hawkbit.mgmt.json.model.systemmanagement; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -18,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; */ @JsonInclude(Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class SystemTenantServiceUsage { +public class MgmtSystemTenantServiceUsage { private final String tenantName; private long targets; @@ -31,7 +31,7 @@ public class SystemTenantServiceUsage { * * @param tenantName */ - public SystemTenantServiceUsage(final String tenantName) { + public MgmtSystemTenantServiceUsage(final String tenantName) { super(); this.tenantName = tenantName; } diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java index d8f395568..e8c25403f 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRestConstants.java @@ -11,8 +11,6 @@ package org.eclipse.hawkbit.mgmt.rest.api; /** * Constants for RESTful API. * - * - * */ public final class MgmtRestConstants { @@ -46,8 +44,21 @@ public final class MgmtRestConstants { public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules"; public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/"; + public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}"; + /** + * The base URL mapping for the spring acuator management context path. + */ + public static final String BASE_SYSTEM_MAPPING = "/system"; + + /** + * URL mapping for system admin operations. + */ + public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin"; + + public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + BASE_SYSTEM_MAPPING; + /** * The target URL mapping, href link for assigned distribution set. */ diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java similarity index 80% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java index 6185fceea..4415d1a4e 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemManagementRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java @@ -6,12 +6,12 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.rest.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.Collection; -import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemCache; -import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemStatisticsRest; +import org.eclipse.hawkbit.mgmt.json.model.systemmanagement.MgmtSystemCache; +import org.eclipse.hawkbit.mgmt.json.model.systemmanagement.MgmtSystemStatisticsRest; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; @@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestMethod; * {@link SystemManagement} capabilities by REST. * */ -@RequestMapping(SystemRestConstant.SYSTEM_ADMIN_MAPPING) -public interface SystemManagementRestApi { +@RequestMapping(MgmtRestConstants.SYSTEM_ADMIN_MAPPING) +public interface MgmtSystemManagementRestApi { /** * Deletes the tenant data of a given tenant. USE WITH CARE! @@ -43,7 +43,7 @@ public interface SystemManagementRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/usage", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getSystemUsageStats(); + ResponseEntity getSystemUsageStats(); /** * Returns a list of all caches. @@ -51,7 +51,7 @@ public interface SystemManagementRestApi { * @return a list of caches for all tenants */ @RequestMapping(method = RequestMethod.GET, value = "/caches") - ResponseEntity> getCaches(); + ResponseEntity> getCaches(); /** * Invalidates all caches for all tenants. diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java similarity index 81% rename from hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java rename to hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java index 1f2c497e2..92c732c96 100644 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java @@ -6,12 +6,12 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.rest.api; +package org.eclipse.hawkbit.mgmt.rest.api; import java.util.Map; -import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; -import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValueRequest; +import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValue; +import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValueRequest; import org.springframework.hateoas.ResourceSupport; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -25,8 +25,8 @@ import org.springframework.web.bind.annotation.RequestMethod; * * */ -@RequestMapping(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING) -public interface SystemRestApi { +@RequestMapping(MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING) +public interface MgmtSystemRestApi { @RequestMapping(method = RequestMethod.GET, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) ResponseEntity getSystem(); @@ -36,7 +36,7 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/configs", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity> getSystemConfiguration(); + ResponseEntity> getSystemConfiguration(); /** * Handles the DELETE request of deleting a tenant specific configuration @@ -64,7 +64,8 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.GET, value = "/configs/{keyName}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity getConfigurationValue(@PathVariable("keyName") final String keyName); + ResponseEntity getConfigurationValue( + @PathVariable("keyName") final String keyName); /** * Handles the GET request of deleting a tenant specific configuration value @@ -80,8 +81,8 @@ public interface SystemRestApi { */ @RequestMapping(method = RequestMethod.PUT, value = "/configs/{keyName}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) - ResponseEntity updateConfigurationValue( + ResponseEntity updateConfigurationValue( @PathVariable("keyName") final String keyName, - @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest); + @RequestBody final MgmtSystemTenantConfigurationValueRequest configurationValueRest); } \ No newline at end of file diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemManagementResource.java similarity index 73% rename from hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemManagementResource.java index 6ea27d9ce..46e51f2ee 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemManagementResource.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import java.util.Collection; import java.util.Collections; @@ -14,13 +14,13 @@ import java.util.List; import java.util.stream.Collectors; import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions; +import org.eclipse.hawkbit.mgmt.json.model.systemmanagement.MgmtSystemCache; +import org.eclipse.hawkbit.mgmt.json.model.systemmanagement.MgmtSystemStatisticsRest; +import org.eclipse.hawkbit.mgmt.json.model.systemmanagement.MgmtSystemTenantServiceUsage; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemManagementRestApi; import org.eclipse.hawkbit.report.model.SystemUsageReport; import org.eclipse.hawkbit.report.model.TenantUsage; import org.eclipse.hawkbit.repository.SystemManagement; -import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemCache; -import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemStatisticsRest; -import org.eclipse.hawkbit.system.json.model.systemmanagement.SystemTenantServiceUsage; -import org.eclipse.hawkbit.system.rest.api.SystemManagementRestApi; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -37,9 +37,9 @@ import org.springframework.web.bind.annotation.RestController; * */ @RestController -public class SystemManagementResource implements SystemManagementRestApi { +public class MgmtSystemManagementResource implements MgmtSystemManagementRestApi { - private static final Logger LOGGER = LoggerFactory.getLogger(SystemManagementResource.class); + private static final Logger LOGGER = LoggerFactory.getLogger(MgmtSystemManagementResource.class); @Autowired private SystemManagement systemManagement; @@ -67,22 +67,22 @@ public class SystemManagementResource implements SystemManagementRestApi { * @return system usage statistics */ @Override - public ResponseEntity getSystemUsageStats() { + public ResponseEntity getSystemUsageStats() { final SystemUsageReport report = systemManagement.getSystemUsageStatistics(); - final SystemStatisticsRest result = new SystemStatisticsRest().setOverallActions(report.getOverallActions()) - .setOverallArtifacts(report.getOverallArtifacts()) + final MgmtSystemStatisticsRest result = new MgmtSystemStatisticsRest() + .setOverallActions(report.getOverallActions()).setOverallArtifacts(report.getOverallArtifacts()) .setOverallArtifactVolumeInBytes(report.getOverallArtifactVolumeInBytes()) .setOverallTargets(report.getOverallTargets()).setOverallTenants(report.getTenants().size()); - result.setTenantStats( - report.getTenants().stream().map(SystemManagementResource::convertTenant).collect(Collectors.toList())); + result.setTenantStats(report.getTenants().stream().map(MgmtSystemManagementResource::convertTenant) + .collect(Collectors.toList())); return ResponseEntity.ok(result); } - private static SystemTenantServiceUsage convertTenant(final TenantUsage tenant) { - final SystemTenantServiceUsage result = new SystemTenantServiceUsage(tenant.getTenantName()); + private static MgmtSystemTenantServiceUsage convertTenant(final TenantUsage tenant) { + final MgmtSystemTenantServiceUsage result = new MgmtSystemTenantServiceUsage(tenant.getTenantName()); result.setActions(tenant.getActions()); result.setArtifacts(tenant.getArtifacts()); result.setOverallArtifactVolumeInBytes(tenant.getOverallArtifactVolumeInBytes()); @@ -98,7 +98,7 @@ public class SystemManagementResource implements SystemManagementRestApi { */ @Override @PreAuthorize(SpringEvalExpressions.HAS_AUTH_SYSTEM_ADMIN) - public ResponseEntity> getCaches() { + public ResponseEntity> getCaches() { final Collection cacheNames = cacheManager.getCacheNames(); return ResponseEntity .ok(cacheNames.stream().map(cacheManager::getCache).map(this::cacheRest).collect(Collectors.toList())); @@ -118,20 +118,20 @@ public class SystemManagementResource implements SystemManagementRestApi { return ResponseEntity.ok(cacheNames); } - private SystemCache cacheRest(final Cache cache) { + private MgmtSystemCache cacheRest(final Cache cache) { final Object nativeCache = cache.getNativeCache(); if (nativeCache instanceof com.google.common.cache.Cache) { return guavaCache(cache, nativeCache); } else { - return new SystemCache(cache.getName(), Collections.emptyList()); + return new MgmtSystemCache(cache.getName(), Collections.emptyList()); } } @SuppressWarnings("unchecked") - private SystemCache guavaCache(final Cache cache, final Object nativeCache) { + private MgmtSystemCache guavaCache(final Cache cache, final Object nativeCache) { final com.google.common.cache.Cache guavaCache = (com.google.common.cache.Cache) nativeCache; final List keys = guavaCache.asMap().keySet().stream().map(key -> key.toString()) .collect(Collectors.toList()); - return new SystemCache(cache.getName(), keys); + return new MgmtSystemCache(cache.getName(), keys); } } diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemMapper.java similarity index 74% rename from hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemMapper.java index 3a7b39029..d3f78fad2 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemMapper.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemMapper.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; @@ -14,18 +14,18 @@ import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.HashMap; import java.util.Map; +import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValue; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; /** * A mapper which maps repository model to RESTful model representation and * back. */ -public class SystemMapper { +public class MgmtSystemMapper { - private SystemMapper() { + private MgmtSystemMapper() { // Utility class } @@ -34,10 +34,10 @@ public class SystemMapper { * instance of TenantConfigurationManagement * @return a map of all existing configuration values */ - public static Map toResponse( + public static Map toResponse( final TenantConfigurationManagement tenantConfigurationManagement) { - final Map configurationMap = new HashMap<>(); + final Map configurationMap = new HashMap<>(); for (final TenantConfigurationKey key : TenantConfigurationKey.values()) { configurationMap.put(key.getKeyName(), @@ -49,15 +49,15 @@ public class SystemMapper { /** * maps a TenantConfigurationValue from the repository model to a - * SystemTenantConfigurationValue, the RESTful model. + * MgmtSystemTenantConfigurationValue, the RESTful model. * * @param repoConfValue * configuration value as repository model * @return configuration value as RESTful model */ - public static SystemTenantConfigurationValue toResponse(final String key, + public static MgmtSystemTenantConfigurationValue toResponse(final String key, final TenantConfigurationValue repoConfValue) { - final SystemTenantConfigurationValue restConfValue = new SystemTenantConfigurationValue(); + final MgmtSystemTenantConfigurationValue restConfValue = new MgmtSystemTenantConfigurationValue(); restConfValue.setValue(repoConfValue.getValue()); restConfValue.setGlobal(repoConfValue.isGlobal()); @@ -66,7 +66,7 @@ public class SystemMapper { restConfValue.setLastModifiedAt(repoConfValue.getLastModifiedAt()); restConfValue.setLastModifiedBy(repoConfValue.getLastModifiedBy()); - restConfValue.add(linkTo(methodOn(SystemResource.class).getConfigurationValue(key)).withRel("self")); + restConfValue.add(linkTo(methodOn(MgmtSystemResource.class).getConfigurationValue(key)).withRel("self")); return restConfValue; } diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java similarity index 76% rename from hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java index 4333cfefb..5aac17318 100644 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/rest/resource/SystemResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java @@ -6,18 +6,18 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.system.rest.resource; +package org.eclipse.hawkbit.mgmt.rest.resource; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn; import java.util.Map; +import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValue; +import org.eclipse.hawkbit.mgmt.json.model.system.MgmtSystemTenantConfigurationValueRequest; +import org.eclipse.hawkbit.mgmt.rest.api.MgmtSystemRestApi; import org.eclipse.hawkbit.repository.TenantConfigurationManagement; import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValue; -import org.eclipse.hawkbit.system.json.model.system.SystemTenantConfigurationValueRequest; -import org.eclipse.hawkbit.system.rest.api.SystemRestApi; import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,15 +31,11 @@ import org.springframework.web.bind.annotation.RestController; /** * REST Resource handling tenant specific configuration operations. - * - * - * - * */ @RestController -public class SystemResource implements SystemRestApi { +public class MgmtSystemResource implements MgmtSystemRestApi { - private static final Logger LOG = LoggerFactory.getLogger(SystemResource.class); + private static final Logger LOG = LoggerFactory.getLogger(MgmtSystemResource.class); @Autowired private TenantConfigurationManagement tenantConfigurationManagement; @@ -47,7 +43,7 @@ public class SystemResource implements SystemRestApi { @Override public ResponseEntity getSystem() { final ResourceSupport resourceSupport = new ResourceSupport(); - resourceSupport.add(linkTo(methodOn(SystemResource.class).getSystemConfiguration()).withRel("configs")); + resourceSupport.add(linkTo(methodOn(MgmtSystemResource.class).getSystemConfiguration()).withRel("configs")); return ResponseEntity.ok(resourceSupport); } @@ -55,8 +51,8 @@ public class SystemResource implements SystemRestApi { * @return a Map of all configuration values. */ @Override - public ResponseEntity> getSystemConfiguration() { - return new ResponseEntity<>(SystemMapper.toResponse(tenantConfigurationManagement), HttpStatus.OK); + public ResponseEntity> getSystemConfiguration() { + return new ResponseEntity<>(MgmtSystemMapper.toResponse(tenantConfigurationManagement), HttpStatus.OK); } /** @@ -91,13 +87,13 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity getConfigurationValue( + public ResponseEntity getConfigurationValue( @PathVariable("keyName") final String keyName) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); LOG.debug("{} config value getted, return status {}", keyName, HttpStatus.OK); - return new ResponseEntity<>(SystemMapper.toResponse(configKey.getKeyName(), + return new ResponseEntity<>(MgmtSystemMapper.toResponse(configKey.getKeyName(), tenantConfigurationManagement.getConfigurationValue(configKey)), HttpStatus.OK); } @@ -114,16 +110,16 @@ public class SystemResource implements SystemRestApi { * response. */ @Override - public ResponseEntity updateConfigurationValue( + public ResponseEntity updateConfigurationValue( @PathVariable("keyName") final String keyName, - @RequestBody final SystemTenantConfigurationValueRequest configurationValueRest) { + @RequestBody final MgmtSystemTenantConfigurationValueRequest configurationValueRest) { final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName); final TenantConfigurationValue updatedValue = tenantConfigurationManagement .addOrUpdateConfiguration(configKey, configurationValueRest.getValue()); - return new ResponseEntity<>(SystemMapper.toResponse(keyName, updatedValue), HttpStatus.OK); + return new ResponseEntity<>(MgmtSystemMapper.toResponse(keyName, updatedValue), HttpStatus.OK); } } \ No newline at end of file diff --git a/hawkbit-system-api/README.md b/hawkbit-system-api/README.md deleted file mode 100644 index 41b1a8416..000000000 --- a/hawkbit-system-api/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Eclipse.IoT hawkBit - System API - -The System API is used to configurate the hawkBit Update Server. This includes tenants specific operations as well as system wide operations. - - -# Compile - -#### Build hawkbit-system-api - -``` -$ cd hawkbit/hawkbit-system-api -$ mvn clean install -``` - diff --git a/hawkbit-system-api/pom.xml b/hawkbit-system-api/pom.xml deleted file mode 100644 index b68b02b36..000000000 --- a/hawkbit-system-api/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-parent - 0.2.0-SNAPSHOT - - hawkbit-system-api - hawkBit :: System REST API - - - - - org.springframework.hateoas - spring-hateoas - - - com.fasterxml.jackson.core - jackson-annotations - - - \ No newline at end of file diff --git a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java b/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java deleted file mode 100644 index cb10ba8b2..000000000 --- a/hawkbit-system-api/src/main/java/org/eclipse/hawkbit/system/rest/api/SystemRestConstant.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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.system.rest.api; - -/** - * - */ -public final class SystemRestConstant { - - /** - * API version definition. We are using only major versions. - */ - public static final String API_VERSION = "v1"; - - /** - * The base URL mapping for the spring acuator management context path. - */ - public static final String BASE_SYSTEM_MAPPING = "/system"; - - /** - * The base URL mapping of the SP rest resources. - */ - public static final String BASE_V1_REQUEST_MAPPING = "/rest/" + API_VERSION; - - /** - * URL mapping for system admin operations. - */ - public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin"; - - public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + BASE_SYSTEM_MAPPING; - - private SystemRestConstant() { - - } -} diff --git a/hawkbit-system-resource/README.md b/hawkbit-system-resource/README.md deleted file mode 100644 index 20eaf5c6b..000000000 --- a/hawkbit-system-resource/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Eclipse.IoT hawkBit - System Resource - -This is the server-side implementation of the hawkBit System API that is used to configurate the hawkBit Update Server - -# Compile - -#### Build hawkbit-system-resource - -``` -$ cd hawkbit/hawkbit-system-resource -$ mvn clean install -``` - diff --git a/hawkbit-system-resource/pom.xml b/hawkbit-system-resource/pom.xml deleted file mode 100644 index 3a2433366..000000000 --- a/hawkbit-system-resource/pom.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-parent - 0.2.0-SNAPSHOT - - hawkbit-system-resource - hawkBit :: System REST Resources - - - - - org.eclipse.hawkbit - hawkbit-repository - ${project.version} - - - org.eclipse.hawkbit - hawkbit-system-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-rest-core - ${project.version} - - - org.springframework.plugin - spring-plugin-core - - - - - org.eclipse.hawkbit - hawkbit-rest-core - ${project.version} - tests - test - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - - test - - - org.springframework.boot - spring-boot-starter-log4j2 - test - - - com.h2database - h2 - test - - - org.mariadb.jdbc - mariadb-java-client - test - - - javax.el - javax.el-api - test - - - org.springframework.security - spring-security-config - test - - - org.eclipse.hawkbit - hawkbit-repository - ${project.version} - tests - test - - - org.eclipse.hawkbit - hawkbit-http-security - ${project.version} - test - - - com.jayway.jsonpath - json-path - test - - - org.json - json - test - - - com.fasterxml.jackson.core - jackson-databind - test - - - com.fasterxml.jackson.core - jackson-core - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-aspects - test - - - org.easytesting - fest-assert-core - test - - - org.easytesting - fest-assert - test - - - de.flapdoodle.embed - de.flapdoodle.embed.mongo - test - - - ru.yandex.qatools.allure - allure-junit-adaptor - test - - - org.springframework - spring-context-support - test - - - \ No newline at end of file diff --git a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java b/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java deleted file mode 100644 index bf706bdc4..000000000 --- a/hawkbit-system-resource/src/main/java/org/eclipse/hawkbit/system/annotation/EnableSystemApi.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.system.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.eclipse.hawkbit.rest.configuration.RestConfiguration; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; -import org.springframework.stereotype.Controller; - -/** - * Annotation to enable {@link ComponentScan} in the resource package to setup - * all {@link Controller} annotated classes and setup the System API. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Configuration -@ComponentScan -@Import(RestConfiguration.class) -public @interface EnableSystemApi { - -} diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java deleted file mode 100644 index 1b2772530..000000000 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/ResourceUtility.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.system.rest.resource; - -import java.io.IOException; - -import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -/** - * Utility additions for the REST API tests. - * - * - */ -public final class ResourceUtility { - private static final ObjectMapper mapper = new ObjectMapper(); - - static ExceptionInfo convertException(final String jsonExceptionResponse) - throws JsonParseException, JsonMappingException, IOException { - return mapper.readValue(jsonExceptionResponse, ExceptionInfo.class); - } - -} diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java deleted file mode 100644 index fb98a8470..000000000 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemManagementResourceTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * 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.system.rest.resource; - -import static org.fest.assertions.api.Assertions.assertThat; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import java.io.ByteArrayInputStream; -import java.util.List; -import java.util.Random; - -import org.eclipse.hawkbit.AbstractIntegrationTestWithMongoDB; -import org.eclipse.hawkbit.TestDataUtil; -import org.eclipse.hawkbit.WithSpringAuthorityRule; -import org.eclipse.hawkbit.WithUser; -import org.eclipse.hawkbit.im.authentication.SpPermission; -import org.eclipse.hawkbit.repository.model.DistributionSet; -import org.eclipse.hawkbit.repository.model.SoftwareModule; -import org.eclipse.hawkbit.repository.model.Target; -import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; -import org.junit.Test; -import org.springframework.http.MediaType; - -import ru.yandex.qatools.allure.annotations.Description; -import ru.yandex.qatools.allure.annotations.Features; -import ru.yandex.qatools.allure.annotations.Stories; - -/** - * - * - */ -@Features("Component Tests - System API") -@Stories("System Management Resource") -public class SystemManagementResourceTest extends AbstractIntegrationTestWithMongoDB { - - @Test - @WithUser(tenantId = "mytenant", authorities = { SpPermission.SYSTEM_ADMIN }) - @Description("Tests that the system is able to collect statistics for the entire system.") - public void collectSystemStatistics() throws Exception { - createTestTenantsForSystemStatistics(2, 2000, 100, 2); - - mvc.perform(get("/system/admin/usage").accept(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$tenantStats.[?(@.tenantName==tenant0)][0].targets", equalTo(100))) - .andExpect(jsonPath("$tenantStats.[?(@.tenantName==tenant0)][0].overallArtifactVolumeInBytes", - equalTo(2000))) - .andExpect(jsonPath("$tenantStats.[?(@.tenantName==tenant0)][0].artifacts", equalTo(1))) - .andExpect(jsonPath("$tenantStats.[?(@.tenantName==tenant0)][0].actions", equalTo(200))) - .andExpect(jsonPath("$overallTargets", equalTo(200))) - .andExpect(jsonPath("$overallArtifacts", equalTo(2))) - .andExpect(jsonPath("$overallArtifactVolumeInBytes", equalTo(4000))) - .andExpect(jsonPath("$overallActions", equalTo(400))) - .andExpect(jsonPath("$overallTenants", equalTo(4))); - } - - @Test - @WithUser(tenantId = "mytenant", authorities = { SpPermission.DELETE_TARGET, SpPermission.DELETE_REPOSITORY, - SpPermission.CREATE_REPOSITORY, SpPermission.READ_REPOSITORY }) - @Description("Tests that the system is not able to collect statistics for the entire system if the .") - public void collectSystemStatisticsWithMissingPermissionFails() throws Exception { - - mvc.perform(get("/system/admin/usage").accept(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isForbidden()); - } - - @Test - @WithUser(tenantId = "mytenant", allSpPermissions = true) - @Description("Tests that a tenant can be deletd by API.") - public void deleteTenant() throws Exception { - - final DistributionSet dsA = TestDataUtil.generateDistributionSet("", softwareManagement, - distributionSetManagement); - - assertThat(distributionSetManagement.findDistributionSetById(dsA.getId())).isNotNull(); - - mvc.perform(delete("/system/admin/tenants/mytenant")).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isOk()); - - assertThat(distributionSetManagement.findDistributionSetById(dsA.getId())).isNull(); - - } - - @Test - @WithUser(tenantId = "mytenant", authorities = { SpPermission.DELETE_TARGET, SpPermission.DELETE_REPOSITORY, - SpPermission.CREATE_REPOSITORY, SpPermission.READ_REPOSITORY }) - @Description("Tenant deletion is only possible for SYSTEM_ADMINs. Repository or target delete is not sufficient.") - public void deleteTenantFailsMissingPermission() throws Exception { - - final DistributionSet dsA = TestDataUtil.generateDistributionSet("", softwareManagement, - distributionSetManagement); - assertThat(distributionSetManagement.findDistributionSetById(dsA.getId())).isNotNull(); - - mvc.perform(delete("/system/admin/tenants/mytenant")).andDo(MockMvcResultPrinter.print()) - .andExpect(status().isForbidden()); - - assertThat(distributionSetManagement.findDistributionSetById(dsA.getId())).isNotNull(); - } - - @Test - public void getCachesReturnStatus200() throws Exception { - mvc.perform(get("/system/admin/caches")).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); - } - - @Test - public void invalidateCachesReturnStatus200() throws Exception { - mvc.perform(delete("/system/admin/caches")).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); - } - - private byte[] createTestTenantsForSystemStatistics(final int tenants, final int artifactSize, final int targets, - final int updates) throws Exception { - final Random randomgen = new Random(); - final byte random[] = new byte[artifactSize]; - randomgen.nextBytes(random); - - for (int i = 0; i < tenants; i++) { - final String tenantname = "tenant" + i; - securityRule.runAs(WithSpringAuthorityRule.withUserAndTenant("bumlux", tenantname), () -> { - systemManagement.getTenantMetadata(tenantname); - if (artifactSize > 0) { - createTestArtifact(random); - createDeletedTestArtifact(random); - } - if (targets > 0) { - final List createdTargets = createTestTargets(targets); - if (updates > 0) { - for (int x = 0; x < updates; x++) { - final DistributionSet ds = TestDataUtil.generateDistributionSet("to be deployed" + x, - softwareManagement, distributionSetManagement, true); - - deploymentManagement.assignDistributionSet(ds, createdTargets); - } - } - } - - return null; - }); - } - - return random; - } - - private List createTestTargets(final int targets) { - return targetManagement - .createTargets(TestDataUtil.buildTargetFixtures(targets, "testTargetOfTenant", "testTargetOfTenant")); - } - - private void createTestArtifact(final byte[] random) { - SoftwareModule sm = new SoftwareModule(softwareManagement.findSoftwareModuleTypeByKey("os"), "name 1", - "version 1", null, null); - sm = softwareModuleRepository.save(sm); - - artifactManagement.createLocalArtifact(new ByteArrayInputStream(random), sm.getId(), "file1", false); - } - - private void createDeletedTestArtifact(final byte[] random) { - final DistributionSet ds = TestDataUtil.generateDistributionSet("deleted garbage", softwareManagement, - distributionSetManagement, true); - ds.getModules().stream().forEach(module -> { - artifactManagement.createLocalArtifact(new ByteArrayInputStream(random), module.getId(), "file1", false); - softwareManagement.deleteSoftwareModule(module); - }); - } - -} diff --git a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java b/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java deleted file mode 100644 index 3dc9613e2..000000000 --- a/hawkbit-system-resource/src/test/java/org/eclipse/hawkbit/system/rest/resource/SystemResourceTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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.system.rest.resource; - -import static org.fest.assertions.api.Assertions.assertThat; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.Matchers.hasSize; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.eclipse.hawkbit.AbstractIntegrationTest; -import org.eclipse.hawkbit.exception.SpServerError; -import org.eclipse.hawkbit.repository.model.TenantConfigurationValue; -import org.eclipse.hawkbit.rest.json.model.ExceptionInfo; -import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter; -import org.eclipse.hawkbit.system.rest.api.SystemRestConstant; -import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey; -import org.junit.Test; -import org.springframework.http.MediaType; -import org.springframework.test.web.servlet.MvcResult; -import org.springframework.test.web.servlet.ResultActions; - -import ru.yandex.qatools.allure.annotations.Description; -import ru.yandex.qatools.allure.annotations.Features; -import ru.yandex.qatools.allure.annotations.Stories; - -@Features("Component Tests - System RESTful API") -@Stories("ConfigurationResource") -public class SystemResourceTest extends AbstractIntegrationTest { - - private static String BASE_JSON_REQUEST_STRING = "{\"value\":\"%s\"}"; - - @Test - @Description("perform a GET request on all existing configurations.") - public void getConfigurationValues() throws Exception { - - final ResultActions resultActions = mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/")) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.*", hasSize(TenantConfigurationKey.values().length))); - - for (final TenantConfigurationKey key : TenantConfigurationKey.values()) { - - final TenantConfigurationValue confValue = tenantConfigurationManagement.getConfigurationValue(key); - resultActions.andExpect(jsonPath("$.['" + key.getKeyName() + "'].value", equalTo(confValue.getValue()))) - .andExpect(jsonPath("$.['" + key.getKeyName() + "'].global", equalTo(confValue.isGlobal()))); - } - } - - @Test - @Description("perform a GET request on a existing configuration key.") - public void getConfigurationValue() throws Exception { - - final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; - final String notGlobalValue = "notTheGlobalHeaderAuthoryName"; - - tenantConfigurationManagement.addOrUpdateConfiguration(key, notGlobalValue); - - mvc.perform(get(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName())) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()) - .andExpect(jsonPath("value", equalTo(notGlobalValue))).andExpect(jsonPath("global", equalTo(false))) - .andExpect(jsonPath("createdAt", notNullValue())).andExpect(jsonPath("createdBy", notNullValue())); - } - - @Test - @Description("perform a PUT request on a existing configuration key with a valid value.") - public void putConfigurationValue() throws Exception { - - final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; - final String testValue = "12:12:12"; - - mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName()) - .content(String.format(BASE_JSON_REQUEST_STRING, testValue)).contentType(MediaType.APPLICATION_JSON)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isOk()); - - assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).getValue()) - .isEqualTo(testValue); - } - - @Test - @Description("perform a DELETE request on a existing configuration key.") - public void deleteConfigurationValue() throws Exception { - - final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME; - final String notGlobalValue = "notTheGlobalHeaderAuthoryName"; - - tenantConfigurationManagement.addOrUpdateConfiguration(key, notGlobalValue); - assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).isGlobal()).isEqualTo(false); - - assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).getValue()) - .isEqualTo(notGlobalValue); - - mvc.perform(delete(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName())) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isNoContent()); - - assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).isGlobal()).isEqualTo(true); - assertThat(tenantConfigurationManagement.getConfigurationValue(key, String.class).getValue()) - .isNotEqualTo(notGlobalValue); - } - - @Test - @Description("perform a (put) request on a not existing configuration key.") - public void putInvalidConfigurationKey() throws Exception { - - final String notExistingKey = "notExistingKey"; - final String testValue = "12:12:12"; - - final MvcResult mvcResult = mvc - .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", notExistingKey) - .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) - .contentType(MediaType.APPLICATION_JSON)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); - - // verify response json exception message - final ExceptionInfo exceptionInfo = ResourceUtility - .convertException(mvcResult.getResponse().getContentAsString()); - assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_CONFIGURATION_KEY_INVALID.getKey()); - } - - @Test - @Description("perform a put request with a not matching configuration value.") - public void putInvalidConfigurationValue() throws Exception { - - final TenantConfigurationKey key = TenantConfigurationKey.POLLING_TIME_INTERVAL; - final String testValue = "invalidFormattedDuration"; - - final MvcResult mvcResult = mvc - .perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", key.getKeyName()) - .content(String.format(BASE_JSON_REQUEST_STRING, testValue)) - .contentType(MediaType.APPLICATION_JSON)) - .andDo(MockMvcResultPrinter.print()).andExpect(status().isBadRequest()).andReturn(); - - // verify response json exception message - final ExceptionInfo exceptionInfo = ResourceUtility - .convertException(mvcResult.getResponse().getContentAsString()); - assertThat(exceptionInfo.getErrorCode()).isEqualTo(SpServerError.SP_CONFIGURATION_VALUE_INVALID.getKey()); - } -} diff --git a/hawkbit-mgmt-ui/.gitignore b/hawkbit-ui/.gitignore similarity index 100% rename from hawkbit-mgmt-ui/.gitignore rename to hawkbit-ui/.gitignore diff --git a/hawkbit-mgmt-ui/README.md b/hawkbit-ui/README.md similarity index 100% rename from hawkbit-mgmt-ui/README.md rename to hawkbit-ui/README.md diff --git a/hawkbit-mgmt-ui/pom.xml b/hawkbit-ui/pom.xml similarity index 99% rename from hawkbit-mgmt-ui/pom.xml rename to hawkbit-ui/pom.xml index 1c8b8e1ea..e0bde576a 100644 --- a/hawkbit-mgmt-ui/pom.xml +++ b/hawkbit-ui/pom.xml @@ -16,7 +16,7 @@ hawkbit-parent 0.2.0-SNAPSHOT - hawkbit-mgmt-ui + hawkbit-ui hawkBit :: UI Bosch IoT Software Provisioning server web application diff --git a/hawkbit-mgmt-ui/src/main/.gitignore b/hawkbit-ui/src/main/.gitignore similarity index 100% rename from hawkbit-mgmt-ui/src/main/.gitignore rename to hawkbit-ui/src/main/.gitignore diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/AsyncVaadinServletConfiguration.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptor.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/OffsetBasedPageRequest.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/repository/SpPermissionChecker.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/AppWidgetSet.gwt.xml diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DefaultHawkbitUI.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/DispatcherRunnable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/ErrorView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitEventProvider.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/HawkbitUI.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UIEventProvider.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/UiProperties.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/UploadArtifactViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactDetailsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/ArtifactDetailsEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SMFilterEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/SoftwareModuleTypeEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadArtifactUIEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/event/UploadViewAcceptCriteria.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/SMDeleteActionsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/footer/UploadViewConfirmationWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/BaseSwModuleBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/ProxyBaseSoftwareModuleItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleAddUpdateWindow.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleDetails.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtable/SoftwareModuleTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/CreateUpdateSoftwareTypeLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/smtype/SMTypeFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/ArtifactUploadState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/CustomFile.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/state/SoftwareModuleFilters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadConfirmationwindow.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadResultWindow.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatus.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadStatusInfoWindow.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractAcceptCriteria.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ConfirmationDialog.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/CoordinatesToColor.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/DistributionSetTypeBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/ManagmentEntityState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/SoftwareModuleTypeBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/UserDetailsFormatter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/AbstractConfirmationWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationTab.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/confirmwindow/layout/ConfirmationWindowEvents.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractNamedVersionedEntityTableDetailsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/AbstractTableDetailsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/SoftwareModuleDetailsTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtonClickBehaviour.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterMultiButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/filterlayout/AbstractFilterSingleButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/footer/AbstractDeleteActionsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGrid.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/grid/AbstractGridLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractNamedVersionTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/AbstractTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/table/BaseEntityEventType.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTagToken.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/AbstractTargetTagToken.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/DistributionTagToken.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/tagdetails/TargetTagToken.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/DistributionSetInfoPanel.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyDistribution.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTarget.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/ProxyTargetFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPNotificationMessage.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPTargetAttributesLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIButton.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUICheckBox.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIComponentProvider.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIErrorHandler.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIHorizontalLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITabSheet.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUITableHorizonatlLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/components/SPUIUpdateLogLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/CustomRendererWidgetSet.gwt.xml diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlButtonRendererConnector.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/HtmlLabelRendererConnector.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/RolloutRendererConnector.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/RolloutRendererConnector.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/RolloutRendererConnector.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/RolloutRendererConnector.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlButtonRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/HtmlLabelRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRendererData.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRendererData.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRendererData.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/client/renderers/RolloutRendererData.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlButtonRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/HtmlLabelRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/RolloutRenderer.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/RolloutRenderer.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/RolloutRenderer.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/customrenderers/renderers/RolloutRenderer.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleLargeIconNoBorder.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStylePrimarySmall.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmall.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorder.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUH.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleSmallNoBorderUHS.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIButtonStyleTiny.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIComboBoxDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIEmbedValue.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIHeaderLayoutDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUILabelDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITagButtonStyle.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextAreaDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUITextFieldDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/decorators/SPUIWindowDecorator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/DistributionsViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/CreateUpdateDistSetTypeLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/disttype/DSTypeFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetDetails.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/DistributionSetTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/dstable/ManageDistBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionSetTypeEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsUIEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DistributionsViewAcceptCriteria.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/DragEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SaveActionWindowEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SoftwareModuleAssignmentDiscardEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/event/SwModuleUIEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DSDeleteActionsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/footer/DistributionsConfirmationWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/ProxyBaseSwModuleItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleDetails.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtable/SwModuleTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/smtype/DistSMTypeFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistFilters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageDistUIState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/distributions/state/ManageSoftwareModuleFilters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/FilterExpression.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/Filters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/CustomTargetFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetSearchTextFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetStatusFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filter/target/TargetTagFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CreateOrUpdateFilterTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/CustomTargetBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterManagementViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/FilterQueryValidation.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TargetFilterTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/TokenDescription.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/ValidationResult.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/event/CustomFilterUIEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/footer/TargetFilterCountMessageLabel.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/state/FilterManagementUIState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/HawkbitLoginUI.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/login/LoginView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/DeploymentViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryComponent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/actionhistory/ActionHistoryTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionAddUpdateWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionDetails.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstable/DistributionTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/CreateUpdateDistributionTagLayoutWindow.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/dstag/DistributionTagLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadPopupEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/BulkUploadValidationMessageEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTableFilterEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DistributionTagDropEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/DragEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementUIEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/ManagementViewAcceptCriteria.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/PinUnpinEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/SaveActionWindowEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetAddUpdateWindowEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetFilterEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/event/TargetTableEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ActionTypeOptionGroupLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/CountMessageLabel.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/DeleteActionsLayoutHelper.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/footer/ManangementConfirmationWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/DistributionTableFilters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/ManagementUIState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetBulkUpload.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetFilterParameters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/state/TargetTableFilters.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/CreateUpdateTagLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/ProxyTag.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/SpColorPickerPreview.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/tag/TagIdName.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/BulkUploadHandler.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetAddUpdateWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkTokenTags.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetBulkUpdateWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetDetails.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTableLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/AbstractTargetTagFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CreateUpdateTargetTagLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/CustomTargetTagFilterButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/FilterByStatusLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/MultipleTargetFilter.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetFilterQueryButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtonClick.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterButtons.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettag/TargetTagFilterLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenu.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/menu/DashboardMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/DelayedEventBusPushStrategy.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/push/EventPushStrategy.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/DistributionBarHelper.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/RolloutViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/StatusFontIcon.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/event/RolloutEvent.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/AddUpdateRolloutWindowLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/DistributionBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/ProxyRollout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListGrid.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rollout/RolloutListView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/ProxyRolloutGroup.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupListGrid.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgroup/RolloutGroupsListView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsBeanQuery.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsCountLabelMessage.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListGrid.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListHeader.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/rolloutgrouptargets/RolloutGroupTargetsListView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/rollout/state/RolloutUIState.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/AuthenticationConfigurationView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/BaseConfigurationView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationGroup.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/ConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/DefaultDistributionSetTypeLayout.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/PollingConfigurationView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardView.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/TenantConfigurationDashboardViewMenuItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AbstractAuthenticationTenantConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AnonymousDownloadAuthenticationConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/AuthenticationConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/CertificateAuthenticationConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/GatewaySecurityTokenAuthenticationConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/authentication/TargetSecurityTokenAuthenticationConfigurationItem.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationConfigField.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/tenantconfiguration/polling/DurationField.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/AssignInstalledDSTooltipGenerator.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/AssignInstalledDSTooltipGenerator.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/AssignInstalledDSTooltipGenerator.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/AssignInstalledDSTooltipGenerator.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/HawkbitCommonUtil.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/I18N.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactory.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/NotificationMessage.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPDateTimeUtil.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIButtonDefinitions.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIComponetIdProvider.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIDefinitions.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUILabelDefinitions.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUIStyleDefinitions.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SPUITargetDefinitions.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/TableColumn.java diff --git a/hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java similarity index 100% rename from hawkbit-mgmt-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java rename to hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/UINotification.java diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/.gitignore b/hawkbit-ui/src/main/resources/VAADIN/.gitignore similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/.gitignore rename to hawkbit-ui/src/main/resources/VAADIN/.gitignore diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/.gitignore diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/accordion.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/action-history.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/artifact-upload.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/colorpicker.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/common.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/dashboardview.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/drop-hint.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-layout-styles.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/filter-status.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/footer-common.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/generic-styles.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/hawkbitvariables.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/login.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/others.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-common.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/popup-window.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/rollout.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/statusprogressbar.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/systemconfig.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-common.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-content.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table-header-common.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/table.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/tags.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/customstyles/target-filter-query.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_selected1.png diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/lightCorner_top.png diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/images/profile-pic-57px.jpg diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/layouts/footer.html diff --git a/hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss rename to hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/styles.scss diff --git a/hawkbit-mgmt-ui/src/main/resources/messages.properties b/hawkbit-ui/src/main/resources/messages.properties similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/messages.properties rename to hawkbit-ui/src/main/resources/messages.properties diff --git a/hawkbit-mgmt-ui/src/main/resources/messages_de.properties b/hawkbit-ui/src/main/resources/messages_de.properties similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/messages_de.properties rename to hawkbit-ui/src/main/resources/messages_de.properties diff --git a/hawkbit-mgmt-ui/src/main/resources/messages_en.properties b/hawkbit-ui/src/main/resources/messages_en.properties similarity index 100% rename from hawkbit-mgmt-ui/src/main/resources/messages_en.properties rename to hawkbit-ui/src/main/resources/messages_en.properties diff --git a/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java b/hawkbit-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java similarity index 100% rename from hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java rename to hawkbit-ui/src/test/java/org/eclipse/hawkbit/push/SpringSecurityAtmosphereInterceptorTest.java diff --git a/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java b/hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java similarity index 100% rename from hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java rename to hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/NamingThreadFactoryTest.java diff --git a/hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java b/hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java similarity index 100% rename from hawkbit-mgmt-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java rename to hawkbit-ui/src/test/java/org/eclipse/hawkbit/ui/utils/SPUIComponentProviderTest.java diff --git a/pom.xml b/pom.xml index 6fdab75b3..851fa44d8 100644 --- a/pom.xml +++ b/pom.xml @@ -27,8 +27,6 @@ hawkbit-core hawkbit-security-core hawkbit-rest-core - hawkbit-system-api - hawkbit-system-resource hawkbit-mgmt-api hawkbit-mgmt-resource hawkbit-ddi-api @@ -39,7 +37,7 @@ hawkbit-repository hawkbit-security-integration hawkbit-http-security - hawkbit-mgmt-ui + hawkbit-ui hawkbit-artifact-repository-mongo hawkbit-autoconfigure hawkbit-cache-redis From 05615a9e86f2db0178827f26ca1d1fcf4bb810ea Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 14:28:31 +0200 Subject: [PATCH 108/124] Modify JavaDoc Signed-off-by: SirWayne --- .../hawkbit/ddi/json/model/DdiCancel.java | 2 +- .../ddi/json/model/DdiCancelActionToStop.java | 4 +- .../hawkbit/ddi/json/model/DdiDeployment.java | 4 +- .../ddi/json/model/DdiDeploymentBase.java | 4 +- .../rest/api/DdiRootControllerRestApi.java | 38 +++++++++---------- .../resource/DdiArtifactStoreController.java | 5 +-- .../mgmt/json/model/action/MgmtAction.java | 4 +- .../json/model/artifact/MgmtArtifact.java | 6 +-- .../model/distributionset/MgmtActionType.java | 8 +--- .../softwaremodule/MgmtSoftwareModule.java | 6 +-- .../rest/api/MgmtDistributionSetRestApi.java | 11 ------ .../api/MgmtDistributionSetTagRestApi.java | 24 ------------ .../api/MgmtDistributionSetTypeRestApi.java | 2 - .../mgmt/rest/api/MgmtRolloutRestApi.java | 13 ------- .../rest/api/MgmtSoftwareModuleRestApi.java | 2 - .../api/MgmtSoftwareModuleTypeRestApi.java | 2 - .../rest/api/MgmtSystemManagementRestApi.java | 2 +- .../mgmt/rest/api/MgmtTargetRestApi.java | 16 -------- .../mgmt/rest/api/MgmtTargetTagRestApi.java | 16 -------- .../mgmt/annotation/EnableMgmtApi.java | 3 -- .../MgmtDownloadArtifactResource.java | 4 -- .../rest/resource/MgmtDownloadResource.java | 2 - .../rest/resource/MgmtTargetTagResource.java | 2 +- .../util/RestResourceConversionHelper.java | 5 +-- 24 files changed, 36 insertions(+), 149 deletions(-) diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java index 9167ae73c..c117dea14 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancel.java @@ -24,7 +24,7 @@ public class DdiCancel { * Parameterized constructor. * * @param id - * of the {@link CancelAction} + * of the cancel action * @param cancelAction * the action */ diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java index e7b946a87..3ab8d6b55 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiCancelActionToStop.java @@ -11,7 +11,7 @@ package org.eclipse.hawkbit.ddi.json.model; import javax.validation.constraints.NotNull; /** - * The {@link Action} that has to be stopped by the target. + * The action that has to be stopped by the target. */ public class DdiCancelActionToStop { @@ -22,7 +22,7 @@ public class DdiCancelActionToStop { * Parameterized constructor. * * @param stopId - * ID of the {@link Action} to be stoppedW + * ID of the action to be stoppedW */ public DdiCancelActionToStop(final String stopId) { super(); diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java index 7f8c84d39..f72083d7a 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeployment.java @@ -13,7 +13,7 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonValue; /** - * Detailed {@link UpdateAction} information. + * Detailed update action information. */ public class DdiDeployment { @@ -57,7 +57,7 @@ public class DdiDeployment { } /** - * The handling type for the update {@link Action}. + * The handling type for the update action. */ public enum HandlingType { diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java index 4d89f759b..8f1116b1b 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/json/model/DdiDeploymentBase.java @@ -15,7 +15,7 @@ import org.springframework.hateoas.ResourceSupport; import com.fasterxml.jackson.annotation.JsonProperty; /** - * {@link UpdateAction} resource. + * Update action resource. */ public class DdiDeploymentBase extends ResourceSupport { @@ -30,7 +30,7 @@ public class DdiDeploymentBase extends ResourceSupport { * Constructor. * * @param id - * of the {@link UpdateAction} + * of the update action * @param deployment * details. */ diff --git a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java index eaa879562..67436c3ca 100644 --- a/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java +++ b/hawkbit-ddi-api/src/main/java/org/eclipse/hawkbit/ddi/rest/api/DdiRootControllerRestApi.java @@ -40,10 +40,9 @@ public interface DdiRootControllerRestApi { * Returns all artifacts of a given software module and target. * * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} + * of the target that matches to controller id * @param softwareModuleId - * of the {@link SoftwareModule} + * of the software module * @return the response */ @RequestMapping(method = RequestMethod.GET, value = "/{targetid}/softwaremodules/{softwareModuleId}/artifacts", produces = { @@ -56,8 +55,7 @@ public interface DdiRootControllerRestApi { * Root resource for an individual {@link Target}. * * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} + * of the target that matches to controller id * @param request * the HTTP request injected by spring * @return the response @@ -71,11 +69,11 @@ public interface DdiRootControllerRestApi { * partial (as specified by RFC7233 (Range Requests)) download request. * * @param targetid - * of the related + * of the related target * @param softwareModuleId - * of the parent {@link SoftwareModule} + * of the parent software module * @param fileName - * of the related {@link LocalArtifact} + * of the related local artifact * @param response * of the servlet * @param request @@ -94,11 +92,11 @@ public interface DdiRootControllerRestApi { * Handles GET {@link DdiArtifact} MD5 checksum file download request. * * @param targetid - * of the related + * of the related target * @param softwareModuleId - * of the parent {@link SoftwareModule} + * of the parent software module * @param fileName - * of the related {@link LocalArtifact} + * of the related local artifact * @param response * of the servlet * @param request @@ -114,14 +112,13 @@ public interface DdiRootControllerRestApi { @PathVariable("fileName") final String fileName); /** - * Resource for {@link SoftwareModule} {@link UpdateAction}s. + * Resource for software module. * * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} + * of the target that matches to controller id * @param actionId - * of the {@link DdiDeploymentBase} that matches to - * {@link Target#getActiveActions()} + * of the {@link DdiDeploymentBase} that matches to active + * actions. * @param resource * an hashcode of the resource which indicates if the action has * been changed, e.g. from 'soft' to 'force' and the eTag needs @@ -143,8 +140,7 @@ public interface DdiRootControllerRestApi { * @param feedback * to provide * @param targetid - * of the {@link Target} that matches to - * {@link Target#getControllerId()} + * of the target that matches to controller id * @param actionId * of the action we have feedback for * @param request @@ -175,7 +171,7 @@ public interface DdiRootControllerRestApi { @PathVariable("targetid") final String targetid); /** - * {@link RequestMethod.GET} method for the {@link DdiCancel} action. + * RequestMethod.GET method for the {@link DdiCancel} action. * * @param targetid * ID of the calling target @@ -192,8 +188,8 @@ public interface DdiRootControllerRestApi { @PathVariable("actionId") @NotEmpty final Long actionId); /** - * {@link RequestMethod.POST} method receiving the {@link DdiActionFeedback} - * from the target. + * RequestMethod.POST method receiving the {@link DdiActionFeedback} from + * the target. * * @param feedback * the {@link DdiActionFeedback} from the target. diff --git a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java index e7a60f34a..9c51cf8f4 100644 --- a/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java +++ b/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiArtifactStoreController.java @@ -43,9 +43,8 @@ import org.springframework.web.context.WebApplicationContext; * The {@link DdiArtifactStoreController} of the HawkBit server controller API * that is queried by the HawkBit target in order to download artifacts * independent of their own individual resource. This is offered in addition to - * the - * {@link DdiRootController#downloadArtifact(String, Long, Long, javax.servlet.http.HttpServletResponse)} - * for legacy controllers that can not be fed with a download URI at runtime. + * the {@link DdiRootController#downloadArtifact(String, Long, String)} for + * legacy controllers that can not be fed with a download URI at runtime. */ @RestController @Scope(WebApplicationContext.SCOPE_REQUEST) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java index 5b63b5f69..234e282a0 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/action/MgmtAction.java @@ -24,12 +24,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class MgmtAction extends MgmtBaseEntity { /** - * API definition for {@link UpdateAction}. + * API definition for update action}. */ public static final String ACTION_UPDATE = "update"; /** - * API definition for {@link CancelAction}. + * API definition for cancel action. */ public static final String ACTION_CANCEL = "cancel"; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java index 2bcf3c059..afb2d204a 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/artifact/MgmtArtifact.java @@ -108,11 +108,7 @@ public class MgmtArtifact extends MgmtBaseEntity { } /** - * Type maps to either {@link LocalArtifact} or {@link ExternalArtifact}. - * - * - * - * + * Type maps to either local artifact} or external artifact. */ public enum ArtifactType { LOCAL("local"), EXTERNAL("external"); diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java index 98017d18a..d95375f5a 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/distributionset/MgmtActionType.java @@ -11,10 +11,7 @@ package org.eclipse.hawkbit.mgmt.json.model.distributionset; import com.fasterxml.jackson.annotation.JsonValue; /** - * Definition of the {@link ActionType} for the REST management API. - * - * - * + * Definition of the Action type for the REST management API. * */ public enum MgmtActionType { @@ -39,9 +36,6 @@ public enum MgmtActionType { this.name = name; } - /** - * @return the name - */ @JsonValue public String getName() { return name; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java index fe47347a9..ec4a48e89 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/softwaremodule/MgmtSoftwareModule.java @@ -24,15 +24,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; @JsonIgnoreProperties(ignoreUnknown = true) public class MgmtSoftwareModule extends MgmtNamedEntity { /** - * API definition for {@link SoftwareModule.Type#RUNTIME}. + * API definition for Software module type#RUNTIME. */ public static final String SM_RUNTIME = "runtime"; /** - * API definition for {@link SoftwareModule.Type#OS}. + * API definition for for Software module type#OS. */ public static final String SM_OS = "os"; /** - * API definition for {@link SoftwareModule.Type#APPLICATION}. + * API definition for for Software module type#APPLICATION. */ public static final String SM_APPLICATION = "application"; diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java index 01ae4f93f..c61c9ecd3 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetRestApi.java @@ -68,8 +68,6 @@ public interface MgmtDistributionSetRestApi { * * @return a single DistributionSet with status OK. * - * @throws EntityNotFoundException - * in case no DistributionSet with the given ID exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -298,9 +296,6 @@ public interface MgmtDistributionSetRestApi { * the list of software modules ids to assign * @return http status * - * @throws EntityNotFoundException - * in case no distribution set with the given - * {@code distributionSetId} exists. */ @RequestMapping(method = RequestMethod.POST, value = "/{distributionSetId}/assignedSM", consumes = { MediaType.APPLICATION_JSON_VALUE, @@ -318,9 +313,6 @@ public interface MgmtDistributionSetRestApi { * the software module id to get rejected form the distribution * set * @return status OK if rejection was successful. - * @throws EntityNotFoundException - * in case no distribution set with the given - * {@code distributionSetId} exists. */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionSetId}/assignedSM/{softwareModuleId}") ResponseEntity deleteAssignSoftwareModules(@PathVariable("distributionSetId") final Long distributionSetId, @@ -343,9 +335,6 @@ public interface MgmtDistributionSetRestApi { * {@code field:direction, field:direction} * @return a list of the assigned software modules of a distribution set * with status OK, if none is assigned than {@code null} - * @throws EntityNotFoundException - * in case no distribution set with the given - * {@code distributionSetId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetId}/assignedSM", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java index 761e803af..5a836ef55 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTagRestApi.java @@ -64,9 +64,6 @@ public interface MgmtDistributionSetTagRestApi { * the ID of the distribution set tag to retrieve * * @return a single distribution set tag with status OK. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionsetTagId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -97,9 +94,6 @@ public interface MgmtDistributionSetTagRestApi { * the the request body to be updated * @return status OK if update is successful and the updated distribution * set tag. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.PUT, value = "/{distributionsetTagId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -113,9 +107,6 @@ public interface MgmtDistributionSetTagRestApi { * @param distributionsetTagId * the ID of the distribution set tag * @return status OK if delete as successfully. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{distributionsetTagId}") @@ -130,9 +121,6 @@ public interface MgmtDistributionSetTagRestApi { * the ID of the distribution set tag * * @return the list of assigned distribution sets. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) ResponseEntity> getAssignedDistributionSets( @@ -149,9 +137,6 @@ public interface MgmtDistributionSetTagRestApi { * * @return the list of assigned distribution sets and unassigned * distribution sets. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + "/toggleTagAssignment") @@ -168,9 +153,6 @@ public interface MgmtDistributionSetTagRestApi { * list of distribution sets ids to be assigned * * @return the list of assigned distribution set. - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) ResponseEntity> assignDistributionSets( @@ -184,9 +166,6 @@ public interface MgmtDistributionSetTagRestApi { * @param distributionsetTagId * the ID of the distribution set tag to retrieve * @return http status code - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING) ResponseEntity unassignDistributionSets( @@ -201,9 +180,6 @@ public interface MgmtDistributionSetTagRestApi { * @param distributionsetId * the ID of the distribution set to unassign * @return http status code - * @throws EntityNotFoundException - * in case the given {@code distributionsetTagId} doesn't - * exists. */ @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.DISTRIBUTIONSET_REQUEST_MAPPING + "/{distributionsetId}") diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java index 01aea87f1..25468739e 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtDistributionSetTypeRestApi.java @@ -68,8 +68,6 @@ public interface MgmtDistributionSetTypeRestApi { * the ID of the module type to retrieve * * @return a single softwareModule with status OK. - * @throws EntityNotFoundException - * in case no with the given {@code softwareModuleId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{distributionSetTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java index 450d080d1..7f93e2ce8 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtRolloutRestApi.java @@ -60,8 +60,6 @@ public interface MgmtRolloutRestApi { * @param rolloutId * the ID of the rollout to retrieve * @return a single rollout with status OK. - * @throws EntityNotFoundException - * in case no rollout with the given {@code rolloutId} exists. */ @RequestMapping(value = "/{rolloutId}", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) @@ -76,7 +74,6 @@ public interface MgmtRolloutRestApi { * status code 201 with the successfully created rollout. In any * failure the JsonResponseExceptionHandler is handling the * response. - * @throws EntityNotFoundException */ @RequestMapping(method = RequestMethod.POST, consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -89,9 +86,6 @@ public interface MgmtRolloutRestApi { * the ID of the rollout to be started. * @return OK response (200) if rollout could be started. In case of any * exception the corresponding errors occur. - * @throws EntityNotFoundException - * @see RolloutManagement#startRollout(Rollout) - * @see ResponseExceptionHandler */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/start", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -105,9 +99,6 @@ public interface MgmtRolloutRestApi { * the ID of the rollout to be paused. * @return OK response (200) if rollout could be paused. In case of any * exception the corresponding errors occur. - * @throws EntityNotFoundException - * @see RolloutManagement#pauseRollout(Rollout) - * @see ResponseExceptionHandler */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/pause", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -120,9 +111,6 @@ public interface MgmtRolloutRestApi { * the ID of the rollout to be resumed. * @return OK response (200) if rollout could be resumed. In case of any * exception the corresponding errors occur. - * @throws EntityNotFoundException - * @see RolloutManagement#resumeRollout(Rollout) - * @see ResponseExceptionHandler */ @RequestMapping(method = RequestMethod.POST, value = "/{rolloutId}/resume", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -167,7 +155,6 @@ public interface MgmtRolloutRestApi { * @param groupId * the groupId to retrieve the rollout group * @return the OK response containing the MgmtRolloutGroupResponseBody - * @throws EntityNotFoundException */ @RequestMapping(method = RequestMethod.GET, value = "/{rolloutId}/deploygroups/{groupId}", produces = { MediaType.APPLICATION_JSON_VALUE, "application/hal+json" }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java index 54bf7b08b..cdd63ee26 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleRestApi.java @@ -143,8 +143,6 @@ public interface MgmtSoftwareModuleRestApi { * the ID of the module to retrieve * * @return a single softwareModule with status OK. - * @throws EntityNotFoundException - * in case no with the given {@code softwareModuleId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java index 208162645..3fe32d9ad 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSoftwareModuleTypeRestApi.java @@ -63,8 +63,6 @@ public interface MgmtSoftwareModuleTypeRestApi { * the ID of the module type to retrieve * * @return a single softwareModule with status OK. - * @throws EntityNotFoundException - * in case no with the given {@code softwareModuleId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{softwareModuleTypeId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java index 4415d1a4e..d4832aa7d 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemManagementRestApi.java @@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** - * {@link SystemManagement} capabilities by REST. + * System management capabilities by REST. * */ @RequestMapping(MgmtRestConstants.SYSTEM_ADMIN_MAPPING) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java index 077c2c799..d44d473b1 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java @@ -38,8 +38,6 @@ public interface MgmtTargetRestApi { * @param targetId * the ID of the target to retrieve * @return a single target with status OK. - * @throws EntityNotFoundException - * in case no target with the given {@code targetId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}", produces = { "application/hal+json", @@ -127,8 +125,6 @@ public interface MgmtTargetRestApi { * @param targetId * the ID of the target to retrieve the attributes. * @return the target attributes as map response with status OK - * @throws EntityNotFoundException - * in case no target with the given {@code targetId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/attributes", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -189,10 +185,6 @@ public interface MgmtTargetRestApi { * @param force * optional parameter, which indicates a force cancel * @return status no content in case cancellation was successful - * @throws CancelActionNotAllowedException - * if the given action is not active and cannot be canceled. - * @throws EntityNotFoundException - * if the target or the action is not found */ @RequestMapping(method = RequestMethod.DELETE, value = "/{targetId}/actions/{actionId}") ResponseEntity cancelAction(@PathVariable("targetId") final String targetId, @@ -236,8 +228,6 @@ public interface MgmtTargetRestApi { * the ID of the target to retrieve the assigned distribution * @return the assigned distribution set with status OK, if none is assigned * than {@code null} content (e.g. "{}") - * @throws EntityNotFoundException - * in case no target with the given {@code targetId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/assignedDS", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -251,10 +241,6 @@ public interface MgmtTargetRestApi { * @param dsId * of the distributionset that is to be assigned * @return http status - * - * @throws EntityNotFoundException - * in case no target with the given {@code targetId} exists. - * */ @RequestMapping(method = RequestMethod.POST, value = "/{targetId}/assignedDS", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -269,8 +255,6 @@ public interface MgmtTargetRestApi { * the ID of the target to retrieve * @return the assigned installed set with status OK, if none is installed * than {@code null} content (e.g. "{}") - * @throws EntityNotFoundException - * in case no target with the given {@code targetId} exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetId}/installedDS", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java index 132a9f939..e568e7377 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetTagRestApi.java @@ -64,8 +64,6 @@ public interface MgmtTargetTagRestApi { * the ID of the target tag to retrieve * * @return a single target tag with status OK. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.GET, value = "/{targetTagId}", produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -94,8 +92,6 @@ public interface MgmtTargetTagRestApi { * @param restTargetTagRest * the the request body to be updated * @return status OK if update is successful and the updated target tag. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.PUT, value = "/{targetTagId}", consumes = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }, produces = { "application/hal+json", MediaType.APPLICATION_JSON_VALUE }) @@ -108,8 +104,6 @@ public interface MgmtTargetTagRestApi { * @param targetTagId * the ID of the target tag * @return status OK if delete as successfully. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. * */ @RequestMapping(method = RequestMethod.DELETE, value = "/{targetTagId}") @@ -123,8 +117,6 @@ public interface MgmtTargetTagRestApi { * the ID of the target tag to retrieve * * @return the list of assigned targets. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.GET, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) ResponseEntity> getAssignedTargets(@PathVariable("targetTagId") final Long targetTagId); @@ -139,8 +131,6 @@ public interface MgmtTargetTagRestApi { * list of target ids to be toggled * * @return the list of assigned targets and unassigned targets. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + "/toggleTagAssignment") @@ -157,8 +147,6 @@ public interface MgmtTargetTagRestApi { * list of target ids to be assigned * * @return the list of assigned targets. - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.POST, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) ResponseEntity> assignTargets(@PathVariable("targetTagId") final Long targetTagId, @@ -170,8 +158,6 @@ public interface MgmtTargetTagRestApi { * @param targetTagId * the ID of the target tag to retrieve * @return http status code - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING) ResponseEntity unassignTargets(@PathVariable("targetTagId") final Long targetTagId); @@ -184,8 +170,6 @@ public interface MgmtTargetTagRestApi { * @param controllerId * the ID of the target to unassign * @return http status code - * @throws EntityNotFoundException - * in case the given {@code targetTagId} doesn't exists. */ @RequestMapping(method = RequestMethod.DELETE, value = MgmtRestConstants.TARGET_TAG_TAGERTS_REQUEST_MAPPING + "/{controllerId}") diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java index 2b7f754a8..18cff40f3 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java @@ -23,9 +23,6 @@ import org.springframework.stereotype.Controller; * Annotation to enable {@link ComponentScan} in the resource package to setup * all {@link Controller} annotated classes and setup the REST-Resources for the * Management API. - * - * - * */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index 077efa84c..dad43bf00 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -53,10 +53,6 @@ public class MgmtDownloadArtifactResource implements MgmtDownloadArtifactRestApi * of the parent SoftwareModule * @param artifactId * of the related LocalArtifact - * @param servletResponse - * of the servlet - * @param request - * of the client * * @return responseEntity with status ok if successful */ diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java index 10cd2db3b..87a215183 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadResource.java @@ -58,8 +58,6 @@ public class MgmtDownloadResource implements MgmtDownloadRestApi { * * @param downloadId * the generated download id - * @param response - * of the servlet * @return {@link ResponseEntity} with status {@link HttpStatus#OK} if * successful */ diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java index 03265a76c..2bafecd8b 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetTagResource.java @@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** - * REST Resource handling for {@link Tag} CRUD operations. + * REST Resource handling for tag CRUD operations. * */ @RestController diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java index 96f30cc87..181ccc1f8 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/RestResourceConversionHelper.java @@ -69,7 +69,7 @@ public final class RestResourceConversionHelper { /** *

* Write response with target relation and publishes events concerning the - * download progress based on given {@link UpdateActionStatus}. + * download progress based on given update action status. *

* *

@@ -89,9 +89,6 @@ public final class RestResourceConversionHelper { * @param statusId * of the UpdateActionStatus * - * @throws IOException - * in case of exceptions - * * @return http code * * @see https://tools.ietf.org/html/rfc7233 From 96af492a9caf047648c17b7762d1e2fb440bf73a Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 15:02:49 +0200 Subject: [PATCH 109/124] Fix NPE in equals Signed-off-by: SirWayne --- .../hawkbit/ui/artifacts/upload/UploadHandler.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java index 77207bd50..d5c6759b5 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/upload/UploadHandler.java @@ -339,7 +339,7 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + (fileName == null ? 0 : fileName.hashCode()); + result = prime * result + ((fileName == null) ? 0 : fileName.hashCode()); return result; } @@ -348,12 +348,17 @@ public class UploadHandler implements StreamVariable, Receiver, SucceededListene if (this == obj) { return true; } - if (!(obj instanceof UploadHandler)) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { return false; } final UploadHandler other = (UploadHandler) obj; - if (fileName == null && other.fileName != null) { - return false; + if (fileName == null) { + if (other.fileName != null) { + return false; + } } else if (!fileName.equals(other.fileName)) { return false; } From f02485129e4223c4845cbea388c2d765471f3969 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 15:24:28 +0200 Subject: [PATCH 110/124] Extend migration guide Signed-off-by: SirWayne --- MIGRATION.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 8db1ee57c..f9d9fff51 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -11,3 +11,10 @@ ### REST API model changes for clients - ENTITYPagedList classes have been removed; generic PagedList used instead (e.g. PagedList instead of TargetPagedList). - ENTITYsrest classes have been removed; List used instead (e.g. List instead of TargetsRest) + +### Renamed api annotations +- Annotation `org.eclipse.hawkbit.rest.resource.EnableRestResources` have changed to `org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi` +- Annotation `org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi` have changed to `org.eclipse.hawkbit.ddi.annotation.EnableDdiApi` + +### Renamed maven modules +- Module hawkbit-mgmt-api-client have changed to hawkbit-example-mgmt-simulator \ No newline at end of file From 27721c7cf803a82559fb0ec90716d96a0b18cb98 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Wed, 18 May 2016 15:39:47 +0200 Subject: [PATCH 111/124] Move Ddi client Signed-off-by: SirWayne --- .../hawkbit-example-ddi-feign-client/pom.xml | 35 +-- .../hawkbit/ddi/client/DdiDecoder.java | 54 ---- .../ddi/client/DdiDefaultFeignClient.java | 94 ------- .../hawkbit/ddi/client/DdiExampleClient.java | 232 ------------------ .../AuthenticationInterceptor.java | 19 -- .../AuthenticationInterceptorFactory.java | 34 --- ...ecurityTokenAuthenticationInterceptor.java | 35 --- .../RootControllerResourceClient.java | 3 +- ...RootControllerResourceClientConstants.java | 26 -- .../ArtifactsPersistenceStrategy.java | 31 --- .../client/strategy/DoNotSaveArtifacts.java | 28 --- .../SaveArtifactsToLocalTempDirectories.java | 34 --- 12 files changed, 10 insertions(+), 615 deletions(-) delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java delete mode 100644 examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java diff --git a/examples/hawkbit-example-ddi-feign-client/pom.xml b/examples/hawkbit-example-ddi-feign-client/pom.xml index 3450231cd..8256b5b30 100644 --- a/examples/hawkbit-example-ddi-feign-client/pom.xml +++ b/examples/hawkbit-example-ddi-feign-client/pom.xml @@ -38,51 +38,32 @@ hawkbit-example-core-feign-client ${project.version} - - org.eclipse.hawkbit - hawkbit-ddi-api - ${project.version} - org.eclipse.hawkbit hawkbit-ddi-dl-api ${project.version} - org.springframework.cloud - spring-cloud-starter-feign + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + + + com.google.guava + guava com.netflix.feign feign-core + com.netflix.feign feign-jackson - - javax.servlet - javax.servlet-api - - - - org.springframework.plugin - spring-plugin-core - com.fasterxml.jackson.core jackson-databind - - - - com.google.guava - guava - - - commons-lang - commons-lang - - diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java deleted file mode 100644 index 79f0758e0..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDecoder.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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.client; - -import java.io.IOException; -import java.lang.reflect.Type; -import java.util.Collection; -import java.util.Map; - -import org.springframework.cloud.netflix.feign.support.ResponseEntityDecoder; -import org.springframework.hateoas.hal.Jackson2HalModule; -import org.springframework.http.ResponseEntity; - -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; - -import feign.Response; -import feign.codec.Decoder; -import feign.jackson.JacksonDecoder; - -/** - * Decoder for DDI client. - * - */ -public class DdiDecoder implements Decoder { - - private static final String OCTET_STREAM = "[application/octet-stream]"; - - private final ObjectMapper mapper; - - public DdiDecoder() { - mapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) - .registerModule(new Jackson2HalModule()); - } - - @Override - public Object decode(final Response response, final Type type) throws IOException { - - final Map> header = response.headers(); - final String contentType = String.valueOf(header.get("Content-Type")); - if (contentType.equals(OCTET_STREAM)) { - return ResponseEntity.ok(response.body().asInputStream()); - } - final ResponseEntityDecoder responseEntityDecoder = new ResponseEntityDecoder(new JacksonDecoder(mapper)); - return responseEntityDecoder.decode(response, type); - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java deleted file mode 100644 index e579c07b5..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiDefaultFeignClient.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * 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.client; - -import org.apache.commons.lang.Validate; -import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; -import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; -import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClientConstants; -import org.eclipse.hawkbit.feign.core.client.ApplicationJsonRequestHeaderInterceptor; -import org.eclipse.hawkbit.feign.core.client.IgnoreMultipleConsumersProducersSpringMvcContract; - -import feign.Feign; -import feign.Feign.Builder; -import feign.Logger; -import feign.Logger.Level; -import feign.jackson.JacksonEncoder; - -/** - * Default implementation of DDI client. - */ -public class DdiDefaultFeignClient { - - private RootControllerResourceClient rootControllerResourceClient; - private final Builder feignBuilder; - private final String baseUrl; - private final String tenant; - - /** - * Constructor for default DDI feign client with no authentication. - * - * @param baseUrl - * the base url of the client - * @param tenant - * the tenant - */ - public DdiDefaultFeignClient(final String baseUrl, final String tenant) { - this(baseUrl, tenant, null); - } - - /** - * Constructor for default DDI feign client with authentication. - * - * @param baseUrl - * the base url of the client - * @param tenant - * the tenant - * @param authenticationInterceptor - */ - public DdiDefaultFeignClient(final String baseUrl, final String tenant, - final AuthenticationInterceptor authenticationInterceptor) { - feignBuilder = Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()) - .requestInterceptor(new ApplicationJsonRequestHeaderInterceptor()).logLevel(Level.FULL) - .logger(new Logger.ErrorLogger()).encoder(new JacksonEncoder()).decoder(new DdiDecoder()); - if (authenticationInterceptor != null) { - feignBuilder.requestInterceptor(authenticationInterceptor); - } - Validate.notNull(baseUrl, "A baseUrl has to be set"); - Validate.notNull(tenant, "A tenant has to be set"); - this.baseUrl = baseUrl; - this.tenant = tenant; - } - - /** - * Get the feign builder. - * - * @return the feign builder - */ - public Builder getFeignBuilder() { - return feignBuilder; - } - - /** - * Get the rootController resource client. - * - * @return the rootController resource client - */ - public RootControllerResourceClient getRootControllerResourceClient() { - - if (rootControllerResourceClient == null) { - String rootControllerResourcePath = this.baseUrl + RootControllerResourceClientConstants.PATH; - rootControllerResourcePath = rootControllerResourcePath.replace("{tenant}", tenant); - rootControllerResourceClient = feignBuilder.target(RootControllerResourceClient.class, - rootControllerResourcePath); - } - return rootControllerResourceClient; - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java deleted file mode 100644 index 2c0421067..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/DdiExampleClient.java +++ /dev/null @@ -1,232 +0,0 @@ -/** - * 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.client; - -import java.io.IOException; -import java.io.InputStream; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.temporal.ChronoField; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -import org.eclipse.hawkbit.ddi.client.authenctication.AuthenticationInterceptor; -import org.eclipse.hawkbit.ddi.client.resource.RootControllerResourceClient; -import org.eclipse.hawkbit.ddi.client.strategy.ArtifactsPersistenceStrategy; -import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; -import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; -import org.eclipse.hawkbit.ddi.json.model.DdiChunk; -import org.eclipse.hawkbit.ddi.json.model.DdiControllerBase; -import org.eclipse.hawkbit.ddi.json.model.DdiDeploymentBase; -import org.eclipse.hawkbit.ddi.json.model.DdiResult; -import org.eclipse.hawkbit.ddi.json.model.DdiResult.FinalResult; -import org.eclipse.hawkbit.ddi.json.model.DdiStatus; -import org.eclipse.hawkbit.ddi.json.model.DdiStatus.ExecutionStatus; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.hateoas.Link; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * DDI example client based on defualt DDI feign client. - */ -public class DdiExampleClient implements Runnable { - - private static final Logger LOGGER = LoggerFactory.getLogger(DdiExampleClient.class); - - private final String controllerId; - private Long actionIdOfLastInstalltion; - private final RootControllerResourceClient rootControllerResourceClient; - private final ArtifactsPersistenceStrategy persistenceStrategy; - private DdiClientStatus clientStatus; - private FinalResult finalResultOfCurrentUpdate; - - /** - * Constructor for the DDI example client. - * - * @param baseUrl - * the base url of the hawkBit server - * @param controllerId - * the controller id that will be simulated - * @param tenant - * the tenant - * @param persistenceStrategy - * the persistence strategy for downloading artifacts - */ - public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final ArtifactsPersistenceStrategy persistenceStrategy) { - this(baseUrl, controllerId, tenant, persistenceStrategy, null); - } - - /** - * Constructor for the DDI example client. - * - * @param baseUrl - * the base url of the hawkBit server - * @param controllerId - * the controller id that will be simulated - * @param tenant - * the tenant - * @param persistenceStrategy - * the persistence strategy for downloading artifacts - * @param authenticationInterceptor - * the authentication intercepter to authenticate the DDI client, - * might be {@code null} - */ - public DdiExampleClient(final String baseUrl, final String controllerId, final String tenant, - final ArtifactsPersistenceStrategy persistenceStrategy, - final AuthenticationInterceptor authenticationInterceptor) { - this.controllerId = controllerId; - this.rootControllerResourceClient = new DdiDefaultFeignClient(baseUrl, tenant, authenticationInterceptor) - .getRootControllerResourceClient(); - this.actionIdOfLastInstalltion = null; - this.persistenceStrategy = persistenceStrategy; - this.clientStatus = DdiClientStatus.DOWN; - } - - @Override - public void run() { - clientStatus = DdiClientStatus.UP; - ResponseEntity response; - while (clientStatus == DdiClientStatus.UP) { - LOGGER.info(" Controller {} polling from hawkBit server", controllerId); - response = rootControllerResourceClient.getControllerBase(controllerId); - final String pollingTimeFormReponse = response.getBody().getConfig().getPolling().getSleep(); - final LocalTime localtime = LocalTime.parse(pollingTimeFormReponse); - final long pollingIntervalInMillis = localtime.getLong(ChronoField.MILLI_OF_DAY); - final Link controllerDeploymentBaseLink = response.getBody().getLink("deploymentBase"); - if (controllerDeploymentBaseLink != null) { - final Long actionId = getActionIdOutOfLink(controllerDeploymentBaseLink); - final Integer resource = getResourceOutOfLink(controllerDeploymentBaseLink); - if (actionId != actionIdOfLastInstalltion) { - finalResultOfCurrentUpdate = FinalResult.NONE; - startDownload(actionId, resource); - finishUpdateProcess(actionId); - actionIdOfLastInstalltion = actionId; - } - } - try { - Thread.sleep(pollingIntervalInMillis); - } catch (final InterruptedException e) { - LOGGER.error("Error during sleep"); - } - } - } - - /** - * Stop the DDI example client - */ - public void stop() { - clientStatus = DdiClientStatus.DOWN; - } - - private void startDownload(final Long actionId, final Integer resource) { - final ResponseEntity respone = rootControllerResourceClient - .getControllerBasedeploymentAction(controllerId, actionId, resource); - final DdiDeploymentBase ddiDeploymentBase = respone.getBody(); - final List chunks = ddiDeploymentBase.getDeployment().getChunks(); - for (final DdiChunk chunk : chunks) { - downloadArtifacts(chunk, actionId); - } - } - - private void downloadArtifacts(final DdiChunk chunk, final Long actionId) { - final List artifactList = chunk.getArtifacts(); - if (artifactList.isEmpty()) { - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "No artifacts to download for softwaremodule " + chunk.getName()); - return; - } - for (final DdiArtifact ddiArtifact : artifactList) { - if (finalResultOfCurrentUpdate != FinalResult.FAILURE) { - downloadArtifact(actionId, ddiArtifact); - } - } - } - - private void downloadArtifact(final Long actionId, final DdiArtifact ddiArtifact) { - - final String artifact = ddiArtifact.getFilename(); - final Link downloadLink = ddiArtifact.getLink("download-http"); - final String[] downloadLinkSep = downloadLink.getHref().split(Pattern.quote("/")); - final Long softwareModuleId = Long.valueOf(downloadLinkSep[8]); - - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "Starting download of artifact " + artifact); - LOGGER.info("Starting download of artifact " + artifact); - - final ResponseEntity responseDownloadArtifact = rootControllerResourceClient - .downloadArtifact(controllerId, softwareModuleId, artifact); - final HttpStatus statsuCode = responseDownloadArtifact.getStatusCode(); - LOGGER.info("Finished download with stataus {}", statsuCode); - - try { - persistenceStrategy.handleInputStream(responseDownloadArtifact.getBody(), artifact); - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "Downloaded artifact " + artifact); - } catch (final IOException e) { - LOGGER.error("Download of artifact failed", e); - sendFeedBackMessage(actionId, ExecutionStatus.PROCEEDING, FinalResult.NONE, - "Download of artifact " + artifact + "failed"); - finalResultOfCurrentUpdate = FinalResult.FAILURE; - } - - } - - private void sendFeedBackMessage(final Long actionId, final ExecutionStatus executionStatus, - final FinalResult finalResult, final String message) { - final DdiResult result = new DdiResult(finalResult, null); - final List details = new ArrayList<>(); - details.add(message); - final DdiStatus ddiStatus = new DdiStatus(executionStatus, result, details); - final String time = String.valueOf(LocalDateTime.now()); - final DdiActionFeedback feedback = new DdiActionFeedback(actionId, time, ddiStatus); - rootControllerResourceClient.postBasedeploymentActionFeedback(feedback, controllerId, actionId); - LOGGER.info("Sent feedback message to HaktBit"); - } - - private void finishUpdateProcess(final Long actionId) { - - if (finalResultOfCurrentUpdate == FinalResult.FAILURE) { - sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.FAILURE, "Error during update process"); - } - - if (finalResultOfCurrentUpdate == FinalResult.NONE) { - sendFeedBackMessage(actionId, ExecutionStatus.CLOSED, FinalResult.SUCESS, - "Simulated installation successful"); - } - - } - - private Long getActionIdOutOfLink(final Link controllerDeploymentBaseLink) { - final String[] ending = splitControllerDeploymentBaseLinkInActionIdAndResource(controllerDeploymentBaseLink); - return Long.valueOf(ending[0]); - } - - private Integer getResourceOutOfLink(final Link controllerDeploymentBaseLink) { - final String[] ending = splitControllerDeploymentBaseLinkInActionIdAndResource(controllerDeploymentBaseLink); - return Integer.valueOf(ending[1].substring(2)); - } - - private String[] splitControllerDeploymentBaseLinkInActionIdAndResource(final Link controllerDeploymentBaseLink) { - final String link = controllerDeploymentBaseLink.getHref(); - final String[] segments = link.split(Pattern.quote("/")); - return segments[8].split(Pattern.quote("?")); - } - - /** - * Enum for DDI running status. - */ - public enum DdiClientStatus { - UP, DOWN; - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java deleted file mode 100644 index f1a746c1b..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptor.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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.client.authenctication; - -import feign.RequestInterceptor; - -/** - * An DdiClient authentication intercepter to provide credential information - * e.g. in http-headers. - */ -public interface AuthenticationInterceptor extends RequestInterceptor { - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java deleted file mode 100644 index 5d2fb6706..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/AuthenticationInterceptorFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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.client.authenctication; - -/** - * A factory to create {@link AuthenticationInterceptor}s. - */ -public class AuthenticationInterceptorFactory { - - private AuthenticationInterceptorFactory() { - // factory class no public constructor - } - - /** - * Creates a new {@link AuthenticationInterceptor} to authenticate a - * Ddi-Client via a target-security-token HTTP authorization header. - * - * @param targetSecurityToken - * the target-security-token to be added to the HTTP - * 'TargetToken' authorization header - * @return the authentication interceptor which can be used to authenticate - * an Ddi-Client - */ - public static AuthenticationInterceptor createTargetSecurityAuthenticator(final String targetSecurityToken) { - return new TargetSecurityTokenAuthenticationInterceptor(targetSecurityToken); - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java deleted file mode 100644 index 93559dd6d..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/authenctication/TargetSecurityTokenAuthenticationInterceptor.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.client.authenctication; - -import com.google.common.net.HttpHeaders; - -import feign.RequestTemplate; - -/** - * Implementation of the {@link AuthenticationInterceptor} to add a given - * target-security-token to the HTTP authorization header. - */ -class TargetSecurityTokenAuthenticationInterceptor implements AuthenticationInterceptor { - - private final String targetSecurityToken; - - /** - * @param targetSecurityToken - * the security token to add to the authorization header - */ - TargetSecurityTokenAuthenticationInterceptor(final String targetSecurityToken) { - this.targetSecurityToken = targetSecurityToken; - } - - @Override - public void apply(final RequestTemplate template) { - template.header(HttpHeaders.AUTHORIZATION, "TargetToken " + targetSecurityToken); - } -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java index db41a6e86..389f65da7 100644 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java +++ b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClient.java @@ -8,13 +8,14 @@ */ package org.eclipse.hawkbit.ddi.client.resource; +import org.eclipse.hawkbit.ddi.rest.api.DdiRestConstants; import org.eclipse.hawkbit.ddi.rest.api.DdiRootControllerRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** * Client binding for the Rootcontroller resource of the DDI API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + RootControllerResourceClientConstants.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + DdiRestConstants.BASE_V1_REQUEST_MAPPING) public interface RootControllerResourceClient extends DdiRootControllerRestApi { } diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java deleted file mode 100644 index 07d31337e..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/resource/RootControllerResourceClientConstants.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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.client.resource; - -/** - * - * Constants for RootController resource client. - */ -public class RootControllerResourceClientConstants { - - public static final String PATH = "{tenant}/controller/v1"; - - /** - * Private constructor to prevent instantiation. - */ - private RootControllerResourceClientConstants() { - - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java deleted file mode 100644 index d7e99522e..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/ArtifactsPersistenceStrategy.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.client.strategy; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Interface of persistence strategy. - */ -@FunctionalInterface -public interface ArtifactsPersistenceStrategy { - - /** - * Method handling the artifact download. - * - * @param in - * the input stream - * @param artifactName - * the name of the artifact - * @throws IOException - */ - public void handleInputStream(InputStream in, String artifactName) throws IOException; - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java deleted file mode 100644 index 4d71528b2..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/DoNotSaveArtifacts.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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.client.strategy; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Implementation of {@link ArtifactsPersistenceStrategy} for not downloading - * any artifacts. - */ -public class DoNotSaveArtifacts implements ArtifactsPersistenceStrategy { - - @Override - public void handleInputStream(final InputStream in, final String artifactName) throws IOException { - - while (in.read() != -1) { - ; - } - } - -} diff --git a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java b/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java deleted file mode 100644 index afcc01419..000000000 --- a/examples/hawkbit-example-ddi-feign-client/src/main/java/org/eclipse/hawkbit/ddi/client/strategy/SaveArtifactsToLocalTempDirectories.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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.client.strategy; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import com.google.common.io.ByteStreams; -import com.google.common.io.Files; - -/** - * Implementation of {@link ArtifactsPersistenceStrategy} for downloading - * artifacts to the temp directory. - */ -public class SaveArtifactsToLocalTempDirectories implements ArtifactsPersistenceStrategy { - - @Override - public void handleInputStream(final InputStream in, final String artifactName) throws IOException { - final File tempDir = Files.createTempDir(); - final File file = new File(tempDir, artifactName); - final OutputStream out = new FileOutputStream(file); - ByteStreams.copy(in, out); - } - -} From c9248a80db20d91eb7e7fdd24706bfec27f0c58a Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 18 May 2016 16:05:10 +0200 Subject: [PATCH 112/124] Updated readme.md for changes module names Signed-off-by: Jonathan Philip Knoblauch --- examples/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/README.md b/examples/README.md index ce8d26962..0aebbc117 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,8 +5,8 @@ Example projects that show how _hawkBit_ can be used to create, run or access an - `hawkbit-custom-theme-example` : Example for a customized theme for Management UI. - `hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options. - `hawkbit-example-app` : Allows you to run the Spring Boot hawkBit app. Includes all _hawkBit_ interfaces, i.e. DDI, DMF, Mgmt-API, Mgmt-UI. -- `hawkbit-example-ddi-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API. Includes simulation of target. -- `hawkbit-example-feign-core-client` : Core resources for the examples. -- `hawkbit-example-mgmt-client` : Example client for the _hawkBit_ Management API -- `hawkbit-example-mgmt-spring-client` : Example client for the _hawkBit_ Management API based on Spring Boot. +- `hawkbit-example-core-feign-client` : Core resources for the client examples. +- `hawkbit-example-ddi-feign-client` : Example _hawkBit_ DDI client based on the _hawkBit_ DDI API. +- `hawkbit-example-mgmt-feign-client` : Example _hawkBit_ Management client based on the _hawkBit_ Management API +- `hawkbit-example-mgmt-simulator` : Example client simulation for the _hawkBit_ Management API based on Spring Boot and the hawkbit-example-mgmt-feign-client. From fcd6cef3fbd7607089918161e86bf8ce67325f4c Mon Sep 17 00:00:00 2001 From: Jonathan Philip Knoblauch Date: Wed, 18 May 2016 16:16:11 +0200 Subject: [PATCH 113/124] Updated readme.md due to changes modules structure Signed-off-by: Jonathan Philip Knoblauch --- .../README.md | 8 ++--- .../README.md | 29 +++++-------------- .../README.md | 8 ++--- .../hawkbit-example-mgmt-simulator/README.md | 2 +- 4 files changed, 16 insertions(+), 31 deletions(-) diff --git a/examples/hawkbit-example-core-feign-client/README.md b/examples/hawkbit-example-core-feign-client/README.md index 27d1ea04e..bcded015e 100644 --- a/examples/hawkbit-example-core-feign-client/README.md +++ b/examples/hawkbit-example-core-feign-client/README.md @@ -1,13 +1,13 @@ -# Eclipse.IoT hawkBit - Example Feign Core Client +# Eclipse.IoT hawkBit - Example Core Feign Client -This modules contains core resources that are needed by the hawkBit Example DDI Client and the hawkBit Example Management Spring Client. +This modules contains core resources that are needed by the hawkBit Example DDI Feign Client and the hawkBit Example Mgmt Feign Client. # Compile -#### Build hawkbit-example-feign-core-client +#### Build hawkbit-example-core-feign-client ``` -$ cd hawkbit/examples/hawkbit-example-feign-core-client +$ cd hawkbit/examples/hawkbit-example-core-feign-client $ mvn clean install ``` diff --git a/examples/hawkbit-example-ddi-feign-client/README.md b/examples/hawkbit-example-ddi-feign-client/README.md index 8b016ed5e..d1e1bd18d 100644 --- a/examples/hawkbit-example-ddi-feign-client/README.md +++ b/examples/hawkbit-example-ddi-feign-client/README.md @@ -1,29 +1,14 @@ -# Eclipse.IoT hawkBit - Example DDI Client +# Eclipse.IoT hawkBit - Example DDI Feign Client -The hawkBit Example DDI Client is an implementation of a simulated device/target that communicates with the hawkBit server via the DDI API. +This modules contains an example feign client implementation based on the DDI API. -# Compile, Run and Getting Started +Powered by [Feign](https://github.com/Netflix/feign). -#### Build hawkbit-example-ddi-client +# Compile + +#### Build hawkbit-example-ddi-feign-client ``` -$ cd hawkbit/examples/hawkbit-example-ddi-client +$ cd hawkbit/examples/hawkbit-example-ddi-feign-client $ mvn clean install ``` - -#### Run hawkBit Example DDI Client - -Start the [hawkBit example app](../hawkbit-example-app). - -Create an instance of the hawkBit Example DDI Client and run it as thread e.g. in the ExecutorService. - -``` -DdiExampleClient ddiExampleClient = new DdiExampleClient("http://localhost:8080/", "controllerIdName", "DEFAULT", new DoNotSaveArtifacts()); -ExecutorService executorService = Executors.newFixedThreadPool(1); -executorService.execute(ddiExampleClient); -``` - -#### Getting started with hawkBit Example DDI Client - -After the hawkBit Example DDI Client has started it will poll once against the given hawkBit server and form then depending on your polling configuration. After the hawkBit Example DDI Client has polled successful you will see a target in the deployment view regarding the given controller id of your hawkBit Example DDI Client. You can know assign a distributionSet to the target and let the hawkBit Example DDI Client simulated an update. - diff --git a/examples/hawkbit-example-mgmt-feign-client/README.md b/examples/hawkbit-example-mgmt-feign-client/README.md index b73ddd96b..3a2dcf61b 100644 --- a/examples/hawkbit-example-mgmt-feign-client/README.md +++ b/examples/hawkbit-example-mgmt-feign-client/README.md @@ -1,15 +1,15 @@ -# Eclipse.IoT hawkBit - Example Management Client +# Eclipse.IoT hawkBit - Example Management Feign Client -This modules contains an example feign client implementation based on the Mgmt API. +This modules contains an example feign client implementation based on the Management API. Powered by [Feign](https://github.com/Netflix/feign). # Compile -#### Build hawkbit-example-mgmt-client +#### Build hawkbit-example-mgmt-feign-client ``` -$ cd hawkbit/examples/hawkbit-example-mgmt-client +$ cd hawkbit/examples/hawkbit-example-mgmt-feign-client $ mvn clean install ``` diff --git a/examples/hawkbit-example-mgmt-simulator/README.md b/examples/hawkbit-example-mgmt-simulator/README.md index 9e11e212d..f49d84320 100644 --- a/examples/hawkbit-example-mgmt-simulator/README.md +++ b/examples/hawkbit-example-mgmt-simulator/README.md @@ -1,6 +1,6 @@ # Eclipse.IoT hawkBit - Management API Example Client -Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Client and the hawkBit Management API. +Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Fiegn Client and the hawkBit Management API. Powered by [Feign](https://github.com/Netflix/feign). From 176f190ec662bb408b80a455441038bb8a0db872 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 19 May 2016 10:15:02 +0200 Subject: [PATCH 114/124] Update docu and readme.md Signed-off-by: SirWayne --- README.md | 10 ++++------ examples/hawkbit-example-core-feign-client/README.md | 2 +- examples/hawkbit-example-ddi-feign-client/README.md | 6 +++--- examples/hawkbit-example-mgmt-feign-client/README.md | 6 +++--- .../resource/MgmtDistributionSetClientResource.java | 4 ++-- .../resource/MgmtDistributionSetTagClientResource.java | 5 ++--- .../MgmtDistributionSetTypeClientResource.java | 4 ++-- .../resource/MgmtDownloadArtifactClientResource.java | 5 ++--- .../client/resource/MgmtDownloadClientResource.java | 6 ++---- .../client/resource/MgmtRolloutClientResource.java | 5 ++--- .../resource/MgmtSoftwareModuleClientResource.java | 5 ++--- .../resource/MgmtSoftwareModuleTypeClientResource.java | 5 ++--- ...ientResource.java => MgmtSystemClientResource.java} | 6 +++--- ...ce.java => MgmtSystemManagementClientResource.java} | 6 +++--- .../mgmt/client/resource/MgmtTargetClientResource.java | 5 ++--- .../client/resource/MgmtTargetTagClientResource.java | 4 ++-- examples/hawkbit-example-mgmt-simulator/README.md | 6 +++--- examples/hawkbit-example-mgmt-simulator/pom.xml | 2 +- 18 files changed, 41 insertions(+), 51 deletions(-) rename examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{SystemClientResource.java => MgmtSystemClientResource.java} (71%) rename examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/{SystemManagementClientResource.java => MgmtSystemManagementClientResource.java} (70%) diff --git a/README.md b/README.md index a4119e7b1..1a33e0c60 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ $ java -jar ./examples/hawkbit-example-app/target/hawkbit-example-app-#version#. $ java -jar ./examples/hawkbit-device-simulator/target/hawkbit-device-simulator-#version#.jar ``` #### Generate Getting Started data -[Example Management API Client](examples/hawkbit-mgmt-api-client) +[Example Management API Client](examples/hawkbit-example-mgmt-simulator) ``` -$ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#version#.jar +$ java -jar ./examples/hawkbit-example-mgmt-simulator/target/hawkbit-example-mgmt-simulator-#version#.jar ``` # Releases and Roadmap @@ -70,11 +70,9 @@ $ java -jar ./examples/hawkbit-mgmt-api-client/target/hawkbit-mgmt-api-client-#v * `hawkbit-http-security` : Implementation for security filters for HTTP. * `hawkbit-mgmt-api` : The hawkBit Management API * `hawkbit-mgmt-resource` : Implementation of the hawkBit Management API -* `hawkbit-mgmt-ui` : Vaadin UI. * `hawkbit-repository` : Repository implementation based on SQL for all meta-data. * `hawkbit-rest-core` : Core elements for the rest modules. * `hawkbit-security-core` : Core security elements. * `hawkbit-security-integration` : Security integration elements to integrate security into hawkBit. -* `hawkbit-system-api` : The hawkBit System API -* `hawkbit-system-resource` : Implementation of the hawkBit System API -* `hawkbit-test-report` : Test reports \ No newline at end of file +* `hawkbit-test-report` : Test reports +* `hawkbit-ui` : Vaadin UI. \ No newline at end of file diff --git a/examples/hawkbit-example-core-feign-client/README.md b/examples/hawkbit-example-core-feign-client/README.md index bcded015e..432a31c41 100644 --- a/examples/hawkbit-example-core-feign-client/README.md +++ b/examples/hawkbit-example-core-feign-client/README.md @@ -1,6 +1,6 @@ # Eclipse.IoT hawkBit - Example Core Feign Client -This modules contains core resources that are needed by the hawkBit Example DDI Feign Client and the hawkBit Example Mgmt Feign Client. +This modules contains core beans that are needed to create a [Feign Client](https://github.com/Netflix/feign) with hwakBit. # Compile diff --git a/examples/hawkbit-example-ddi-feign-client/README.md b/examples/hawkbit-example-ddi-feign-client/README.md index d1e1bd18d..0eae90c23 100644 --- a/examples/hawkbit-example-ddi-feign-client/README.md +++ b/examples/hawkbit-example-ddi-feign-client/README.md @@ -1,7 +1,7 @@ -# Eclipse.IoT hawkBit - Example DDI Feign Client - -This modules contains an example feign client implementation based on the DDI API. +# Eclipse.IoT hawkBit - Example DDI Feign Client API +This modules contains the declarative client binding resources of the DDI API. +For more information see 'Feign Inheritance Support' at [Spring Cloud] (http://projects.spring.io/spring-cloud/spring-cloud.html). Powered by [Feign](https://github.com/Netflix/feign). # Compile diff --git a/examples/hawkbit-example-mgmt-feign-client/README.md b/examples/hawkbit-example-mgmt-feign-client/README.md index 3a2dcf61b..b5b7eb3d2 100644 --- a/examples/hawkbit-example-mgmt-feign-client/README.md +++ b/examples/hawkbit-example-mgmt-feign-client/README.md @@ -1,7 +1,7 @@ -# Eclipse.IoT hawkBit - Example Management Feign Client - -This modules contains an example feign client implementation based on the Management API. +# Eclipse.IoT hawkBit - Example Management Feign Client API +This modules contains the declarative client binding resources of the Management API. +For more information see 'Feign Inheritance Support' at [Spring Cloud] (http://projects.spring.io/spring-cloud/spring-cloud.html). Powered by [Feign](https://github.com/Netflix/feign). # Compile diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java index b513f43f1..7bf696a8f 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetClientResource.java @@ -9,13 +9,13 @@ 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}/" + MgmtDistributionSetClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING) public interface MgmtDistributionSetClientResource extends MgmtDistributionSetRestApi { - static String PATH = "rest/v1/distributionsets"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java index 6d4f60bb7..783cc09fa 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTagClientResource.java @@ -9,13 +9,12 @@ 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}/" + MgmtDistributionSetTagClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING) public interface MgmtDistributionSetTagClientResource extends MgmtDistributionSetTagRestApi { - - static String PATH = "rest/v1/distributionsettags"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java index fe745968f..35f26781f 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDistributionSetTypeClientResource.java @@ -9,14 +9,14 @@ 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}/" + MgmtDistributionSetTypeClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING) public interface MgmtDistributionSetTypeClientResource extends MgmtDistributionSetTypeRestApi { - static String PATH = "rest/v1/distributionsettypes"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java index 3f7917f22..f32e448ac 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java @@ -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; /** * */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtDownloadArtifactClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) public interface MgmtDownloadArtifactClientResource extends MgmtDownloadArtifactRestApi { - static String PATH = "rest/v1/softwaremodules"; - } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java index 2626b8a90..9a1dcee61 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadClientResource.java @@ -9,14 +9,12 @@ 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}/" + MgmtDownloadClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE) public interface MgmtDownloadClientResource extends MgmtDownloadRestApi { - - static String PATH = "api/v1/downloadserver/"; - } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java index 430550b3a..d2643a938 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtRolloutClientResource.java @@ -8,14 +8,13 @@ */ 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}/" + MgmtRolloutClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING) public interface MgmtRolloutClientResource extends MgmtRolloutRestApi { - - static String PATH = "rest/v1/rollouts"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java index cc6dbd477..16ea188bd 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleClientResource.java @@ -9,6 +9,7 @@ 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; @@ -23,11 +24,9 @@ import feign.Param; /** * Client binding for the SoftwareModule resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtSoftwareModuleClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SOFTWAREMODULE_V1_REQUEST_MAPPING) public interface MgmtSoftwareModuleClientResource extends MgmtSoftwareModuleRestApi { - static String PATH = "rest/v1/softwaremodules"; - @RequestMapping(method = RequestMethod.POST, value = "/{softwareModuleId}/artifacts") ResponseEntity uploadArtifact(@PathVariable("softwareModuleId") final Long softwareModuleId, @Param("file") final MultipartFile file, diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java index 6d5ca476c..766ec215f 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java @@ -8,14 +8,13 @@ */ 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 oftwareModuleType resource of the management API. */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtSoftwareModuleTypeClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) public interface MgmtSoftwareModuleTypeClientResource extends MgmtSoftwareModuleTypeRestApi { - - static String PATH = "rest/v1/softwaremoduletypes"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemClientResource.java similarity index 71% rename from examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemClientResource.java index 8d94cddb9..7d6967fed 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemClientResource.java @@ -8,6 +8,7 @@ */ 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; @@ -15,7 +16,6 @@ import org.springframework.cloud.netflix.feign.FeignClient; * Client binding for the {@link MgmtSystemRestApi}. * */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemClientResource.PATH) -public interface SystemClientResource extends MgmtSystemRestApi { - static String PATH = "rest/v1/system"; +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SYSTEM_V1_REQUEST_MAPPING) +public interface MgmtSystemClientResource extends MgmtSystemRestApi { } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemManagementClientResource.java similarity index 70% rename from examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java rename to examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemManagementClientResource.java index 21aa7b7c1..d1974b43f 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/SystemManagementClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSystemManagementClientResource.java @@ -8,6 +8,7 @@ */ 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; @@ -15,8 +16,7 @@ import org.springframework.cloud.netflix.feign.FeignClient; * Client binding for the {@link MgmtSystemManagementRestApi}. * */ -@FeignClient(url = "${hawkbit.url:localhost:8080}/" + SystemManagementClientResource.PATH) -public interface SystemManagementClientResource extends MgmtSystemManagementRestApi { - static String PATH = "system/admin"; +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SYSTEM_ADMIN_MAPPING) +public interface MgmtSystemManagementClientResource extends MgmtSystemManagementRestApi { } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java index 19f78a12f..872c4251a 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetClientResource.java @@ -8,14 +8,13 @@ */ 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}/" + MgmtTargetClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING) public interface MgmtTargetClientResource extends MgmtTargetRestApi { - - static String PATH = "rest/v1/targets"; } diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java index 475008cf3..7b0c213af 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtTargetTagClientResource.java @@ -8,13 +8,13 @@ */ 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}/" + MgmtTargetTagClientResource.PATH) +@FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.TARGET_TAG_V1_REQUEST_MAPPING) public interface MgmtTargetTagClientResource extends MgmtTargetTagRestApi { - static String PATH = "rest/v1/targettags"; } diff --git a/examples/hawkbit-example-mgmt-simulator/README.md b/examples/hawkbit-example-mgmt-simulator/README.md index f49d84320..772084629 100644 --- a/examples/hawkbit-example-mgmt-simulator/README.md +++ b/examples/hawkbit-example-mgmt-simulator/README.md @@ -1,4 +1,4 @@ -# Eclipse.IoT hawkBit - Management API Example Client +# Eclipse.IoT hawkBit - Example Management Feign Client Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Fiegn Client and the hawkBit Management API. @@ -10,13 +10,13 @@ Run getting started example - $ java -jar hawkbit-mgmt-api-client-#version#.jar + $ java -jar hawkbit-example-mgmt-simulator-#version#.jar Run create and start rollout example - $ java -jar hawkbit-mgmt-api-client-#version#.jar --createrollout + $ java -jar hawkbit-example-mgmt-simulator-#version#.jar --createrollout ## This example shows diff --git a/examples/hawkbit-example-mgmt-simulator/pom.xml b/examples/hawkbit-example-mgmt-simulator/pom.xml index fbe099f40..469290dfc 100644 --- a/examples/hawkbit-example-mgmt-simulator/pom.xml +++ b/examples/hawkbit-example-mgmt-simulator/pom.xml @@ -18,7 +18,7 @@ jar hawkbit-example-mgmt-simulator - hawkBit-example :: Management Feign Client + hawkBit-example :: Management feign client simulator From f345d5068fd96a9b4d9c38ab0167c0b1b430220e Mon Sep 17 00:00:00 2001 From: venu1278 Date: Thu, 19 May 2016 15:56:19 +0530 Subject: [PATCH 115/124] fix_flashing_whitepage_on_login_application Signed-off-by: venu1278 --- .../main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss index 550a0479b..128c66e55 100644 --- a/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss +++ b/hawkbit-ui/src/main/resources/VAADIN/themes/hawkbit/hawkbittheme.scss @@ -132,14 +132,12 @@ $v-included-components: remove($v-included-components, form); left: 50%; margin-left: -20px; } - .v-generated-body &.v-app , .v-generated-body .v-app { - background-color: rgba(0, 0, 0, 0); + .v-generated-body &.v-app { background-image: $app-background-image, linear-gradient(to bottom, $app-background-image-gradient) !important; background-image: $app-background-image, -webkit-linear-gradient(top, $app-background-image-gradient) !important; background-image: $app-background-image, -moz-linear-gradient(top, $app-background-image-gradient) !important; background-position: bottom; background-repeat: no-repeat; - height:100%; - width:100%; } + } From 5f8a2bebef54cdf8d88873cbc7bc2d89facfbc33 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Thu, 19 May 2016 12:57:32 +0200 Subject: [PATCH 116/124] add license header to logback.xml Signed-off-by: Michael Hirsch --- .../src/main/resources/logback.xml | 10 ++++++++++ .../hawkbit-example-app/src/main/resources/logback.xml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/examples/hawkbit-device-simulator/src/main/resources/logback.xml b/examples/hawkbit-device-simulator/src/main/resources/logback.xml index 0cdbf8ff6..da64e62d1 100644 --- a/examples/hawkbit-device-simulator/src/main/resources/logback.xml +++ b/examples/hawkbit-device-simulator/src/main/resources/logback.xml @@ -1,4 +1,14 @@ + diff --git a/examples/hawkbit-example-app/src/main/resources/logback.xml b/examples/hawkbit-example-app/src/main/resources/logback.xml index 7470bb201..a76e39683 100644 --- a/examples/hawkbit-example-app/src/main/resources/logback.xml +++ b/examples/hawkbit-example-app/src/main/resources/logback.xml @@ -1,4 +1,14 @@ + From 088da91fde624c615b60ab916ed1afe6a64e9908 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Thu, 19 May 2016 17:21:10 +0200 Subject: [PATCH 117/124] fix typo in readme.md Signed-off-by: Michael Hirsch --- examples/hawkbit-example-mgmt-simulator/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hawkbit-example-mgmt-simulator/README.md b/examples/hawkbit-example-mgmt-simulator/README.md index 772084629..925df8041 100644 --- a/examples/hawkbit-example-mgmt-simulator/README.md +++ b/examples/hawkbit-example-mgmt-simulator/README.md @@ -1,6 +1,6 @@ # Eclipse.IoT hawkBit - Example Management Feign Client -Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Fiegn Client and the hawkBit Management API. +Example Spring Boot client that shows how to efficiently use the hawkBit Example Management Feign Client and the hawkBit Management API. Powered by [Feign](https://github.com/Netflix/feign). @@ -28,7 +28,7 @@ In getting started example: * creating software modules * assigning software modules to distribution sets -In rollout mode: +In create rollout example: * creating software modules type * creating distribution set type * creating distribution sets From f9ed3b305d81d56023082141eecabb49a30607fb Mon Sep 17 00:00:00 2001 From: SirWayne Date: Thu, 19 May 2016 18:28:09 +0200 Subject: [PATCH 118/124] Move annotation Signed-off-by: SirWayne --- .../src/main/java/org/eclipse/hawkbit/app/Start.java | 2 +- .../autoconfigure/web/ResourceControllerAutoConfiguration.java | 2 +- .../eclipse/hawkbit/mgmt/{annotation => }/EnableMgmtApi.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/{annotation => }/EnableMgmtApi.java (96%) diff --git a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java index 197fc3218..4a3e6028a 100644 --- a/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java +++ b/examples/hawkbit-example-app/src/main/java/org/eclipse/hawkbit/app/Start.java @@ -11,7 +11,7 @@ package org.eclipse.hawkbit.app; import org.eclipse.hawkbit.RepositoryApplicationConfiguration; import org.eclipse.hawkbit.autoconfigure.security.EnableHawkbitManagedSecurityConfiguration; import org.eclipse.hawkbit.ddi.EnableDdiApi; -import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; +import org.eclipse.hawkbit.mgmt.EnableMgmtApi; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Import; diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java index 6684b700d..ee54995c8 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/web/ResourceControllerAutoConfiguration.java @@ -9,7 +9,7 @@ package org.eclipse.hawkbit.autoconfigure.web; import org.eclipse.hawkbit.ddi.EnableDdiApi; -import org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi; +import org.eclipse.hawkbit.mgmt.EnableMgmtApi; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/EnableMgmtApi.java similarity index 96% rename from hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java rename to hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/EnableMgmtApi.java index 18cff40f3..6d4252e55 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/annotation/EnableMgmtApi.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/EnableMgmtApi.java @@ -6,7 +6,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.hawkbit.mgmt.annotation; +package org.eclipse.hawkbit.mgmt; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; From 47e254e14ee1c609353cdf46cb1a87d27adfb2e7 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 20 May 2016 13:56:36 +0200 Subject: [PATCH 119/124] move widgetset to src/main/resources and remove cleaning of widgeset Signed-off-by: Michael Hirsch --- hawkbit-ui/pom.xml | 89 +++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/hawkbit-ui/pom.xml b/hawkbit-ui/pom.xml index e0bde576a..11fc3c7c4 100644 --- a/hawkbit-ui/pom.xml +++ b/hawkbit-ui/pom.xml @@ -1,15 +1,6 @@ - - + + 4.0.0 org.eclipse.hawkbit @@ -28,8 +19,8 @@ -Xmx1g -Xss1024k - ${project.build.directory}/classes/VAADIN/widgetsets - ${project.build.directory}/classes/VAADIN/widgetsets + src/main/resources/VAADIN/widgetsets + src/main/resources/VAADIN/widgetsets src/main/resources true @@ -43,12 +34,12 @@ + process-classes - clean resources update-theme update-widgetset @@ -58,29 +49,47 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - true - - true - true - - - CustomRenderers - 1 - org.eclipse.hawkbit.ui.customrenderers.CustomRendererWidgetSet - - - - + + org.apache.maven.plugins + maven-antrun-plugin + + + process-classes + + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + true + + true + true + + + CustomRenderers + 1 + org.eclipse.hawkbit.ui.customrenderers.CustomRendererWidgetSet + + + + - + org.eclipse.m2e lifecycle-mapping @@ -171,11 +180,11 @@ com.vaadin vaadin-server - - com.vaadin - vaadin-client - - + + com.vaadin + vaadin-client + + com.vaadin vaadin-push From fe1e2f74e738e52886a106a1221ec63fae18e13a Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 20 May 2016 14:25:03 +0200 Subject: [PATCH 120/124] exclude compiled vaadin widgetset from license check Signed-off-by: Michael Hirsch --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index b6d09758e..3abb3cd8c 100644 --- a/pom.xml +++ b/pom.xml @@ -164,6 +164,7 @@ **/*.sql eclipse_codeformatter.xml **/addons.scss + **/VAADIN/widgetsets/** JAVADOC_STYLE From 1fa335dedd3e1c86da2d2187eaf492b4543bcd9e Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Fri, 20 May 2016 15:35:15 +0200 Subject: [PATCH 121/124] fix license header in pom file Signed-off-by: Michael Hirsch --- hawkbit-ui/pom.xml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hawkbit-ui/pom.xml b/hawkbit-ui/pom.xml index 11fc3c7c4..6a3f76df6 100644 --- a/hawkbit-ui/pom.xml +++ b/hawkbit-ui/pom.xml @@ -1,5 +1,13 @@ - + 4.0.0 From 57153b12441e11a4aac35a5a0fb7f84d5d94521d Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 24 May 2016 10:45:07 +0200 Subject: [PATCH 122/124] Remove commons.lang 2.3 Signed-off-by: SirWayne --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 851fa44d8..98227857c 100644 --- a/pom.xml +++ b/pom.xml @@ -105,7 +105,6 @@ 1.1 1.1.1 3.4 - 2.3 20141113 2.0.0 @@ -557,11 +556,6 @@ commons-lang3 ${commons-lang3.version} - - commons-lang - commons-lang - ${commons.lang} - org.springframework.boot spring-boot-starter-test From ee6566081b1e0db6aa7eb1a957f47d17eadfc252 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Tue, 24 May 2016 10:48:17 +0200 Subject: [PATCH 123/124] adding or fix javadoc Signed-off-by: Michael Hirsch --- .../hawkbit/feign/core/client/FeignClientConfiguration.java | 4 ++-- .../client/resource/MgmtDownloadArtifactClientResource.java | 3 ++- .../client/resource/MgmtSoftwareModuleTypeClientResource.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java b/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java index 2723a251e..1512b7f9e 100644 --- a/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java +++ b/examples/hawkbit-example-core-feign-client/src/main/java/org/eclipse/hawkbit/feign/core/client/FeignClientConfiguration.java @@ -18,8 +18,8 @@ import feign.Contract; import feign.Feign; /** - * - * + * Spring annotated java configuration class which defines necessary beans for + * configure the feign-client. */ @Configuration @ConditionalOnClass(Feign.class) diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java index f32e448ac..d25a609b2 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtDownloadArtifactClientResource.java @@ -13,7 +13,8 @@ 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) public interface MgmtDownloadArtifactClientResource extends MgmtDownloadArtifactRestApi { diff --git a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java index 766ec215f..1e9462c47 100644 --- a/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java +++ b/examples/hawkbit-example-mgmt-feign-client/src/main/java/org/eclipse/hawkbit/mgmt/client/resource/MgmtSoftwareModuleTypeClientResource.java @@ -13,7 +13,7 @@ import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi; import org.springframework.cloud.netflix.feign.FeignClient; /** - * Client binding for the oftwareModuleType resource of the management API. + * Client binding for the SoftwareModuleType resource of the management API. */ @FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.SOFTWAREMODULETYPE_V1_REQUEST_MAPPING) public interface MgmtSoftwareModuleTypeClientResource extends MgmtSoftwareModuleTypeRestApi { From dc74ec8889564d31ea7052734d99bad676742ac4 Mon Sep 17 00:00:00 2001 From: SirWayne Date: Tue, 24 May 2016 15:08:07 +0200 Subject: [PATCH 124/124] Some rework for the pull request Signed-off-by: SirWayne --- .../hawkbit-example-ddi-feign-client/pom.xml | 1 - .../rest/resource/DdiDeploymentBaseTest.java | 57 ++++++++----------- .../PropertyBasedArtifactUrlHandlerTest.java | 9 +-- .../mgmt/rest/api/MgmtSystemRestApi.java | 2 +- .../mgmt/rest/api/MgmtTargetRestApi.java | 2 +- .../rest/resource/MgmtSystemResource.java | 2 +- 6 files changed, 33 insertions(+), 40 deletions(-) diff --git a/examples/hawkbit-example-ddi-feign-client/pom.xml b/examples/hawkbit-example-ddi-feign-client/pom.xml index 8256b5b30..5388544db 100644 --- a/examples/hawkbit-example-ddi-feign-client/pom.xml +++ b/examples/hawkbit-example-ddi-feign-client/pom.xml @@ -55,7 +55,6 @@ com.netflix.feign feign-core - com.netflix.feign diff --git a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java index df75bc6b3..eb3ed8844 100644 --- a/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java +++ b/hawkbit-ddi-resource/src/test/java/org/eclipse/hawkbit/ddi/rest/resource/DdiDeploymentBaseTest.java @@ -57,6 +57,9 @@ import ru.yandex.qatools.allure.annotations.Stories; @Stories("Deployment Action Resource") public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoDB { + private static final String HTTP_LOCALHOST = "http://localhost:8080/"; + private static final String HTTPS_LOCALHOST = "https://localhost:8080/"; + @Test() @Description("Ensures that artifacts are not found, when softare module does not exists.") public void artifactsNotFound() throws Exception { @@ -171,24 +174,22 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0].hashes.sha1", equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) @@ -201,23 +202,21 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==bApp)][0].version", @@ -316,12 +315,12 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0].hashes.sha1", equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) @@ -334,23 +333,21 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==bApp)][0].version", @@ -446,23 +443,21 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD equalTo(artifact.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.download-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[0]._links.md5sum-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].size", equalTo(5 * 1024))) @@ -474,24 +469,22 @@ public class DdiDeploymentBaseTest extends AbstractRestIntegrationTestWithMongoD jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1].hashes.sha1", equalTo(artifactSignature.getSha1Hash()))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum.href", - equalTo("https://localhost:8080/" + tenantAware.getCurrentTenant() + equalTo(HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.download-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature"))) .andExpect(jsonPath("$deployment.chunks[?(@.part==os)][0].artifacts[1]._links.md5sum-http.href", - equalTo("http://localhost:8080/" + tenantAware.getCurrentTenant() - + "/controller/v1/4712/softwaremodules/" + equalTo(HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/4712/softwaremodules/" + findDistributionSetByAction.findFirstModuleByType(osType).getId() + "/artifacts/test1.signature.MD5SUM"))) diff --git a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java index 27021d265..f9a2ea316 100644 --- a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java +++ b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/util/PropertyBasedArtifactUrlHandlerTest.java @@ -39,6 +39,8 @@ import ru.yandex.qatools.allure.annotations.Stories; AmqpTestConfiguration.class }) public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTestWithMongoDB { + private static final String HTTPS_LOCALHOST = "https://localhost:8080/"; + private static final String HTTP_LOCALHOST = "http://localhost:8080/"; @Autowired private ArtifactUrlHandler urlHandlerProperties; @Autowired @@ -69,9 +71,8 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash, UrlProtocol.HTTP); assertEquals("http is build incorrect", - "http://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId - + "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/" - + localArtifact.getFilename(), + HTTP_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "/softwaremodules/" + + localArtifact.getSoftwareModule().getId() + "/artifacts/" + localArtifact.getFilename(), url); } @@ -81,7 +82,7 @@ public class PropertyBasedArtifactUrlHandlerTest extends AbstractIntegrationTest final String url = urlHandlerProperties.getUrl(controllerId, softwareModuleId, fileName, sha1Hash, UrlProtocol.HTTPS); assertEquals("https is build incorrect", - "https://localhost:8080/" + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + HTTPS_LOCALHOST + tenantAware.getCurrentTenant() + "/controller/v1/" + controllerId + "/softwaremodules/" + localArtifact.getSoftwareModule().getId() + "/artifacts/" + localArtifact.getFilename(), url); diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java index 92c732c96..d120759b2 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtSystemRestApi.java @@ -85,4 +85,4 @@ public interface MgmtSystemRestApi { @PathVariable("keyName") final String keyName, @RequestBody final MgmtSystemTenantConfigurationValueRequest configurationValueRest); -} \ No newline at end of file +} diff --git a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java index d44d473b1..bf4e169a0 100644 --- a/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java +++ b/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/rest/api/MgmtTargetRestApi.java @@ -260,4 +260,4 @@ public interface MgmtTargetRestApi { MediaType.APPLICATION_JSON_VALUE }) ResponseEntity getInstalledDistributionSet(@PathVariable("targetId") final String targetId); -} \ No newline at end of file +} diff --git a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java index 5aac17318..24a3f275e 100644 --- a/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java +++ b/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSystemResource.java @@ -122,4 +122,4 @@ public class MgmtSystemResource implements MgmtSystemRestApi { return new ResponseEntity<>(MgmtSystemMapper.toResponse(keyName, updatedValue), HttpStatus.OK); } -} \ No newline at end of file +}