Skip to content

Commit ad62a1f

Browse files
committed
cleanup and spotless
1 parent 5ffb98d commit ad62a1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+250
-568
lines changed

ibm-mq-metrics/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,10 @@ dependencies {
6767
}
6868
isTransitive = false
6969
}
70-
7170
}
7271

7372
tasks.shadowJar {
7473
dependencies {
7574
exclude(dependency("com.ibm.mq:com.ibm.mq.allclient:9.4.2.1"))
7675
}
7776
}
78-
79-

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

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq;
177

188
import com.ibm.mq.constants.CMQC;
@@ -38,8 +28,10 @@ public WMQContext(QueueManager queueManager) {
3828
validateArgs();
3929
}
4030

41-
public Hashtable<String,?> getMQEnvironment() {
42-
Hashtable<String,?> env = new Hashtable<>();
31+
/** Note: This Hashtable type is needed for IBM client classes. */
32+
@SuppressWarnings("JdkObsolete")
33+
public Hashtable<String, ?> getMQEnvironment() {
34+
Hashtable<String, ?> env = new Hashtable<>();
4335
addEnvProperty(env, CMQC.HOST_NAME_PROPERTY, queueManager.getHost());
4436
addEnvProperty(env, CMQC.PORT_PROPERTY, queueManager.getPort());
4537
addEnvProperty(env, CMQC.CHANNEL_PROPERTY, queueManager.getChannelName());

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

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq;
177

188
import com.fasterxml.jackson.databind.ObjectMapper;
199
import com.ibm.mq.MQQueueManager;
2010
import com.ibm.mq.headers.pcf.PCFMessageAgent;
11+
import io.opentelemetry.api.common.AttributeKey;
12+
import io.opentelemetry.api.common.Attributes;
13+
import io.opentelemetry.api.metrics.LongGauge;
14+
import io.opentelemetry.api.metrics.Meter;
2115
import io.opentelemetry.ibm.mq.config.QueueManager;
2216
import io.opentelemetry.ibm.mq.metrics.MetricsConfig;
2317
import io.opentelemetry.ibm.mq.metricscollector.*;
@@ -34,10 +28,6 @@
3428
import io.opentelemetry.ibm.mq.metricscollector.TopicMetricsCollector;
3529
import io.opentelemetry.ibm.mq.opentelemetry.ConfigWrapper;
3630
import io.opentelemetry.ibm.mq.util.WMQUtil;
37-
import io.opentelemetry.api.common.AttributeKey;
38-
import io.opentelemetry.api.common.Attributes;
39-
import io.opentelemetry.api.metrics.LongGauge;
40-
import io.opentelemetry.api.metrics.Meter;
4131
import java.util.ArrayList;
4232
import java.util.List;
4333
import java.util.Map;
@@ -97,7 +87,7 @@ public void run() {
9787
}
9888

9989
@NotNull
100-
private List<Map<String, ?>> getQueueManagers(ConfigWrapper config) {
90+
private static List<Map<String, ?>> getQueueManagers(ConfigWrapper config) {
10191
List<Map<String, ?>> queueManagers = config.getQueueManagers();
10292
if (queueManagers.isEmpty()) {
10393
throw new IllegalStateException(
@@ -180,7 +170,7 @@ private void extractAndReportMetrics(
180170
}
181171

182172
/** Destroy the agent and disconnect from queue manager */
183-
private void cleanUp(MQQueueManager ibmQueueManager, PCFMessageAgent agent) {
173+
private static void cleanUp(MQQueueManager ibmQueueManager, PCFMessageAgent agent) {
184174
// Disconnect the agent.
185175

186176
if (agent != null) {

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.config;
177

188
import io.opentelemetry.ibm.mq.metricscollector.FilterType;

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.config;
177

188
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.config;
177

188
import java.util.HashSet;

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.metrics;
177

188
import io.opentelemetry.api.metrics.LongCounter;
@@ -22,7 +12,9 @@
2212
// This file is generated using weaver. Do not edit manually.
2313

2414
/** Metric definitions generated from a Weaver model. Do not edit manually. */
25-
public class Metrics {
15+
public final class Metrics {
16+
17+
private Metrics() {}
2618

2719
public static LongGauge createMqMessageRetryCount(Meter meter) {
2820
return meter

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.metrics;
177

188
import io.opentelemetry.ibm.mq.opentelemetry.ConfigWrapper;

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.metricscollector;
177

188
import static com.ibm.mq.constants.CMQC.MQRC_SELECTOR_ERROR;
@@ -22,11 +12,11 @@
2212
import com.ibm.mq.constants.CMQCFC;
2313
import com.ibm.mq.headers.pcf.PCFException;
2414
import com.ibm.mq.headers.pcf.PCFMessage;
25-
import io.opentelemetry.ibm.mq.metrics.Metrics;
2615
import io.opentelemetry.api.common.AttributeKey;
2716
import io.opentelemetry.api.common.Attributes;
2817
import io.opentelemetry.api.metrics.LongGauge;
2918
import io.opentelemetry.api.metrics.Meter;
19+
import io.opentelemetry.ibm.mq.metrics.Metrics;
3020
import java.util.ArrayList;
3121
import java.util.Arrays;
3222
import java.util.List;

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
/*
2-
* Copyright Splunk Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
154
*/
5+
166
package io.opentelemetry.ibm.mq.metricscollector;
177

188
public enum FilterType {

0 commit comments

Comments
 (0)