bosrvclient 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d3a58316a483ff781612d134ad763c5bdc4483b
4
- data.tar.gz: b63cd5904a254b1239f3087a6b846c8ea911f42b
3
+ metadata.gz: 174919dab658c4bf6ce7651f8fcb27a02fbbf09e
4
+ data.tar.gz: bd14f59234b0a2481f7773385a1fffcc686fb8f7
5
5
  SHA512:
6
- metadata.gz: cb0688e937d1e89552575501cf525481380e924e3cae20064b02f7d27be2a3f8fb78bc38eba39c69248240e69da21a79b634ef93be19ce7637000a0cd7cda88a
7
- data.tar.gz: f7691086b8128cfd14493312e37fcea839e34b923c3d5880b73f8bbdea946584c83b175b524967c039806c8e77d428f5e52c2dd3accd3be82b9393104212f3ee
6
+ metadata.gz: c8a26b6b205113f7c3c728d875bba04fe0d67a5144782e0414e483055b6475953372a042e3cd58ea7f89bf918b389c345748d48243a2ce535c0c947f202eab09
7
+ data.tar.gz: 20c400bf770fde32424c1905adc8d6377a09b3528d3cc38eb7a15e266b9ec23bfabc0553cbd210d7226d93f828b53197dc0d4e70fb5634a75a5e21388fc3aa20
@@ -185,11 +185,20 @@ module Bosrv
185
185
 
186
186
  def cursor_close(token, resource)
187
187
  send_cursor_close(token, resource)
188
+ recv_cursor_close()
188
189
  end
189
190
 
190
191
  def send_cursor_close(token, resource)
191
192
  send_message('cursor_close', Cursor_close_args, :token => token, :resource => resource)
192
193
  end
194
+
195
+ def recv_cursor_close()
196
+ result = receive_message(Cursor_close_result)
197
+ raise result.err unless result.err.nil?
198
+ raise result.arr unless result.arr.nil?
199
+ return
200
+ end
201
+
193
202
  def get_table_list(token, path)
194
203
  send_get_table_list(token, path)
195
204
  return recv_get_table_list()
@@ -463,8 +472,15 @@ module Bosrv
463
472
 
464
473
  def process_cursor_close(seqid, iprot, oprot)
465
474
  args = read_args(iprot, Cursor_close_args)
466
- @handler.cursor_close(args.token, args.resource)
467
- return
475
+ result = Cursor_close_result.new()
476
+ begin
477
+ @handler.cursor_close(args.token, args.resource)
478
+ rescue ::Exc::ServiceError => err
479
+ result.err = err
480
+ rescue ::Exc::AuthError => arr
481
+ result.arr = arr
482
+ end
483
+ write_result(result, oprot, 'cursor_close', seqid)
468
484
  end
469
485
 
470
486
  def process_get_table_list(seqid, iprot, oprot)
@@ -988,9 +1004,12 @@ module Bosrv
988
1004
 
989
1005
  class Cursor_close_result
990
1006
  include ::Thrift::Struct, ::Thrift::Struct_Union
1007
+ ERR = 1
1008
+ ARR = 2
991
1009
 
992
1010
  FIELDS = {
993
-
1011
+ ERR => {:type => ::Thrift::Types::STRUCT, :name => 'err', :class => ::Exc::ServiceError},
1012
+ ARR => {:type => ::Thrift::Types::STRUCT, :name => 'arr', :class => ::Exc::AuthError}
994
1013
  }
995
1014
 
996
1015
  def struct_fields; FIELDS; end
@@ -9,10 +9,12 @@ require 'thrift'
9
9
  module Exc
10
10
  class ServiceError < ::Thrift::Exception
11
11
  include ::Thrift::Struct, ::Thrift::Struct_Union
12
- WHY = 1
13
- MISC = 2
12
+ CODE = 1
13
+ WHY = 2
14
+ MISC = 3
14
15
 
15
16
  FIELDS = {
17
+ CODE => {:type => ::Thrift::Types::I32, :name => 'code'},
16
18
  WHY => {:type => ::Thrift::Types::STRING, :name => 'why'},
17
19
  MISC => {:type => ::Thrift::Types::STRING, :name => 'misc', :optional => true}
18
20
  }
@@ -20,6 +22,7 @@ module Exc
20
22
  def struct_fields; FIELDS; end
21
23
 
22
24
  def validate
25
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field code is unset!') unless @code
23
26
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
24
27
  end
25
28
 
@@ -28,10 +31,12 @@ module Exc
28
31
 
29
32
  class AuthError < ::Thrift::Exception
30
33
  include ::Thrift::Struct, ::Thrift::Struct_Union
31
- WHY = 1
32
- MISC = 2
34
+ CODE = 1
35
+ WHY = 2
36
+ MISC = 3
33
37
 
34
38
  FIELDS = {
39
+ CODE => {:type => ::Thrift::Types::I32, :name => 'code'},
35
40
  WHY => {:type => ::Thrift::Types::STRING, :name => 'why', :default => %q"invalid auth token"},
36
41
  MISC => {:type => ::Thrift::Types::STRING, :name => 'misc', :optional => true}
37
42
  }
@@ -39,6 +44,7 @@ module Exc
39
44
  def struct_fields; FIELDS; end
40
45
 
41
46
  def validate
47
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field code is unset!') unless @code
42
48
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field why is unset!') unless @why
43
49
  end
44
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosrvclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Jen