From 7468d8961ef982b01ac4b3e0c28b060a45cbd7c6 Mon Sep 17 00:00:00 2001 From: Kai Zimmermann Date: Fri, 3 Jun 2016 12:34:09 +0200 Subject: [PATCH] Completed constants. Signed-off-by: Kai Zimmermann --- .../eclipse/hawkbit/repository/Constants.java | 28 +++++++++++++++---- .../repository/jpa/JpaSystemManagement.java | 9 +++--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/Constants.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/Constants.java index 6ccb4bc82..9a1e442b0 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/Constants.java +++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/Constants.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.repository; @@ -12,16 +17,29 @@ import org.eclipse.hawkbit.repository.model.SoftwareModuleType; */ public final class Constants { /** - * Default {@link SoftwareModuleType} generated by repository for every new - * account for Firmware/Operating System. + * {@link SoftwareModuleType#getKey()} of a {@link SoftwareModuleType} + * generated by repository for every new account for Firmware/Operating + * System. */ public static final String SMT_DEFAULT_OS_KEY = "os"; /** - * Default {@link SoftwareModuleType} generated by repository for every new - * account for applications. + * {@link SoftwareModuleType#getKey()} of a {@link SoftwareModuleType} + * generated by repository for every new account for applications. */ public static final String SMT_DEFAULT_APP_KEY = "application"; + /** + * {@link SoftwareModuleType#getName()} of a {@link SoftwareModuleType} + * generated by repository for every new account for "Firmware/Operating + * System" . + */ + public static final String SMT_DEFAULT_OS_NAME = "Firmware"; + /** + * {@link SoftwareModuleType#getName()} of a {@link SoftwareModuleType} + * generated by repository for every new account for "applications/apps". + */ + public static final String SMT_DEFAULT_APP_NAME = "Application"; + /** * {@link DistributionSetType#getKey()} of a {@link DistributionSetType} * generated by repository for every new account that includes diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java index a2865c4b0..3fed3d858 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java @@ -284,10 +284,11 @@ public class JpaSystemManagement implements CurrentTenantCacheKeyGenerator, Syst } private DistributionSetType createStandardSoftwareDataSetup() { - final SoftwareModuleType app = softwareModuleTypeRepository.save(new JpaSoftwareModuleType( - Constants.SMT_DEFAULT_APP_KEY, "Application", "Application Addons", Integer.MAX_VALUE)); + final SoftwareModuleType app = softwareModuleTypeRepository + .save(new JpaSoftwareModuleType(Constants.SMT_DEFAULT_APP_KEY, Constants.SMT_DEFAULT_APP_NAME, + "Application Addons", Integer.MAX_VALUE)); final SoftwareModuleType os = softwareModuleTypeRepository.save(new JpaSoftwareModuleType( - Constants.SMT_DEFAULT_OS_KEY, "Firmware", "Core firmware or operationg system", 1)); + Constants.SMT_DEFAULT_OS_KEY, Constants.SMT_DEFAULT_OS_NAME, "Core firmware or operationg system", 1)); distributionSetTypeRepository .save((JpaDistributionSetType) new JpaDistributionSetType(Constants.DST_DEFAULT_OS_ONLY_KEY, @@ -299,4 +300,4 @@ public class JpaSystemManagement implements CurrentTenantCacheKeyGenerator, Syst Constants.DST_DEFAULT_OS_WITH_APPS_NAME, "Default type with Firmware/OS and optional app(s).") .addMandatoryModuleType(os).addOptionalModuleType(app)); } -} +} \ No newline at end of file