Improve core with lombok (#1587)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -11,17 +11,18 @@ package org.eclipse.hawkbit;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Defines global configuration for the controllers/clients on the provisioning
|
||||
* targets/devices.
|
||||
*
|
||||
*
|
||||
* Note: many of the controller related properties can be overridden on tenant
|
||||
* level.
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "hawkbit.controller")
|
||||
public class ControllerPollProperties implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -59,56 +60,4 @@ public class ControllerPollProperties implements Serializable {
|
||||
* (maintenanceWindowStartTime - t)/maintenanceWindowPollCount.
|
||||
*/
|
||||
private int maintenanceWindowPollCount = 3;
|
||||
|
||||
public String getPollingTime() {
|
||||
return pollingTime;
|
||||
}
|
||||
|
||||
public void setPollingTime(final String pollingTime) {
|
||||
this.pollingTime = pollingTime;
|
||||
}
|
||||
|
||||
public String getPollingOverdueTime() {
|
||||
return pollingOverdueTime;
|
||||
}
|
||||
|
||||
public void setPollingOverdueTime(final String pollingOverdueTime) {
|
||||
this.pollingOverdueTime = pollingOverdueTime;
|
||||
}
|
||||
|
||||
public String getMaxPollingTime() {
|
||||
return maxPollingTime;
|
||||
}
|
||||
|
||||
public void setMaxPollingTime(final String maxPollingTime) {
|
||||
this.maxPollingTime = maxPollingTime;
|
||||
}
|
||||
|
||||
public String getMinPollingTime() {
|
||||
return minPollingTime;
|
||||
}
|
||||
|
||||
public void setMinPollingTime(final String minPollingTime) {
|
||||
this.minPollingTime = minPollingTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns poll count for maintenance window
|
||||
* ({@link ControllerPollProperties#maintenanceWindowPollCount}).
|
||||
*
|
||||
* @return maintenanceWindowPollCount as int.
|
||||
*/
|
||||
public int getMaintenanceWindowPollCount() {
|
||||
return maintenanceWindowPollCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets poll count for maintenance window
|
||||
* ({@link ControllerPollProperties#maintenanceWindowPollCount}).
|
||||
*
|
||||
* @param maintenanceWindowPollCount.
|
||||
*/
|
||||
public void setMaintenanceWindowPollCount(int maintenanceWindowPollCount) {
|
||||
this.maintenanceWindowPollCount = maintenanceWindowPollCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.springframework.core.io.support.ResourcePatternResolver;
|
||||
* same name. All properties files will be merged.
|
||||
*/
|
||||
public class DistributedResourceBundleMessageSource extends ReloadableResourceBundleMessageSource {
|
||||
|
||||
// Exception squid:S2387 - Follows our upper case convention
|
||||
@SuppressWarnings({ "squid:S2387" })
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DistributedResourceBundleMessageSource.class);
|
||||
|
||||
@@ -9,12 +9,16 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties for the server e.g. the server's URL which must be configured.
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
@ConfigurationProperties("hawkbit.server")
|
||||
public class HawkbitServerProperties {
|
||||
/**
|
||||
@@ -27,45 +31,26 @@ public class HawkbitServerProperties {
|
||||
|
||||
private final Build build = new Build();
|
||||
|
||||
public Anonymous getAnonymous() {
|
||||
return anonymous;
|
||||
}
|
||||
|
||||
public Build getBuild() {
|
||||
return build;
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties for anonymous API access by Devices/Controllers.
|
||||
*
|
||||
*/
|
||||
@Getter
|
||||
public static class Anonymous {
|
||||
private final Download download = new Download();
|
||||
|
||||
public Download getDownload() {
|
||||
return download;
|
||||
}
|
||||
private final Download download = new Download();
|
||||
|
||||
/**
|
||||
* Properties for artifact download under anonymous API access by
|
||||
* Devices/Controllers.
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public static class Download {
|
||||
|
||||
/**
|
||||
* Unauthenticated artifact download possible if true.
|
||||
*/
|
||||
private boolean enabled;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(final boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,10 +75,6 @@ public class HawkbitServerProperties {
|
||||
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(final String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user