Dependency updates and cleanup.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mark Nellemann 2023-11-22 10:47:00 +01:00
parent c7644a9137
commit 98db370f0b
6 changed files with 59 additions and 46 deletions

View file

@ -5,8 +5,8 @@ plugins {
id 'jacoco'
id "net.nemerosa.versioning" version "2.15.1"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.netflix.nebula.ospackage" version "11.4.0"
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
@ -18,19 +18,19 @@ group = projectGroup
version = projectVersion
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.7.4'
implementation 'info.picocli:picocli:4.7.4'
annotationProcessor 'info.picocli:picocli-codegen:4.7.5'
implementation 'info.picocli:picocli:4.7.5'
implementation 'com.influxdb:influxdb-client-java:6.10.0'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'org.slf4j:slf4j-simple:2.0.7'
implementation 'org.slf4j:slf4j-api:2.0.9'
implementation 'org.slf4j:slf4j-simple:2.0.9'
implementation 'com.squareup.okhttp3:okhttp:4.11.0' // Also used by InfluxDB Client
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.2'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.3'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.3'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
testImplementation "org.mock-server:mockserver-netty-no-dependencies:5.14.0"
testImplementation "org.mock-server:mockserver-netty-no-dependencies:5.15.0"
}
application {

View file

@ -15,17 +15,19 @@
*/
package biz.nellemann.svci;
import biz.nellemann.svci.dto.toml.Configuration;
import com.fasterxml.jackson.dataformat.toml.TomlMapper;
import picocli.CommandLine;
import picocli.CommandLine.Option;
import picocli.CommandLine.Command;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import com.fasterxml.jackson.dataformat.toml.TomlMapper;
import biz.nellemann.svci.dto.toml.Configuration;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;
@Command(name = "svci",
mixinStandardHelpOptions = true,
versionProvider = biz.nellemann.svci.VersionProvider.class,
@ -94,7 +96,7 @@ public class Application implements Callable<Integer> {
}
influxClient.logoff();
} catch (Exception e) {
} catch (InterruptedException | IOException e) {
System.err.println(e.getMessage());
return 1;
}

View file

@ -4,6 +4,7 @@ import picocli.CommandLine;
public class DefaultProvider implements CommandLine.IDefaultValueProvider {
@Override
public String defaultValue(CommandLine.Model.ArgSpec argSpec) throws Exception {
if(argSpec.isOption()) {
switch (argSpec.paramLabel()) {

View file

@ -15,22 +15,21 @@
*/
package biz.nellemann.svci;
import biz.nellemann.svci.dto.toml.InfluxConfiguration;
import static java.lang.Thread.sleep;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.InfluxDBClientFactory;
import com.influxdb.client.WriteApi;
import com.influxdb.client.WriteOptions;
import com.influxdb.client.domain.WritePrecision;
import com.influxdb.client.write.Point;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static java.lang.Thread.sleep;
import biz.nellemann.svci.dto.toml.InfluxConfiguration;
public final class InfluxClient {

View file

@ -1,17 +1,7 @@
package biz.nellemann.svci;
import biz.nellemann.svci.dto.json.AuthResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.*;
import java.net.*;
import java.io.IOException;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@ -19,6 +9,23 @@ import java.security.cert.X509Certificate;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import biz.nellemann.svci.dto.json.AuthResponse;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class RestClient {
private final static Logger log = LoggerFactory.getLogger(RestClient.class);
@ -83,7 +90,7 @@ public class RestClient {
authToken = authResponse.token;
log.debug("logon() - auth token: {}", authToken);
} catch (Exception e) {
} catch (IOException e) {
log.warn("logon() - error: {}", e.getMessage());
}

View file

@ -15,14 +15,8 @@
*/
package biz.nellemann.svci;
import biz.nellemann.svci.dto.json.*;
import biz.nellemann.svci.dto.json.System;
import biz.nellemann.svci.dto.toml.SvcConfiguration;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import static java.lang.Thread.sleep;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
@ -31,7 +25,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static java.lang.Thread.sleep;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import biz.nellemann.svci.dto.json.EnclosureStat;
import biz.nellemann.svci.dto.json.MDiskGroup;
import biz.nellemann.svci.dto.json.NodeStat;
import biz.nellemann.svci.dto.json.System;
import biz.nellemann.svci.dto.json.VDisk;
import biz.nellemann.svci.dto.toml.SvcConfiguration;
class VolumeController implements Runnable {