Skip to content

Commit caa8783

Browse files
committed
more cleanups
1 parent 72050bc commit caa8783

File tree

7 files changed

+34
-24
lines changed

7 files changed

+34
-24
lines changed

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.ibm.mq.constants.CMQC;
99
import io.opentelemetry.ibm.mq.config.QueueManager;
1010
import java.util.Hashtable;
11+
import javax.annotation.Nullable;
1112
import org.slf4j.Logger;
1213
import org.slf4j.LoggerFactory;
1314

@@ -30,7 +31,7 @@ public WmqContext(QueueManager queueManager) {
3031

3132
/** Note: This Hashtable type is needed for IBM client classes. */
3233
@SuppressWarnings("JdkObsolete")
33-
public Hashtable<String, ?> getMQEnvironment() {
34+
public Hashtable<String, ?> getMqEnvironment() {
3435
Hashtable<String, ?> env = new Hashtable<>();
3536
addEnvProperty(env, CMQC.HOST_NAME_PROPERTY, queueManager.getHost());
3637
addEnvProperty(env, CMQC.PORT_PROPERTY, queueManager.getPort());
@@ -56,7 +57,7 @@ public WmqContext(QueueManager queueManager) {
5657
}
5758

5859
@SuppressWarnings({"unused", "unchecked", "rawtypes"})
59-
private void addEnvProperty(Hashtable env, String propName, Object propVal) {
60+
private static void addEnvProperty(Hashtable env, String propName, @Nullable Object propVal) {
6061
if (null != propVal) {
6162
if (propVal instanceof String) {
6263
String propString = (String) propVal;

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/WmqMonitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
import java.util.concurrent.Callable;
3434
import java.util.concurrent.ExecutorService;
3535
import java.util.function.Consumer;
36+
import javax.annotation.Nullable;
3637
import org.jetbrains.annotations.NotNull;
37-
import org.jetbrains.annotations.Nullable;
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
4040

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/config/QueueManager.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.ibm.mq.config;
77

88
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9-
import org.jetbrains.annotations.Nullable;
9+
import javax.annotation.Nullable;
1010

1111
/** This is a jackson databind class used purely for config. */
1212
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -40,7 +40,8 @@ public class QueueManager {
4040
@Nullable private ResourceFilters listenerFilters;
4141
@Nullable private ResourceFilters topicFilters;
4242

43-
public @Nullable String getHost() {
43+
@Nullable
44+
public String getHost() {
4445
return host;
4546
}
4647

@@ -64,31 +65,35 @@ public void setName(String name) {
6465
this.name = name;
6566
}
6667

67-
public @Nullable String getChannelName() {
68+
@Nullable
69+
public String getChannelName() {
6870
return channelName;
6971
}
7072

7173
public void setChannelName(@Nullable String channelName) {
7274
this.channelName = channelName;
7375
}
7476

75-
public @Nullable String getTransportType() {
77+
@Nullable
78+
public String getTransportType() {
7679
return transportType;
7780
}
7881

7982
public void setTransportType(@Nullable String transportType) {
8083
this.transportType = transportType;
8184
}
8285

83-
public @Nullable String getUsername() {
86+
@Nullable
87+
public String getUsername() {
8488
return username;
8589
}
8690

8791
public void setUsername(@Nullable String username) {
8892
this.username = username;
8993
}
9094

91-
public @Nullable String getPassword() {
95+
@Nullable
96+
public String getPassword() {
9297
return password;
9398
}
9499

@@ -107,23 +112,26 @@ public void setQueueFilters(@Nullable ResourceFilters queueFilters) {
107112
this.queueFilters = queueFilters;
108113
}
109114

110-
public @Nullable String getSslKeyRepository() {
115+
@Nullable
116+
public String getSslKeyRepository() {
111117
return sslKeyRepository;
112118
}
113119

114120
public void setSslKeyRepository(@Nullable String sslKeyRepository) {
115121
this.sslKeyRepository = sslKeyRepository;
116122
}
117123

118-
public @Nullable String getCipherSuite() {
124+
@Nullable
125+
public String getCipherSuite() {
119126
return cipherSuite;
120127
}
121128

122129
public void setCipherSuite(String cipherSuite) {
123130
this.cipherSuite = cipherSuite;
124131
}
125132

126-
public @Nullable String getCipherSpec() {
133+
@Nullable
134+
public String getCipherSpec() {
127135
return cipherSpec;
128136
}
129137

@@ -142,15 +150,17 @@ public void setChannelFilters(@Nullable ResourceFilters channelFilters) {
142150
this.channelFilters = channelFilters;
143151
}
144152

145-
public @Nullable String getReplyQueuePrefix() {
153+
@Nullable
154+
public String getReplyQueuePrefix() {
146155
return replyQueuePrefix;
147156
}
148157

149158
public void setReplyQueuePrefix(@Nullable String replyQueuePrefix) {
150159
this.replyQueuePrefix = replyQueuePrefix;
151160
}
152161

153-
public @Nullable String getModelQueueName() {
162+
@Nullable
163+
public String getModelQueueName() {
154164
return modelQueueName;
155165
}
156166

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/metricscollector/ReadConfigurationEventQueueCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import io.opentelemetry.ibm.mq.metrics.Metrics;
2121
import java.io.IOException;
2222
import java.util.function.Consumer;
23-
import org.jetbrains.annotations.Nullable;
23+
import javax.annotation.Nullable;
2424
import org.slf4j.Logger;
2525
import org.slf4j.LoggerFactory;
2626

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/opentelemetry/Config.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ final class Config {
1414

1515
private static final Logger logger = LoggerFactory.getLogger(Config.class);
1616

17-
private Config(){
18-
19-
}
17+
private Config() {}
2018

2119
static void setUpSslConnection(Map<String, ?> config) {
2220
getConfigValueAndSetSystemProperty(config, "keyStorePath", "javax.net.ssl.keyStore");

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/opentelemetry/Main.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ public static void run(
8181

8282
Runtime.getRuntime().addShutdownHook(new Thread(service::shutdown));
8383
WmqMonitor monitor = new WmqMonitor(config, service, meterProvider.get("websphere/mq"));
84-
ScheduledFuture<?> unused = service.scheduleAtFixedRate(
85-
monitor::run,
86-
config.getTaskInitialDelaySeconds(),
87-
config.getTaskDelaySeconds(),
88-
TimeUnit.SECONDS);
84+
ScheduledFuture<?> unused =
85+
service.scheduleAtFixedRate(
86+
monitor::run,
87+
config.getTaskInitialDelaySeconds(),
88+
config.getTaskDelaySeconds(),
89+
TimeUnit.SECONDS);
8990
}
9091
}

ibm-mq-metrics/src/main/java/io/opentelemetry/ibm/mq/util/WmqUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ && isNotNullOrEmpty(queueManager.getReplyQueuePrefix())) {
5858
@SuppressWarnings("rawtypes")
5959
public static MQQueueManager connectToQueueManager(QueueManager queueManager) {
6060
WmqContext auth = new WmqContext(queueManager);
61-
Hashtable env = auth.getMQEnvironment();
61+
Hashtable env = auth.getMqEnvironment();
6262
try {
6363
MQQueueManager ibmQueueManager = new MQQueueManager(queueManager.getName(), env);
6464
logger.debug(

0 commit comments

Comments
 (0)