| 94 |
ashish |
1 |
#
|
|
|
2 |
# Autogenerated by Thrift
|
|
|
3 |
#
|
|
|
4 |
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
#
|
|
|
6 |
|
|
|
7 |
from thrift.Thrift import *
|
|
|
8 |
from ttypes import *
|
|
|
9 |
from thrift.Thrift import TProcessor
|
|
|
10 |
from thrift.transport import TTransport
|
|
|
11 |
from thrift.protocol import TBinaryProtocol
|
|
|
12 |
try:
|
|
|
13 |
from thrift.protocol import fastbinary
|
|
|
14 |
except:
|
|
|
15 |
fastbinary = None
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
class Iface:
|
|
|
19 |
def getPropetry(self, propertyName):
|
|
|
20 |
"""
|
|
|
21 |
Parameters:
|
|
|
22 |
- propertyName
|
|
|
23 |
"""
|
|
|
24 |
pass
|
|
|
25 |
|
|
|
26 |
def loadProperty(self, propertyName, propertyValue):
|
|
|
27 |
"""
|
|
|
28 |
Parameters:
|
|
|
29 |
- propertyName
|
|
|
30 |
- propertyValue
|
|
|
31 |
"""
|
|
|
32 |
pass
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
class Client(Iface):
|
|
|
36 |
def __init__(self, iprot, oprot=None):
|
|
|
37 |
self._iprot = self._oprot = iprot
|
|
|
38 |
if oprot != None:
|
|
|
39 |
self._oprot = oprot
|
|
|
40 |
self._seqid = 0
|
|
|
41 |
|
|
|
42 |
def getPropetry(self, propertyName):
|
|
|
43 |
"""
|
|
|
44 |
Parameters:
|
|
|
45 |
- propertyName
|
|
|
46 |
"""
|
|
|
47 |
self.send_getPropetry(propertyName)
|
|
|
48 |
return self.recv_getPropetry()
|
|
|
49 |
|
|
|
50 |
def send_getPropetry(self, propertyName):
|
|
|
51 |
self._oprot.writeMessageBegin('getPropetry', TMessageType.CALL, self._seqid)
|
|
|
52 |
args = getPropetry_args()
|
|
|
53 |
args.propertyName = propertyName
|
|
|
54 |
args.write(self._oprot)
|
|
|
55 |
self._oprot.writeMessageEnd()
|
|
|
56 |
self._oprot.trans.flush()
|
|
|
57 |
|
|
|
58 |
def recv_getPropetry(self, ):
|
|
|
59 |
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
|
|
|
60 |
if mtype == TMessageType.EXCEPTION:
|
|
|
61 |
x = TApplicationException()
|
|
|
62 |
x.read(self._iprot)
|
|
|
63 |
self._iprot.readMessageEnd()
|
|
|
64 |
raise x
|
|
|
65 |
result = getPropetry_result()
|
|
|
66 |
result.read(self._iprot)
|
|
|
67 |
self._iprot.readMessageEnd()
|
|
|
68 |
if result.success != None:
|
|
|
69 |
return result.success
|
|
|
70 |
if result.e != None:
|
|
|
71 |
raise result.e
|
|
|
72 |
raise TApplicationException(TApplicationException.MISSING_RESULT, "getPropetry failed: unknown result");
|
|
|
73 |
|
|
|
74 |
def loadProperty(self, propertyName, propertyValue):
|
|
|
75 |
"""
|
|
|
76 |
Parameters:
|
|
|
77 |
- propertyName
|
|
|
78 |
- propertyValue
|
|
|
79 |
"""
|
|
|
80 |
self.send_loadProperty(propertyName, propertyValue)
|
|
|
81 |
self.recv_loadProperty()
|
|
|
82 |
|
|
|
83 |
def send_loadProperty(self, propertyName, propertyValue):
|
|
|
84 |
self._oprot.writeMessageBegin('loadProperty', TMessageType.CALL, self._seqid)
|
|
|
85 |
args = loadProperty_args()
|
|
|
86 |
args.propertyName = propertyName
|
|
|
87 |
args.propertyValue = propertyValue
|
|
|
88 |
args.write(self._oprot)
|
|
|
89 |
self._oprot.writeMessageEnd()
|
|
|
90 |
self._oprot.trans.flush()
|
|
|
91 |
|
|
|
92 |
def recv_loadProperty(self, ):
|
|
|
93 |
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
|
|
|
94 |
if mtype == TMessageType.EXCEPTION:
|
|
|
95 |
x = TApplicationException()
|
|
|
96 |
x.read(self._iprot)
|
|
|
97 |
self._iprot.readMessageEnd()
|
|
|
98 |
raise x
|
|
|
99 |
result = loadProperty_result()
|
|
|
100 |
result.read(self._iprot)
|
|
|
101 |
self._iprot.readMessageEnd()
|
|
|
102 |
return
|
|
|
103 |
|
|
|
104 |
|
|
|
105 |
class Processor(Iface, TProcessor):
|
|
|
106 |
def __init__(self, handler):
|
|
|
107 |
self._handler = handler
|
|
|
108 |
self._processMap = {}
|
|
|
109 |
self._processMap["getPropetry"] = Processor.process_getPropetry
|
|
|
110 |
self._processMap["loadProperty"] = Processor.process_loadProperty
|
|
|
111 |
|
|
|
112 |
def process(self, iprot, oprot):
|
|
|
113 |
(name, type, seqid) = iprot.readMessageBegin()
|
|
|
114 |
if name not in self._processMap:
|
|
|
115 |
iprot.skip(TType.STRUCT)
|
|
|
116 |
iprot.readMessageEnd()
|
|
|
117 |
x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
|
|
|
118 |
oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
|
|
|
119 |
x.write(oprot)
|
|
|
120 |
oprot.writeMessageEnd()
|
|
|
121 |
oprot.trans.flush()
|
|
|
122 |
return
|
|
|
123 |
else:
|
|
|
124 |
self._processMap[name](self, seqid, iprot, oprot)
|
|
|
125 |
return True
|
|
|
126 |
|
|
|
127 |
def process_getPropetry(self, seqid, iprot, oprot):
|
|
|
128 |
args = getPropetry_args()
|
|
|
129 |
args.read(iprot)
|
|
|
130 |
iprot.readMessageEnd()
|
|
|
131 |
result = getPropetry_result()
|
|
|
132 |
try:
|
|
|
133 |
result.success = self._handler.getPropetry(args.propertyName)
|
|
|
134 |
except ConfigException, e:
|
|
|
135 |
result.e = e
|
|
|
136 |
oprot.writeMessageBegin("getPropetry", TMessageType.REPLY, seqid)
|
|
|
137 |
result.write(oprot)
|
|
|
138 |
oprot.writeMessageEnd()
|
|
|
139 |
oprot.trans.flush()
|
|
|
140 |
|
|
|
141 |
def process_loadProperty(self, seqid, iprot, oprot):
|
|
|
142 |
args = loadProperty_args()
|
|
|
143 |
args.read(iprot)
|
|
|
144 |
iprot.readMessageEnd()
|
|
|
145 |
result = loadProperty_result()
|
|
|
146 |
self._handler.loadProperty(args.propertyName, args.propertyValue)
|
|
|
147 |
oprot.writeMessageBegin("loadProperty", TMessageType.REPLY, seqid)
|
|
|
148 |
result.write(oprot)
|
|
|
149 |
oprot.writeMessageEnd()
|
|
|
150 |
oprot.trans.flush()
|
|
|
151 |
|
|
|
152 |
|
|
|
153 |
# HELPER FUNCTIONS AND STRUCTURES
|
|
|
154 |
|
|
|
155 |
class getPropetry_args:
|
|
|
156 |
"""
|
|
|
157 |
Attributes:
|
|
|
158 |
- propertyName
|
|
|
159 |
"""
|
|
|
160 |
|
|
|
161 |
thrift_spec = (
|
|
|
162 |
None, # 0
|
|
|
163 |
(1, TType.STRING, 'propertyName', None, None, ), # 1
|
|
|
164 |
)
|
|
|
165 |
|
|
|
166 |
def __init__(self, propertyName=None,):
|
|
|
167 |
self.propertyName = propertyName
|
|
|
168 |
|
|
|
169 |
def read(self, iprot):
|
|
|
170 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
171 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
172 |
return
|
|
|
173 |
iprot.readStructBegin()
|
|
|
174 |
while True:
|
|
|
175 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
176 |
if ftype == TType.STOP:
|
|
|
177 |
break
|
|
|
178 |
if fid == 1:
|
|
|
179 |
if ftype == TType.STRING:
|
|
|
180 |
self.propertyName = iprot.readString();
|
|
|
181 |
else:
|
|
|
182 |
iprot.skip(ftype)
|
|
|
183 |
else:
|
|
|
184 |
iprot.skip(ftype)
|
|
|
185 |
iprot.readFieldEnd()
|
|
|
186 |
iprot.readStructEnd()
|
|
|
187 |
|
|
|
188 |
def write(self, oprot):
|
|
|
189 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
190 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
191 |
return
|
|
|
192 |
oprot.writeStructBegin('getPropetry_args')
|
|
|
193 |
if self.propertyName != None:
|
|
|
194 |
oprot.writeFieldBegin('propertyName', TType.STRING, 1)
|
|
|
195 |
oprot.writeString(self.propertyName)
|
|
|
196 |
oprot.writeFieldEnd()
|
|
|
197 |
oprot.writeFieldStop()
|
|
|
198 |
oprot.writeStructEnd()
|
|
|
199 |
|
|
|
200 |
def __repr__(self):
|
|
|
201 |
L = ['%s=%r' % (key, value)
|
|
|
202 |
for key, value in self.__dict__.iteritems()]
|
|
|
203 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
204 |
|
|
|
205 |
def __eq__(self, other):
|
|
|
206 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
207 |
|
|
|
208 |
def __ne__(self, other):
|
|
|
209 |
return not (self == other)
|
|
|
210 |
|
|
|
211 |
class getPropetry_result:
|
|
|
212 |
"""
|
|
|
213 |
Attributes:
|
|
|
214 |
- success
|
|
|
215 |
- e
|
|
|
216 |
"""
|
|
|
217 |
|
|
|
218 |
thrift_spec = (
|
|
|
219 |
(0, TType.STRING, 'success', None, None, ), # 0
|
|
|
220 |
(1, TType.STRUCT, 'e', (ConfigException, ConfigException.thrift_spec), None, ), # 1
|
|
|
221 |
)
|
|
|
222 |
|
|
|
223 |
def __init__(self, success=None, e=None,):
|
|
|
224 |
self.success = success
|
|
|
225 |
self.e = e
|
|
|
226 |
|
|
|
227 |
def read(self, iprot):
|
|
|
228 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
229 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
230 |
return
|
|
|
231 |
iprot.readStructBegin()
|
|
|
232 |
while True:
|
|
|
233 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
234 |
if ftype == TType.STOP:
|
|
|
235 |
break
|
|
|
236 |
if fid == 0:
|
|
|
237 |
if ftype == TType.STRING:
|
|
|
238 |
self.success = iprot.readString();
|
|
|
239 |
else:
|
|
|
240 |
iprot.skip(ftype)
|
|
|
241 |
elif fid == 1:
|
|
|
242 |
if ftype == TType.STRUCT:
|
|
|
243 |
self.e = ConfigException()
|
|
|
244 |
self.e.read(iprot)
|
|
|
245 |
else:
|
|
|
246 |
iprot.skip(ftype)
|
|
|
247 |
else:
|
|
|
248 |
iprot.skip(ftype)
|
|
|
249 |
iprot.readFieldEnd()
|
|
|
250 |
iprot.readStructEnd()
|
|
|
251 |
|
|
|
252 |
def write(self, oprot):
|
|
|
253 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
254 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
255 |
return
|
|
|
256 |
oprot.writeStructBegin('getPropetry_result')
|
|
|
257 |
if self.success != None:
|
|
|
258 |
oprot.writeFieldBegin('success', TType.STRING, 0)
|
|
|
259 |
oprot.writeString(self.success)
|
|
|
260 |
oprot.writeFieldEnd()
|
|
|
261 |
if self.e != None:
|
|
|
262 |
oprot.writeFieldBegin('e', TType.STRUCT, 1)
|
|
|
263 |
self.e.write(oprot)
|
|
|
264 |
oprot.writeFieldEnd()
|
|
|
265 |
oprot.writeFieldStop()
|
|
|
266 |
oprot.writeStructEnd()
|
|
|
267 |
|
|
|
268 |
def __repr__(self):
|
|
|
269 |
L = ['%s=%r' % (key, value)
|
|
|
270 |
for key, value in self.__dict__.iteritems()]
|
|
|
271 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
272 |
|
|
|
273 |
def __eq__(self, other):
|
|
|
274 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
275 |
|
|
|
276 |
def __ne__(self, other):
|
|
|
277 |
return not (self == other)
|
|
|
278 |
|
|
|
279 |
class loadProperty_args:
|
|
|
280 |
"""
|
|
|
281 |
Attributes:
|
|
|
282 |
- propertyName
|
|
|
283 |
- propertyValue
|
|
|
284 |
"""
|
|
|
285 |
|
|
|
286 |
thrift_spec = (
|
|
|
287 |
None, # 0
|
|
|
288 |
(1, TType.STRING, 'propertyName', None, None, ), # 1
|
|
|
289 |
(2, TType.STRING, 'propertyValue', None, None, ), # 2
|
|
|
290 |
)
|
|
|
291 |
|
|
|
292 |
def __init__(self, propertyName=None, propertyValue=None,):
|
|
|
293 |
self.propertyName = propertyName
|
|
|
294 |
self.propertyValue = propertyValue
|
|
|
295 |
|
|
|
296 |
def read(self, iprot):
|
|
|
297 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
298 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
299 |
return
|
|
|
300 |
iprot.readStructBegin()
|
|
|
301 |
while True:
|
|
|
302 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
303 |
if ftype == TType.STOP:
|
|
|
304 |
break
|
|
|
305 |
if fid == 1:
|
|
|
306 |
if ftype == TType.STRING:
|
|
|
307 |
self.propertyName = iprot.readString();
|
|
|
308 |
else:
|
|
|
309 |
iprot.skip(ftype)
|
|
|
310 |
elif fid == 2:
|
|
|
311 |
if ftype == TType.STRING:
|
|
|
312 |
self.propertyValue = iprot.readString();
|
|
|
313 |
else:
|
|
|
314 |
iprot.skip(ftype)
|
|
|
315 |
else:
|
|
|
316 |
iprot.skip(ftype)
|
|
|
317 |
iprot.readFieldEnd()
|
|
|
318 |
iprot.readStructEnd()
|
|
|
319 |
|
|
|
320 |
def write(self, oprot):
|
|
|
321 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
322 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
323 |
return
|
|
|
324 |
oprot.writeStructBegin('loadProperty_args')
|
|
|
325 |
if self.propertyName != None:
|
|
|
326 |
oprot.writeFieldBegin('propertyName', TType.STRING, 1)
|
|
|
327 |
oprot.writeString(self.propertyName)
|
|
|
328 |
oprot.writeFieldEnd()
|
|
|
329 |
if self.propertyValue != None:
|
|
|
330 |
oprot.writeFieldBegin('propertyValue', TType.STRING, 2)
|
|
|
331 |
oprot.writeString(self.propertyValue)
|
|
|
332 |
oprot.writeFieldEnd()
|
|
|
333 |
oprot.writeFieldStop()
|
|
|
334 |
oprot.writeStructEnd()
|
|
|
335 |
|
|
|
336 |
def __repr__(self):
|
|
|
337 |
L = ['%s=%r' % (key, value)
|
|
|
338 |
for key, value in self.__dict__.iteritems()]
|
|
|
339 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
340 |
|
|
|
341 |
def __eq__(self, other):
|
|
|
342 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
343 |
|
|
|
344 |
def __ne__(self, other):
|
|
|
345 |
return not (self == other)
|
|
|
346 |
|
|
|
347 |
class loadProperty_result:
|
|
|
348 |
|
|
|
349 |
thrift_spec = (
|
|
|
350 |
)
|
|
|
351 |
|
|
|
352 |
def read(self, iprot):
|
|
|
353 |
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
|
|
|
354 |
fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
|
|
|
355 |
return
|
|
|
356 |
iprot.readStructBegin()
|
|
|
357 |
while True:
|
|
|
358 |
(fname, ftype, fid) = iprot.readFieldBegin()
|
|
|
359 |
if ftype == TType.STOP:
|
|
|
360 |
break
|
|
|
361 |
else:
|
|
|
362 |
iprot.skip(ftype)
|
|
|
363 |
iprot.readFieldEnd()
|
|
|
364 |
iprot.readStructEnd()
|
|
|
365 |
|
|
|
366 |
def write(self, oprot):
|
|
|
367 |
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
|
|
|
368 |
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
|
|
|
369 |
return
|
|
|
370 |
oprot.writeStructBegin('loadProperty_result')
|
|
|
371 |
oprot.writeFieldStop()
|
|
|
372 |
oprot.writeStructEnd()
|
|
|
373 |
|
|
|
374 |
def __repr__(self):
|
|
|
375 |
L = ['%s=%r' % (key, value)
|
|
|
376 |
for key, value in self.__dict__.iteritems()]
|
|
|
377 |
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
|
|
|
378 |
|
|
|
379 |
def __eq__(self, other):
|
|
|
380 |
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
|
|
|
381 |
|
|
|
382 |
def __ne__(self, other):
|
|
|
383 |
return not (self == other)
|
|
|
384 |
|
|
|
385 |
|