diff --git a/commons/Dockerfile b/commons/Dockerfile index b81294b..08dfa53 100644 --- a/commons/Dockerfile +++ b/commons/Dockerfile @@ -1,4 +1,3 @@ -FROM ubuntu:20.04 +FROM alpine:3.15.0 -RUN apt-get update && \ - apt-get install -y thrift-compiler=0.13.0* \ No newline at end of file +RUN apk add thrift=0.15.0-r1 \ No newline at end of file diff --git a/gojmx/go.mod b/gojmx/go.mod index 83bfda4..cc3a904 100644 --- a/gojmx/go.mod +++ b/gojmx/go.mod @@ -3,7 +3,7 @@ module github.com/newrelic/nrjmx/gojmx go 1.16 require ( - github.com/apache/thrift v0.13.0 + github.com/apache/thrift v0.15.0 github.com/docker/docker v20.10.11+incompatible github.com/docker/go-connections v0.4.0 github.com/pkg/errors v0.9.1 diff --git a/gojmx/go.sum b/gojmx/go.sum index 832f1eb..e75f04c 100644 --- a/gojmx/go.sum +++ b/gojmx/go.sum @@ -67,6 +67,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= 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/apache/thrift v0.15.0 h1:aGvdaR0v1t9XLgjtBYwxcBvBOTMqClzwE26CHOgjW1Y= +github.com/apache/thrift v0.15.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= 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= @@ -281,6 +283,7 @@ 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.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= diff --git a/gojmx/internal/nrprotocol/GoUnusedProtection__.go b/gojmx/internal/nrprotocol/GoUnusedProtection__.go index 00597c9..0b7632f 100644 --- a/gojmx/internal/nrprotocol/GoUnusedProtection__.go +++ b/gojmx/internal/nrprotocol/GoUnusedProtection__.go @@ -1,5 +1,4 @@ -// Autogenerated by Thrift Compiler (0.13.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.15.0). DO NOT EDIT. package nrprotocol diff --git a/gojmx/internal/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go b/gojmx/internal/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go index d853ff1..877a11e 100755 --- a/gojmx/internal/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go +++ b/gojmx/internal/nrprotocol/j_m_x_service-remote/j_m_x_service-remote.go @@ -1,5 +1,4 @@ -// Autogenerated by Thrift Compiler (0.13.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.15.0). DO NOT EDIT. package main @@ -13,7 +12,7 @@ import ( "os" "strconv" "strings" - "github.com/apache/thrift/lib/go/thrift" + thrift "github.com/apache/thrift/lib/go/thrift" "github.com/newrelic/nrjmx/gojmx/internal/nrprotocol" ) @@ -92,6 +91,7 @@ func main() { cmd := flag.Arg(0) var err error + var cfg *thrift.TConfiguration = nil if useHttp { trans, err = thrift.NewTHttpClient(parsedUrl.String()) if len(headers) > 0 { @@ -109,13 +109,13 @@ func main() { os.Exit(1) } } - trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr)) + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) if err != nil { fmt.Fprintln(os.Stderr, "error resolving address:", err) os.Exit(1) } if framed { - trans = thrift.NewTFramedTransport(trans) + trans = thrift.NewTFramedTransportConf(trans, cfg) } } if err != nil { @@ -126,16 +126,16 @@ func main() { var protocolFactory thrift.TProtocolFactory switch protocol { case "compact": - protocolFactory = thrift.NewTCompactProtocolFactory() + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) break case "simplejson": - protocolFactory = thrift.NewTSimpleJSONProtocolFactory() + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) break case "json": protocolFactory = thrift.NewTJSONProtocolFactory() break case "binary", "": - protocolFactory = thrift.NewTBinaryProtocolFactoryDefault() + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) break default: fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) @@ -156,19 +156,19 @@ func main() { fmt.Fprintln(os.Stderr, "Connect requires 1 args") flag.Usage() } - arg21 := flag.Arg(1) - mbTrans22 := thrift.NewTMemoryBufferLen(len(arg21)) - defer mbTrans22.Close() - _, err23 := mbTrans22.WriteString(arg21) - if err23 != nil { + arg28 := flag.Arg(1) + mbTrans29 := thrift.NewTMemoryBufferLen(len(arg28)) + defer mbTrans29.Close() + _, err30 := mbTrans29.WriteString(arg28) + if err30 != nil { Usage() return } - factory24 := thrift.NewTJSONProtocolFactory() - jsProt25 := factory24.GetProtocol(mbTrans22) + factory31 := thrift.NewTJSONProtocolFactory() + jsProt32 := factory31.GetProtocol(mbTrans29) argvalue0 := nrprotocol.NewJMXConfig() - err26 := argvalue0.Read(jsProt25) - if err26 != nil { + err33 := argvalue0.Read(context.Background(), jsProt32) + if err33 != nil { Usage() return } @@ -219,19 +219,19 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - arg30 := flag.Arg(2) - mbTrans31 := thrift.NewTMemoryBufferLen(len(arg30)) - defer mbTrans31.Close() - _, err32 := mbTrans31.WriteString(arg30) - if err32 != nil { + arg37 := flag.Arg(2) + mbTrans38 := thrift.NewTMemoryBufferLen(len(arg37)) + defer mbTrans38.Close() + _, err39 := mbTrans38.WriteString(arg37) + if err39 != nil { Usage() return } - factory33 := thrift.NewTJSONProtocolFactory() - jsProt34 := factory33.GetProtocol(mbTrans31) + factory40 := thrift.NewTJSONProtocolFactory() + jsProt41 := factory40.GetProtocol(mbTrans38) containerStruct1 := nrprotocol.NewJMXServiceGetMBeanAttributesArgs() - err35 := containerStruct1.ReadField2(jsProt34) - if err35 != nil { + err42 := containerStruct1.ReadField2(context.Background(), jsProt41) + if err42 != nil { Usage() return } diff --git a/gojmx/internal/nrprotocol/nrjmx-consts.go b/gojmx/internal/nrprotocol/nrjmx-consts.go index 53cf3e7..e0f3872 100644 --- a/gojmx/internal/nrprotocol/nrjmx-consts.go +++ b/gojmx/internal/nrprotocol/nrjmx-consts.go @@ -1,21 +1,20 @@ -// Autogenerated by Thrift Compiler (0.13.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.15.0). DO NOT EDIT. package nrprotocol -import( +import ( "bytes" "context" - "reflect" "fmt" - "github.com/apache/thrift/lib/go/thrift" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" ) // (needed to ensure safety because of naive import list construction.) var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = reflect.DeepEqual +var _ = time.Now var _ = bytes.Equal diff --git a/gojmx/internal/nrprotocol/nrjmx.go b/gojmx/internal/nrprotocol/nrjmx.go index 9bc45a3..3ead6fc 100644 --- a/gojmx/internal/nrprotocol/nrjmx.go +++ b/gojmx/internal/nrprotocol/nrjmx.go @@ -1,23 +1,22 @@ -// Autogenerated by Thrift Compiler (0.13.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.15.0). DO NOT EDIT. package nrprotocol -import( +import ( "bytes" "context" - "reflect" "database/sql/driver" "errors" "fmt" - "github.com/apache/thrift/lib/go/thrift" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" ) // (needed to ensure safety because of naive import list construction.) var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = reflect.DeepEqual +var _ = time.Now var _ = bytes.Equal type ResponseType int64 @@ -187,14 +186,14 @@ func (p *JMXConfig) IsSetUriPath() bool { return p.UriPath != nil } -func (p *JMXConfig) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXConfig) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -202,171 +201,171 @@ func (p *JMXConfig) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.I32 { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRING { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.STRING { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 7: if fieldTypeId == thrift.STRING { - if err := p.ReadField7(iprot); err != nil { + if err := p.ReadField7(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 8: if fieldTypeId == thrift.STRING { - if err := p.ReadField8(iprot); err != nil { + if err := p.ReadField8(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 9: if fieldTypeId == thrift.STRING { - if err := p.ReadField9(iprot); err != nil { + if err := p.ReadField9(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 10: if fieldTypeId == thrift.STRING { - if err := p.ReadField10(iprot); err != nil { + if err := p.ReadField10(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 11: if fieldTypeId == thrift.BOOL { - if err := p.ReadField11(iprot); err != nil { + if err := p.ReadField11(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 12: if fieldTypeId == thrift.BOOL { - if err := p.ReadField12(iprot); err != nil { + if err := p.ReadField12(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 13: if fieldTypeId == thrift.BOOL { - if err := p.ReadField13(iprot); err != nil { + if err := p.ReadField13(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 14: if fieldTypeId == thrift.I64 { - if err := p.ReadField14(iprot); err != nil { + if err := p.ReadField14(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 15: if fieldTypeId == thrift.BOOL { - if err := p.ReadField15(iprot); err != nil { + if err := p.ReadField15(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXConfig) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.ConnectionURL = v @@ -374,8 +373,8 @@ func (p *JMXConfig) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Hostname = v @@ -383,8 +382,8 @@ func (p *JMXConfig) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *JMXConfig) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { p.Port = v @@ -392,8 +391,8 @@ func (p *JMXConfig) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { p.UriPath = &v @@ -401,8 +400,8 @@ func (p *JMXConfig) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 5: ", err) } else { p.Username = v @@ -410,8 +409,8 @@ func (p *JMXConfig) ReadField5(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 6: ", err) } else { p.Password = v @@ -419,8 +418,8 @@ func (p *JMXConfig) ReadField6(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField7(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 7: ", err) } else { p.KeyStore = v @@ -428,8 +427,8 @@ func (p *JMXConfig) ReadField7(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField8(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 8: ", err) } else { p.KeyStorePassword = v @@ -437,8 +436,8 @@ func (p *JMXConfig) ReadField8(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField9(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 9: ", err) } else { p.TrustStore = v @@ -446,8 +445,8 @@ func (p *JMXConfig) ReadField9(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField10(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConfig) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 10: ", err) } else { p.TrustStorePassword = v @@ -455,8 +454,8 @@ func (p *JMXConfig) ReadField10(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField11(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *JMXConfig) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 11: ", err) } else { p.IsRemote = v @@ -464,8 +463,8 @@ func (p *JMXConfig) ReadField11(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField12(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *JMXConfig) ReadField12(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 12: ", err) } else { p.IsJBossStandaloneMode = v @@ -473,8 +472,8 @@ func (p *JMXConfig) ReadField12(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField13(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *JMXConfig) ReadField13(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 13: ", err) } else { p.UseSSL = v @@ -482,8 +481,8 @@ func (p *JMXConfig) ReadField13(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField14(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *JMXConfig) ReadField14(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 14: ", err) } else { p.RequestTimeoutMs = v @@ -491,8 +490,8 @@ func (p *JMXConfig) ReadField14(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) ReadField15(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *JMXConfig) ReadField15(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 15: ", err) } else { p.Verbose = v @@ -500,185 +499,214 @@ func (p *JMXConfig) ReadField15(iprot thrift.TProtocol) error { return nil } -func (p *JMXConfig) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("JMXConfig"); err != nil { +func (p *JMXConfig) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "JMXConfig"); 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 := 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 := p.writeField7(oprot); err != nil { return err } - if err := p.writeField8(oprot); err != nil { return err } - if err := p.writeField9(oprot); err != nil { return err } - if err := p.writeField10(oprot); err != nil { return err } - if err := p.writeField11(oprot); err != nil { return err } - if err := p.writeField12(oprot); err != nil { return err } - if err := p.writeField13(oprot); err != nil { return err } - if err := p.writeField14(oprot); err != nil { return err } - if err := p.writeField15(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + if err := p.writeField11(ctx, oprot); err != nil { return err } + if err := p.writeField12(ctx, oprot); err != nil { return err } + if err := p.writeField13(ctx, oprot); err != nil { return err } + if err := p.writeField14(ctx, oprot); err != nil { return err } + if err := p.writeField15(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXConfig) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("connectionURL", thrift.STRING, 1); err != nil { +func (p *JMXConfig) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "connectionURL", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:connectionURL: ", p), err) } - if err := oprot.WriteString(string(p.ConnectionURL)); err != nil { + if err := oprot.WriteString(ctx, string(p.ConnectionURL)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.connectionURL (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connectionURL: ", p), err) } return err } -func (p *JMXConfig) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hostname", thrift.STRING, 2); err != nil { +func (p *JMXConfig) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hostname", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hostname: ", p), err) } - if err := oprot.WriteString(string(p.Hostname)); err != nil { + if err := oprot.WriteString(ctx, string(p.Hostname)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.hostname (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hostname: ", p), err) } return err } -func (p *JMXConfig) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("port", thrift.I32, 3); err != nil { +func (p *JMXConfig) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "port", thrift.I32, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:port: ", p), err) } - if err := oprot.WriteI32(int32(p.Port)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.Port)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.port (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:port: ", p), err) } return err } -func (p *JMXConfig) writeField4(oprot thrift.TProtocol) (err error) { +func (p *JMXConfig) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetUriPath() { - if err := oprot.WriteFieldBegin("uriPath", thrift.STRING, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "uriPath", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:uriPath: ", p), err) } - if err := oprot.WriteString(string(*p.UriPath)); err != nil { + if err := oprot.WriteString(ctx, string(*p.UriPath)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.uriPath (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:uriPath: ", p), err) } } return err } -func (p *JMXConfig) writeField5(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("username", thrift.STRING, 5); err != nil { +func (p *JMXConfig) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:username: ", p), err) } - if err := oprot.WriteString(string(p.Username)); err != nil { + if err := oprot.WriteString(ctx, string(p.Username)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.username (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:username: ", p), err) } return err } -func (p *JMXConfig) writeField6(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("password", thrift.STRING, 6); err != nil { +func (p *JMXConfig) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:password: ", p), err) } - if err := oprot.WriteString(string(p.Password)); err != nil { + if err := oprot.WriteString(ctx, string(p.Password)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.password (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:password: ", p), err) } return err } -func (p *JMXConfig) writeField7(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("keyStore", thrift.STRING, 7); err != nil { +func (p *JMXConfig) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "keyStore", thrift.STRING, 7); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:keyStore: ", p), err) } - if err := oprot.WriteString(string(p.KeyStore)); err != nil { + if err := oprot.WriteString(ctx, string(p.KeyStore)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.keyStore (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 7:keyStore: ", p), err) } return err } -func (p *JMXConfig) writeField8(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("keyStorePassword", thrift.STRING, 8); err != nil { +func (p *JMXConfig) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "keyStorePassword", thrift.STRING, 8); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:keyStorePassword: ", p), err) } - if err := oprot.WriteString(string(p.KeyStorePassword)); err != nil { + if err := oprot.WriteString(ctx, string(p.KeyStorePassword)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.keyStorePassword (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 8:keyStorePassword: ", p), err) } return err } -func (p *JMXConfig) writeField9(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("trustStore", thrift.STRING, 9); err != nil { +func (p *JMXConfig) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "trustStore", thrift.STRING, 9); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:trustStore: ", p), err) } - if err := oprot.WriteString(string(p.TrustStore)); err != nil { + if err := oprot.WriteString(ctx, string(p.TrustStore)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.trustStore (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 9:trustStore: ", p), err) } return err } -func (p *JMXConfig) writeField10(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("trustStorePassword", thrift.STRING, 10); err != nil { +func (p *JMXConfig) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "trustStorePassword", thrift.STRING, 10); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:trustStorePassword: ", p), err) } - if err := oprot.WriteString(string(p.TrustStorePassword)); err != nil { + if err := oprot.WriteString(ctx, string(p.TrustStorePassword)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.trustStorePassword (10) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 10:trustStorePassword: ", p), err) } return err } -func (p *JMXConfig) writeField11(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("isRemote", thrift.BOOL, 11); err != nil { +func (p *JMXConfig) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "isRemote", thrift.BOOL, 11); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:isRemote: ", p), err) } - if err := oprot.WriteBool(bool(p.IsRemote)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.IsRemote)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.isRemote (11) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 11:isRemote: ", p), err) } return err } -func (p *JMXConfig) writeField12(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("isJBossStandaloneMode", thrift.BOOL, 12); err != nil { +func (p *JMXConfig) writeField12(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "isJBossStandaloneMode", thrift.BOOL, 12); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:isJBossStandaloneMode: ", p), err) } - if err := oprot.WriteBool(bool(p.IsJBossStandaloneMode)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.IsJBossStandaloneMode)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.isJBossStandaloneMode (12) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 12:isJBossStandaloneMode: ", p), err) } return err } -func (p *JMXConfig) writeField13(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("useSSL", thrift.BOOL, 13); err != nil { +func (p *JMXConfig) writeField13(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "useSSL", thrift.BOOL, 13); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:useSSL: ", p), err) } - if err := oprot.WriteBool(bool(p.UseSSL)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.UseSSL)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.useSSL (13) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 13:useSSL: ", p), err) } return err } -func (p *JMXConfig) writeField14(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("requestTimeoutMs", thrift.I64, 14); err != nil { +func (p *JMXConfig) writeField14(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "requestTimeoutMs", thrift.I64, 14); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:requestTimeoutMs: ", p), err) } - if err := oprot.WriteI64(int64(p.RequestTimeoutMs)); err != nil { + if err := oprot.WriteI64(ctx, int64(p.RequestTimeoutMs)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.requestTimeoutMs (14) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 14:requestTimeoutMs: ", p), err) } return err } -func (p *JMXConfig) writeField15(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("verbose", thrift.BOOL, 15); err != nil { +func (p *JMXConfig) writeField15(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "verbose", thrift.BOOL, 15); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 15:verbose: ", p), err) } - if err := oprot.WriteBool(bool(p.Verbose)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.Verbose)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.verbose (15) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 15:verbose: ", p), err) } return err } +func (p *JMXConfig) Equals(other *JMXConfig) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ConnectionURL != other.ConnectionURL { return false } + if p.Hostname != other.Hostname { return false } + if p.Port != other.Port { return false } + if p.UriPath != other.UriPath { + if p.UriPath == nil || other.UriPath == nil { + return false + } + if (*p.UriPath) != (*other.UriPath) { return false } + } + if p.Username != other.Username { return false } + if p.Password != other.Password { return false } + if p.KeyStore != other.KeyStore { return false } + if p.KeyStorePassword != other.KeyStorePassword { return false } + if p.TrustStore != other.TrustStore { return false } + if p.TrustStorePassword != other.TrustStorePassword { return false } + if p.IsRemote != other.IsRemote { return false } + if p.IsJBossStandaloneMode != other.IsJBossStandaloneMode { return false } + if p.UseSSL != other.UseSSL { return false } + if p.RequestTimeoutMs != other.RequestTimeoutMs { return false } + if p.Verbose != other.Verbose { return false } + return true +} + func (p *JMXConfig) String() string { if p == nil { return "" @@ -736,14 +764,14 @@ func (p *AttributeResponse) GetIntValue() int64 { func (p *AttributeResponse) GetBoolValue() bool { return p.BoolValue } -func (p *AttributeResponse) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *AttributeResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -751,91 +779,91 @@ func (p *AttributeResponse) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.I32 { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.I64 { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 7: if fieldTypeId == thrift.BOOL { - if err := p.ReadField7(iprot); err != nil { + if err := p.ReadField7(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *AttributeResponse) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *AttributeResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.StatusMsg = v @@ -843,8 +871,8 @@ func (p *AttributeResponse) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *AttributeResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Name = v @@ -852,8 +880,8 @@ func (p *AttributeResponse) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *AttributeResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { temp := ResponseType(v) @@ -862,8 +890,8 @@ func (p *AttributeResponse) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *AttributeResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { p.StringValue = v @@ -871,8 +899,8 @@ func (p *AttributeResponse) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { +func (p *AttributeResponse) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { return thrift.PrependError("error reading field 5: ", err) } else { p.DoubleValue = v @@ -880,8 +908,8 @@ func (p *AttributeResponse) ReadField5(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *AttributeResponse) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 6: ", err) } else { p.IntValue = v @@ -889,8 +917,8 @@ func (p *AttributeResponse) ReadField6(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) ReadField7(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *AttributeResponse) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 7: ", err) } else { p.BoolValue = v @@ -898,95 +926,111 @@ func (p *AttributeResponse) ReadField7(iprot thrift.TProtocol) error { return nil } -func (p *AttributeResponse) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("AttributeResponse"); err != nil { +func (p *AttributeResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AttributeResponse"); 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 := 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 := p.writeField7(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *AttributeResponse) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("statusMsg", thrift.STRING, 1); err != nil { +func (p *AttributeResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "statusMsg", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusMsg: ", p), err) } - if err := oprot.WriteString(string(p.StatusMsg)); err != nil { + if err := oprot.WriteString(ctx, string(p.StatusMsg)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.statusMsg (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusMsg: ", p), err) } return err } -func (p *AttributeResponse) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil { +func (p *AttributeResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } - if err := oprot.WriteString(string(p.Name)); err != nil { + if err := oprot.WriteString(ctx, string(p.Name)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } return err } -func (p *AttributeResponse) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("responseType", thrift.I32, 3); err != nil { +func (p *AttributeResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "responseType", thrift.I32, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:responseType: ", p), err) } - if err := oprot.WriteI32(int32(p.ResponseType)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.ResponseType)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.responseType (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:responseType: ", p), err) } return err } -func (p *AttributeResponse) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 4); err != nil { +func (p *AttributeResponse) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stringValue: ", p), err) } - if err := oprot.WriteString(string(p.StringValue)); err != nil { + if err := oprot.WriteString(ctx, string(p.StringValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.stringValue (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stringValue: ", p), err) } return err } -func (p *AttributeResponse) writeField5(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("doubleValue", thrift.DOUBLE, 5); err != nil { +func (p *AttributeResponse) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "doubleValue", thrift.DOUBLE, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:doubleValue: ", p), err) } - if err := oprot.WriteDouble(float64(p.DoubleValue)); err != nil { + if err := oprot.WriteDouble(ctx, float64(p.DoubleValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.doubleValue (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:doubleValue: ", p), err) } return err } -func (p *AttributeResponse) writeField6(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("intValue", thrift.I64, 6); err != nil { +func (p *AttributeResponse) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "intValue", thrift.I64, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:intValue: ", p), err) } - if err := oprot.WriteI64(int64(p.IntValue)); err != nil { + if err := oprot.WriteI64(ctx, int64(p.IntValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.intValue (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:intValue: ", p), err) } return err } -func (p *AttributeResponse) writeField7(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("boolValue", thrift.BOOL, 7); err != nil { +func (p *AttributeResponse) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "boolValue", thrift.BOOL, 7); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:boolValue: ", p), err) } - if err := oprot.WriteBool(bool(p.BoolValue)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.BoolValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.boolValue (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 7:boolValue: ", p), err) } return err } +func (p *AttributeResponse) Equals(other *AttributeResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StatusMsg != other.StatusMsg { return false } + if p.Name != other.Name { return false } + if p.ResponseType != other.ResponseType { return false } + if p.StringValue != other.StringValue { return false } + if p.DoubleValue != other.DoubleValue { return false } + if p.IntValue != other.IntValue { return false } + if p.BoolValue != other.BoolValue { return false } + return true +} + func (p *AttributeResponse) String() string { if p == nil { return "" @@ -1020,14 +1064,14 @@ func (p *JMXError) GetCauseMessage() string { func (p *JMXError) GetStacktrace() string { return p.Stacktrace } -func (p *JMXError) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXError) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1035,51 +1079,51 @@ func (p *JMXError) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXError) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXError) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Message = v @@ -1087,8 +1131,8 @@ func (p *JMXError) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *JMXError) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXError) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.CauseMessage = v @@ -1096,8 +1140,8 @@ func (p *JMXError) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *JMXError) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXError) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { p.Stacktrace = v @@ -1105,51 +1149,63 @@ func (p *JMXError) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *JMXError) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("JMXError"); err != nil { +func (p *JMXError) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "JMXError"); 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 := p.writeField3(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXError) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil { +func (p *JMXError) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "message", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) } - if err := oprot.WriteString(string(p.Message)); err != nil { + if err := oprot.WriteString(ctx, string(p.Message)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) } return err } -func (p *JMXError) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("causeMessage", thrift.STRING, 2); err != nil { +func (p *JMXError) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "causeMessage", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:causeMessage: ", p), err) } - if err := oprot.WriteString(string(p.CauseMessage)); err != nil { + if err := oprot.WriteString(ctx, string(p.CauseMessage)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.causeMessage (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:causeMessage: ", p), err) } return err } -func (p *JMXError) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("stacktrace", thrift.STRING, 3); err != nil { +func (p *JMXError) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stacktrace", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stacktrace: ", p), err) } - if err := oprot.WriteString(string(p.Stacktrace)); err != nil { + if err := oprot.WriteString(ctx, string(p.Stacktrace)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.stacktrace (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stacktrace: ", p), err) } return err } +func (p *JMXError) Equals(other *JMXError) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Message != other.Message { return false } + if p.CauseMessage != other.CauseMessage { return false } + if p.Stacktrace != other.Stacktrace { return false } + return true +} + func (p *JMXError) String() string { if p == nil { return "" @@ -1161,6 +1217,12 @@ func (p *JMXError) Error() string { return p.String() } +func (JMXError) TExceptionType() thrift.TExceptionType { + return thrift.TExceptionTypeCompiled +} + +var _ thrift.TException = (*JMXError)(nil) + // Attributes: // - Message type JMXConnectionError struct { @@ -1175,14 +1237,14 @@ func NewJMXConnectionError() *JMXConnectionError { func (p *JMXConnectionError) GetMessage() string { return p.Message } -func (p *JMXConnectionError) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXConnectionError) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1190,31 +1252,31 @@ func (p *JMXConnectionError) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXConnectionError) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXConnectionError) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Message = v @@ -1222,29 +1284,39 @@ func (p *JMXConnectionError) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *JMXConnectionError) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("JMXConnectionError"); err != nil { +func (p *JMXConnectionError) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "JMXConnectionError"); 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.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXConnectionError) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil { +func (p *JMXConnectionError) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "message", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) } - if err := oprot.WriteString(string(p.Message)); err != nil { + if err := oprot.WriteString(ctx, string(p.Message)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) } return err } +func (p *JMXConnectionError) Equals(other *JMXConnectionError) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Message != other.Message { return false } + return true +} + func (p *JMXConnectionError) String() string { if p == nil { return "" @@ -1256,29 +1328,36 @@ func (p *JMXConnectionError) Error() string { return p.String() } +func (JMXConnectionError) TExceptionType() thrift.TExceptionType { + return thrift.TExceptionTypeCompiled +} + +var _ thrift.TException = (*JMXConnectionError)(nil) + type JMXService interface { // Parameters: // - Config - Connect(ctx context.Context, config *JMXConfig) (err error) - Disconnect(ctx context.Context) (err error) - GetClientVersion(ctx context.Context) (r string, err error) + Connect(ctx context.Context, config *JMXConfig) (_err error) + Disconnect(ctx context.Context) (_err error) + GetClientVersion(ctx context.Context) (_r string, _err error) // Parameters: // - MBeanNamePattern - QueryMBeanNames(ctx context.Context, mBeanNamePattern string) (r []string, err error) + QueryMBeanNames(ctx context.Context, mBeanNamePattern string) (_r []string, _err error) // Parameters: // - MBeanName - GetMBeanAttributeNames(ctx context.Context, mBeanName string) (r []string, err error) + GetMBeanAttributeNames(ctx context.Context, mBeanName string) (_r []string, _err error) // Parameters: // - MBeanName // - Attributes - GetMBeanAttributes(ctx context.Context, mBeanName string, attributes []string) (r []*AttributeResponse, err error) + GetMBeanAttributes(ctx context.Context, mBeanName string, attributes []string) (_r []*AttributeResponse, _err error) // Parameters: // - MBeanNamePattern - QueryMBeanAttributes(ctx context.Context, mBeanNamePattern string) (r []*AttributeResponse, err error) + QueryMBeanAttributes(ctx context.Context, mBeanNamePattern string) (_r []*AttributeResponse, _err error) } type JMXServiceClient struct { c thrift.TClient + meta thrift.ResponseMeta } func NewJMXServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *JMXServiceClient { @@ -1302,129 +1381,159 @@ func NewJMXServiceClient(c thrift.TClient) *JMXServiceClient { func (p *JMXServiceClient) Client_() thrift.TClient { return p.c } + +func (p *JMXServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *JMXServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + // Parameters: // - Config -func (p *JMXServiceClient) Connect(ctx context.Context, config *JMXConfig) (err error) { +func (p *JMXServiceClient) Connect(ctx context.Context, config *JMXConfig) (_err error) { var _args0 JMXServiceConnectArgs _args0.Config = config - var _result1 JMXServiceConnectResult - if err = p.Client_().Call(ctx, "connect", &_args0, &_result1); err != nil { + var _result2 JMXServiceConnectResult + var _meta1 thrift.ResponseMeta + _meta1, _err = p.Client_().Call(ctx, "connect", &_args0, &_result2) + p.SetLastResponseMeta_(_meta1) + if _err != nil { return } switch { - case _result1.ConnErr!= nil: - return _result1.ConnErr - case _result1.JmxErr!= nil: - return _result1.JmxErr + case _result2.ConnErr!= nil: + return _result2.ConnErr + case _result2.JmxErr!= nil: + return _result2.JmxErr } return nil } -func (p *JMXServiceClient) Disconnect(ctx context.Context) (err error) { - var _args2 JMXServiceDisconnectArgs - var _result3 JMXServiceDisconnectResult - if err = p.Client_().Call(ctx, "disconnect", &_args2, &_result3); err != nil { +func (p *JMXServiceClient) Disconnect(ctx context.Context) (_err error) { + var _args3 JMXServiceDisconnectArgs + var _result5 JMXServiceDisconnectResult + var _meta4 thrift.ResponseMeta + _meta4, _err = p.Client_().Call(ctx, "disconnect", &_args3, &_result5) + p.SetLastResponseMeta_(_meta4) + if _err != nil { return } switch { - case _result3.Err!= nil: - return _result3.Err + case _result5.Err!= nil: + return _result5.Err } return nil } -func (p *JMXServiceClient) GetClientVersion(ctx context.Context) (r string, err error) { - var _args4 JMXServiceGetClientVersionArgs - var _result5 JMXServiceGetClientVersionResult - if err = p.Client_().Call(ctx, "getClientVersion", &_args4, &_result5); err != nil { +func (p *JMXServiceClient) GetClientVersion(ctx context.Context) (_r string, _err error) { + var _args6 JMXServiceGetClientVersionArgs + var _result8 JMXServiceGetClientVersionResult + var _meta7 thrift.ResponseMeta + _meta7, _err = p.Client_().Call(ctx, "getClientVersion", &_args6, &_result8) + p.SetLastResponseMeta_(_meta7) + if _err != nil { return } switch { - case _result5.Err!= nil: - return r, _result5.Err + case _result8.Err!= nil: + return _r, _result8.Err } - return _result5.GetSuccess(), nil + return _result8.GetSuccess(), nil } // Parameters: // - MBeanNamePattern -func (p *JMXServiceClient) QueryMBeanNames(ctx context.Context, mBeanNamePattern string) (r []string, err error) { - var _args6 JMXServiceQueryMBeanNamesArgs - _args6.MBeanNamePattern = mBeanNamePattern - var _result7 JMXServiceQueryMBeanNamesResult - if err = p.Client_().Call(ctx, "queryMBeanNames", &_args6, &_result7); err != nil { +func (p *JMXServiceClient) QueryMBeanNames(ctx context.Context, mBeanNamePattern string) (_r []string, _err error) { + var _args9 JMXServiceQueryMBeanNamesArgs + _args9.MBeanNamePattern = mBeanNamePattern + var _result11 JMXServiceQueryMBeanNamesResult + var _meta10 thrift.ResponseMeta + _meta10, _err = p.Client_().Call(ctx, "queryMBeanNames", &_args9, &_result11) + p.SetLastResponseMeta_(_meta10) + if _err != nil { return } switch { - case _result7.ConnErr!= nil: - return r, _result7.ConnErr - case _result7.JmxErr!= nil: - return r, _result7.JmxErr + case _result11.ConnErr!= nil: + return _r, _result11.ConnErr + case _result11.JmxErr!= nil: + return _r, _result11.JmxErr } - return _result7.GetSuccess(), nil + return _result11.GetSuccess(), nil } // Parameters: // - MBeanName -func (p *JMXServiceClient) GetMBeanAttributeNames(ctx context.Context, mBeanName string) (r []string, err error) { - var _args8 JMXServiceGetMBeanAttributeNamesArgs - _args8.MBeanName = mBeanName - var _result9 JMXServiceGetMBeanAttributeNamesResult - if err = p.Client_().Call(ctx, "getMBeanAttributeNames", &_args8, &_result9); err != nil { +func (p *JMXServiceClient) GetMBeanAttributeNames(ctx context.Context, mBeanName string) (_r []string, _err error) { + var _args12 JMXServiceGetMBeanAttributeNamesArgs + _args12.MBeanName = mBeanName + var _result14 JMXServiceGetMBeanAttributeNamesResult + var _meta13 thrift.ResponseMeta + _meta13, _err = p.Client_().Call(ctx, "getMBeanAttributeNames", &_args12, &_result14) + p.SetLastResponseMeta_(_meta13) + if _err != nil { return } switch { - case _result9.ConnErr!= nil: - return r, _result9.ConnErr - case _result9.JmxErr!= nil: - return r, _result9.JmxErr + case _result14.ConnErr!= nil: + return _r, _result14.ConnErr + case _result14.JmxErr!= nil: + return _r, _result14.JmxErr } - return _result9.GetSuccess(), nil + return _result14.GetSuccess(), nil } // Parameters: // - MBeanName // - Attributes -func (p *JMXServiceClient) GetMBeanAttributes(ctx context.Context, mBeanName string, attributes []string) (r []*AttributeResponse, err error) { - var _args10 JMXServiceGetMBeanAttributesArgs - _args10.MBeanName = mBeanName - _args10.Attributes = attributes - var _result11 JMXServiceGetMBeanAttributesResult - if err = p.Client_().Call(ctx, "getMBeanAttributes", &_args10, &_result11); err != nil { +func (p *JMXServiceClient) GetMBeanAttributes(ctx context.Context, mBeanName string, attributes []string) (_r []*AttributeResponse, _err error) { + var _args15 JMXServiceGetMBeanAttributesArgs + _args15.MBeanName = mBeanName + _args15.Attributes = attributes + var _result17 JMXServiceGetMBeanAttributesResult + var _meta16 thrift.ResponseMeta + _meta16, _err = p.Client_().Call(ctx, "getMBeanAttributes", &_args15, &_result17) + p.SetLastResponseMeta_(_meta16) + if _err != nil { return } switch { - case _result11.ConnErr!= nil: - return r, _result11.ConnErr - case _result11.JmxErr!= nil: - return r, _result11.JmxErr + case _result17.ConnErr!= nil: + return _r, _result17.ConnErr + case _result17.JmxErr!= nil: + return _r, _result17.JmxErr } - return _result11.GetSuccess(), nil + return _result17.GetSuccess(), nil } // Parameters: // - MBeanNamePattern -func (p *JMXServiceClient) QueryMBeanAttributes(ctx context.Context, mBeanNamePattern string) (r []*AttributeResponse, err error) { - var _args12 JMXServiceQueryMBeanAttributesArgs - _args12.MBeanNamePattern = mBeanNamePattern - var _result13 JMXServiceQueryMBeanAttributesResult - if err = p.Client_().Call(ctx, "queryMBeanAttributes", &_args12, &_result13); err != nil { +func (p *JMXServiceClient) QueryMBeanAttributes(ctx context.Context, mBeanNamePattern string) (_r []*AttributeResponse, _err error) { + var _args18 JMXServiceQueryMBeanAttributesArgs + _args18.MBeanNamePattern = mBeanNamePattern + var _result20 JMXServiceQueryMBeanAttributesResult + var _meta19 thrift.ResponseMeta + _meta19, _err = p.Client_().Call(ctx, "queryMBeanAttributes", &_args18, &_result20) + p.SetLastResponseMeta_(_meta19) + if _err != nil { return } switch { - case _result13.ConnErr!= nil: - return r, _result13.ConnErr - case _result13.JmxErr!= nil: - return r, _result13.JmxErr + case _result20.ConnErr!= nil: + return _r, _result20.ConnErr + case _result20.JmxErr!= nil: + return _r, _result20.JmxErr } - return _result13.GetSuccess(), nil + return _result20.GetSuccess(), nil } type JMXServiceProcessor struct { @@ -1447,31 +1556,31 @@ func (p *JMXServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunctio func NewJMXServiceProcessor(handler JMXService) *JMXServiceProcessor { - self14 := &JMXServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self14.processorMap["connect"] = &jMXServiceProcessorConnect{handler:handler} - self14.processorMap["disconnect"] = &jMXServiceProcessorDisconnect{handler:handler} - self14.processorMap["getClientVersion"] = &jMXServiceProcessorGetClientVersion{handler:handler} - self14.processorMap["queryMBeanNames"] = &jMXServiceProcessorQueryMBeanNames{handler:handler} - self14.processorMap["getMBeanAttributeNames"] = &jMXServiceProcessorGetMBeanAttributeNames{handler:handler} - self14.processorMap["getMBeanAttributes"] = &jMXServiceProcessorGetMBeanAttributes{handler:handler} - self14.processorMap["queryMBeanAttributes"] = &jMXServiceProcessorQueryMBeanAttributes{handler:handler} -return self14 + self21 := &JMXServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self21.processorMap["connect"] = &jMXServiceProcessorConnect{handler:handler} + self21.processorMap["disconnect"] = &jMXServiceProcessorDisconnect{handler:handler} + self21.processorMap["getClientVersion"] = &jMXServiceProcessorGetClientVersion{handler:handler} + self21.processorMap["queryMBeanNames"] = &jMXServiceProcessorQueryMBeanNames{handler:handler} + self21.processorMap["getMBeanAttributeNames"] = &jMXServiceProcessorGetMBeanAttributeNames{handler:handler} + self21.processorMap["getMBeanAttributes"] = &jMXServiceProcessorGetMBeanAttributes{handler:handler} + self21.processorMap["queryMBeanAttributes"] = &jMXServiceProcessorQueryMBeanAttributes{handler:handler} +return self21 } func (p *JMXServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { return false, err } + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } if processor, ok := p.GetProcessorFunction(name); ok { return processor.Process(ctx, seqId, iprot, oprot) } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x15 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x15.Write(oprot) - oprot.WriteMessageEnd() + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x22 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x22.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, x15 + return false, x22 } @@ -1481,45 +1590,76 @@ type jMXServiceProcessorConnect struct { func (p *jMXServiceProcessorConnect) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceConnectArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("connect", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "connect", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceConnectResult{} - var err2 error if err2 = p.handler.Connect(ctx, args.Config); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXConnectionError: result.ConnErr = v case *JMXError: result.JmxErr = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing connect: " + err2.Error()) - oprot.WriteMessageBegin("connect", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "connect", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } - if err2 = oprot.WriteMessageBegin("connect", thrift.REPLY, seqId); err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "connect", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1533,43 +1673,74 @@ type jMXServiceProcessorDisconnect struct { func (p *jMXServiceProcessorDisconnect) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceDisconnectArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("disconnect", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "disconnect", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceDisconnectResult{} - var err2 error if err2 = p.handler.Disconnect(ctx); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXError: result.Err = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing disconnect: " + err2.Error()) - oprot.WriteMessageBegin("disconnect", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "disconnect", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } - if err2 = oprot.WriteMessageBegin("disconnect", thrift.REPLY, seqId); err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "disconnect", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1583,46 +1754,77 @@ type jMXServiceProcessorGetClientVersion struct { func (p *jMXServiceProcessorGetClientVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceGetClientVersionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getClientVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getClientVersion", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceGetClientVersionResult{} -var retval string - var err2 error + var retval string if retval, err2 = p.handler.GetClientVersion(ctx); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXError: result.Err = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getClientVersion: " + err2.Error()) - oprot.WriteMessageBegin("getClientVersion", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "getClientVersion", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } else { result.Success = &retval -} - if err2 = oprot.WriteMessageBegin("getClientVersion", thrift.REPLY, seqId); err2 != nil { - err = err2 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "getClientVersion", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1636,48 +1838,79 @@ type jMXServiceProcessorQueryMBeanNames struct { func (p *jMXServiceProcessorQueryMBeanNames) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceQueryMBeanNamesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryMBeanNames", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "queryMBeanNames", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceQueryMBeanNamesResult{} -var retval []string - var err2 error + var retval []string if retval, err2 = p.handler.QueryMBeanNames(ctx, args.MBeanNamePattern); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXConnectionError: result.ConnErr = v case *JMXError: result.JmxErr = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryMBeanNames: " + err2.Error()) - oprot.WriteMessageBegin("queryMBeanNames", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "queryMBeanNames", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } else { result.Success = retval -} - if err2 = oprot.WriteMessageBegin("queryMBeanNames", thrift.REPLY, seqId); err2 != nil { - err = err2 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "queryMBeanNames", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1691,48 +1924,79 @@ type jMXServiceProcessorGetMBeanAttributeNames struct { func (p *jMXServiceProcessorGetMBeanAttributeNames) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceGetMBeanAttributeNamesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getMBeanAttributeNames", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getMBeanAttributeNames", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceGetMBeanAttributeNamesResult{} -var retval []string - var err2 error + var retval []string if retval, err2 = p.handler.GetMBeanAttributeNames(ctx, args.MBeanName); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXConnectionError: result.ConnErr = v case *JMXError: result.JmxErr = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMBeanAttributeNames: " + err2.Error()) - oprot.WriteMessageBegin("getMBeanAttributeNames", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "getMBeanAttributeNames", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } else { result.Success = retval -} - if err2 = oprot.WriteMessageBegin("getMBeanAttributeNames", thrift.REPLY, seqId); err2 != nil { - err = err2 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "getMBeanAttributeNames", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1746,48 +2010,79 @@ type jMXServiceProcessorGetMBeanAttributes struct { func (p *jMXServiceProcessorGetMBeanAttributes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceGetMBeanAttributesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getMBeanAttributes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getMBeanAttributes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceGetMBeanAttributesResult{} -var retval []*AttributeResponse - var err2 error + var retval []*AttributeResponse if retval, err2 = p.handler.GetMBeanAttributes(ctx, args.MBeanName, args.Attributes); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXConnectionError: result.ConnErr = v case *JMXError: result.JmxErr = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMBeanAttributes: " + err2.Error()) - oprot.WriteMessageBegin("getMBeanAttributes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "getMBeanAttributes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } else { result.Success = retval -} - if err2 = oprot.WriteMessageBegin("getMBeanAttributes", thrift.REPLY, seqId); err2 != nil { - err = err2 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "getMBeanAttributes", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1801,48 +2096,79 @@ type jMXServiceProcessorQueryMBeanAttributes struct { func (p *jMXServiceProcessorQueryMBeanAttributes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { args := JMXServiceQueryMBeanAttributesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryMBeanAttributes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "queryMBeanAttributes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() result := JMXServiceQueryMBeanAttributesResult{} -var retval []*AttributeResponse - var err2 error + var retval []*AttributeResponse if retval, err2 = p.handler.QueryMBeanAttributes(ctx, args.MBeanNamePattern); err2 != nil { + tickerCancel() switch v := err2.(type) { case *JMXConnectionError: result.ConnErr = v case *JMXError: result.JmxErr = v default: + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryMBeanAttributes: " + err2.Error()) - oprot.WriteMessageBegin("queryMBeanAttributes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + oprot.WriteMessageBegin(ctx, "queryMBeanAttributes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } } else { result.Success = retval -} - if err2 = oprot.WriteMessageBegin("queryMBeanAttributes", thrift.REPLY, seqId); err2 != nil { - err = err2 } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "queryMBeanAttributes", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) } if err != nil { return @@ -1874,14 +2200,14 @@ func (p *JMXServiceConnectArgs) IsSetConfig() bool { return p.Config != nil } -func (p *JMXServiceConnectArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceConnectArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1889,57 +2215,57 @@ func (p *JMXServiceConnectArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceConnectArgs) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceConnectArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Config = &JMXConfig{} - if err := p.Config.Read(iprot); err != nil { + if err := p.Config.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) } return nil } -func (p *JMXServiceConnectArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("connect_args"); err != nil { +func (p *JMXServiceConnectArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "connect_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 := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceConnectArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 1); err != nil { +func (p *JMXServiceConnectArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "config", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:config: ", p), err) } - if err := p.Config.Write(oprot); err != nil { + if err := p.Config.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:config: ", p), err) } return err } @@ -1985,14 +2311,14 @@ func (p *JMXServiceConnectResult) IsSetJmxErr() bool { return p.JmxErr != nil } -func (p *JMXServiceConnectResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceConnectResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2000,90 +2326,90 @@ func (p *JMXServiceConnectResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceConnectResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceConnectResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.ConnErr = &JMXConnectionError{} - if err := p.ConnErr.Read(iprot); err != nil { + if err := p.ConnErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) } return nil } -func (p *JMXServiceConnectResult) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXServiceConnectResult) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.JmxErr = &JMXError{} - if err := p.JmxErr.Read(iprot); err != nil { + if err := p.JmxErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) } return nil } -func (p *JMXServiceConnectResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("connect_result"); err != nil { +func (p *JMXServiceConnectResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "connect_result"); 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 := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceConnectResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceConnectResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConnErr() { - if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.ConnErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } } return err } -func (p *JMXServiceConnectResult) writeField2(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceConnectResult) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetJmxErr() { - if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.JmxErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } } return err @@ -2103,39 +2429,39 @@ func NewJMXServiceDisconnectArgs() *JMXServiceDisconnectArgs { return &JMXServiceDisconnectArgs{} } -func (p *JMXServiceDisconnectArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceDisconnectArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } if fieldTypeId == thrift.STOP { break; } - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceDisconnectArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("disconnect_args"); err != nil { +func (p *JMXServiceDisconnectArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "disconnect_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } @@ -2168,14 +2494,14 @@ func (p *JMXServiceDisconnectResult) IsSetErr() bool { return p.Err != nil } -func (p *JMXServiceDisconnectResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceDisconnectResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2183,58 +2509,58 @@ func (p *JMXServiceDisconnectResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceDisconnectResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceDisconnectResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Err = &JMXError{} - if err := p.Err.Read(iprot); err != nil { + if err := p.Err.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) } return nil } -func (p *JMXServiceDisconnectResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("disconnect_result"); err != nil { +func (p *JMXServiceDisconnectResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "disconnect_result"); 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.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceDisconnectResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceDisconnectResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetErr() { - if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "err", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) } - if err := p.Err.Write(oprot); err != nil { + if err := p.Err.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) } } return err @@ -2254,39 +2580,39 @@ func NewJMXServiceGetClientVersionArgs() *JMXServiceGetClientVersionArgs { return &JMXServiceGetClientVersionArgs{} } -func (p *JMXServiceGetClientVersionArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetClientVersionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } if fieldTypeId == thrift.STOP { break; } - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetClientVersionArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getClientVersion_args"); err != nil { +func (p *JMXServiceGetClientVersionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getClientVersion_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } @@ -2332,14 +2658,14 @@ func (p *JMXServiceGetClientVersionResult) IsSetErr() bool { return p.Err != nil } -func (p *JMXServiceGetClientVersionResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetClientVersionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2347,41 +2673,41 @@ func (p *JMXServiceGetClientVersionResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRING { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetClientVersionResult) ReadField0(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXServiceGetClientVersionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { p.Success = &v @@ -2389,48 +2715,48 @@ func (p *JMXServiceGetClientVersionResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *JMXServiceGetClientVersionResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceGetClientVersionResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Err = &JMXError{} - if err := p.Err.Read(iprot); err != nil { + if err := p.Err.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err) } return nil } -func (p *JMXServiceGetClientVersionResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getClientVersion_result"); err != nil { +func (p *JMXServiceGetClientVersionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getClientVersion_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.writeField0(ctx, oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceGetClientVersionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetClientVersionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRING, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteString(string(*p.Success)); err != nil { + if err := oprot.WriteString(ctx, string(*p.Success)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } } return err } -func (p *JMXServiceGetClientVersionResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetClientVersionResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetErr() { - if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "err", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err) } - if err := p.Err.Write(oprot); err != nil { + if err := p.Err.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err) } } return err @@ -2457,14 +2783,14 @@ func NewJMXServiceQueryMBeanNamesArgs() *JMXServiceQueryMBeanNamesArgs { func (p *JMXServiceQueryMBeanNamesArgs) GetMBeanNamePattern() string { return p.MBeanNamePattern } -func (p *JMXServiceQueryMBeanNamesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceQueryMBeanNamesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2472,31 +2798,31 @@ func (p *JMXServiceQueryMBeanNamesArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceQueryMBeanNamesArgs) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXServiceQueryMBeanNamesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.MBeanNamePattern = v @@ -2504,25 +2830,25 @@ func (p *JMXServiceQueryMBeanNamesArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *JMXServiceQueryMBeanNamesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryMBeanNames_args"); err != nil { +func (p *JMXServiceQueryMBeanNamesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "queryMBeanNames_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 := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceQueryMBeanNamesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("mBeanNamePattern", thrift.STRING, 1); err != nil { +func (p *JMXServiceQueryMBeanNamesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "mBeanNamePattern", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:mBeanNamePattern: ", p), err) } - if err := oprot.WriteString(string(p.MBeanNamePattern)); err != nil { + if err := oprot.WriteString(ctx, string(p.MBeanNamePattern)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.mBeanNamePattern (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:mBeanNamePattern: ", p), err) } return err } @@ -2579,14 +2905,14 @@ func (p *JMXServiceQueryMBeanNamesResult) IsSetJmxErr() bool { return p.JmxErr != nil } -func (p *JMXServiceQueryMBeanNamesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceQueryMBeanNamesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2594,143 +2920,143 @@ func (p *JMXServiceQueryMBeanNamesResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.LIST { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceQueryMBeanNamesResult) ReadField0(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *JMXServiceQueryMBeanNamesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]string, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { -var _elem16 string - if v, err := iprot.ReadString(); err != nil { +var _elem23 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem16 = v + _elem23 = v } - p.Success = append(p.Success, _elem16) + p.Success = append(p.Success, _elem23) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *JMXServiceQueryMBeanNamesResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceQueryMBeanNamesResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.ConnErr = &JMXConnectionError{} - if err := p.ConnErr.Read(iprot); err != nil { + if err := p.ConnErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) } return nil } -func (p *JMXServiceQueryMBeanNamesResult) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXServiceQueryMBeanNamesResult) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.JmxErr = &JMXError{} - if err := p.JmxErr.Read(iprot); err != nil { + if err := p.JmxErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) } return nil } -func (p *JMXServiceQueryMBeanNamesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryMBeanNames_result"); err != nil { +func (p *JMXServiceQueryMBeanNamesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "queryMBeanNames_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 := p.writeField0(ctx, oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceQueryMBeanNamesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanNamesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Success)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Success { - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } } return err } -func (p *JMXServiceQueryMBeanNamesResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanNamesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConnErr() { - if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.ConnErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } } return err } -func (p *JMXServiceQueryMBeanNamesResult) writeField2(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanNamesResult) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetJmxErr() { - if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.JmxErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } } return err @@ -2757,14 +3083,14 @@ func NewJMXServiceGetMBeanAttributeNamesArgs() *JMXServiceGetMBeanAttributeNames func (p *JMXServiceGetMBeanAttributeNamesArgs) GetMBeanName() string { return p.MBeanName } -func (p *JMXServiceGetMBeanAttributeNamesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2772,31 +3098,31 @@ func (p *JMXServiceGetMBeanAttributeNamesArgs) Read(iprot thrift.TProtocol) erro switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesArgs) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.MBeanName = v @@ -2804,25 +3130,25 @@ func (p *JMXServiceGetMBeanAttributeNamesArgs) ReadField1(iprot thrift.TProtoco return nil } -func (p *JMXServiceGetMBeanAttributeNamesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMBeanAttributeNames_args"); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMBeanAttributeNames_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 := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("mBeanName", thrift.STRING, 1); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "mBeanName", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:mBeanName: ", p), err) } - if err := oprot.WriteString(string(p.MBeanName)); err != nil { + if err := oprot.WriteString(ctx, string(p.MBeanName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.mBeanName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:mBeanName: ", p), err) } return err } @@ -2879,14 +3205,14 @@ func (p *JMXServiceGetMBeanAttributeNamesResult) IsSetJmxErr() bool { return p.JmxErr != nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2894,143 +3220,143 @@ func (p *JMXServiceGetMBeanAttributeNamesResult) Read(iprot thrift.TProtocol) er switch fieldId { case 0: if fieldTypeId == thrift.LIST { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField0(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]string, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { -var _elem17 string - if v, err := iprot.ReadString(); err != nil { +var _elem24 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem17 = v + _elem24 = v } - p.Success = append(p.Success, _elem17) + p.Success = append(p.Success, _elem24) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.ConnErr = &JMXConnectionError{} - if err := p.ConnErr.Read(iprot); err != nil { + if err := p.ConnErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXServiceGetMBeanAttributeNamesResult) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.JmxErr = &JMXError{} - if err := p.JmxErr.Read(iprot); err != nil { + if err := p.JmxErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMBeanAttributeNames_result"); err != nil { +func (p *JMXServiceGetMBeanAttributeNamesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMBeanAttributeNames_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 := p.writeField0(ctx, oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributeNamesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributeNamesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Success)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Success { - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } } return err } -func (p *JMXServiceGetMBeanAttributeNamesResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributeNamesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConnErr() { - if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.ConnErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } } return err } -func (p *JMXServiceGetMBeanAttributeNamesResult) writeField2(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributeNamesResult) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetJmxErr() { - if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.JmxErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } } return err @@ -3063,14 +3389,14 @@ func (p *JMXServiceGetMBeanAttributesArgs) GetMBeanName() string { func (p *JMXServiceGetMBeanAttributesArgs) GetAttributes() []string { return p.Attributes } -func (p *JMXServiceGetMBeanAttributesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetMBeanAttributesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3078,41 +3404,41 @@ func (p *JMXServiceGetMBeanAttributesArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.LIST { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetMBeanAttributesArgs) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXServiceGetMBeanAttributesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.MBeanName = v @@ -3120,66 +3446,66 @@ func (p *JMXServiceGetMBeanAttributesArgs) ReadField1(iprot thrift.TProtocol) e return nil } -func (p *JMXServiceGetMBeanAttributesArgs) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *JMXServiceGetMBeanAttributesArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]string, 0, size) p.Attributes = tSlice for i := 0; i < size; i ++ { -var _elem18 string - if v, err := iprot.ReadString(); err != nil { +var _elem25 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem18 = v + _elem25 = v } - p.Attributes = append(p.Attributes, _elem18) + p.Attributes = append(p.Attributes, _elem25) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMBeanAttributes_args"); err != nil { +func (p *JMXServiceGetMBeanAttributesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMBeanAttributes_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 := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("mBeanName", thrift.STRING, 1); err != nil { +func (p *JMXServiceGetMBeanAttributesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "mBeanName", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:mBeanName: ", p), err) } - if err := oprot.WriteString(string(p.MBeanName)); err != nil { + if err := oprot.WriteString(ctx, string(p.MBeanName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.mBeanName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:mBeanName: ", p), err) } return err } -func (p *JMXServiceGetMBeanAttributesArgs) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("attributes", thrift.LIST, 2); err != nil { +func (p *JMXServiceGetMBeanAttributesArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "attributes", thrift.LIST, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:attributes: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Attributes)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Attributes)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Attributes { - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:attributes: ", p), err) } return err } @@ -3236,14 +3562,14 @@ func (p *JMXServiceGetMBeanAttributesResult) IsSetJmxErr() bool { return p.JmxErr != nil } -func (p *JMXServiceGetMBeanAttributesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceGetMBeanAttributesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3251,142 +3577,142 @@ func (p *JMXServiceGetMBeanAttributesResult) Read(iprot thrift.TProtocol) error switch fieldId { case 0: if fieldTypeId == thrift.LIST { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceGetMBeanAttributesResult) ReadField0(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *JMXServiceGetMBeanAttributesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*AttributeResponse, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { - _elem19 := &AttributeResponse{} - if err := _elem19.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err) + _elem26 := &AttributeResponse{} + if err := _elem26.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) } - p.Success = append(p.Success, _elem19) + p.Success = append(p.Success, _elem26) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributesResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceGetMBeanAttributesResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.ConnErr = &JMXConnectionError{} - if err := p.ConnErr.Read(iprot); err != nil { + if err := p.ConnErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) } return nil } -func (p *JMXServiceGetMBeanAttributesResult) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXServiceGetMBeanAttributesResult) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.JmxErr = &JMXError{} - if err := p.JmxErr.Read(iprot); err != nil { + if err := p.JmxErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) } return nil } -func (p *JMXServiceGetMBeanAttributesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getMBeanAttributes_result"); err != nil { +func (p *JMXServiceGetMBeanAttributesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMBeanAttributes_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 := p.writeField0(ctx, oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceGetMBeanAttributesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Success { - if err := v.Write(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } } return err } -func (p *JMXServiceGetMBeanAttributesResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConnErr() { - if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.ConnErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } } return err } -func (p *JMXServiceGetMBeanAttributesResult) writeField2(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceGetMBeanAttributesResult) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetJmxErr() { - if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.JmxErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } } return err @@ -3413,14 +3739,14 @@ func NewJMXServiceQueryMBeanAttributesArgs() *JMXServiceQueryMBeanAttributesArgs func (p *JMXServiceQueryMBeanAttributesArgs) GetMBeanNamePattern() string { return p.MBeanNamePattern } -func (p *JMXServiceQueryMBeanAttributesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceQueryMBeanAttributesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3428,31 +3754,31 @@ func (p *JMXServiceQueryMBeanAttributesArgs) Read(iprot thrift.TProtocol) error switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceQueryMBeanAttributesArgs) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *JMXServiceQueryMBeanAttributesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.MBeanNamePattern = v @@ -3460,25 +3786,25 @@ func (p *JMXServiceQueryMBeanAttributesArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *JMXServiceQueryMBeanAttributesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryMBeanAttributes_args"); err != nil { +func (p *JMXServiceQueryMBeanAttributesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "queryMBeanAttributes_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 := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceQueryMBeanAttributesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("mBeanNamePattern", thrift.STRING, 1); err != nil { +func (p *JMXServiceQueryMBeanAttributesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "mBeanNamePattern", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:mBeanNamePattern: ", p), err) } - if err := oprot.WriteString(string(p.MBeanNamePattern)); err != nil { + if err := oprot.WriteString(ctx, string(p.MBeanNamePattern)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.mBeanNamePattern (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:mBeanNamePattern: ", p), err) } return err } @@ -3535,14 +3861,14 @@ func (p *JMXServiceQueryMBeanAttributesResult) IsSetJmxErr() bool { return p.JmxErr != nil } -func (p *JMXServiceQueryMBeanAttributesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *JMXServiceQueryMBeanAttributesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3550,142 +3876,142 @@ func (p *JMXServiceQueryMBeanAttributesResult) Read(iprot thrift.TProtocol) erro switch fieldId { case 0: if fieldTypeId == thrift.LIST { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *JMXServiceQueryMBeanAttributesResult) ReadField0(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *JMXServiceQueryMBeanAttributesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([]*AttributeResponse, 0, size) p.Success = tSlice for i := 0; i < size; i ++ { - _elem20 := &AttributeResponse{} - if err := _elem20.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem20), err) + _elem27 := &AttributeResponse{} + if err := _elem27.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) } - p.Success = append(p.Success, _elem20) + p.Success = append(p.Success, _elem27) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *JMXServiceQueryMBeanAttributesResult) ReadField1(iprot thrift.TProtocol) error { +func (p *JMXServiceQueryMBeanAttributesResult) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.ConnErr = &JMXConnectionError{} - if err := p.ConnErr.Read(iprot); err != nil { + if err := p.ConnErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConnErr), err) } return nil } -func (p *JMXServiceQueryMBeanAttributesResult) ReadField2(iprot thrift.TProtocol) error { +func (p *JMXServiceQueryMBeanAttributesResult) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.JmxErr = &JMXError{} - if err := p.JmxErr.Read(iprot); err != nil { + if err := p.JmxErr.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JmxErr), err) } return nil } -func (p *JMXServiceQueryMBeanAttributesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryMBeanAttributes_result"); err != nil { +func (p *JMXServiceQueryMBeanAttributesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "queryMBeanAttributes_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 := p.writeField0(ctx, oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *JMXServiceQueryMBeanAttributesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanAttributesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Success { - if err := v.Write(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } } return err } -func (p *JMXServiceQueryMBeanAttributesResult) writeField1(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanAttributesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConnErr() { - if err := oprot.WriteFieldBegin("connErr", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.ConnErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConnErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:connErr: ", p), err) } } return err } -func (p *JMXServiceQueryMBeanAttributesResult) writeField2(oprot thrift.TProtocol) (err error) { +func (p *JMXServiceQueryMBeanAttributesResult) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetJmxErr() { - if err := oprot.WriteFieldBegin("jmxErr", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "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 { + if err := p.JmxErr.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JmxErr), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jmxErr: ", p), err) } } return err diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/AttributeResponse.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/AttributeResponse.java index e64d1a6..6740b31 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/AttributeResponse.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/AttributeResponse.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -499,8 +499,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof AttributeResponse) return this.equals((AttributeResponse)that); return false; @@ -615,7 +613,7 @@ public int compareTo(AttributeResponse other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatusMsg()).compareTo(other.isSetStatusMsg()); + lastComparison = java.lang.Boolean.compare(isSetStatusMsg(), other.isSetStatusMsg()); if (lastComparison != 0) { return lastComparison; } @@ -625,7 +623,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName()); if (lastComparison != 0) { return lastComparison; } @@ -635,7 +633,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetResponseType()).compareTo(other.isSetResponseType()); + lastComparison = java.lang.Boolean.compare(isSetResponseType(), other.isSetResponseType()); if (lastComparison != 0) { return lastComparison; } @@ -645,7 +643,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetStringValue()).compareTo(other.isSetStringValue()); + lastComparison = java.lang.Boolean.compare(isSetStringValue(), other.isSetStringValue()); if (lastComparison != 0) { return lastComparison; } @@ -655,7 +653,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetDoubleValue()).compareTo(other.isSetDoubleValue()); + lastComparison = java.lang.Boolean.compare(isSetDoubleValue(), other.isSetDoubleValue()); if (lastComparison != 0) { return lastComparison; } @@ -665,7 +663,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetIntValue()).compareTo(other.isSetIntValue()); + lastComparison = java.lang.Boolean.compare(isSetIntValue(), other.isSetIntValue()); if (lastComparison != 0) { return lastComparison; } @@ -675,7 +673,7 @@ public int compareTo(AttributeResponse other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetBoolValue()).compareTo(other.isSetBoolValue()); + lastComparison = java.lang.Boolean.compare(isSetBoolValue(), other.isSetBoolValue()); if (lastComparison != 0) { return lastComparison; } diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java index 7e67c5b..3874d0e 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConfig.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -887,8 +887,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof JMXConfig) return this.equals((JMXConfig)that); return false; @@ -1101,7 +1099,7 @@ public int compareTo(JMXConfig other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetConnectionURL()).compareTo(other.isSetConnectionURL()); + lastComparison = java.lang.Boolean.compare(isSetConnectionURL(), other.isSetConnectionURL()); if (lastComparison != 0) { return lastComparison; } @@ -1111,7 +1109,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetHostname()).compareTo(other.isSetHostname()); + lastComparison = java.lang.Boolean.compare(isSetHostname(), other.isSetHostname()); if (lastComparison != 0) { return lastComparison; } @@ -1121,7 +1119,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetPort()).compareTo(other.isSetPort()); + lastComparison = java.lang.Boolean.compare(isSetPort(), other.isSetPort()); if (lastComparison != 0) { return lastComparison; } @@ -1131,7 +1129,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetUriPath()).compareTo(other.isSetUriPath()); + lastComparison = java.lang.Boolean.compare(isSetUriPath(), other.isSetUriPath()); if (lastComparison != 0) { return lastComparison; } @@ -1141,7 +1139,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + lastComparison = java.lang.Boolean.compare(isSetUsername(), other.isSetUsername()); if (lastComparison != 0) { return lastComparison; } @@ -1151,7 +1149,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + lastComparison = java.lang.Boolean.compare(isSetPassword(), other.isSetPassword()); if (lastComparison != 0) { return lastComparison; } @@ -1161,7 +1159,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetKeyStore()).compareTo(other.isSetKeyStore()); + lastComparison = java.lang.Boolean.compare(isSetKeyStore(), other.isSetKeyStore()); if (lastComparison != 0) { return lastComparison; } @@ -1171,7 +1169,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetKeyStorePassword()).compareTo(other.isSetKeyStorePassword()); + lastComparison = java.lang.Boolean.compare(isSetKeyStorePassword(), other.isSetKeyStorePassword()); if (lastComparison != 0) { return lastComparison; } @@ -1181,7 +1179,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTrustStore()).compareTo(other.isSetTrustStore()); + lastComparison = java.lang.Boolean.compare(isSetTrustStore(), other.isSetTrustStore()); if (lastComparison != 0) { return lastComparison; } @@ -1191,7 +1189,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTrustStorePassword()).compareTo(other.isSetTrustStorePassword()); + lastComparison = java.lang.Boolean.compare(isSetTrustStorePassword(), other.isSetTrustStorePassword()); if (lastComparison != 0) { return lastComparison; } @@ -1201,7 +1199,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetIsRemote()).compareTo(other.isSetIsRemote()); + lastComparison = java.lang.Boolean.compare(isSetIsRemote(), other.isSetIsRemote()); if (lastComparison != 0) { return lastComparison; } @@ -1211,7 +1209,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetIsJBossStandaloneMode()).compareTo(other.isSetIsJBossStandaloneMode()); + lastComparison = java.lang.Boolean.compare(isSetIsJBossStandaloneMode(), other.isSetIsJBossStandaloneMode()); if (lastComparison != 0) { return lastComparison; } @@ -1221,7 +1219,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetUseSSL()).compareTo(other.isSetUseSSL()); + lastComparison = java.lang.Boolean.compare(isSetUseSSL(), other.isSetUseSSL()); if (lastComparison != 0) { return lastComparison; } @@ -1231,7 +1229,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetRequestTimeoutMs()).compareTo(other.isSetRequestTimeoutMs()); + lastComparison = java.lang.Boolean.compare(isSetRequestTimeoutMs(), other.isSetRequestTimeoutMs()); if (lastComparison != 0) { return lastComparison; } @@ -1241,7 +1239,7 @@ public int compareTo(JMXConfig other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetVerbose()).compareTo(other.isSetVerbose()); + lastComparison = java.lang.Boolean.compare(isSetVerbose(), other.isSetVerbose()); if (lastComparison != 0) { return lastComparison; } diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java index afaa0ea..18993cb 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXConnectionError.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -178,8 +178,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof JMXConnectionError) return this.equals((JMXConnectionError)that); return false; @@ -222,7 +220,7 @@ public int compareTo(JMXConnectionError other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.compare(isSetMessage(), other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java index 2762634..522b5e0 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXError.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -280,8 +280,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof JMXError) return this.equals((JMXError)that); return false; @@ -350,7 +348,7 @@ public int compareTo(JMXError other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = java.lang.Boolean.compare(isSetMessage(), other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } @@ -360,7 +358,7 @@ public int compareTo(JMXError other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCauseMessage()).compareTo(other.isSetCauseMessage()); + lastComparison = java.lang.Boolean.compare(isSetCauseMessage(), other.isSetCauseMessage()); if (lastComparison != 0) { return lastComparison; } @@ -370,7 +368,7 @@ public int compareTo(JMXError other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetStacktrace()).compareTo(other.isSetStacktrace()); + lastComparison = java.lang.Boolean.compare(isSetStacktrace(), other.isSetStacktrace()); if (lastComparison != 0) { return lastComparison; } diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java index 64c5f49..fdced56 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/JMXService.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -1399,8 +1399,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof connect_args) return this.equals((connect_args)that); return false; @@ -1443,7 +1441,7 @@ public int compareTo(connect_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetConfig()).compareTo(other.isSetConfig()); + lastComparison = java.lang.Boolean.compare(isSetConfig(), other.isSetConfig()); if (lastComparison != 0) { return lastComparison; } @@ -1822,8 +1820,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof connect_result) return this.equals((connect_result)that); return false; @@ -1879,7 +1875,7 @@ public int compareTo(connect_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + lastComparison = java.lang.Boolean.compare(isSetConnErr(), other.isSetConnErr()); if (lastComparison != 0) { return lastComparison; } @@ -1889,7 +1885,7 @@ public int compareTo(connect_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + lastComparison = java.lang.Boolean.compare(isSetJmxErr(), other.isSetJmxErr()); if (lastComparison != 0) { return lastComparison; } @@ -2190,8 +2186,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof disconnect_args) return this.equals((disconnect_args)that); return false; @@ -2501,8 +2495,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof disconnect_result) return this.equals((disconnect_result)that); return false; @@ -2545,7 +2537,7 @@ public int compareTo(disconnect_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); + lastComparison = java.lang.Boolean.compare(isSetErr(), other.isSetErr()); if (lastComparison != 0) { return lastComparison; } @@ -2813,8 +2805,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getClientVersion_args) return this.equals((getClientVersion_args)that); return false; @@ -3175,8 +3165,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getClientVersion_result) return this.equals((getClientVersion_result)that); return false; @@ -3232,7 +3220,7 @@ public int compareTo(getClientVersion_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -3242,7 +3230,7 @@ public int compareTo(getClientVersion_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetErr()).compareTo(other.isSetErr()); + lastComparison = java.lang.Boolean.compare(isSetErr(), other.isSetErr()); if (lastComparison != 0) { return lastComparison; } @@ -3598,8 +3586,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof queryMBeanNames_args) return this.equals((queryMBeanNames_args)that); return false; @@ -3642,7 +3628,7 @@ public int compareTo(queryMBeanNames_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMBeanNamePattern()).compareTo(other.isSetMBeanNamePattern()); + lastComparison = java.lang.Boolean.compare(isSetMBeanNamePattern(), other.isSetMBeanNamePattern()); if (lastComparison != 0) { return lastComparison; } @@ -4085,8 +4071,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof queryMBeanNames_result) return this.equals((queryMBeanNames_result)that); return false; @@ -4155,7 +4139,7 @@ public int compareTo(queryMBeanNames_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -4165,7 +4149,7 @@ public int compareTo(queryMBeanNames_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + lastComparison = java.lang.Boolean.compare(isSetConnErr(), other.isSetConnErr()); if (lastComparison != 0) { return lastComparison; } @@ -4175,7 +4159,7 @@ public int compareTo(queryMBeanNames_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + lastComparison = java.lang.Boolean.compare(isSetJmxErr(), other.isSetJmxErr()); if (lastComparison != 0) { return lastComparison; } @@ -4396,7 +4380,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, queryMBeanNames_resu java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + org.apache.thrift.protocol.TList _list5 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.success = new java.util.ArrayList(_list5.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem6; for (int _i7 = 0; _i7 < _list5.size; ++_i7) @@ -4596,8 +4580,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getMBeanAttributeNames_args) return this.equals((getMBeanAttributeNames_args)that); return false; @@ -4640,7 +4622,7 @@ public int compareTo(getMBeanAttributeNames_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMBeanName()).compareTo(other.isSetMBeanName()); + lastComparison = java.lang.Boolean.compare(isSetMBeanName(), other.isSetMBeanName()); if (lastComparison != 0) { return lastComparison; } @@ -5083,8 +5065,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getMBeanAttributeNames_result) return this.equals((getMBeanAttributeNames_result)that); return false; @@ -5153,7 +5133,7 @@ public int compareTo(getMBeanAttributeNames_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -5163,7 +5143,7 @@ public int compareTo(getMBeanAttributeNames_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + lastComparison = java.lang.Boolean.compare(isSetConnErr(), other.isSetConnErr()); if (lastComparison != 0) { return lastComparison; } @@ -5173,7 +5153,7 @@ public int compareTo(getMBeanAttributeNames_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + lastComparison = java.lang.Boolean.compare(isSetJmxErr(), other.isSetJmxErr()); if (lastComparison != 0) { return lastComparison; } @@ -5394,7 +5374,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getMBeanAttributeNam java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + org.apache.thrift.protocol.TList _list13 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.success = new java.util.ArrayList(_list13.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem14; for (int _i15 = 0; _i15 < _list13.size; ++_i15) @@ -5663,8 +5643,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getMBeanAttributes_args) return this.equals((getMBeanAttributes_args)that); return false; @@ -5720,7 +5698,7 @@ public int compareTo(getMBeanAttributes_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMBeanName()).compareTo(other.isSetMBeanName()); + lastComparison = java.lang.Boolean.compare(isSetMBeanName(), other.isSetMBeanName()); if (lastComparison != 0) { return lastComparison; } @@ -5730,7 +5708,7 @@ public int compareTo(getMBeanAttributes_args other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetAttributes()).compareTo(other.isSetAttributes()); + lastComparison = java.lang.Boolean.compare(isSetAttributes(), other.isSetAttributes()); if (lastComparison != 0) { return lastComparison; } @@ -5926,7 +5904,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getMBeanAttributes_a } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + org.apache.thrift.protocol.TList _list21 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING); struct.attributes = new java.util.ArrayList(_list21.size); @org.apache.thrift.annotation.Nullable java.lang.String _elem22; for (int _i23 = 0; _i23 < _list21.size; ++_i23) @@ -6239,8 +6217,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof getMBeanAttributes_result) return this.equals((getMBeanAttributes_result)that); return false; @@ -6309,7 +6285,7 @@ public int compareTo(getMBeanAttributes_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -6319,7 +6295,7 @@ public int compareTo(getMBeanAttributes_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + lastComparison = java.lang.Boolean.compare(isSetConnErr(), other.isSetConnErr()); if (lastComparison != 0) { return lastComparison; } @@ -6329,7 +6305,7 @@ public int compareTo(getMBeanAttributes_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + lastComparison = java.lang.Boolean.compare(isSetJmxErr(), other.isSetJmxErr()); if (lastComparison != 0) { return lastComparison; } @@ -6551,7 +6527,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, getMBeanAttributes_r java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.success = new java.util.ArrayList(_list29.size); @org.apache.thrift.annotation.Nullable AttributeResponse _elem30; for (int _i31 = 0; _i31 < _list29.size; ++_i31) @@ -6752,8 +6728,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof queryMBeanAttributes_args) return this.equals((queryMBeanAttributes_args)that); return false; @@ -6796,7 +6770,7 @@ public int compareTo(queryMBeanAttributes_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetMBeanNamePattern()).compareTo(other.isSetMBeanNamePattern()); + lastComparison = java.lang.Boolean.compare(isSetMBeanNamePattern(), other.isSetMBeanNamePattern()); if (lastComparison != 0) { return lastComparison; } @@ -7242,8 +7216,6 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that == null) - return false; if (that instanceof queryMBeanAttributes_result) return this.equals((queryMBeanAttributes_result)that); return false; @@ -7312,7 +7284,7 @@ public int compareTo(queryMBeanAttributes_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -7322,7 +7294,7 @@ public int compareTo(queryMBeanAttributes_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConnErr()).compareTo(other.isSetConnErr()); + lastComparison = java.lang.Boolean.compare(isSetConnErr(), other.isSetConnErr()); if (lastComparison != 0) { return lastComparison; } @@ -7332,7 +7304,7 @@ public int compareTo(queryMBeanAttributes_result other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetJmxErr()).compareTo(other.isSetJmxErr()); + lastComparison = java.lang.Boolean.compare(isSetJmxErr(), other.isSetJmxErr()); if (lastComparison != 0) { return lastComparison; } @@ -7554,7 +7526,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, queryMBeanAttributes java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + org.apache.thrift.protocol.TList _list37 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); struct.success = new java.util.ArrayList(_list37.size); @org.apache.thrift.annotation.Nullable AttributeResponse _elem38; for (int _i39 = 0; _i39 < _list37.size; ++_i39) diff --git a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ResponseType.java b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ResponseType.java index 5143612..b4e3b54 100644 --- a/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ResponseType.java +++ b/src/main/java/org/newrelic/nrjmx/v2/nrprotocol/ResponseType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.13.0) + * Autogenerated by Thrift Compiler (0.15.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated