From 042ae62d0f87f76f2276d3b125dce524ce715398 Mon Sep 17 00:00:00 2001 From: cristianciutea Date: Sun, 21 Nov 2021 19:57:48 +0100 Subject: [PATCH] test: added connection test --- build/build.mk | 6 +- commons/nrjmx.thrift | 18 +- pom.xml | 5 + src/go/go.mod | 6 +- src/go/go.sum | 290 +--- src/go/jmx_connector_test.go | 109 -- src/go/nrjmx.go | 54 + src/go/nrjmx_connector_test.go | 187 +++ src/go/{jmx_test.go => nrjmx_test.go} | 76 +- .../GoUnusedProtection__.go | 2 +- src/go/nrprotocol/convertor.go | 18 + src/go/nrprotocol/convertor_test.go | 78 ++ .../j_m_x_service-remote.go | 37 +- .../{protocol => nrprotocol}/nrjmx-consts.go | 2 +- src/go/{protocol => nrprotocol}/nrjmx.go | 712 +++++++--- src/go/process.go | 111 ++ .../java/org/newrelic/nrjmx/Application.java | 35 + .../java/org/newrelic/nrjmx/Arguments.java | 10 + .../newrelic/nrjmx/v2/JMXFetcher copy.java | 478 +++++++ .../org/newrelic/nrjmx/v2/JMXFetcher.java | 331 +++++ .../newrelic/nrjmx/v2/JMXServiceHandler.java | 55 + .../newrelic/nrjmx/v2/StandardIOServer.java | 116 ++ .../nrjmx/v2/StandardIOTransportServer.java | 31 + .../nrjmx/v2/nrprotocol/JMXAttribute.java | 895 ++++++++++++ .../JMXAttributeValue.java | 138 +- .../{protocol => nrprotocol}/JMXConfig.java | 4 +- .../JMXConnectionError.java | 4 +- .../v2/{protocol => nrprotocol}/JMXError.java | 4 +- .../{protocol => nrprotocol}/JMXService.java | 1207 ++++++++++++++++- .../{protocol => nrprotocol}/LogMessage.java | 4 +- .../{protocol => nrprotocol}/ValueType.java | 4 +- .../nrjmx/v2/protocol/JMXAttribute.java | 487 ------- .../main/java/org/newrelic/jmx/Service.java | 4 +- 33 files changed, 4332 insertions(+), 1186 deletions(-) delete mode 100644 src/go/jmx_connector_test.go create mode 100644 src/go/nrjmx.go create mode 100644 src/go/nrjmx_connector_test.go rename src/go/{jmx_test.go => nrjmx_test.go} (90%) rename src/go/{protocol => nrprotocol}/GoUnusedProtection__.go (88%) create mode 100644 src/go/nrprotocol/convertor.go create mode 100644 src/go/nrprotocol/convertor_test.go rename src/go/{protocol => nrprotocol}/j_m_x_service-remote/j_m_x_service-remote.go (85%) rename src/go/{protocol => nrprotocol}/nrjmx-consts.go (95%) rename src/go/{protocol => nrprotocol}/nrjmx.go (84%) create mode 100644 src/go/process.go create mode 100644 src/main/java/org/newrelic/nrjmx/v2/JMXFetcher copy.java create mode 100644 src/main/java/org/newrelic/nrjmx/v2/JMXFetcher.java create mode 100644 src/main/java/org/newrelic/nrjmx/v2/JMXServiceHandler.java create mode 100644 src/main/java/org/newrelic/nrjmx/v2/StandardIOServer.java create mode 100644 src/main/java/org/newrelic/nrjmx/v2/StandardIOTransportServer.java create mode 100644 src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttribute.java rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/JMXAttributeValue.java (89%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/JMXConfig.java (99%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/JMXConnectionError.java (99%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/JMXError.java (99%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/JMXService.java (76%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/LogMessage.java (99%) rename src/main/java/org/newrelic/nrjmx/v2/{protocol => nrprotocol}/ValueType.java (92%) delete mode 100644 src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttribute.java diff --git a/build/build.mk b/build/build.mk index 916eeef7..c78ad07a 100644 --- a/build/build.mk +++ b/build/build.mk @@ -26,10 +26,10 @@ code-gen-deps: .PHONY : code-gen code-gen: code-gen-deps @($(DOCKER_THRIFT) thrift -r --out src/main/java/ --gen java ./commons/nrjmx.thrift) - @($(DOCKER_THRIFT) thrift -r --out src/go/ --gen go:package=protocol ./commons/nrjmx.thrift) + @($(DOCKER_THRIFT) thrift -r --out src/go/ --gen go:package_prefix=github.com/newrelic/nrjmx/,package=nrprotocol ./commons/nrjmx.thrift) -TRACKED_GEN_DIR=src/main/java/protocol \ - src/go/protocol +TRACKED_GEN_DIR=src/main/java/prot \ + src/go/prot .PHONY : check-gen-code check-gen-code: code-gen @echo "Checking the generated code..." ; \ diff --git a/commons/nrjmx.thrift b/commons/nrjmx.thrift index d8a033ef..65b4e62e 100644 --- a/commons/nrjmx.thrift +++ b/commons/nrjmx.thrift @@ -1,4 +1,4 @@ -namespace java org.newrelic.nrjmx.v2.protocol +namespace java org.newrelic.nrjmx.v2.nrprotocol struct JMXConfig { 1: string connectionURL @@ -19,20 +19,16 @@ enum ValueType { STRING = 1, DOUBLE = 2, INT = 3, - BOOL = 4 -} - -struct JMXAttributeValue { - 1: ValueType valueType, - 2: string stringValue, - 3: double doubleValue, - 4: i64 intValue, - 5: bool boolValue + BOOL = 4, } struct JMXAttribute { 1: string attribute - 2: JMXAttributeValue value + 2: ValueType valueType, + 3: string stringValue, + 4: double doubleValue, + 5: i64 intValue, + 6: bool boolValue } struct LogMessage { diff --git a/pom.xml b/pom.xml index 17752254..9a3f514f 100644 --- a/pom.xml +++ b/pom.xml @@ -36,6 +36,11 @@ 1.16.0 test + + org.apache.thrift + libthrift + 0.13.0 + org.slf4j slf4j-api diff --git a/src/go/go.mod b/src/go/go.mod index bc2d40a3..3bf4b25f 100644 --- a/src/go/go.mod +++ b/src/go/go.mod @@ -3,10 +3,10 @@ module github.com/newrelic/nrjmx go 1.14 require ( - github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use // indirect - github.com/docker/docker v20.10.7+incompatible + github.com/apache/thrift v0.13.0 + github.com/docker/docker v20.10.11+incompatible github.com/docker/go-connections v0.4.0 github.com/newrelic/infra-integrations-sdk v3.7.0+incompatible github.com/stretchr/testify v1.7.0 - github.com/testcontainers/testcontainers-go v0.11.1 + github.com/testcontainers/testcontainers-go v0.12.0 ) diff --git a/src/go/go.sum b/src/go/go.sum index fa21b697..e9e9f722 100644 --- a/src/go/go.sum +++ b/src/go/go.sum @@ -10,33 +10,17 @@ cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6T cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= @@ -53,6 +37,8 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Flaque/filet v0.0.0-20201012163910-45f684403088 h1:PnnQln5IGbhLeJOi6hVs+lCeF+B1dRfFKPGXUAez0Ww= +github.com/Flaque/filet v0.0.0-20201012163910-45f684403088/go.mod h1:TK+jB3mBs+8ZMWhU5BqZKnZWJ1MrLo8etNVg51ueTBo= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= @@ -79,13 +65,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/thrift v0.15.0 h1:aGvdaR0v1t9XLgjtBYwxcBvBOTMqClzwE26CHOgjW1Y= -github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use h1:xsANrjjFgHGZdvm+CH11MokyE+otra0nzE6s6h4AYao= -github.com/apache/thrift/lib/go/thrift v0.0.1-do-not-use/go.mod h1:DFhKuRr6Y5sTnmWbwMaNNsb2Sb191zcHZCUmz+x3YsM= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/apache/thrift v0.13.0 h1:5hryIiq9gtn+MiLVn0wP37kb/uTeRZgN08WoCsAhIhI= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -94,7 +75,7 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= @@ -108,16 +89,16 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= @@ -135,6 +116,7 @@ github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -152,6 +134,7 @@ github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= +github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e h1:6JKvHHt396/qabvMhnhUZvWaHZzfVfldxE60TK8YLhg= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= @@ -199,13 +182,13 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -217,8 +200,8 @@ github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TT github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.11+incompatible h1:OqzI/g/W54LczvhnccGqniFoQghHx3pklbLuhfXpqGo= +github.com/docker/docker v20.10.11+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= @@ -238,14 +221,13 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= @@ -298,9 +280,6 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -314,10 +293,9 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -325,41 +303,32 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -367,37 +336,19 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:Fecb github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -406,7 +357,6 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -419,42 +369,37 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/moby/sys/mount v0.2.0 h1:WhCW5B355jtxndN5ovugJlMFJawbUODuW8fSnEH6SSM= github.com/moby/sys/mount v0.2.0/go.mod h1:aAivFE2LB3W4bACsUXChRHQ0qKWsetY4Y9V7sxOougM= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1 h1:1O+1cHA1aujwEwwVMa2Xm2l+gIpUHyd3+D+d7LZh1kM= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/sys/mountinfo v0.5.0 h1:2Ks8/r6lopsxWi9m58nlwjaeSzUX9iiL1vj5qB/9ObI= +github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk= @@ -471,7 +416,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/newrelic/infra-integrations-sdk v1.0.0 h1:CxQqJZ55vkIYjEOM45QBxgPrQNsC5rWBoSBR1w0zbC0= github.com/newrelic/infra-integrations-sdk v3.7.0+incompatible h1:DErIlRt4xGwgcR4N/LkzvH/c9xOituAtnEgwFUwfVSs= github.com/newrelic/infra-integrations-sdk v3.7.0+incompatible/go.mod h1:tMUHRMq6mJS0YyBnbWrTXAnREnQqC1AGO6Lu45u5xAM= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -480,10 +424,12 @@ github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -498,28 +444,27 @@ github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5X github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93 h1:x2UMpOOVf3kQ8arv/EsDGwim8PTNqzL1/EYDr/+scOM= github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg= +github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -546,13 +491,10 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -561,27 +503,21 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -591,17 +527,15 @@ github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRci github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/testcontainers/testcontainers-go v0.11.1 h1:FiYsB83LSGbiawoV8TpAZGfcCUbtaeeg1SXqEKUxh08= -github.com/testcontainers/testcontainers-go v0.11.1/go.mod h1:/V0UVq+1e7NWYoqTPog179clf0Qp9TOyp4EcXaEFQz8= +github.com/testcontainers/testcontainers-go v0.12.0 h1:SK0NryGHIx7aifF6YqReORL18aGAA4bsDPtikDVCEyg= +github.com/testcontainers/testcontainers-go v0.12.0/go.mod h1:SIndOQXZng0IW8iWU1Js0ynrfZ8xcxrTtDfF6rD2pxs= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -618,46 +552,32 @@ github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2 github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -684,8 +604,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -694,16 +612,11 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -716,7 +629,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -728,51 +640,29 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211108170745-6635138e15ea h1:FosBMXtOc8Tp9Hbo4ltl1WJSrTVewZU8MPnTPY2HdH8= +golang.org/x/net v0.0.0-20211108170745-6635138e15ea/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -812,18 +702,11 @@ golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -832,18 +715,13 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211109184856-51b60fd695b3 h1:T6tyxxvHMj2L1R2kZg0uNMpS8ZhB9lRa9XRGTCSA65w= +golang.org/x/sys v0.0.0-20211109184856-51b60fd695b3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -851,11 +729,13 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -877,7 +757,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -892,29 +771,13 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -926,26 +789,12 @@ google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -966,32 +815,10 @@ google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1004,19 +831,9 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1026,32 +843,34 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1060,10 +879,10 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1071,7 +890,6 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= diff --git a/src/go/jmx_connector_test.go b/src/go/jmx_connector_test.go deleted file mode 100644 index 6a7ba77e..00000000 --- a/src/go/jmx_connector_test.go +++ /dev/null @@ -1,109 +0,0 @@ -package main - -import ( - "context" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/docker/docker/client" - "github.com/newrelic/infra-integrations-sdk/jmx" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/testcontainers/testcontainers-go" - "github.com/testcontainers/testcontainers-go/wait" -) - -const ( - jbossJMXPort = "9990" -) - -func Test_Connector_Success(t *testing.T) { - ctx := context.Background() - - // GIVEN a JBoss Server with JMX exposed running inside a container - container, err := runJbossStandaloneJMXContainer(ctx) - require.NoError(t, err) - defer container.Terminate(ctx) - container.GetContainerID() - - // Install the connector - dstFile := filepath.Join(prjDir, "/bin/jboss-client.jar") - err = copyFileFromContainer(ctx, container.GetContainerID(), "/opt/jboss/wildfly/bin/client/jboss-client.jar", dstFile) - assert.NoError(t, err) - - defer os.Remove(dstFile) - - // THEN JMX connection can be oppened - jmxPort, err := container.MappedPort(ctx, jbossJMXPort) - require.NoError(t, err) - jmxHost, err := container.Host(ctx) - require.NoError(t, err) - - options := []jmx.Option{ - jmx.WithRemoteProtocol(), - jmx.WithRemoteStandAloneJBoss(), - } - - err = jmx.Open(jmxHost, jmxPort.Port(), "admin1234", "Password1!", options...) - defer jmx.Close() - assert.NoError(t, err) - - // AND Query returns expected data - result, err := jmx.Query("jboss.as:subsystem=remoting,configuration=endpoint", 10000) - assert.NoError(t, err) - - val, found := result["jboss.as:subsystem=remoting,configuration=endpoint,attr=heartbeatInterval"] - assert.True(t, found) - assert.Equal(t, float64(60000), val) -} - -// runJbossStandaloneJMXContainer will start a container running a jboss instace with JMX. -func runJbossStandaloneJMXContainer(ctx context.Context) (testcontainers.Container, error) { - req := testcontainers.ContainerRequest{ - Image: "test_jboss", - - ExposedPorts: []string{ - fmt.Sprintf("%[1]s:%[1]s", jbossJMXPort), - }, - - WaitingFor: wait.ForListeningPort(jbossJMXPort), - } - - container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ - ContainerRequest: req, - Started: true, - }) - - if err != nil { - return nil, err - } - - container.StartLogProducer(ctx) - container.FollowOutput(&TestLogConsumer{}) - return container, err -} - -func copyFileFromContainer(ctx context.Context, containerID, srcPath, dstPath string) error { - cli, err := client.NewClientWithOpts(client.FromEnv) - if err != nil { - return err - } - reader, containerPathStat, err := cli.CopyFromContainer(ctx, containerID, srcPath) - if err != nil { - return err - } - defer reader.Close() - - if !containerPathStat.Mode.IsRegular() { - return fmt.Errorf("src is not a regular file: %s", srcPath) - } - - b, err := ioutil.ReadAll(reader) - if err != nil { - return err - } - return ioutil.WriteFile(dstPath, b, 0644) -} diff --git a/src/go/nrjmx.go b/src/go/nrjmx.go new file mode 100644 index 00000000..2ea1a0bd --- /dev/null +++ b/src/go/nrjmx.go @@ -0,0 +1,54 @@ +package nrjmx + +import ( + "context" + + "time" + + "github.com/apache/thrift/lib/go/thrift" + "github.com/newrelic/nrjmx/nrprotocol" +) + +func NewJMXServiceClient(ctx context.Context) (client *JMXClient, err error) { + jmxProcess, err := startJMXProcess(ctx) + if err != nil { + return + } + + var protocolFactory thrift.TProtocolFactory + protocolFactory = thrift.NewTCompactProtocolFactory() + + var transportFactory thrift.TTransportFactory + + transportFactory = thrift.NewTBufferedTransportFactory(8192) + + transportFactory = thrift.NewTFramedTransportFactory(transportFactory) + + var transport thrift.TTransport + + transport = thrift.NewStreamTransport(jmxProcess.Stdout, jmxProcess.Stdin) + transport, err = transportFactory.GetTransport(transport) + if err != nil { + return nil, err + } + + iprot := protocolFactory.GetProtocol(transport) + oprot := protocolFactory.GetProtocol(transport) + client = &JMXClient{ + JMXService: nrprotocol.NewJMXServiceClient(thrift.NewTStandardClient(iprot, oprot)), + jmxProcess: *jmxProcess, + ctx: ctx, + } + return +} + +type JMXClient struct { + nrprotocol.JMXService + jmxProcess jmxProcess + ctx context.Context +} + +func (j *JMXClient) Close(timeout time.Duration) error { + j.Disconnect(j.ctx) + return j.jmxProcess.stop(timeout) +} diff --git a/src/go/nrjmx_connector_test.go b/src/go/nrjmx_connector_test.go new file mode 100644 index 00000000..ca420054 --- /dev/null +++ b/src/go/nrjmx_connector_test.go @@ -0,0 +1,187 @@ +package nrjmx + +import ( + "context" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "testing" + + "github.com/newrelic/nrjmx/nrprotocol" + + "github.com/docker/docker/client" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/testcontainers/testcontainers-go" + "github.com/testcontainers/testcontainers-go/wait" +) + +const ( + jbossJMXPort = "9990" +) + +func Test_Connector_Success(t *testing.T) { + ctx := context.Background() + + // GIVEN a JBoss Server with JMX exposed running inside a container + container, err := runJbossStandaloneJMXContainer(ctx) + require.NoError(t, err) + defer container.Terminate(ctx) + + // Install the connector + dstFile := filepath.Join(prjDir, "/bin/jboss-client.jar") + err = copyFileFromContainer(ctx, container.GetContainerID(), "/opt/jboss/wildfly/bin/client/jboss-client.jar", dstFile) + assert.NoError(t, err) + + defer os.Remove(dstFile) + + // THEN JMX connection can be oppened + jmxPort, err := container.MappedPort(ctx, jbossJMXPort) + require.NoError(t, err) + jmxHost, err := container.Host(ctx) + require.NoError(t, err) + + client, err := NewJMXServiceClient(ctx) + assert.NoError(t, err) + + config := &nrprotocol.JMXConfig{ + Hostname: jmxHost, + Port: int32(jmxPort.Int()), + Username: "admin1234", + Password: "Password1!", + IsJBossStandaloneMode: true, + IsRemote: true, + } + + _, err = client.Connect(ctx, config) + defer client.Disconnect(ctx) + assert.NoError(t, err) + + // AND Query returns expected data + actual, err := client.QueryMbean(ctx, "jboss.as:subsystem=remoting,configuration=endpoint") + assert.NoError(t, err) + + expected := []*nrprotocol.JMXAttribute{ + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=authenticationRetries", + ValueType: nrprotocol.ValueType_INT, + IntValue: 3, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=heartbeatInterval", + ValueType: nrprotocol.ValueType_INT, + IntValue: 60000, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundChannels", + ValueType: nrprotocol.ValueType_INT, + IntValue: 40, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessageSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 9223372036854775807, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessages", + ValueType: nrprotocol.ValueType_INT, + IntValue: 80, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundChannels", + ValueType: nrprotocol.ValueType_INT, + IntValue: 40, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessageSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 9223372036854775807, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessages", + ValueType: nrprotocol.ValueType_INT, + IntValue: 65535, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveBufferSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 8192, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveWindowSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 131072, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=saslProtocol", + ValueType: nrprotocol.ValueType_STRING, + StringValue: "remote", + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=sendBufferSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 8192, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=transmitWindowSize", + ValueType: nrprotocol.ValueType_INT, + IntValue: 131072, + }, + { + Attribute: "jboss.as:subsystem=remoting,configuration=endpoint,attr=worker", + ValueType: nrprotocol.ValueType_STRING, + StringValue: "default", + }, + } + + assert.Equal(t, expected, actual) +} + +// runJbossStandaloneJMXContainer will start a container running a jboss instace with JMX. +func runJbossStandaloneJMXContainer(ctx context.Context) (testcontainers.Container, error) { + req := testcontainers.ContainerRequest{ + Image: "test_jboss", + + ExposedPorts: []string{ + fmt.Sprintf("%[1]s:%[1]s", jbossJMXPort), + }, + + WaitingFor: wait.ForListeningPort(jbossJMXPort), + } + + container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{ + ContainerRequest: req, + Started: true, + }) + + if err != nil { + return nil, err + } + + container.StartLogProducer(ctx) + container.FollowOutput(&TestLogConsumer{}) + return container, err +} + +func copyFileFromContainer(ctx context.Context, containerID, srcPath, dstPath string) error { + cli, err := client.NewClientWithOpts(client.FromEnv) + if err != nil { + return err + } + reader, containerPathStat, err := cli.CopyFromContainer(ctx, containerID, srcPath) + if err != nil { + return err + } + defer reader.Close() + + if !containerPathStat.Mode.IsRegular() { + return fmt.Errorf("src is not a regular file: %s", srcPath) + } + + b, err := ioutil.ReadAll(reader) + if err != nil { + return err + } + return ioutil.WriteFile(dstPath, b, 0644) +} diff --git a/src/go/jmx_test.go b/src/go/nrjmx_test.go similarity index 90% rename from src/go/jmx_test.go rename to src/go/nrjmx_test.go index 302e8553..4704b9a2 100644 --- a/src/go/jmx_test.go +++ b/src/go/nrjmx_test.go @@ -1,4 +1,4 @@ -package main +package nrjmx import ( "bytes" @@ -15,6 +15,7 @@ import ( "github.com/docker/go-connections/nat" "github.com/newrelic/infra-integrations-sdk/jmx" + "github.com/newrelic/nrjmx/nrprotocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" @@ -78,17 +79,28 @@ func Test_Query_Success_LargeAmountOfData(t *testing.T) { defer cleanMBeans(ctx, container) + // time.Sleep(1 * time.Hour) + // THEN JMX connection can be oppened jmxPort, err := container.MappedPort(ctx, testServerJMXPort) require.NoError(t, err) jmxHost, err := container.Host(ctx) require.NoError(t, err) - err = jmx.Open(jmxHost, jmxPort.Port(), "", "") - defer jmx.Close() + client, err := NewJMXServiceClient(ctx) + assert.NoError(t, err) + + config := &nrprotocol.JMXConfig{ + Hostname: jmxHost, + Port: int32(jmxPort.Int()), + UriPath: "jmxrmi", + } + + _, err = client.Connect(ctx, config) + defer client.Disconnect(ctx) assert.NoError(t, err) - result, err := jmx.Query("test:type=Cat,*", 600000) + result, err := client.QueryMbean(ctx, "test:type=Cat,*") assert.NoError(t, err) // AND query returns at least 5Mb of data. @@ -107,7 +119,7 @@ func Test_Query_Success(t *testing.T) { resp, err := addMBeans(ctx, container, map[string]interface{}{ "name": "tomas", "doubleValue": 1.2, - "floatValue": 2.2, + "floatValue": 2.2222222, "numberValue": 3, "boolValue": true, }) @@ -122,23 +134,57 @@ func Test_Query_Success(t *testing.T) { jmxHost, err := container.Host(ctx) require.NoError(t, err) - err = jmx.Open(jmxHost, jmxPort.Port(), "", "") - defer jmx.Close() + client, err := NewJMXServiceClient(ctx) + assert.NoError(t, err) + + config := &nrprotocol.JMXConfig{ + Hostname: jmxHost, + Port: int32(jmxPort.Int()), + UriPath: "jmxrmi", + } + + _, err = client.Connect(ctx, config) + defer client.Disconnect(ctx) assert.NoError(t, err) // AND Query returns expected data - result, err := jmx.Query("test:type=Cat,*", 10000) + actual, err := client.QueryMbean(ctx, "test:type=Cat,*") assert.NoError(t, err) - expected := map[string]interface{}{ - "test:type=Cat,name=tomas,attr=Name": "tomas", - "test:type=Cat,name=tomas,attr=DoubleValue": 1.2, - "test:type=Cat,name=tomas,attr=FloatValue": 2.2, - "test:type=Cat,name=tomas,attr=BoolValue": true, - "test:type=Cat,name=tomas,attr=NumberValue": float64(3), + expected := []*nrprotocol.JMXAttribute{ + { + Attribute: "test:type=Cat,name=tomas,attr=FloatValue", + + ValueType: nrprotocol.ValueType_DOUBLE, + DoubleValue: 2.222222, + }, + { + Attribute: "test:type=Cat,name=tomas,attr=NumberValue", + + ValueType: nrprotocol.ValueType_INT, + IntValue: 3, + }, + { + Attribute: "test:type=Cat,name=tomas,attr=BoolValue", + + ValueType: nrprotocol.ValueType_BOOL, + BoolValue: true, + }, + { + Attribute: "test:type=Cat,name=tomas,attr=DoubleValue", + + ValueType: nrprotocol.ValueType_DOUBLE, + DoubleValue: 1.2, + }, + { + Attribute: "test:type=Cat,name=tomas,attr=Name", + + ValueType: nrprotocol.ValueType_STRING, + StringValue: "tomas", + }, } - assert.EqualValues(t, result, expected) + assert.Equal(t, expected, actual) } func Test_URL_Success(t *testing.T) { diff --git a/src/go/protocol/GoUnusedProtection__.go b/src/go/nrprotocol/GoUnusedProtection__.go similarity index 88% rename from src/go/protocol/GoUnusedProtection__.go rename to src/go/nrprotocol/GoUnusedProtection__.go index 7acc656e..00597c95 100644 --- a/src/go/protocol/GoUnusedProtection__.go +++ b/src/go/nrprotocol/GoUnusedProtection__.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (0.13.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package protocol +package nrprotocol var GoUnusedProtection__ int; diff --git a/src/go/nrprotocol/convertor.go b/src/go/nrprotocol/convertor.go new file mode 100644 index 00000000..6d91c86c --- /dev/null +++ b/src/go/nrprotocol/convertor.go @@ -0,0 +1,18 @@ +package nrprotocol + +import "fmt" + +func (j *JMXAttribute) GetValue() interface{} { + switch j.ValueType { + case ValueType_BOOL: + return j.GetBoolValue() + case ValueType_STRING: + return j.GetStringValue() + case ValueType_DOUBLE: + return j.GetDoubleValue() + case ValueType_INT: + return j.GetIntValue() + default: + panic(fmt.Sprintf("unkown value type: %v", j.ValueType)) + } +} diff --git a/src/go/nrprotocol/convertor_test.go b/src/go/nrprotocol/convertor_test.go new file mode 100644 index 00000000..323db7b2 --- /dev/null +++ b/src/go/nrprotocol/convertor_test.go @@ -0,0 +1,78 @@ +package nrprotocol + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_Convert_Success(t *testing.T) { + + testCases := []struct { + name string + jmxAttr *JMXAttribute + expected interface{} + }{ + { + name: "Double Value", + jmxAttr: &JMXAttribute{ + Attribute: "test:type=Cat,name=tomas,attr=FloatValue", + AttributeValue: &JMXAttributeValue{ + ValueType: ValueType_DOUBLE, + DoubleValue: 2.222222, + }, + }, + expected: float64(2.222222), + }, + { + name: "Number Value", + jmxAttr: &JMXAttribute{ + Attribute: "test:type=Cat,name=tomas,attr=NumberValue", + AttributeValue: &JMXAttributeValue{ + ValueType: ValueType_INT, + IntValue: 3, + }, + }, + expected: int64(3), + }, + { + name: "Bool Value", + jmxAttr: &JMXAttribute{ + Attribute: "test:type=Cat,name=tomas,attr=BoolValue", + AttributeValue: &JMXAttributeValue{ + ValueType: ValueType_BOOL, + BoolValue: true, + }, + }, + expected: bool(true), + }, + { + name: "Double Value", + jmxAttr: &JMXAttribute{ + Attribute: "test:type=Cat,name=tomas,attr=DoubleValue", + AttributeValue: &JMXAttributeValue{ + ValueType: ValueType_DOUBLE, + DoubleValue: 1.2, + }, + }, + expected: float64(1.2), + }, + { + name: "String Value", + jmxAttr: &JMXAttribute{ + Attribute: "test:type=Cat,name=tomas,attr=Name", + AttributeValue: &JMXAttributeValue{ + ValueType: ValueType_STRING, + StringValue: "tomas", + }, + }, + expected: string("tomas"), + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + assert.Equal(t, testCase.expected, testCase.jmxAttr.GetAttributeValue().GetValue()) + }) + } +} diff --git a/src/go/protocol/j_m_x_service-remote/j_m_x_service-remote.go b/src/go/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go similarity index 85% rename from src/go/protocol/j_m_x_service-remote/j_m_x_service-remote.go rename to src/go/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go index 2f67ed64..026fba96 100755 --- a/src/go/protocol/j_m_x_service-remote/j_m_x_service-remote.go +++ b/src/go/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go @@ -14,10 +14,10 @@ import ( "strconv" "strings" "github.com/apache/thrift/lib/go/thrift" - "protocol" + "github.com/newrelic/nrjmx/nrprotocol" ) -var _ = protocol.GoUnusedProtection__ +var _ = nrprotocol.GoUnusedProtection__ func Usage() { fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") @@ -26,6 +26,7 @@ func Usage() { fmt.Fprintln(os.Stderr, " bool connect(JMXConfig config)") fmt.Fprintln(os.Stderr, " void disconnect()") fmt.Fprintln(os.Stderr, " queryMbean(string beanName)") + fmt.Fprintln(os.Stderr, " queryMbean2(string beanName)") fmt.Fprintln(os.Stderr, " getLogs()") fmt.Fprintln(os.Stderr) os.Exit(0) @@ -141,7 +142,7 @@ func main() { } iprot := protocolFactory.GetProtocol(trans) oprot := protocolFactory.GetProtocol(trans) - client := protocol.NewJMXServiceClient(thrift.NewTStandardClient(iprot, oprot)) + client := nrprotocol.NewJMXServiceClient(thrift.NewTStandardClient(iprot, oprot)) if err := trans.Open(); err != nil { fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) os.Exit(1) @@ -153,19 +154,19 @@ func main() { fmt.Fprintln(os.Stderr, "Connect requires 1 args") flag.Usage() } - arg12 := flag.Arg(1) - mbTrans13 := thrift.NewTMemoryBufferLen(len(arg12)) - defer mbTrans13.Close() - _, err14 := mbTrans13.WriteString(arg12) - if err14 != nil { + arg16 := flag.Arg(1) + mbTrans17 := thrift.NewTMemoryBufferLen(len(arg16)) + defer mbTrans17.Close() + _, err18 := mbTrans17.WriteString(arg16) + if err18 != nil { Usage() return } - factory15 := thrift.NewTJSONProtocolFactory() - jsProt16 := factory15.GetProtocol(mbTrans13) - argvalue0 := protocol.NewJMXConfig() - err17 := argvalue0.Read(jsProt16) - if err17 != nil { + factory19 := thrift.NewTJSONProtocolFactory() + jsProt20 := factory19.GetProtocol(mbTrans17) + argvalue0 := nrprotocol.NewJMXConfig() + err21 := argvalue0.Read(jsProt20) + if err21 != nil { Usage() return } @@ -191,6 +192,16 @@ func main() { fmt.Print(client.QueryMbean(context.Background(), value0)) fmt.Print("\n") break + case "queryMbean2": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "QueryMbean2 requires 1 args") + flag.Usage() + } + argvalue0 := flag.Arg(1) + value0 := argvalue0 + fmt.Print(client.QueryMbean2(context.Background(), value0)) + fmt.Print("\n") + break case "getLogs": if flag.NArg() - 1 != 0 { fmt.Fprintln(os.Stderr, "GetLogs requires 0 args") diff --git a/src/go/protocol/nrjmx-consts.go b/src/go/nrprotocol/nrjmx-consts.go similarity index 95% rename from src/go/protocol/nrjmx-consts.go rename to src/go/nrprotocol/nrjmx-consts.go index ce79d8f7..53cf3e75 100644 --- a/src/go/protocol/nrjmx-consts.go +++ b/src/go/nrprotocol/nrjmx-consts.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (0.13.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package protocol +package nrprotocol import( "bytes" diff --git a/src/go/protocol/nrjmx.go b/src/go/nrprotocol/nrjmx.go similarity index 84% rename from src/go/protocol/nrjmx.go rename to src/go/nrprotocol/nrjmx.go index 81c674ad..af675158 100644 --- a/src/go/protocol/nrjmx.go +++ b/src/go/nrprotocol/nrjmx.go @@ -1,7 +1,7 @@ // Autogenerated by Thrift Compiler (0.13.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -package protocol +package nrprotocol import( "bytes" @@ -567,44 +567,50 @@ func (p *JMXConfig) String() string { } // Attributes: +// - Attribute // - ValueType // - StringValue // - DoubleValue // - IntValue // - BoolValue -type JMXAttributeValue struct { - ValueType ValueType `thrift:"valueType,1" db:"valueType" json:"valueType"` - StringValue string `thrift:"stringValue,2" db:"stringValue" json:"stringValue"` - DoubleValue float64 `thrift:"doubleValue,3" db:"doubleValue" json:"doubleValue"` - IntValue int64 `thrift:"intValue,4" db:"intValue" json:"intValue"` - BoolValue bool `thrift:"boolValue,5" db:"boolValue" json:"boolValue"` +type JMXAttribute struct { + Attribute string `thrift:"attribute,1" db:"attribute" json:"attribute"` + ValueType ValueType `thrift:"valueType,2" db:"valueType" json:"valueType"` + StringValue string `thrift:"stringValue,3" db:"stringValue" json:"stringValue"` + DoubleValue float64 `thrift:"doubleValue,4" db:"doubleValue" json:"doubleValue"` + IntValue int64 `thrift:"intValue,5" db:"intValue" json:"intValue"` + BoolValue bool `thrift:"boolValue,6" db:"boolValue" json:"boolValue"` } -func NewJMXAttributeValue() *JMXAttributeValue { - return &JMXAttributeValue{} +func NewJMXAttribute() *JMXAttribute { + return &JMXAttribute{} } -func (p *JMXAttributeValue) GetValueType() ValueType { +func (p *JMXAttribute) GetAttribute() string { + return p.Attribute +} + +func (p *JMXAttribute) GetValueType() ValueType { return p.ValueType } -func (p *JMXAttributeValue) GetStringValue() string { +func (p *JMXAttribute) GetStringValue() string { return p.StringValue } -func (p *JMXAttributeValue) GetDoubleValue() float64 { +func (p *JMXAttribute) GetDoubleValue() float64 { return p.DoubleValue } -func (p *JMXAttributeValue) GetIntValue() int64 { +func (p *JMXAttribute) GetIntValue() int64 { return p.IntValue } -func (p *JMXAttributeValue) GetBoolValue() bool { +func (p *JMXAttribute) GetBoolValue() bool { return p.BoolValue } -func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { +func (p *JMXAttribute) Read(iprot thrift.TProtocol) error { if _, err := iprot.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } @@ -618,7 +624,7 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { if fieldTypeId == thrift.STOP { break; } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { if err := p.ReadField1(iprot); err != nil { return err } @@ -628,7 +634,7 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I32 { if err := p.ReadField2(iprot); err != nil { return err } @@ -638,7 +644,7 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { } } case 3: - if fieldTypeId == thrift.DOUBLE { + if fieldTypeId == thrift.STRING { if err := p.ReadField3(iprot); err != nil { return err } @@ -648,7 +654,7 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { } } case 4: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.DOUBLE { if err := p.ReadField4(iprot); err != nil { return err } @@ -658,7 +664,7 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { } } case 5: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.I64 { if err := p.ReadField5(iprot); err != nil { return err } @@ -667,6 +673,16 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { return err } } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } default: if err := iprot.Skip(fieldTypeId); err != nil { return err @@ -682,9 +698,18 @@ func (p *JMXAttributeValue) Read(iprot thrift.TProtocol) error { return nil } -func (p *JMXAttributeValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *JMXAttribute) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { return thrift.PrependError("error reading field 1: ", err) +} else { + p.Attribute = v +} + return nil +} + +func (p *JMXAttribute) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) } else { temp := ValueType(v) p.ValueType = temp @@ -692,44 +717,44 @@ func (p *JMXAttributeValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *JMXAttributeValue) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXAttribute) ReadField3(iprot thrift.TProtocol) error { if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) + return thrift.PrependError("error reading field 3: ", err) } else { p.StringValue = v } return nil } -func (p *JMXAttributeValue) ReadField3(iprot thrift.TProtocol) error { +func (p *JMXAttribute) ReadField4(iprot thrift.TProtocol) error { if v, err := iprot.ReadDouble(); err != nil { - return thrift.PrependError("error reading field 3: ", err) + return thrift.PrependError("error reading field 4: ", err) } else { p.DoubleValue = v } return nil } -func (p *JMXAttributeValue) ReadField4(iprot thrift.TProtocol) error { +func (p *JMXAttribute) ReadField5(iprot thrift.TProtocol) error { if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) + return thrift.PrependError("error reading field 5: ", err) } else { p.IntValue = v } return nil } -func (p *JMXAttributeValue) ReadField5(iprot thrift.TProtocol) error { +func (p *JMXAttribute) ReadField6(iprot thrift.TProtocol) error { if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 5: ", err) + return thrift.PrependError("error reading field 6: ", err) } else { p.BoolValue = v } return nil } -func (p *JMXAttributeValue) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("JMXAttributeValue"); err != nil { +func (p *JMXAttribute) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("JMXAttribute"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { if err := p.writeField1(oprot); err != nil { return err } @@ -737,6 +762,7 @@ func (p *JMXAttributeValue) Write(oprot thrift.TProtocol) error { if err := p.writeField3(oprot); err != nil { return err } if err := p.writeField4(oprot); err != nil { return err } if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } } if err := oprot.WriteFieldStop(); err != nil { return thrift.PrependError("write field stop error: ", err) } @@ -745,187 +771,63 @@ func (p *JMXAttributeValue) Write(oprot thrift.TProtocol) error { return nil } -func (p *JMXAttributeValue) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("valueType", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:valueType: ", p), err) } +func (p *JMXAttribute) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("attribute", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:attribute: ", p), err) } + if err := oprot.WriteString(string(p.Attribute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.attribute (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:attribute: ", p), err) } + return err +} + +func (p *JMXAttribute) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("valueType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueType: ", p), err) } if err := oprot.WriteI32(int32(p.ValueType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.valueType (1) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.valueType (2) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:valueType: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueType: ", p), err) } return err } -func (p *JMXAttributeValue) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) } +func (p *JMXAttribute) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stringValue: ", p), err) } if err := oprot.WriteString(string(p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.stringValue (3) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stringValue: ", p), err) } return err } -func (p *JMXAttributeValue) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("doubleValue", thrift.DOUBLE, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:doubleValue: ", p), err) } +func (p *JMXAttribute) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("doubleValue", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:doubleValue: ", p), err) } if err := oprot.WriteDouble(float64(p.DoubleValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.doubleValue (3) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.doubleValue (4) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:doubleValue: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:doubleValue: ", p), err) } return err } -func (p *JMXAttributeValue) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("intValue", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:intValue: ", p), err) } +func (p *JMXAttribute) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("intValue", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:intValue: ", p), err) } if err := oprot.WriteI64(int64(p.IntValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.intValue (4) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.intValue (5) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:intValue: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:intValue: ", p), err) } return err } -func (p *JMXAttributeValue) writeField5(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("boolValue", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:boolValue: ", p), err) } +func (p *JMXAttribute) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("boolValue", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:boolValue: ", p), err) } if err := oprot.WriteBool(bool(p.BoolValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.boolValue (5) field write error: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T.boolValue (6) field write error: ", p), err) } if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:boolValue: ", p), err) } - return err -} - -func (p *JMXAttributeValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("JMXAttributeValue(%+v)", *p) -} - -// Attributes: -// - Attribute -// - Value -type JMXAttribute struct { - Attribute string `thrift:"attribute,1" db:"attribute" json:"attribute"` - Value *JMXAttributeValue `thrift:"value,2" db:"value" json:"value"` -} - -func NewJMXAttribute() *JMXAttribute { - return &JMXAttribute{} -} - - -func (p *JMXAttribute) GetAttribute() string { - return p.Attribute -} -var JMXAttribute_Value_DEFAULT *JMXAttributeValue -func (p *JMXAttribute) GetValue() *JMXAttributeValue { - if !p.IsSetValue() { - return JMXAttribute_Value_DEFAULT - } -return p.Value -} -func (p *JMXAttribute) IsSetValue() bool { - return p.Value != nil -} - -func (p *JMXAttribute) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *JMXAttribute) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Attribute = v -} - return nil -} - -func (p *JMXAttribute) ReadField2(iprot thrift.TProtocol) error { - p.Value = &JMXAttributeValue{} - if err := p.Value.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) - } - return nil -} - -func (p *JMXAttribute) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("JMXAttribute"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *JMXAttribute) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("attribute", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:attribute: ", p), err) } - if err := oprot.WriteString(string(p.Attribute)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.attribute (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:attribute: ", p), err) } - return err -} - -func (p *JMXAttribute) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } - if err := p.Value.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:boolValue: ", p), err) } return err } @@ -1306,6 +1208,9 @@ type JMXService interface { // Parameters: // - BeanName QueryMbean(ctx context.Context, beanName string) (r []*JMXAttribute, err error) + // Parameters: + // - BeanName + QueryMbean2(ctx context.Context, beanName string) (r map[string]string, err error) GetLogs(ctx context.Context) (r []*LogMessage, err error) } @@ -1386,15 +1291,34 @@ func (p *JMXServiceClient) QueryMbean(ctx context.Context, beanName string) (r [ return _result5.GetSuccess(), nil } -func (p *JMXServiceClient) GetLogs(ctx context.Context) (r []*LogMessage, err error) { - var _args6 JMXServiceGetLogsArgs - var _result7 JMXServiceGetLogsResult - if err = p.Client_().Call(ctx, "getLogs", &_args6, &_result7); err != nil { +// Parameters: +// - BeanName +func (p *JMXServiceClient) QueryMbean2(ctx context.Context, beanName string) (r map[string]string, err error) { + var _args6 JMXServiceQueryMbean2Args + _args6.BeanName = beanName + var _result7 JMXServiceQueryMbean2Result + if err = p.Client_().Call(ctx, "queryMbean2", &_args6, &_result7); err != nil { return } + switch { + case _result7.ConnErr!= nil: + return r, _result7.ConnErr + case _result7.JmxErr!= nil: + return r, _result7.JmxErr + } + return _result7.GetSuccess(), nil } +func (p *JMXServiceClient) GetLogs(ctx context.Context) (r []*LogMessage, err error) { + var _args8 JMXServiceGetLogsArgs + var _result9 JMXServiceGetLogsResult + if err = p.Client_().Call(ctx, "getLogs", &_args8, &_result9); err != nil { + return + } + return _result9.GetSuccess(), nil +} + type JMXServiceProcessor struct { processorMap map[string]thrift.TProcessorFunction handler JMXService @@ -1415,12 +1339,13 @@ func (p *JMXServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunctio func NewJMXServiceProcessor(handler JMXService) *JMXServiceProcessor { - self8 := &JMXServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self8.processorMap["connect"] = &jMXServiceProcessorConnect{handler:handler} - self8.processorMap["disconnect"] = &jMXServiceProcessorDisconnect{handler:handler} - self8.processorMap["queryMbean"] = &jMXServiceProcessorQueryMbean{handler:handler} - self8.processorMap["getLogs"] = &jMXServiceProcessorGetLogs{handler:handler} -return self8 + self10 := &JMXServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self10.processorMap["connect"] = &jMXServiceProcessorConnect{handler:handler} + self10.processorMap["disconnect"] = &jMXServiceProcessorDisconnect{handler:handler} + self10.processorMap["queryMbean"] = &jMXServiceProcessorQueryMbean{handler:handler} + self10.processorMap["queryMbean2"] = &jMXServiceProcessorQueryMbean2{handler:handler} + self10.processorMap["getLogs"] = &jMXServiceProcessorGetLogs{handler:handler} +return self10 } func (p *JMXServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { @@ -1431,12 +1356,12 @@ func (p *JMXServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.T } iprot.Skip(thrift.STRUCT) iprot.ReadMessageEnd() - x9 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + x11 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x9.Write(oprot) + x11.Write(oprot) oprot.WriteMessageEnd() oprot.Flush(ctx) - return false, x9 + return false, x11 } @@ -1600,6 +1525,61 @@ var retval []*JMXAttribute return true, err } +type jMXServiceProcessorQueryMbean2 struct { + handler JMXService +} + +func (p *jMXServiceProcessorQueryMbean2) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := JMXServiceQueryMbean2Args{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryMbean2", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := JMXServiceQueryMbean2Result{} +var retval map[string]string + var err2 error + if retval, err2 = p.handler.QueryMbean2(ctx, args.BeanName); err2 != nil { + switch v := err2.(type) { + case *JMXConnectionError: + result.ConnErr = v + case *JMXError: + result.JmxErr = v + default: + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryMbean2: " + err2.Error()) + oprot.WriteMessageBegin("queryMbean2", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } + } else { + result.Success = retval +} + if err2 = oprot.WriteMessageBegin("queryMbean2", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type jMXServiceProcessorGetLogs struct { handler JMXService } @@ -2292,11 +2272,11 @@ func (p *JMXServiceQueryMbeanResult) ReadField0(iprot thrift.TProtocol) error { tSlice := make([]*JMXAttribute, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { - _elem10 := &JMXAttribute{} - if err := _elem10.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + _elem12 := &JMXAttribute{} + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) } - p.Success = append(p.Success, _elem10) + p.Success = append(p.Success, _elem12) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) @@ -2389,6 +2369,314 @@ func (p *JMXServiceQueryMbeanResult) String() string { return fmt.Sprintf("JMXServiceQueryMbeanResult(%+v)", *p) } +// Attributes: +// - BeanName +type JMXServiceQueryMbean2Args struct { + BeanName string `thrift:"beanName,1" db:"beanName" json:"beanName"` +} + +func NewJMXServiceQueryMbean2Args() *JMXServiceQueryMbean2Args { + return &JMXServiceQueryMbean2Args{} +} + + +func (p *JMXServiceQueryMbean2Args) GetBeanName() string { + return p.BeanName +} +func (p *JMXServiceQueryMbean2Args) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JMXServiceQueryMbean2Args) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.BeanName = v +} + return nil +} + +func (p *JMXServiceQueryMbean2Args) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryMbean2_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *JMXServiceQueryMbean2Args) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("beanName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:beanName: ", p), err) } + if err := oprot.WriteString(string(p.BeanName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.beanName (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:beanName: ", p), err) } + return err +} + +func (p *JMXServiceQueryMbean2Args) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("JMXServiceQueryMbean2Args(%+v)", *p) +} + +// Attributes: +// - Success +// - ConnErr +// - JmxErr +type JMXServiceQueryMbean2Result struct { + Success map[string]string `thrift:"success,0" db:"success" json:"success,omitempty"` + ConnErr *JMXConnectionError `thrift:"connErr,1" db:"connErr" json:"connErr,omitempty"` + JmxErr *JMXError `thrift:"jmxErr,2" db:"jmxErr" json:"jmxErr,omitempty"` +} + +func NewJMXServiceQueryMbean2Result() *JMXServiceQueryMbean2Result { + return &JMXServiceQueryMbean2Result{} +} + +var JMXServiceQueryMbean2Result_Success_DEFAULT map[string]string + +func (p *JMXServiceQueryMbean2Result) GetSuccess() map[string]string { + return p.Success +} +var JMXServiceQueryMbean2Result_ConnErr_DEFAULT *JMXConnectionError +func (p *JMXServiceQueryMbean2Result) GetConnErr() *JMXConnectionError { + if !p.IsSetConnErr() { + return JMXServiceQueryMbean2Result_ConnErr_DEFAULT + } +return p.ConnErr +} +var JMXServiceQueryMbean2Result_JmxErr_DEFAULT *JMXError +func (p *JMXServiceQueryMbean2Result) GetJmxErr() *JMXError { + if !p.IsSetJmxErr() { + return JMXServiceQueryMbean2Result_JmxErr_DEFAULT + } +return p.JmxErr +} +func (p *JMXServiceQueryMbean2Result) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *JMXServiceQueryMbean2Result) IsSetConnErr() bool { + return p.ConnErr != nil +} + +func (p *JMXServiceQueryMbean2Result) IsSetJmxErr() bool { + return p.JmxErr != nil +} + +func (p *JMXServiceQueryMbean2Result) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.MAP { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JMXServiceQueryMbean2Result) ReadField0(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Success = tMap + for i := 0; i < size; i ++ { +var _key13 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key13 = v +} +var _val14 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val14 = v +} + p.Success[_key13] = _val14 + } + if err := iprot.ReadMapEnd(); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *JMXServiceQueryMbean2Result) ReadField1(iprot thrift.TProtocol) error { + p.ConnErr = &JMXConnectionError{} + if err := p.ConnErr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) + } + return nil +} + +func (p *JMXServiceQueryMbean2Result) ReadField2(iprot thrift.TProtocol) error { + p.JmxErr = &JMXError{} + if err := p.JmxErr.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) + } + return nil +} + +func (p *JMXServiceQueryMbean2Result) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryMbean2_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *JMXServiceQueryMbean2Result) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Success)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Success { + if err := oprot.WriteString(string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *JMXServiceQueryMbean2Result) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetConnErr() { + if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:connErr: ", p), err) } + if err := p.ConnErr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } + } + return err +} + +func (p *JMXServiceQueryMbean2Result) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetJmxErr() { + if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:jmxErr: ", p), err) } + if err := p.JmxErr.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } + } + return err +} + +func (p *JMXServiceQueryMbean2Result) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("JMXServiceQueryMbean2Result(%+v)", *p) +} + type JMXServiceGetLogsArgs struct { } @@ -2505,11 +2793,11 @@ func (p *JMXServiceGetLogsResult) ReadField0(iprot thrift.TProtocol) error { tSlice := make([]*LogMessage, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { - _elem11 := &LogMessage{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + _elem15 := &LogMessage{} + if err := _elem15.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem15), err) } - p.Success = append(p.Success, _elem11) + p.Success = append(p.Success, _elem15) } if err := iprot.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) diff --git a/src/go/process.go b/src/go/process.go new file mode 100644 index 00000000..1f972f78 --- /dev/null +++ b/src/go/process.go @@ -0,0 +1,111 @@ +package nrjmx + +import ( + "bufio" + "context" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "time" +) + +var bufferSize = 4 * 1024 // initial 4KB per line. +var defaultNrjmxExec = "/usr/local/bin/nrjmx" + +func getNrjmxExec() string { + if os.Getenv("NR_JMX_TOOL") != "" { + return os.Getenv("NR_JMX_TOOL") + } + return defaultNrjmxExec +} + +// var defaultNrjmxExec = "/home/cristi/workspace/cppc/java/nrjmx/bin/nrjmx" + +type jmxProcess struct { + cmd *exec.Cmd + ctx context.Context + cancel context.CancelFunc + Stdout io.ReadCloser + Stdin io.WriteCloser + Stderr io.ReadCloser +} + +func startJMXProcess(ctx context.Context) (*jmxProcess, error) { + ctx, cancel := context.WithCancel(ctx) + + cmd := exec.CommandContext(ctx, filepath.Clean(getNrjmxExec()), "-v2") + + stdout, err := cmd.StdoutPipe() + if err != nil { + return nil, fmt.Errorf("failed to create stdout pipe to %q: %v", cmd.Path, err) + } + + stdin, err := cmd.StdinPipe() + if err != nil { + return nil, fmt.Errorf("failed to create stdin pipe to %q: %v", cmd.Path, err) + } + + stderr, err := cmd.StderrPipe() + if err != nil { + return nil, fmt.Errorf("failed to create stderr pipe to %q: %v", cmd.Path, err) + } + + go func() { + reader := bufio.NewReaderSize(stderr, bufferSize) + + for { + select { + case <-ctx.Done(): + return + default: + break + } + + line, err := reader.ReadString('\n') + // API needs re to allow stderr full read before closing + if err != nil { + if _, isAlreadyClosed := err.(*os.PathError); !isAlreadyClosed && err != io.EOF { + fmt.Fprintf(os.Stderr, "error while reading stderr: '%v'", err) + continue + } + return + } + fmt.Fprint(os.Stderr, line) + } + }() + + if err := cmd.Start(); err != nil { + return nil, fmt.Errorf("failed to start %q: %v", cmd.Path, err) + } + + return &jmxProcess{ + Stdout: stdout, + Stdin: stdin, + Stderr: stderr, + cmd: cmd, + ctx: ctx, + cancel: cancel, + }, nil +} + +func (p *jmxProcess) stop(timeout time.Duration) error { + var errors error + + if err := p.Stdout.Close(); err != nil { + errors = fmt.Errorf("failed to detach stdout from %q: %w", p.cmd.Path, err) + } + if err := p.Stdin.Close(); err != nil { + errors = fmt.Errorf("failed to detach stdin from %q: %w", p.cmd.Path, err) + } + if err := p.Stderr.Close(); err != nil { + errors = fmt.Errorf("failed to detach stder from %q: %w", p.cmd.Path, err) + } + p.cancel() + err := p.cmd.Wait() + if err != nil { + errors = fmt.Errorf("command failed %q: %w", p.cmd.Path, err) + } + return errors +} diff --git a/src/main/java/org/newrelic/nrjmx/Application.java b/src/main/java/org/newrelic/nrjmx/Application.java index b1e92b82..bf99cd4e 100644 --- a/src/main/java/org/newrelic/nrjmx/Application.java +++ b/src/main/java/org/newrelic/nrjmx/Application.java @@ -6,7 +6,19 @@ package org.newrelic.nrjmx; import java.util.logging.Logger; + import org.apache.commons.cli.HelpFormatter; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TJSONProtocol; +import org.apache.thrift.server.TServer; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.server.TServer.Args; +import org.newrelic.nrjmx.v2.JMXServiceHandler; +import org.newrelic.nrjmx.v2.StandardIOServer; +import org.newrelic.nrjmx.v2.StandardIOTransportServer; +import org.newrelic.nrjmx.v2.nrprotocol.JMXService; public class Application { @@ -29,6 +41,15 @@ public static void main(String[] args) { System.exit(0); } + if (!cliArgs.isProtocolV2()) { + runV1(cliArgs); + } else { + runV2(cliArgs); + } + + } + + private static void runV1(Arguments cliArgs) { Logger logger = Logger.getLogger("nrjmx"); Logging.setup(logger, cliArgs.isVerbose()); @@ -69,6 +90,20 @@ public static void main(String[] args) { } } + private static void runV2(Arguments cliArgs) { + JMXServiceHandler handler = new JMXServiceHandler(); + TProcessor processor = new JMXService.Processor(handler); + + TServerTransport serverTransport = new StandardIOTransportServer(); + TServer server = new StandardIOServer( + new Args(serverTransport).processor(processor).protocolFactory(new TCompactProtocol.Factory())); + + handler.addServer(server); + server.serve(); + + serverTransport.close(); + } + private static void logTrace(Arguments cliArgs, Logger logger, Exception e) { if (cliArgs.isDebugMode()) { logger.info("exception trace for " + e.getClass().getCanonicalName() + ": " + e); diff --git a/src/main/java/org/newrelic/nrjmx/Arguments.java b/src/main/java/org/newrelic/nrjmx/Arguments.java index fdbadb9c..5c4bf34e 100644 --- a/src/main/java/org/newrelic/nrjmx/Arguments.java +++ b/src/main/java/org/newrelic/nrjmx/Arguments.java @@ -24,6 +24,7 @@ class Arguments { private String keyStorePassword; private String trustStore; private String trustStorePassword; + private boolean protocolV2; private boolean verbose; private boolean debug; private boolean isRemoteJMX; @@ -35,6 +36,10 @@ private Arguments() {} static Options options() { if (options == null) { options = new Options(); + Option v2 = + Option.builder("v2").longOpt("protocolV2").desc("Use nrjmx protocol v2").hasArg(false).build(); + options.addOption(v2); + Option connectionURL = Option.builder("C") .longOpt("connURL") @@ -116,6 +121,7 @@ static Arguments from(String[] args) throws ParseException { CommandLine cmd = new DefaultParser().parse(options(), args); Arguments argsObj = new Arguments(); + argsObj.protocolV2 = cmd.hasOption("protocolV2"); argsObj.connectionURL = cmd.getOptionValue("connURL", ""); argsObj.hostname = cmd.getOptionValue("hostname", "localhost"); argsObj.port = Integer.parseInt(cmd.getOptionValue("port", "7199")); @@ -134,6 +140,10 @@ static Arguments from(String[] args) throws ParseException { return argsObj; } + Boolean isProtocolV2() { + return protocolV2; + } + String getConnectionURL() { return connectionURL; } diff --git a/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher copy.java b/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher copy.java new file mode 100644 index 00000000..7b26db56 --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher copy.java @@ -0,0 +1,478 @@ +package org.newrelic.nrjmx.v2; + +/* +* Copyright 2020 New Relic Corporation. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +*/ + +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.logging.Logger; + +import javax.management.Attribute; +import javax.management.InstanceNotFoundException; +import javax.management.IntrospectionException; +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanInfo; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectInstance; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.openmbean.CompositeData; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.rmi.ssl.SslRMIClientSocketFactory; + +import org.newrelic.nrjmx.v2.nrprotocol.JMXAttribute; +import org.newrelic.nrjmx.v2.nrprotocol.JMXAttributeValue; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConfig; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConnectionError; +import org.newrelic.nrjmx.v2.nrprotocol.JMXError; +import org.newrelic.nrjmx.v2.nrprotocol.LogMessage; +import org.newrelic.nrjmx.v2.nrprotocol.ValueType; + +/** + * JMXFetcher class reads queries from an InputStream (usually stdin) and sends + * the results to an OutputStream (usually stdout) + */ +public class JMXFetcher { + public static final String defaultURIPath = "jmxrmi"; + public static final Boolean defaultJBossModeIsStandalone = false; + + private static final Logger logger = Logger.getLogger("nrjmx"); + + private List logs = new ArrayList<>(); + + private MBeanServerConnection connection; + private List result = new ArrayList<>(); + private String connectionString; + private Map connectionEnv = new HashMap<>(); + + public class QueryError extends Exception { + public QueryError(String message, Exception cause) { + super(message, cause); + } + } + + public class ValueError extends Exception { + public ValueError(String message) { + super(message); + } + } + + public boolean connect() throws JMXConnectionError { + + try { + JMXServiceURL address = new JMXServiceURL(connectionString); + + JMXConnector connector = JMXConnectorFactory.connect(address, connectionEnv); + + this.connection = connector.getMBeanServerConnection(); + } catch (Exception e) { + String message = String.format("Can't connect to JMX server: '%s', error: '%s'", connectionString, + e.getMessage()); + throw new JMXConnectionError(1, message); + } + + return true; + } + + public boolean StringIsNullOrEmpty(String value) { + return value == null || value.equals(""); + } + + public JMXFetcher(JMXConfig jmxConfig) { + if (jmxConfig.connectionURL != null && !jmxConfig.connectionURL.equals("")) { + connectionString = jmxConfig.connectionURL; + } else { + // Official doc for remoting v3 is not available, see: + // - https://developer.jboss.org/thread/196619 + // - http://jbossremoting.jboss.org/documentation/v3.html + // Some doc on URIS at: + // - + // https://github.com/jboss-remoting/jboss-remoting/blob/master/src/main/java/org/jboss/remoting3/EndpointImpl.java#L292-L304 + // - https://stackoverflow.com/questions/42970921/what-is-http-remoting-protocol + // - + // http://www.mastertheboss.com/jboss-server/jboss-monitoring/using-jconsole-to-monitor-a-remote-wildfly-server + String uriPath = jmxConfig.uriPath; + if (jmxConfig.isRemote) { + if (defaultURIPath.equals(uriPath)) { + uriPath = ""; + } else { + uriPath = uriPath.concat("/"); + } + String remoteProtocol = "remote"; + if (jmxConfig.isJBossStandaloneMode) { + remoteProtocol = "remote+http"; + } + connectionString = + String.format("service:jmx:%s://%s:%s%s", remoteProtocol, jmxConfig.hostname, jmxConfig.port, uriPath); + } else { + connectionString = + String.format("service:jmx:rmi:///jndi/rmi://%s:%s/%s", jmxConfig.hostname, jmxConfig.port, uriPath); + } + } + + if (!"".equals(jmxConfig.username)) { + connectionEnv.put(JMXConnector.CREDENTIALS, new String[] {jmxConfig.username, jmxConfig.password}); + } + + if (!"".equals(jmxConfig.keyStore) && !"".equals(jmxConfig.trustStore)) { + Properties p = System.getProperties(); + p.put("javax.net.ssl.keyStore", jmxConfig.keyStore); + p.put("javax.net.ssl.keyStorePassword", jmxConfig.keyStorePassword); + p.put("javax.net.ssl.trustStore", jmxConfig.trustStore); + p.put("javax.net.ssl.trustStorePassword", jmxConfig.trustStorePassword); + connectionEnv.put("com.sun.jndi.rmi.factory.socket", new SslRMIClientSocketFactory()); + } + } + + public List getLogs() { + List result = this.logs; + this.logs = new ArrayList(); + return result; + } + + public List queryMbean(String beanName) throws JMXError { + + try { + Set beanInstances; + // try { + + + + beanInstances = query(beanName); + + // } catch (JMXFetcher.QueryError e) { + // // logger.warning(e.getMessage()); + // // logger.log(Level.FINE, e.getMessage(), e); + // return null; + // } + + for (ObjectInstance instance : beanInstances) { + // try { + queryAttributes(instance); + + // } catch (JMXFetcher.QueryError e) { + // // logger.warning(e.getMessage()); + // // logger.log(Level.FINE, e.getMessage(), e); + // } + } + try { + + return popResults(); + } catch (IllegalArgumentException e) { + + } + + // List result = new ArrayList<>(); + + // JMXAttribute a1 = new JMXAttribute(); + // a1.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=authenticationRetries"; + // a1.valueType = ValueType.INT; + // a1.intValue = 3; + // result.add(a1); + + // JMXAttribute a2 = new JMXAttribute(); + // a2.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=heartbeatInterval"; + // a2.valueType = ValueType.INT; + // a2.intValue = 6000; + // result.add(a2); + + // JMXAttribute a3 = new JMXAttribute(); + // a3.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundChannels"; + // a3.valueType = ValueType.INT; + // a3.intValue = 40; + // result.add(a3); + + // JMXAttribute a4 = new JMXAttribute(); + // a4.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessageSize"; + // a4.valueType = ValueType.INT; + // a4.intValue = Long.parseLong("9223372036854775807"); + // result.add(a4); + + // JMXAttribute a5 = new JMXAttribute(); + // a5.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessages"; + // a5.valueType = ValueType.INT; + // a5.intValue = 80; + // result.add(a5); + + // JMXAttribute a6 = new JMXAttribute(); + // a6.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundChannels"; + // a6.valueType = ValueType.INT; + // a6.intValue = 80; + // result.add(a6); + + // JMXAttribute a7 = new JMXAttribute(); + // a7.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessageSize"; + // a7.valueType = ValueType.INT; + // a7.intValue = Long.parseLong("9223372036854775807"); + // result.add(a7); + + // JMXAttribute a8 = new JMXAttribute(); + // a8.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessages"; + // a8.valueType = ValueType.INT; + // a8.intValue = 65535; + // result.add(a8); + + // JMXAttribute a9 = new JMXAttribute(); + // a9.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveBufferSize"; + // a9.valueType = ValueType.INT; + // a9.intValue = 8192; + // result.add(a9); + + // JMXAttribute a10 = new JMXAttribute(); + // a10.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveWindowSize"; + // a10.valueType = ValueType.INT; + // a10.intValue = 131072; + // result.add(a10); + + // JMXAttribute a11 = new JMXAttribute(); + // a11.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=saslProtocol"; + // a11.valueType = ValueType.STRING; + // a11.stringValue = "remote"; + // result.add(a11); + + // JMXAttribute a12 = new JMXAttribute(); + // a12.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=sendBufferSize"; + // a12.valueType = ValueType.INT; + // a12.intValue = 8192; + // result.add(a12); + + // JMXAttribute a13 = new JMXAttribute(); + // a13.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=transmitWindowSize"; + // a13.valueType = ValueType.INT; + // a13.intValue = 131072; + // result.add(a13); + + // JMXAttribute a14 = new JMXAttribute(); + // a14.attribute = "jboss.as:subsystem=remoting,configuration=endpoint,attr=worker"; + // a14.valueType = ValueType.STRING; + // a14.stringValue = "default"; + // result.add(a14); + + return result; + } catch (Exception ex) { + throw new JMXError(ex.getMessage()); + } + + } + + public Map queryMbean2(String beanName) throws JMXError { + + try { + // Set beanInstances; + // // try { + + + + // beanInstances = query(beanName); + + // // } catch (JMXFetcher.QueryError e) { + // // // logger.warning(e.getMessage()); + // // // logger.log(Level.FINE, e.getMessage(), e); + // // return null; + // // } + + // for (ObjectInstance instance : beanInstances) { + // // try { + // queryAttributes(instance); + + // // } catch (JMXFetcher.QueryError e) { + // // // logger.warning(e.getMessage()); + // // // logger.log(Level.FINE, e.getMessage(), e); + // // } + // } + // try { + + // return popResults(); + // } catch (IllegalArgumentException e) { + + // } + + Map results = new HashMap<>(); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=authenticationRetries", "3"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=heartbeatInterval", "6000"); + + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundChannels", "40"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessageSize", "9223372036854775807"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxInboundMessages", "80"); + + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundChannels", "80"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessageSize", "9223372036854775807"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=maxOutboundMessages", "65535"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveBufferSize", "8192"); + + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=receiveWindowSize", "131072"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=saslProtocol", "remote"); + + + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=sendBufferSize", "8192"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=transmitWindowSize", "131072"); + results.put("jboss.as:subsystem=remoting,configuration=endpoint,attr=worker", "default"); + + return results; + } catch (Exception ex) { + throw new JMXError(ex.getMessage()); + } + + } + + private Set query(String beanName) throws QueryError { + ObjectName queryObject; + + try { + queryObject = new ObjectName(beanName); + } catch (MalformedObjectNameException e) { + throw new QueryError("Can't parse bean name " + beanName, e); + } + + Set beanInstances; + try { + beanInstances = connection.queryMBeans(queryObject, null); + } catch (IOException e) { + throw new QueryError("Can't get beans for query " + beanName, e); + } + + return beanInstances; + } + + private void queryAttributes(ObjectInstance instance) throws QueryError, JMXError { + ObjectName objectName = instance.getObjectName(); + MBeanInfo info; + + try { + info = connection.getMBeanInfo(objectName); + } catch (InstanceNotFoundException | IntrospectionException | ReflectionException | IOException e) { + throw new QueryError("Can't find bean " + objectName.toString(), e); + } + + MBeanAttributeInfo[] attrInfo = info.getAttributes(); + + for (MBeanAttributeInfo attr : attrInfo) { + if (!attr.isReadable()) { + continue; + } + + String attrName = attr.getName(); + Object value; + + + try { + value = connection.getAttribute(objectName, attrName); + if (value instanceof Attribute) { + Attribute jmxAttr = (Attribute) value; + value = jmxAttr.getValue(); + } + } catch (Exception e) { + // logger.warning("Can't get attribute " + attrName + " for bean " + + // objectName.toString() + ": " + // + e.getMessage()); + continue; + } + + String name = String.format("%s,attr=%s", objectName.toString(), attrName); + try { + parseValue(name, value); + } catch (ValueError e) { + this.logs.add(new LogMessage(e.getMessage())); + // logger.fine(e.getMessage()); + } + } + } + + private List popResults() { + List out = result; + result = new ArrayList<>(); + return out; + } + + private void parseValue(String name, Object value) throws ValueError { + JMXAttribute attr = new JMXAttribute(); + attr.attribute = name; + + if (value == null) { + throw new ValueError("Found a null value for bean " + name); + } else if (value instanceof java.lang.Double) { + attr.doubleValue = parseDouble((Double) value); + attr.valueType = ValueType.DOUBLE; + result.add(attr); + } else if (value instanceof java.lang.Float) { + attr.doubleValue = parseFloatToDouble((Float) value); + attr.valueType = ValueType.DOUBLE; + result.add(attr); + } else if (value instanceof Number) { + attr.intValue = ((Number) value).longValue(); + attr.valueType = ValueType.INT; + result.add(attr); + } else if (value instanceof String) { + attr.stringValue = (String) value; + attr.valueType = ValueType.STRING; + result.add(attr); + } else if (value instanceof Boolean) { + attr.boolValue = (Boolean) value; + attr.valueType = ValueType.BOOL; + result.add(attr); + } else if (value instanceof CompositeData) { + CompositeData cdata = (CompositeData) value; + Set fieldKeys = cdata.getCompositeType().keySet(); + + for (String field : fieldKeys) { + if (field.length() < 1) + continue; + + String fieldKey = field.substring(0, 1).toUpperCase() + field.substring(1); + parseValue(String.format("%s.%s", name, fieldKey), cdata.get(field)); + } + } else if (value instanceof HashMap) { + // TODO: Process hashmaps + // logger.fine("HashMaps are not supported yet: " + name); + } else if (value instanceof ArrayList || value.getClass().isArray()) { + // TODO: Process arrays + // logger.fine("Arrays are not supported yet: " + name); + } else { + throw new ValueError("Unsuported data type (" + value.getClass() + ") for bean " + name); + } + } + + /** + * XXX: JSON does not support NaN, Infinity, or -Infinity as they come back from + * JMX. So we parse them out to 0, Max Double, and Min Double respectively. + */ + private Double parseDouble(Double value) { + if (value.isNaN()) { + return 0.0; + } else if (value == Double.NEGATIVE_INFINITY) { + return Double.MIN_VALUE; + } else if (value == Double.POSITIVE_INFINITY) { + return Double.MAX_VALUE; + } + + return value; + } + + /** + * XXX: JSON does not support NaN, Infinity, or -Infinity as they come back from + * JMX. So we parse them out to 0, Max Double, and Min Double respectively. + */ + private Double parseFloatToDouble(Float value) { + if (value.isNaN()) { + return 0.0d; + } else if (value == Double.NEGATIVE_INFINITY) { + return Double.MIN_VALUE; + } else if (value == Double.POSITIVE_INFINITY) { + return Double.MAX_VALUE; + } + + return new BigDecimal(value.toString()).doubleValue(); + } +} diff --git a/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher.java b/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher.java new file mode 100644 index 00000000..594e898c --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/JMXFetcher.java @@ -0,0 +1,331 @@ +package org.newrelic.nrjmx.v2; + +/* +* Copyright 2020 New Relic Corporation. All rights reserved. +* SPDX-License-Identifier: Apache-2.0 +*/ + +import java.io.IOException; +import java.math.BigDecimal; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.logging.Logger; + +import javax.management.Attribute; +import javax.management.InstanceNotFoundException; +import javax.management.IntrospectionException; +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanInfo; +import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; +import javax.management.ObjectInstance; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.openmbean.CompositeData; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXServiceURL; +import javax.rmi.ssl.SslRMIClientSocketFactory; + +import org.newrelic.nrjmx.v2.nrprotocol.JMXAttribute; +import org.newrelic.nrjmx.v2.nrprotocol.JMXAttributeValue; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConfig; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConnectionError; +import org.newrelic.nrjmx.v2.nrprotocol.JMXError; +import org.newrelic.nrjmx.v2.nrprotocol.LogMessage; +import org.newrelic.nrjmx.v2.nrprotocol.ValueType; + +/** + * JMXFetcher class reads queries from an InputStream (usually stdin) and sends + * the results to an OutputStream (usually stdout) + */ +public class JMXFetcher { + public static final String defaultURIPath = "jmxrmi"; + public static final Boolean defaultJBossModeIsStandalone = false; + + private static final Logger logger = Logger.getLogger("nrjmx"); + + private List logs = new ArrayList<>(); + + private MBeanServerConnection connection; + private List result = new ArrayList<>(); + private String connectionString; + private Map connectionEnv = new HashMap<>(); + + public class QueryError extends Exception { + public QueryError(String message, Exception cause) { + super(message, cause); + } + } + + public class ValueError extends Exception { + public ValueError(String message) { + super(message); + } + } + + public boolean connect() throws JMXConnectionError { + + try { + JMXServiceURL address = new JMXServiceURL(connectionString); + + JMXConnector connector = JMXConnectorFactory.connect(address, connectionEnv); + + this.connection = connector.getMBeanServerConnection(); + } catch (Exception e) { + String message = String.format("Can't connect to JMX server: '%s', error: '%s'", connectionString, + e.getMessage()); + throw new JMXConnectionError(1, message); + } + + return true; + } + + public boolean StringIsNullOrEmpty(String value) { + return value == null || value.equals(""); + } + + public JMXFetcher(JMXConfig jmxConfig) { + if (jmxConfig.connectionURL != null && !jmxConfig.connectionURL.equals("")) { + connectionString = jmxConfig.connectionURL; + } else { + // Official doc for remoting v3 is not available, see: + // - https://developer.jboss.org/thread/196619 + // - http://jbossremoting.jboss.org/documentation/v3.html + // Some doc on URIS at: + // - + // https://github.com/jboss-remoting/jboss-remoting/blob/master/src/main/java/org/jboss/remoting3/EndpointImpl.java#L292-L304 + // - https://stackoverflow.com/questions/42970921/what-is-http-remoting-protocol + // - + // http://www.mastertheboss.com/jboss-server/jboss-monitoring/using-jconsole-to-monitor-a-remote-wildfly-server + String uriPath = jmxConfig.uriPath; + if (jmxConfig.isRemote) { + if (defaultURIPath.equals(uriPath)) { + uriPath = ""; + } else { + uriPath = uriPath.concat("/"); + } + String remoteProtocol = "remote"; + if (jmxConfig.isJBossStandaloneMode) { + remoteProtocol = "remote+http"; + } + connectionString = + String.format("service:jmx:%s://%s:%s%s", remoteProtocol, jmxConfig.hostname, jmxConfig.port, uriPath); + } else { + connectionString = + String.format("service:jmx:rmi:///jndi/rmi://%s:%s/%s", jmxConfig.hostname, jmxConfig.port, uriPath); + } + } + + if (!"".equals(jmxConfig.username)) { + connectionEnv.put(JMXConnector.CREDENTIALS, new String[] {jmxConfig.username, jmxConfig.password}); + } + + if (!"".equals(jmxConfig.keyStore) && !"".equals(jmxConfig.trustStore)) { + Properties p = System.getProperties(); + p.put("javax.net.ssl.keyStore", jmxConfig.keyStore); + p.put("javax.net.ssl.keyStorePassword", jmxConfig.keyStorePassword); + p.put("javax.net.ssl.trustStore", jmxConfig.trustStore); + p.put("javax.net.ssl.trustStorePassword", jmxConfig.trustStorePassword); + connectionEnv.put("com.sun.jndi.rmi.factory.socket", new SslRMIClientSocketFactory()); + } + } + + public List getLogs() { + List result = this.logs; + this.logs = new ArrayList(); + return result; + } + + public List queryMbean(String beanName) throws JMXError { + + try { + Set beanInstances; + // try { + + + + beanInstances = query(beanName); + + // } catch (JMXFetcher.QueryError e) { + // // logger.warning(e.getMessage()); + // // logger.log(Level.FINE, e.getMessage(), e); + // return null; + // } + + for (ObjectInstance instance : beanInstances) { + // try { + queryAttributes(instance); + + // } catch (JMXFetcher.QueryError e) { + // // logger.warning(e.getMessage()); + // // logger.log(Level.FINE, e.getMessage(), e); + // } + } + try { + + return popResults(); + } catch (IllegalArgumentException e) { + + } + return result; + } catch (Exception ex) { + throw new JMXError(ex.getMessage()); + } + + } + + private Set query(String beanName) throws QueryError { + ObjectName queryObject; + + try { + queryObject = new ObjectName(beanName); + } catch (MalformedObjectNameException e) { + throw new QueryError("Can't parse bean name " + beanName, e); + } + + Set beanInstances; + try { + beanInstances = connection.queryMBeans(queryObject, null); + } catch (IOException e) { + throw new QueryError("Can't get beans for query " + beanName, e); + } + + return beanInstances; + } + + private void queryAttributes(ObjectInstance instance) throws QueryError, JMXError { + ObjectName objectName = instance.getObjectName(); + MBeanInfo info; + + try { + info = connection.getMBeanInfo(objectName); + } catch (InstanceNotFoundException | IntrospectionException | ReflectionException | IOException e) { + throw new QueryError("Can't find bean " + objectName.toString(), e); + } + + MBeanAttributeInfo[] attrInfo = info.getAttributes(); + + for (MBeanAttributeInfo attr : attrInfo) { + if (!attr.isReadable()) { + continue; + } + + String attrName = attr.getName(); + Object value; + + + try { + value = connection.getAttribute(objectName, attrName); + if (value instanceof Attribute) { + Attribute jmxAttr = (Attribute) value; + value = jmxAttr.getValue(); + } + } catch (Exception e) { + // logger.warning("Can't get attribute " + attrName + " for bean " + + // objectName.toString() + ": " + // + e.getMessage()); + continue; + } + + String name = String.format("%s,attr=%s", objectName.toString(), attrName); + try { + parseValue(name, value); + } catch (ValueError e) { + this.logs.add(new LogMessage(e.getMessage())); + // logger.fine(e.getMessage()); + } + } + } + + private List popResults() { + List out = result; + result = new ArrayList<>(); + return out; + } + + private void parseValue(String name, Object value) throws ValueError { + JMXAttribute attr = new JMXAttribute(); + attr.attribute = name; + + if (value == null) { + throw new ValueError("Found a null value for bean " + name); + } else if (value instanceof java.lang.Double) { + attr.doubleValue = parseDouble((Double) value); + attr.valueType = ValueType.DOUBLE; + result.add(attr); + } else if (value instanceof java.lang.Float) { + attr.doubleValue = parseFloatToDouble((Float) value); + attr.valueType = ValueType.DOUBLE; + result.add(attr); + } else if (value instanceof Number) { + attr.intValue = ((Number) value).longValue(); + attr.valueType = ValueType.INT; + result.add(attr); + } else if (value instanceof String) { + attr.stringValue = (String) value; + attr.valueType = ValueType.STRING; + result.add(attr); + } else if (value instanceof Boolean) { + attr.boolValue = (Boolean) value; + attr.valueType = ValueType.BOOL; + result.add(attr); + } else if (value instanceof CompositeData) { + CompositeData cdata = (CompositeData) value; + Set fieldKeys = cdata.getCompositeType().keySet(); + + for (String field : fieldKeys) { + if (field.length() < 1) + continue; + + String fieldKey = field.substring(0, 1).toUpperCase() + field.substring(1); + parseValue(String.format("%s.%s", name, fieldKey), cdata.get(field)); + } + } else if (value instanceof HashMap) { + // TODO: Process hashmaps + // logger.fine("HashMaps are not supported yet: " + name); + } else if (value instanceof ArrayList || value.getClass().isArray()) { + // TODO: Process arrays + // logger.fine("Arrays are not supported yet: " + name); + } else { + throw new ValueError("Unsuported data type (" + value.getClass() + ") for bean " + name); + } + } + + /** + * XXX: JSON does not support NaN, Infinity, or -Infinity as they come back from + * JMX. So we parse them out to 0, Max Double, and Min Double respectively. + */ + private Double parseDouble(Double value) { + if (value.isNaN()) { + return 0.0; + } else if (value == Double.NEGATIVE_INFINITY) { + return Double.MIN_VALUE; + } else if (value == Double.POSITIVE_INFINITY) { + return Double.MAX_VALUE; + } + + return value; + } + + /** + * XXX: JSON does not support NaN, Infinity, or -Infinity as they come back from + * JMX. So we parse them out to 0, Max Double, and Min Double respectively. + */ + private Double parseFloatToDouble(Float value) { + if (value.isNaN()) { + return 0.0d; + } else if (value == Double.NEGATIVE_INFINITY) { + return Double.MIN_VALUE; + } else if (value == Double.POSITIVE_INFINITY) { + return Double.MAX_VALUE; + } + + return new BigDecimal(value.toString()).doubleValue(); + } +} diff --git a/src/main/java/org/newrelic/nrjmx/v2/JMXServiceHandler.java b/src/main/java/org/newrelic/nrjmx/v2/JMXServiceHandler.java new file mode 100644 index 00000000..5f338876 --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/JMXServiceHandler.java @@ -0,0 +1,55 @@ +package org.newrelic.nrjmx.v2; + +import java.nio.ByteBuffer; +import java.util.List; +import java.util.Map; + +import org.apache.thrift.TException; +import org.apache.thrift.server.TServer; +import org.newrelic.nrjmx.v2.nrprotocol.JMXAttribute; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConfig; +import org.newrelic.nrjmx.v2.nrprotocol.JMXConnectionError; +import org.newrelic.nrjmx.v2.nrprotocol.JMXError; +import org.newrelic.nrjmx.v2.nrprotocol.JMXService; +import org.newrelic.nrjmx.v2.nrprotocol.LogMessage; + +public class JMXServiceHandler implements JMXService.Iface { + + private JMXFetcher jmxFetcher; + private TServer server; + + @Override + public boolean connect(JMXConfig config) throws TException { + this.jmxFetcher = new JMXFetcher(config); + return jmxFetcher.connect(); + } + + @Override + public List queryMbean(String beanName) throws TException { + return jmxFetcher.queryMbean(beanName); + } + + @Override + public void disconnect() throws TException { + if (this.server == null) { + throw new TException("cannot disconnect, server handler null"); + } + this.server.stop(); + } + + @Override + public List getLogs() throws TException { + return jmxFetcher.getLogs(); + } + + public void addServer(TServer server) { + this.server = server; + } + + @Override + public Map queryMbean2(String beanName) throws JMXConnectionError, JMXError, TException { + return jmxFetcher.queryMbean2(beanName); + } + + +} \ No newline at end of file diff --git a/src/main/java/org/newrelic/nrjmx/v2/StandardIOServer.java b/src/main/java/org/newrelic/nrjmx/v2/StandardIOServer.java new file mode 100644 index 00000000..c63bcf0d --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/StandardIOServer.java @@ -0,0 +1,116 @@ +package org.newrelic.nrjmx.v2; + +import java.io.BufferedInputStream; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +import org.apache.thrift.TException; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.server.ServerContext; +import org.apache.thrift.server.TServer; +import org.apache.thrift.transport.TFramedTransport; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class StandardIOServer extends TServer { + /** + * Simple singlethreaded server implementation. + * + */ + private static final Logger LOGGER = LoggerFactory.getLogger(StandardIOServer.class.getName()); + + public StandardIOServer(Args args) { + super(args); + } + + public void serve() { + + try { + serverTransport_.listen(); + } catch (TTransportException ttx) { + LOGGER.error("Error occurred during listening.", ttx); + return; + } + + // Run the preServe event + if (eventHandler_ != null) { + eventHandler_.preServe(); + } + + setServing(true); + + while (!stopped_) { + + TTransport client = null; + TProcessor processor = null; + TTransport inputTransport = null; + TTransport outputTransport = null; + TProtocol inputProtocol = null; + TProtocol outputProtocol = null; + ServerContext connectionContext = null; + try { + client = serverTransport_.accept(); + if (client != null) { + processor = processorFactory_.getProcessor(client); + + inputTransport = new TFramedTransport(inputTransportFactory_.getTransport(client), 8192);//inputTransportFactory_.getTransport(client); + outputTransport = new TFramedTransport(outputTransportFactory_.getTransport(client), 8192);// outputTransportFactory_.getTransport(client); + inputProtocol = inputProtocolFactory_.getProtocol(inputTransport); + outputProtocol = outputProtocolFactory_.getProtocol(outputTransport); + if (eventHandler_ != null) { + connectionContext = eventHandler_.createContext(inputProtocol, outputProtocol); + } + while (!stopped_) { + if (eventHandler_ != null) { + eventHandler_.processContext(connectionContext, inputTransport, outputTransport); + } + processor.process(inputProtocol, outputProtocol); + } + } + } catch (TTransportException ttx) { + // Client died, just move on + LOGGER.debug("Client Transportation Exception", ttx); + break; + } catch (TException tx) { + if (!stopped_) { + LOGGER.error("Thrift error occurred during processing of message.", tx); + } + } catch (Exception x) { + if (!stopped_) { + LOGGER.error("Error occurred during processing of message.", x); + } + break; + } + + if (eventHandler_ != null) { + eventHandler_.deleteContext(connectionContext, inputProtocol, outputProtocol); + } + } + setServing(false); + } + + public void stop() { + stopped_ = true; + serverTransport_.interrupt(); + } +} diff --git a/src/main/java/org/newrelic/nrjmx/v2/StandardIOTransportServer.java b/src/main/java/org/newrelic/nrjmx/v2/StandardIOTransportServer.java new file mode 100644 index 00000000..065dee4c --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/StandardIOTransportServer.java @@ -0,0 +1,31 @@ +package org.newrelic.nrjmx.v2; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.transport.TIOStreamTransport; +import org.apache.thrift.transport.TServerTransport; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; + + +public class StandardIOTransportServer extends TServerTransport { + + TTransport transport; + + @Override + public void listen() throws TTransportException { + } + + @Override + public void close() { + transport.close(); + } + + @Override + protected TTransport acceptImpl() throws TTransportException { + transport = new TIOStreamTransport(System.in, System.out); + return transport; + } + +} diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttribute.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttribute.java new file mode 100644 index 00000000..0667abde --- /dev/null +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttribute.java @@ -0,0 +1,895 @@ +/** + * Autogenerated by Thrift Compiler (0.13.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.newrelic.nrjmx.v2.nrprotocol; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") +public class JMXAttribute implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXAttribute"); + + private static final org.apache.thrift.protocol.TField ATTRIBUTE_FIELD_DESC = new org.apache.thrift.protocol.TField("attribute", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField VALUE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("valueType", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField DOUBLE_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleValue", org.apache.thrift.protocol.TType.DOUBLE, (short)4); + private static final org.apache.thrift.protocol.TField INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("intValue", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField BOOL_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("boolValue", org.apache.thrift.protocol.TType.BOOL, (short)6); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new JMXAttributeStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new JMXAttributeTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String attribute; // required + /** + * + * @see ValueType + */ + public @org.apache.thrift.annotation.Nullable ValueType valueType; // required + public @org.apache.thrift.annotation.Nullable java.lang.String stringValue; // required + public double doubleValue; // required + public long intValue; // required + public boolean boolValue; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + ATTRIBUTE((short)1, "attribute"), + /** + * + * @see ValueType + */ + VALUE_TYPE((short)2, "valueType"), + STRING_VALUE((short)3, "stringValue"), + DOUBLE_VALUE((short)4, "doubleValue"), + INT_VALUE((short)5, "intValue"), + BOOL_VALUE((short)6, "boolValue"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // ATTRIBUTE + return ATTRIBUTE; + case 2: // VALUE_TYPE + return VALUE_TYPE; + case 3: // STRING_VALUE + return STRING_VALUE; + case 4: // DOUBLE_VALUE + return DOUBLE_VALUE; + case 5: // INT_VALUE + return INT_VALUE; + case 6: // BOOL_VALUE + return BOOL_VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __DOUBLEVALUE_ISSET_ID = 0; + private static final int __INTVALUE_ISSET_ID = 1; + private static final int __BOOLVALUE_ISSET_ID = 2; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ATTRIBUTE, new org.apache.thrift.meta_data.FieldMetaData("attribute", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VALUE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("valueType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ValueType.class))); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DOUBLE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("doubleValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + tmpMap.put(_Fields.INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("intValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.BOOL_VALUE, new org.apache.thrift.meta_data.FieldMetaData("boolValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JMXAttribute.class, metaDataMap); + } + + public JMXAttribute() { + } + + public JMXAttribute( + java.lang.String attribute, + ValueType valueType, + java.lang.String stringValue, + double doubleValue, + long intValue, + boolean boolValue) + { + this(); + this.attribute = attribute; + this.valueType = valueType; + this.stringValue = stringValue; + this.doubleValue = doubleValue; + setDoubleValueIsSet(true); + this.intValue = intValue; + setIntValueIsSet(true); + this.boolValue = boolValue; + setBoolValueIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public JMXAttribute(JMXAttribute other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetAttribute()) { + this.attribute = other.attribute; + } + if (other.isSetValueType()) { + this.valueType = other.valueType; + } + if (other.isSetStringValue()) { + this.stringValue = other.stringValue; + } + this.doubleValue = other.doubleValue; + this.intValue = other.intValue; + this.boolValue = other.boolValue; + } + + public JMXAttribute deepCopy() { + return new JMXAttribute(this); + } + + @Override + public void clear() { + this.attribute = null; + this.valueType = null; + this.stringValue = null; + setDoubleValueIsSet(false); + this.doubleValue = 0.0; + setIntValueIsSet(false); + this.intValue = 0; + setBoolValueIsSet(false); + this.boolValue = false; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getAttribute() { + return this.attribute; + } + + public JMXAttribute setAttribute(@org.apache.thrift.annotation.Nullable java.lang.String attribute) { + this.attribute = attribute; + return this; + } + + public void unsetAttribute() { + this.attribute = null; + } + + /** Returns true if field attribute is set (has been assigned a value) and false otherwise */ + public boolean isSetAttribute() { + return this.attribute != null; + } + + public void setAttributeIsSet(boolean value) { + if (!value) { + this.attribute = null; + } + } + + /** + * + * @see ValueType + */ + @org.apache.thrift.annotation.Nullable + public ValueType getValueType() { + return this.valueType; + } + + /** + * + * @see ValueType + */ + public JMXAttribute setValueType(@org.apache.thrift.annotation.Nullable ValueType valueType) { + this.valueType = valueType; + return this; + } + + public void unsetValueType() { + this.valueType = null; + } + + /** Returns true if field valueType is set (has been assigned a value) and false otherwise */ + public boolean isSetValueType() { + return this.valueType != null; + } + + public void setValueTypeIsSet(boolean value) { + if (!value) { + this.valueType = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getStringValue() { + return this.stringValue; + } + + public JMXAttribute setStringValue(@org.apache.thrift.annotation.Nullable java.lang.String stringValue) { + this.stringValue = stringValue; + return this; + } + + public void unsetStringValue() { + this.stringValue = null; + } + + /** Returns true if field stringValue is set (has been assigned a value) and false otherwise */ + public boolean isSetStringValue() { + return this.stringValue != null; + } + + public void setStringValueIsSet(boolean value) { + if (!value) { + this.stringValue = null; + } + } + + public double getDoubleValue() { + return this.doubleValue; + } + + public JMXAttribute setDoubleValue(double doubleValue) { + this.doubleValue = doubleValue; + setDoubleValueIsSet(true); + return this; + } + + public void unsetDoubleValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID); + } + + /** Returns true if field doubleValue is set (has been assigned a value) and false otherwise */ + public boolean isSetDoubleValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID); + } + + public void setDoubleValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __DOUBLEVALUE_ISSET_ID, value); + } + + public long getIntValue() { + return this.intValue; + } + + public JMXAttribute setIntValue(long intValue) { + this.intValue = intValue; + setIntValueIsSet(true); + return this; + } + + public void unsetIntValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __INTVALUE_ISSET_ID); + } + + /** Returns true if field intValue is set (has been assigned a value) and false otherwise */ + public boolean isSetIntValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __INTVALUE_ISSET_ID); + } + + public void setIntValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __INTVALUE_ISSET_ID, value); + } + + public boolean isBoolValue() { + return this.boolValue; + } + + public JMXAttribute setBoolValue(boolean boolValue) { + this.boolValue = boolValue; + setBoolValueIsSet(true); + return this; + } + + public void unsetBoolValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __BOOLVALUE_ISSET_ID); + } + + /** Returns true if field boolValue is set (has been assigned a value) and false otherwise */ + public boolean isSetBoolValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __BOOLVALUE_ISSET_ID); + } + + public void setBoolValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __BOOLVALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case ATTRIBUTE: + if (value == null) { + unsetAttribute(); + } else { + setAttribute((java.lang.String)value); + } + break; + + case VALUE_TYPE: + if (value == null) { + unsetValueType(); + } else { + setValueType((ValueType)value); + } + break; + + case STRING_VALUE: + if (value == null) { + unsetStringValue(); + } else { + setStringValue((java.lang.String)value); + } + break; + + case DOUBLE_VALUE: + if (value == null) { + unsetDoubleValue(); + } else { + setDoubleValue((java.lang.Double)value); + } + break; + + case INT_VALUE: + if (value == null) { + unsetIntValue(); + } else { + setIntValue((java.lang.Long)value); + } + break; + + case BOOL_VALUE: + if (value == null) { + unsetBoolValue(); + } else { + setBoolValue((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case ATTRIBUTE: + return getAttribute(); + + case VALUE_TYPE: + return getValueType(); + + case STRING_VALUE: + return getStringValue(); + + case DOUBLE_VALUE: + return getDoubleValue(); + + case INT_VALUE: + return getIntValue(); + + case BOOL_VALUE: + return isBoolValue(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case ATTRIBUTE: + return isSetAttribute(); + case VALUE_TYPE: + return isSetValueType(); + case STRING_VALUE: + return isSetStringValue(); + case DOUBLE_VALUE: + return isSetDoubleValue(); + case INT_VALUE: + return isSetIntValue(); + case BOOL_VALUE: + return isSetBoolValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof JMXAttribute) + return this.equals((JMXAttribute)that); + return false; + } + + public boolean equals(JMXAttribute that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_attribute = true && this.isSetAttribute(); + boolean that_present_attribute = true && that.isSetAttribute(); + if (this_present_attribute || that_present_attribute) { + if (!(this_present_attribute && that_present_attribute)) + return false; + if (!this.attribute.equals(that.attribute)) + return false; + } + + boolean this_present_valueType = true && this.isSetValueType(); + boolean that_present_valueType = true && that.isSetValueType(); + if (this_present_valueType || that_present_valueType) { + if (!(this_present_valueType && that_present_valueType)) + return false; + if (!this.valueType.equals(that.valueType)) + return false; + } + + boolean this_present_stringValue = true && this.isSetStringValue(); + boolean that_present_stringValue = true && that.isSetStringValue(); + if (this_present_stringValue || that_present_stringValue) { + if (!(this_present_stringValue && that_present_stringValue)) + return false; + if (!this.stringValue.equals(that.stringValue)) + return false; + } + + boolean this_present_doubleValue = true; + boolean that_present_doubleValue = true; + if (this_present_doubleValue || that_present_doubleValue) { + if (!(this_present_doubleValue && that_present_doubleValue)) + return false; + if (this.doubleValue != that.doubleValue) + return false; + } + + boolean this_present_intValue = true; + boolean that_present_intValue = true; + if (this_present_intValue || that_present_intValue) { + if (!(this_present_intValue && that_present_intValue)) + return false; + if (this.intValue != that.intValue) + return false; + } + + boolean this_present_boolValue = true; + boolean that_present_boolValue = true; + if (this_present_boolValue || that_present_boolValue) { + if (!(this_present_boolValue && that_present_boolValue)) + return false; + if (this.boolValue != that.boolValue) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetAttribute()) ? 131071 : 524287); + if (isSetAttribute()) + hashCode = hashCode * 8191 + attribute.hashCode(); + + hashCode = hashCode * 8191 + ((isSetValueType()) ? 131071 : 524287); + if (isSetValueType()) + hashCode = hashCode * 8191 + valueType.getValue(); + + hashCode = hashCode * 8191 + ((isSetStringValue()) ? 131071 : 524287); + if (isSetStringValue()) + hashCode = hashCode * 8191 + stringValue.hashCode(); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(doubleValue); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(intValue); + + hashCode = hashCode * 8191 + ((boolValue) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(JMXAttribute other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetAttribute()).compareTo(other.isSetAttribute()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAttribute()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attribute, other.attribute); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetValueType()).compareTo(other.isSetValueType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValueType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueType, other.valueType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetStringValue()).compareTo(other.isSetStringValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStringValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringValue, other.stringValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetDoubleValue()).compareTo(other.isSetDoubleValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDoubleValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doubleValue, other.doubleValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetIntValue()).compareTo(other.isSetIntValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIntValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intValue, other.intValue); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetBoolValue()).compareTo(other.isSetBoolValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBoolValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolValue, other.boolValue); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("JMXAttribute("); + boolean first = true; + + sb.append("attribute:"); + if (this.attribute == null) { + sb.append("null"); + } else { + sb.append(this.attribute); + } + first = false; + if (!first) sb.append(", "); + sb.append("valueType:"); + if (this.valueType == null) { + sb.append("null"); + } else { + sb.append(this.valueType); + } + first = false; + if (!first) sb.append(", "); + sb.append("stringValue:"); + if (this.stringValue == null) { + sb.append("null"); + } else { + sb.append(this.stringValue); + } + first = false; + if (!first) sb.append(", "); + sb.append("doubleValue:"); + sb.append(this.doubleValue); + first = false; + if (!first) sb.append(", "); + sb.append("intValue:"); + sb.append(this.intValue); + first = false; + if (!first) sb.append(", "); + sb.append("boolValue:"); + sb.append(this.boolValue); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class JMXAttributeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public JMXAttributeStandardScheme getScheme() { + return new JMXAttributeStandardScheme(); + } + } + + private static class JMXAttributeStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, JMXAttribute struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ATTRIBUTE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.attribute = iprot.readString(); + struct.setAttributeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.valueType = org.newrelic.nrjmx.v2.nrprotocol.ValueType.findByValue(iprot.readI32()); + struct.setValueTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // STRING_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.stringValue = iprot.readString(); + struct.setStringValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DOUBLE_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.doubleValue = iprot.readDouble(); + struct.setDoubleValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // INT_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.intValue = iprot.readI64(); + struct.setIntValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // BOOL_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.boolValue = iprot.readBool(); + struct.setBoolValueIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, JMXAttribute struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.attribute != null) { + oprot.writeFieldBegin(ATTRIBUTE_FIELD_DESC); + oprot.writeString(struct.attribute); + oprot.writeFieldEnd(); + } + if (struct.valueType != null) { + oprot.writeFieldBegin(VALUE_TYPE_FIELD_DESC); + oprot.writeI32(struct.valueType.getValue()); + oprot.writeFieldEnd(); + } + if (struct.stringValue != null) { + oprot.writeFieldBegin(STRING_VALUE_FIELD_DESC); + oprot.writeString(struct.stringValue); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DOUBLE_VALUE_FIELD_DESC); + oprot.writeDouble(struct.doubleValue); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(INT_VALUE_FIELD_DESC); + oprot.writeI64(struct.intValue); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BOOL_VALUE_FIELD_DESC); + oprot.writeBool(struct.boolValue); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class JMXAttributeTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public JMXAttributeTupleScheme getScheme() { + return new JMXAttributeTupleScheme(); + } + } + + private static class JMXAttributeTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, JMXAttribute struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetAttribute()) { + optionals.set(0); + } + if (struct.isSetValueType()) { + optionals.set(1); + } + if (struct.isSetStringValue()) { + optionals.set(2); + } + if (struct.isSetDoubleValue()) { + optionals.set(3); + } + if (struct.isSetIntValue()) { + optionals.set(4); + } + if (struct.isSetBoolValue()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetAttribute()) { + oprot.writeString(struct.attribute); + } + if (struct.isSetValueType()) { + oprot.writeI32(struct.valueType.getValue()); + } + if (struct.isSetStringValue()) { + oprot.writeString(struct.stringValue); + } + if (struct.isSetDoubleValue()) { + oprot.writeDouble(struct.doubleValue); + } + if (struct.isSetIntValue()) { + oprot.writeI64(struct.intValue); + } + if (struct.isSetBoolValue()) { + oprot.writeBool(struct.boolValue); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, JMXAttribute struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.attribute = iprot.readString(); + struct.setAttributeIsSet(true); + } + if (incoming.get(1)) { + struct.valueType = org.newrelic.nrjmx.v2.nrprotocol.ValueType.findByValue(iprot.readI32()); + struct.setValueTypeIsSet(true); + } + if (incoming.get(2)) { + struct.stringValue = iprot.readString(); + struct.setStringValueIsSet(true); + } + if (incoming.get(3)) { + struct.doubleValue = iprot.readDouble(); + struct.setDoubleValueIsSet(true); + } + if (incoming.get(4)) { + struct.intValue = iprot.readI64(); + struct.setIntValueIsSet(true); + } + if (incoming.get(5)) { + struct.boolValue = iprot.readBool(); + struct.setBoolValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttributeValue.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttributeValue.java similarity index 89% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttributeValue.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttributeValue.java index 4607d5f0..24167ad0 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttributeValue.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXAttributeValue.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-20") public class JMXAttributeValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXAttributeValue"); @@ -25,10 +25,10 @@ public class JMXAttributeValue implements org.apache.thrift.TBase metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("valueType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ValueType.class))); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.DOUBLE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("doubleValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.DOUBLE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("doubleValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("intValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("intValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.BOOL_VALUE, new org.apache.thrift.meta_data.FieldMetaData("boolValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.BOOL_VALUE, new org.apache.thrift.meta_data.FieldMetaData("boolValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JMXAttributeValue.class, metaDataMap); @@ -132,21 +133,10 @@ public JMXAttributeValue() { } public JMXAttributeValue( - ValueType valueType, - java.lang.String stringValue, - double doubleValue, - long intValue, - boolean boolValue) + ValueType valueType) { this(); this.valueType = valueType; - this.stringValue = stringValue; - this.doubleValue = doubleValue; - setDoubleValueIsSet(true); - this.intValue = intValue; - setIntValueIsSet(true); - this.boolValue = boolValue; - setBoolValueIsSet(true); } /** @@ -429,8 +419,8 @@ public boolean equals(JMXAttributeValue that) { return false; } - boolean this_present_doubleValue = true; - boolean that_present_doubleValue = true; + boolean this_present_doubleValue = true && this.isSetDoubleValue(); + boolean that_present_doubleValue = true && that.isSetDoubleValue(); if (this_present_doubleValue || that_present_doubleValue) { if (!(this_present_doubleValue && that_present_doubleValue)) return false; @@ -438,8 +428,8 @@ public boolean equals(JMXAttributeValue that) { return false; } - boolean this_present_intValue = true; - boolean that_present_intValue = true; + boolean this_present_intValue = true && this.isSetIntValue(); + boolean that_present_intValue = true && that.isSetIntValue(); if (this_present_intValue || that_present_intValue) { if (!(this_present_intValue && that_present_intValue)) return false; @@ -447,8 +437,8 @@ public boolean equals(JMXAttributeValue that) { return false; } - boolean this_present_boolValue = true; - boolean that_present_boolValue = true; + boolean this_present_boolValue = true && this.isSetBoolValue(); + boolean that_present_boolValue = true && that.isSetBoolValue(); if (this_present_boolValue || that_present_boolValue) { if (!(this_present_boolValue && that_present_boolValue)) return false; @@ -471,11 +461,17 @@ public int hashCode() { if (isSetStringValue()) hashCode = hashCode * 8191 + stringValue.hashCode(); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(doubleValue); + hashCode = hashCode * 8191 + ((isSetDoubleValue()) ? 131071 : 524287); + if (isSetDoubleValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(doubleValue); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(intValue); + hashCode = hashCode * 8191 + ((isSetIntValue()) ? 131071 : 524287); + if (isSetIntValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(intValue); - hashCode = hashCode * 8191 + ((boolValue) ? 131071 : 524287); + hashCode = hashCode * 8191 + ((isSetBoolValue()) ? 131071 : 524287); + if (isSetBoolValue()) + hashCode = hashCode * 8191 + ((boolValue) ? 131071 : 524287); return hashCode; } @@ -566,26 +562,34 @@ public java.lang.String toString() { sb.append(this.valueType); } first = false; - if (!first) sb.append(", "); - sb.append("stringValue:"); - if (this.stringValue == null) { - sb.append("null"); - } else { - sb.append(this.stringValue); + if (isSetStringValue()) { + if (!first) sb.append(", "); + sb.append("stringValue:"); + if (this.stringValue == null) { + sb.append("null"); + } else { + sb.append(this.stringValue); + } + first = false; + } + if (isSetDoubleValue()) { + if (!first) sb.append(", "); + sb.append("doubleValue:"); + sb.append(this.doubleValue); + first = false; + } + if (isSetIntValue()) { + if (!first) sb.append(", "); + sb.append("intValue:"); + sb.append(this.intValue); + first = false; + } + if (isSetBoolValue()) { + if (!first) sb.append(", "); + sb.append("boolValue:"); + sb.append(this.boolValue); + first = false; } - first = false; - if (!first) sb.append(", "); - sb.append("doubleValue:"); - sb.append(this.doubleValue); - first = false; - if (!first) sb.append(", "); - sb.append("intValue:"); - sb.append(this.intValue); - first = false; - if (!first) sb.append(", "); - sb.append("boolValue:"); - sb.append(this.boolValue); - first = false; sb.append(")"); return sb.toString(); } @@ -633,7 +637,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, JMXAttributeValue s switch (schemeField.id) { case 1: // VALUE_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.valueType = org.newrelic.nrjmx.v2.protocol.ValueType.findByValue(iprot.readI32()); + struct.valueType = org.newrelic.nrjmx.v2.nrprotocol.ValueType.findByValue(iprot.readI32()); struct.setValueTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -692,19 +696,27 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, JMXAttributeValue oprot.writeFieldEnd(); } if (struct.stringValue != null) { - oprot.writeFieldBegin(STRING_VALUE_FIELD_DESC); - oprot.writeString(struct.stringValue); + if (struct.isSetStringValue()) { + oprot.writeFieldBegin(STRING_VALUE_FIELD_DESC); + oprot.writeString(struct.stringValue); + oprot.writeFieldEnd(); + } + } + if (struct.isSetDoubleValue()) { + oprot.writeFieldBegin(DOUBLE_VALUE_FIELD_DESC); + oprot.writeDouble(struct.doubleValue); + oprot.writeFieldEnd(); + } + if (struct.isSetIntValue()) { + oprot.writeFieldBegin(INT_VALUE_FIELD_DESC); + oprot.writeI64(struct.intValue); + oprot.writeFieldEnd(); + } + if (struct.isSetBoolValue()) { + oprot.writeFieldBegin(BOOL_VALUE_FIELD_DESC); + oprot.writeBool(struct.boolValue); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(DOUBLE_VALUE_FIELD_DESC); - oprot.writeDouble(struct.doubleValue); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(INT_VALUE_FIELD_DESC); - oprot.writeI64(struct.intValue); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BOOL_VALUE_FIELD_DESC); - oprot.writeBool(struct.boolValue); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -761,7 +773,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, JMXAttributeValue st org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { - struct.valueType = org.newrelic.nrjmx.v2.protocol.ValueType.findByValue(iprot.readI32()); + struct.valueType = org.newrelic.nrjmx.v2.nrprotocol.ValueType.findByValue(iprot.readI32()); struct.setValueTypeIsSet(true); } if (incoming.get(1)) { diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConfig.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java similarity index 99% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConfig.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java index 38de78ab..7e9f003d 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConfig.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public class JMXConfig implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXConfig"); diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConnectionError.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java similarity index 99% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConnectionError.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java index fe591f5a..35a5eb03 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXConnectionError.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public class JMXConnectionError extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXConnectionError"); diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXError.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java similarity index 99% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/JMXError.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java index 4e51153f..4b87f10b 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXError.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public class JMXError extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXError"); diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXService.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java similarity index 76% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/JMXService.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java index b447ad41..a6fb2515 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXService.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public class JMXService { public interface Iface { @@ -18,6 +18,8 @@ public interface Iface { public java.util.List queryMbean(java.lang.String beanName) throws JMXConnectionError, JMXError, org.apache.thrift.TException; + public java.util.Map queryMbean2(java.lang.String beanName) throws JMXConnectionError, JMXError, org.apache.thrift.TException; + public java.util.List getLogs() throws org.apache.thrift.TException; } @@ -30,6 +32,8 @@ public interface AsyncIface { public void queryMbean(java.lang.String beanName, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + public void queryMbean2(java.lang.String beanName, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; + public void getLogs(org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException; } @@ -134,6 +138,35 @@ public java.util.List recv_queryMbean() throws JMXConnectionError, throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryMbean failed: unknown result"); } + public java.util.Map queryMbean2(java.lang.String beanName) throws JMXConnectionError, JMXError, org.apache.thrift.TException + { + send_queryMbean2(beanName); + return recv_queryMbean2(); + } + + public void send_queryMbean2(java.lang.String beanName) throws org.apache.thrift.TException + { + queryMbean2_args args = new queryMbean2_args(); + args.setBeanName(beanName); + sendBase("queryMbean2", args); + } + + public java.util.Map recv_queryMbean2() throws JMXConnectionError, JMXError, org.apache.thrift.TException + { + queryMbean2_result result = new queryMbean2_result(); + receiveBase(result, "queryMbean2"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.connErr != null) { + throw result.connErr; + } + if (result.jmxErr != null) { + throw result.jmxErr; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryMbean2 failed: unknown result"); + } + public java.util.List getLogs() throws org.apache.thrift.TException { send_getLogs(); @@ -267,6 +300,38 @@ public java.util.List getResult() throws JMXConnectionError, JMXEr } } + public void queryMbean2(java.lang.String beanName, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + checkReady(); + queryMbean2_call method_call = new queryMbean2_call(beanName, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class queryMbean2_call extends org.apache.thrift.async.TAsyncMethodCall> { + private java.lang.String beanName; + public queryMbean2_call(java.lang.String beanName, org.apache.thrift.async.AsyncMethodCallback> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.beanName = beanName; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryMbean2", org.apache.thrift.protocol.TMessageType.CALL, 0)); + queryMbean2_args args = new queryMbean2_args(); + args.setBeanName(beanName); + args.write(prot); + prot.writeMessageEnd(); + } + + public java.util.Map getResult() throws JMXConnectionError, JMXError, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_queryMbean2(); + } + } + public void getLogs(org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { checkReady(); getLogs_call method_call = new getLogs_call(resultHandler, this, ___protocolFactory, ___transport); @@ -312,6 +377,7 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { + public queryMbean2() { + super("queryMbean2"); + } + + public queryMbean2_args getEmptyArgsInstance() { + return new queryMbean2_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public queryMbean2_result getResult(I iface, queryMbean2_args args) throws org.apache.thrift.TException { + queryMbean2_result result = new queryMbean2_result(); + try { + result.success = iface.queryMbean2(args.beanName); + } catch (JMXConnectionError connErr) { + result.connErr = connErr; + } catch (JMXError jmxErr) { + result.jmxErr = jmxErr; + } + return result; + } + } + public static class getLogs extends org.apache.thrift.ProcessFunction { public getLogs() { super("getLogs"); @@ -449,6 +546,7 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction> { + public queryMbean2() { + super("queryMbean2"); + } + + public queryMbean2_args getEmptyArgsInstance() { + return new queryMbean2_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback>() { + public void onComplete(java.util.Map o) { + queryMbean2_result result = new queryMbean2_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + queryMbean2_result result = new queryMbean2_result(); + if (e instanceof JMXConnectionError) { + result.connErr = (JMXConnectionError) e; + result.setConnErrIsSet(true); + msg = result; + } else if (e instanceof JMXError) { + result.jmxErr = (JMXError) e; + result.setJmxErrIsSet(true); + msg = result; + } else if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, queryMbean2_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws org.apache.thrift.TException { + iface.queryMbean2(args.beanName,resultHandler); + } + } + public static class getLogs extends org.apache.thrift.AsyncProcessFunction> { public getLogs() { super("getLogs"); @@ -3295,6 +3462,1006 @@ private static S scheme(org.apache. } } + public static class queryMbean2_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryMbean2_args"); + + private static final org.apache.thrift.protocol.TField BEAN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("beanName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new queryMbean2_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new queryMbean2_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.lang.String beanName; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + BEAN_NAME((short)1, "beanName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // BEAN_NAME + return BEAN_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BEAN_NAME, new org.apache.thrift.meta_data.FieldMetaData("beanName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryMbean2_args.class, metaDataMap); + } + + public queryMbean2_args() { + } + + public queryMbean2_args( + java.lang.String beanName) + { + this(); + this.beanName = beanName; + } + + /** + * Performs a deep copy on other. + */ + public queryMbean2_args(queryMbean2_args other) { + if (other.isSetBeanName()) { + this.beanName = other.beanName; + } + } + + public queryMbean2_args deepCopy() { + return new queryMbean2_args(this); + } + + @Override + public void clear() { + this.beanName = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getBeanName() { + return this.beanName; + } + + public queryMbean2_args setBeanName(@org.apache.thrift.annotation.Nullable java.lang.String beanName) { + this.beanName = beanName; + return this; + } + + public void unsetBeanName() { + this.beanName = null; + } + + /** Returns true if field beanName is set (has been assigned a value) and false otherwise */ + public boolean isSetBeanName() { + return this.beanName != null; + } + + public void setBeanNameIsSet(boolean value) { + if (!value) { + this.beanName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case BEAN_NAME: + if (value == null) { + unsetBeanName(); + } else { + setBeanName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case BEAN_NAME: + return getBeanName(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case BEAN_NAME: + return isSetBeanName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof queryMbean2_args) + return this.equals((queryMbean2_args)that); + return false; + } + + public boolean equals(queryMbean2_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_beanName = true && this.isSetBeanName(); + boolean that_present_beanName = true && that.isSetBeanName(); + if (this_present_beanName || that_present_beanName) { + if (!(this_present_beanName && that_present_beanName)) + return false; + if (!this.beanName.equals(that.beanName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetBeanName()) ? 131071 : 524287); + if (isSetBeanName()) + hashCode = hashCode * 8191 + beanName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(queryMbean2_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetBeanName()).compareTo(other.isSetBeanName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBeanName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.beanName, other.beanName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("queryMbean2_args("); + boolean first = true; + + sb.append("beanName:"); + if (this.beanName == null) { + sb.append("null"); + } else { + sb.append(this.beanName); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class queryMbean2_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public queryMbean2_argsStandardScheme getScheme() { + return new queryMbean2_argsStandardScheme(); + } + } + + private static class queryMbean2_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, queryMbean2_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BEAN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.beanName = iprot.readString(); + struct.setBeanNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, queryMbean2_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.beanName != null) { + oprot.writeFieldBegin(BEAN_NAME_FIELD_DESC); + oprot.writeString(struct.beanName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class queryMbean2_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public queryMbean2_argsTupleScheme getScheme() { + return new queryMbean2_argsTupleScheme(); + } + } + + private static class queryMbean2_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, queryMbean2_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetBeanName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetBeanName()) { + oprot.writeString(struct.beanName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, queryMbean2_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.beanName = iprot.readString(); + struct.setBeanNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class queryMbean2_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryMbean2_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + private static final org.apache.thrift.protocol.TField CONN_ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("connErr", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField JMX_ERR_FIELD_DESC = new org.apache.thrift.protocol.TField("jmxErr", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new queryMbean2_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new queryMbean2_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable java.util.Map success; // required + public @org.apache.thrift.annotation.Nullable JMXConnectionError connErr; // required + public @org.apache.thrift.annotation.Nullable JMXError jmxErr; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + CONN_ERR((short)1, "connErr"), + JMX_ERR((short)2, "jmxErr"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // CONN_ERR + return CONN_ERR; + case 2: // JMX_ERR + return JMX_ERR; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.CONN_ERR, new org.apache.thrift.meta_data.FieldMetaData("connErr", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JMXConnectionError.class))); + tmpMap.put(_Fields.JMX_ERR, new org.apache.thrift.meta_data.FieldMetaData("jmxErr", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JMXError.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryMbean2_result.class, metaDataMap); + } + + public queryMbean2_result() { + } + + public queryMbean2_result( + java.util.Map success, + JMXConnectionError connErr, + JMXError jmxErr) + { + this(); + this.success = success; + this.connErr = connErr; + this.jmxErr = jmxErr; + } + + /** + * Performs a deep copy on other. + */ + public queryMbean2_result(queryMbean2_result other) { + if (other.isSetSuccess()) { + java.util.Map __this__success = new java.util.HashMap(other.success); + this.success = __this__success; + } + if (other.isSetConnErr()) { + this.connErr = new JMXConnectionError(other.connErr); + } + if (other.isSetJmxErr()) { + this.jmxErr = new JMXError(other.jmxErr); + } + } + + public queryMbean2_result deepCopy() { + return new queryMbean2_result(this); + } + + @Override + public void clear() { + this.success = null; + this.connErr = null; + this.jmxErr = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(java.lang.String key, java.lang.String val) { + if (this.success == null) { + this.success = new java.util.HashMap(); + } + this.success.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getSuccess() { + return this.success; + } + + public queryMbean2_result setSuccess(@org.apache.thrift.annotation.Nullable java.util.Map success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @org.apache.thrift.annotation.Nullable + public JMXConnectionError getConnErr() { + return this.connErr; + } + + public queryMbean2_result setConnErr(@org.apache.thrift.annotation.Nullable JMXConnectionError connErr) { + this.connErr = connErr; + return this; + } + + public void unsetConnErr() { + this.connErr = null; + } + + /** Returns true if field connErr is set (has been assigned a value) and false otherwise */ + public boolean isSetConnErr() { + return this.connErr != null; + } + + public void setConnErrIsSet(boolean value) { + if (!value) { + this.connErr = null; + } + } + + @org.apache.thrift.annotation.Nullable + public JMXError getJmxErr() { + return this.jmxErr; + } + + public queryMbean2_result setJmxErr(@org.apache.thrift.annotation.Nullable JMXError jmxErr) { + this.jmxErr = jmxErr; + return this; + } + + public void unsetJmxErr() { + this.jmxErr = null; + } + + /** Returns true if field jmxErr is set (has been assigned a value) and false otherwise */ + public boolean isSetJmxErr() { + return this.jmxErr != null; + } + + public void setJmxErrIsSet(boolean value) { + if (!value) { + this.jmxErr = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.util.Map)value); + } + break; + + case CONN_ERR: + if (value == null) { + unsetConnErr(); + } else { + setConnErr((JMXConnectionError)value); + } + break; + + case JMX_ERR: + if (value == null) { + unsetJmxErr(); + } else { + setJmxErr((JMXError)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case CONN_ERR: + return getConnErr(); + + case JMX_ERR: + return getJmxErr(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case CONN_ERR: + return isSetConnErr(); + case JMX_ERR: + return isSetJmxErr(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof queryMbean2_result) + return this.equals((queryMbean2_result)that); + return false; + } + + public boolean equals(queryMbean2_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_connErr = true && this.isSetConnErr(); + boolean that_present_connErr = true && that.isSetConnErr(); + if (this_present_connErr || that_present_connErr) { + if (!(this_present_connErr && that_present_connErr)) + return false; + if (!this.connErr.equals(that.connErr)) + return false; + } + + boolean this_present_jmxErr = true && this.isSetJmxErr(); + boolean that_present_jmxErr = true && that.isSetJmxErr(); + if (this_present_jmxErr || that_present_jmxErr) { + if (!(this_present_jmxErr && that_present_jmxErr)) + return false; + if (!this.jmxErr.equals(that.jmxErr)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + hashCode = hashCode * 8191 + ((isSetConnErr()) ? 131071 : 524287); + if (isSetConnErr()) + hashCode = hashCode * 8191 + connErr.hashCode(); + + hashCode = hashCode * 8191 + ((isSetJmxErr()) ? 131071 : 524287); + if (isSetJmxErr()) + hashCode = hashCode * 8191 + jmxErr.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(queryMbean2_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConnErr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connErr, other.connErr); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetJmxErr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jmxErr, other.jmxErr); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("queryMbean2_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("connErr:"); + if (this.connErr == null) { + sb.append("null"); + } else { + sb.append(this.connErr); + } + first = false; + if (!first) sb.append(", "); + sb.append("jmxErr:"); + if (this.jmxErr == null) { + sb.append("null"); + } else { + sb.append(this.jmxErr); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class queryMbean2_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public queryMbean2_resultStandardScheme getScheme() { + return new queryMbean2_resultStandardScheme(); + } + } + + private static class queryMbean2_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, queryMbean2_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin(); + struct.success = new java.util.HashMap(2*_map8.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key9; + @org.apache.thrift.annotation.Nullable java.lang.String _val10; + for (int _i11 = 0; _i11 < _map8.size; ++_i11) + { + _key9 = iprot.readString(); + _val10 = iprot.readString(); + struct.success.put(_key9, _val10); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // CONN_ERR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.connErr = new JMXConnectionError(); + struct.connErr.read(iprot); + struct.setConnErrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // JMX_ERR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.jmxErr = new JMXError(); + struct.jmxErr.read(iprot); + struct.setJmxErrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, queryMbean2_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (java.util.Map.Entry _iter12 : struct.success.entrySet()) + { + oprot.writeString(_iter12.getKey()); + oprot.writeString(_iter12.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.connErr != null) { + oprot.writeFieldBegin(CONN_ERR_FIELD_DESC); + struct.connErr.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.jmxErr != null) { + oprot.writeFieldBegin(JMX_ERR_FIELD_DESC); + struct.jmxErr.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class queryMbean2_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public queryMbean2_resultTupleScheme getScheme() { + return new queryMbean2_resultTupleScheme(); + } + } + + private static class queryMbean2_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, queryMbean2_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetConnErr()) { + optionals.set(1); + } + if (struct.isSetJmxErr()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (java.util.Map.Entry _iter13 : struct.success.entrySet()) + { + oprot.writeString(_iter13.getKey()); + oprot.writeString(_iter13.getValue()); + } + } + } + if (struct.isSetConnErr()) { + struct.connErr.write(oprot); + } + if (struct.isSetJmxErr()) { + struct.jmxErr.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, queryMbean2_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map14 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new java.util.HashMap(2*_map14.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key15; + @org.apache.thrift.annotation.Nullable java.lang.String _val16; + for (int _i17 = 0; _i17 < _map14.size; ++_i17) + { + _key15 = iprot.readString(); + _val16 = iprot.readString(); + struct.success.put(_key15, _val16); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.connErr = new JMXConnectionError(); + struct.connErr.read(iprot); + struct.setConnErrIsSet(true); + } + if (incoming.get(2)) { + struct.jmxErr = new JMXError(); + struct.jmxErr.read(iprot); + struct.setJmxErrIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + public static class getLogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLogs_args"); @@ -3869,14 +5036,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, getLogs_result stru case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.success = new java.util.ArrayList(_list8.size); - @org.apache.thrift.annotation.Nullable LogMessage _elem9; - for (int _i10 = 0; _i10 < _list8.size; ++_i10) + org.apache.thrift.protocol.TList _list18 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list18.size); + @org.apache.thrift.annotation.Nullable LogMessage _elem19; + for (int _i20 = 0; _i20 < _list18.size; ++_i20) { - _elem9 = new LogMessage(); - _elem9.read(iprot); - struct.success.add(_elem9); + _elem19 = new LogMessage(); + _elem19.read(iprot); + struct.success.add(_elem19); } iprot.readListEnd(); } @@ -3904,9 +5071,9 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, getLogs_result str oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (LogMessage _iter11 : struct.success) + for (LogMessage _iter21 : struct.success) { - _iter11.write(oprot); + _iter21.write(oprot); } oprot.writeListEnd(); } @@ -3937,9 +5104,9 @@ public void write(org.apache.thrift.protocol.TProtocol prot, getLogs_result stru if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (LogMessage _iter12 : struct.success) + for (LogMessage _iter22 : struct.success) { - _iter12.write(oprot); + _iter22.write(oprot); } } } @@ -3951,14 +5118,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getLogs_result struc java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new java.util.ArrayList(_list13.size); - @org.apache.thrift.annotation.Nullable LogMessage _elem14; - for (int _i15 = 0; _i15 < _list13.size; ++_i15) + org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new java.util.ArrayList(_list23.size); + @org.apache.thrift.annotation.Nullable LogMessage _elem24; + for (int _i25 = 0; _i25 < _list23.size; ++_i25) { - _elem14 = new LogMessage(); - _elem14.read(iprot); - struct.success.add(_elem14); + _elem24 = new LogMessage(); + _elem24.read(iprot); + struct.success.add(_elem24); } } struct.setSuccessIsSet(true); diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/LogMessage.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/LogMessage.java similarity index 99% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/LogMessage.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/LogMessage.java index 648092d2..38f428c6 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/LogMessage.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/LogMessage.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public class LogMessage implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LogMessage"); diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/ValueType.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ValueType.java similarity index 92% rename from src/main/java/org/newrelic/nrjmx/v2/protocol/ValueType.java rename to src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ValueType.java index 4b4fc652..dcafbd7f 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/ValueType.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ValueType.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package org.newrelic.nrjmx.v2.protocol; +package org.newrelic.nrjmx.v2.nrprotocol; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-21") public enum ValueType implements org.apache.thrift.TEnum { STRING(1), DOUBLE(2), diff --git a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttribute.java b/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttribute.java deleted file mode 100644 index 8e202e67..00000000 --- a/src/main/java/org/newrelic/nrjmx/v2/protocol/JMXAttribute.java +++ /dev/null @@ -1,487 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.13.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.newrelic.nrjmx.v2.protocol; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2021-11-19") -public class JMXAttribute implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JMXAttribute"); - - private static final org.apache.thrift.protocol.TField ATTRIBUTE_FIELD_DESC = new org.apache.thrift.protocol.TField("attribute", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new JMXAttributeStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new JMXAttributeTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable java.lang.String attribute; // required - public @org.apache.thrift.annotation.Nullable JMXAttributeValue value; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - ATTRIBUTE((short)1, "attribute"), - VALUE((short)2, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // ATTRIBUTE - return ATTRIBUTE; - case 2: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ATTRIBUTE, new org.apache.thrift.meta_data.FieldMetaData("attribute", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JMXAttributeValue.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JMXAttribute.class, metaDataMap); - } - - public JMXAttribute() { - } - - public JMXAttribute( - java.lang.String attribute, - JMXAttributeValue value) - { - this(); - this.attribute = attribute; - this.value = value; - } - - /** - * Performs a deep copy on other. - */ - public JMXAttribute(JMXAttribute other) { - if (other.isSetAttribute()) { - this.attribute = other.attribute; - } - if (other.isSetValue()) { - this.value = new JMXAttributeValue(other.value); - } - } - - public JMXAttribute deepCopy() { - return new JMXAttribute(this); - } - - @Override - public void clear() { - this.attribute = null; - this.value = null; - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getAttribute() { - return this.attribute; - } - - public JMXAttribute setAttribute(@org.apache.thrift.annotation.Nullable java.lang.String attribute) { - this.attribute = attribute; - return this; - } - - public void unsetAttribute() { - this.attribute = null; - } - - /** Returns true if field attribute is set (has been assigned a value) and false otherwise */ - public boolean isSetAttribute() { - return this.attribute != null; - } - - public void setAttributeIsSet(boolean value) { - if (!value) { - this.attribute = null; - } - } - - @org.apache.thrift.annotation.Nullable - public JMXAttributeValue getValue() { - return this.value; - } - - public JMXAttribute setValue(@org.apache.thrift.annotation.Nullable JMXAttributeValue value) { - this.value = value; - return this; - } - - public void unsetValue() { - this.value = null; - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case ATTRIBUTE: - if (value == null) { - unsetAttribute(); - } else { - setAttribute((java.lang.String)value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((JMXAttributeValue)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case ATTRIBUTE: - return getAttribute(); - - case VALUE: - return getValue(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case ATTRIBUTE: - return isSetAttribute(); - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof JMXAttribute) - return this.equals((JMXAttribute)that); - return false; - } - - public boolean equals(JMXAttribute that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_attribute = true && this.isSetAttribute(); - boolean that_present_attribute = true && that.isSetAttribute(); - if (this_present_attribute || that_present_attribute) { - if (!(this_present_attribute && that_present_attribute)) - return false; - if (!this.attribute.equals(that.attribute)) - return false; - } - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetAttribute()) ? 131071 : 524287); - if (isSetAttribute()) - hashCode = hashCode * 8191 + attribute.hashCode(); - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(JMXAttribute other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetAttribute()).compareTo(other.isSetAttribute()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAttribute()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.attribute, other.attribute); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("JMXAttribute("); - boolean first = true; - - sb.append("attribute:"); - if (this.attribute == null) { - sb.append("null"); - } else { - sb.append(this.attribute); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (value != null) { - value.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class JMXAttributeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public JMXAttributeStandardScheme getScheme() { - return new JMXAttributeStandardScheme(); - } - } - - private static class JMXAttributeStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, JMXAttribute struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // ATTRIBUTE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.attribute = iprot.readString(); - struct.setAttributeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.value = new JMXAttributeValue(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, JMXAttribute struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.attribute != null) { - oprot.writeFieldBegin(ATTRIBUTE_FIELD_DESC); - oprot.writeString(struct.attribute); - oprot.writeFieldEnd(); - } - if (struct.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - struct.value.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class JMXAttributeTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public JMXAttributeTupleScheme getScheme() { - return new JMXAttributeTupleScheme(); - } - } - - private static class JMXAttributeTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, JMXAttribute struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetAttribute()) { - optionals.set(0); - } - if (struct.isSetValue()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetAttribute()) { - oprot.writeString(struct.attribute); - } - if (struct.isSetValue()) { - struct.value.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, JMXAttribute struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.attribute = iprot.readString(); - struct.setAttributeIsSet(true); - } - if (incoming.get(1)) { - struct.value = new JMXAttributeValue(); - struct.value.read(iprot); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/test-server/src/main/java/org/newrelic/jmx/Service.java b/test-server/src/main/java/org/newrelic/jmx/Service.java index 470ae535..393af5aa 100644 --- a/test-server/src/main/java/org/newrelic/jmx/Service.java +++ b/test-server/src/main/java/org/newrelic/jmx/Service.java @@ -46,11 +46,11 @@ public static void main(String[] args) throws Exception { // Removes all registered MBean cats put("/clear", (req, res) -> { server.queryNames(queryObject, null).forEach(cat -> { - log.info("unregistering {}", cat); + // log.info("unregistering {}", cat); try { server.unregisterMBean(cat); } catch (Exception e) { - log.error("unregistering", e); + // log.error("unregistering", e); } }); return "ok!\n";