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 java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines global configuration for the controllers/clients on the provisioning
|
* Defines global configuration for the controllers/clients on the provisioning
|
||||||
* targets/devices.
|
* targets/devices.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Note: many of the controller related properties can be overridden on tenant
|
* Note: many of the controller related properties can be overridden on tenant
|
||||||
* level.
|
* level.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
@ConfigurationProperties(prefix = "hawkbit.controller")
|
@ConfigurationProperties(prefix = "hawkbit.controller")
|
||||||
public class ControllerPollProperties implements Serializable {
|
public class ControllerPollProperties implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -59,56 +60,4 @@ public class ControllerPollProperties implements Serializable {
|
|||||||
* (maintenanceWindowStartTime - t)/maintenanceWindowPollCount.
|
* (maintenanceWindowStartTime - t)/maintenanceWindowPollCount.
|
||||||
*/
|
*/
|
||||||
private int maintenanceWindowPollCount = 3;
|
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.
|
* same name. All properties files will be merged.
|
||||||
*/
|
*/
|
||||||
public class DistributedResourceBundleMessageSource extends ReloadableResourceBundleMessageSource {
|
public class DistributedResourceBundleMessageSource extends ReloadableResourceBundleMessageSource {
|
||||||
|
|
||||||
// Exception squid:S2387 - Follows our upper case convention
|
// Exception squid:S2387 - Follows our upper case convention
|
||||||
@SuppressWarnings({ "squid:S2387" })
|
@SuppressWarnings({ "squid:S2387" })
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(DistributedResourceBundleMessageSource.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(DistributedResourceBundleMessageSource.class);
|
||||||
|
|||||||
@@ -9,12 +9,16 @@
|
|||||||
*/
|
*/
|
||||||
package org.eclipse.hawkbit;
|
package org.eclipse.hawkbit;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties for the server e.g. the server's URL which must be configured.
|
* Properties for the server e.g. the server's URL which must be configured.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
@ConfigurationProperties("hawkbit.server")
|
@ConfigurationProperties("hawkbit.server")
|
||||||
public class HawkbitServerProperties {
|
public class HawkbitServerProperties {
|
||||||
/**
|
/**
|
||||||
@@ -27,45 +31,26 @@ public class HawkbitServerProperties {
|
|||||||
|
|
||||||
private final Build build = new Build();
|
private final Build build = new Build();
|
||||||
|
|
||||||
public Anonymous getAnonymous() {
|
|
||||||
return anonymous;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Build getBuild() {
|
|
||||||
return build;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties for anonymous API access by Devices/Controllers.
|
* Properties for anonymous API access by Devices/Controllers.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
public static class Anonymous {
|
public static class Anonymous {
|
||||||
private final Download download = new Download();
|
|
||||||
|
|
||||||
public Download getDownload() {
|
private final Download download = new Download();
|
||||||
return download;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properties for artifact download under anonymous API access by
|
* Properties for artifact download under anonymous API access by
|
||||||
* Devices/Controllers.
|
* Devices/Controllers.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
public static class Download {
|
public static class Download {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unauthenticated artifact download possible if true.
|
* Unauthenticated artifact download possible if true.
|
||||||
*/
|
*/
|
||||||
private boolean enabled;
|
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) {
|
public void setUrl(final String url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user