Rev 2926 | Blame | Compare with Previous | Last modification | View Log | RSS feed
## Autogenerated by Thrift Compiler (0.7.0)## DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING#from thrift.Thrift import *from ttypes import *from thrift.Thrift import TProcessorfrom thrift.transport import TTransportfrom thrift.protocol import TBinaryProtocol, TProtocoltry:from thrift.protocol import fastbinaryexcept:fastbinary = Noneclass Iface:def getPropetry(self, propertyName):"""Parameters:- propertyName"""passdef loadProperty(self, propertyName, propertyValue):"""Parameters:- propertyName- propertyValue"""passdef reloadProperties(self, ):passclass Client(Iface):def __init__(self, iprot, oprot=None):self._iprot = self._oprot = iprotif oprot is not None:self._oprot = oprotself._seqid = 0def getPropetry(self, propertyName):"""Parameters:- propertyName"""self.send_getPropetry(propertyName)return self.recv_getPropetry()def send_getPropetry(self, propertyName):self._oprot.writeMessageBegin('getPropetry', TMessageType.CALL, self._seqid)args = getPropetry_args()args.propertyName = propertyNameargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_getPropetry(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = getPropetry_result()result.read(self._iprot)self._iprot.readMessageEnd()if result.success is not None:return result.successif result.e is not None:raise result.eraise TApplicationException(TApplicationException.MISSING_RESULT, "getPropetry failed: unknown result");def loadProperty(self, propertyName, propertyValue):"""Parameters:- propertyName- propertyValue"""self.send_loadProperty(propertyName, propertyValue)self.recv_loadProperty()def send_loadProperty(self, propertyName, propertyValue):self._oprot.writeMessageBegin('loadProperty', TMessageType.CALL, self._seqid)args = loadProperty_args()args.propertyName = propertyNameargs.propertyValue = propertyValueargs.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_loadProperty(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = loadProperty_result()result.read(self._iprot)self._iprot.readMessageEnd()returndef reloadProperties(self, ):self.send_reloadProperties()self.recv_reloadProperties()def send_reloadProperties(self, ):self._oprot.writeMessageBegin('reloadProperties', TMessageType.CALL, self._seqid)args = reloadProperties_args()args.write(self._oprot)self._oprot.writeMessageEnd()self._oprot.trans.flush()def recv_reloadProperties(self, ):(fname, mtype, rseqid) = self._iprot.readMessageBegin()if mtype == TMessageType.EXCEPTION:x = TApplicationException()x.read(self._iprot)self._iprot.readMessageEnd()raise xresult = reloadProperties_result()result.read(self._iprot)self._iprot.readMessageEnd()returnclass Processor(Iface, TProcessor):def __init__(self, handler):self._handler = handlerself._processMap = {}self._processMap["getPropetry"] = Processor.process_getPropetryself._processMap["loadProperty"] = Processor.process_loadPropertyself._processMap["reloadProperties"] = Processor.process_reloadPropertiesdef process(self, iprot, oprot):(name, type, seqid) = iprot.readMessageBegin()if name not in self._processMap:iprot.skip(TType.STRUCT)iprot.readMessageEnd()x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)x.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()returnelse:self._processMap[name](self, seqid, iprot, oprot)return Truedef process_getPropetry(self, seqid, iprot, oprot):args = getPropetry_args()args.read(iprot)iprot.readMessageEnd()result = getPropetry_result()try:result.success = self._handler.getPropetry(args.propertyName)except ConfigException, e:result.e = eoprot.writeMessageBegin("getPropetry", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_loadProperty(self, seqid, iprot, oprot):args = loadProperty_args()args.read(iprot)iprot.readMessageEnd()result = loadProperty_result()self._handler.loadProperty(args.propertyName, args.propertyValue)oprot.writeMessageBegin("loadProperty", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()def process_reloadProperties(self, seqid, iprot, oprot):args = reloadProperties_args()args.read(iprot)iprot.readMessageEnd()result = reloadProperties_result()self._handler.reloadProperties()oprot.writeMessageBegin("reloadProperties", TMessageType.REPLY, seqid)result.write(oprot)oprot.writeMessageEnd()oprot.trans.flush()# HELPER FUNCTIONS AND STRUCTURESclass getPropetry_args:"""Attributes:- propertyName"""thrift_spec = (None, # 0(1, TType.STRING, 'propertyName', None, None, ), # 1)def __init__(self, propertyName=None,):self.propertyName = propertyNamedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRING:self.propertyName = iprot.readString();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getPropetry_args')if self.propertyName is not None:oprot.writeFieldBegin('propertyName', TType.STRING, 1)oprot.writeString(self.propertyName)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class getPropetry_result:"""Attributes:- success- e"""thrift_spec = ((0, TType.STRING, 'success', None, None, ), # 0(1, TType.STRUCT, 'e', (ConfigException, ConfigException.thrift_spec), None, ), # 1)def __init__(self, success=None, e=None,):self.success = successself.e = edef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 0:if ftype == TType.STRING:self.success = iprot.readString();else:iprot.skip(ftype)elif fid == 1:if ftype == TType.STRUCT:self.e = ConfigException()self.e.read(iprot)else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('getPropetry_result')if self.success is not None:oprot.writeFieldBegin('success', TType.STRING, 0)oprot.writeString(self.success)oprot.writeFieldEnd()if self.e is not None:oprot.writeFieldBegin('e', TType.STRUCT, 1)self.e.write(oprot)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class loadProperty_args:"""Attributes:- propertyName- propertyValue"""thrift_spec = (None, # 0(1, TType.STRING, 'propertyName', None, None, ), # 1(2, TType.STRING, 'propertyValue', None, None, ), # 2)def __init__(self, propertyName=None, propertyValue=None,):self.propertyName = propertyNameself.propertyValue = propertyValuedef read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakif fid == 1:if ftype == TType.STRING:self.propertyName = iprot.readString();else:iprot.skip(ftype)elif fid == 2:if ftype == TType.STRING:self.propertyValue = iprot.readString();else:iprot.skip(ftype)else:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('loadProperty_args')if self.propertyName is not None:oprot.writeFieldBegin('propertyName', TType.STRING, 1)oprot.writeString(self.propertyName)oprot.writeFieldEnd()if self.propertyValue is not None:oprot.writeFieldBegin('propertyValue', TType.STRING, 2)oprot.writeString(self.propertyValue)oprot.writeFieldEnd()oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class loadProperty_result:thrift_spec = ()def read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakelse:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('loadProperty_result')oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class reloadProperties_args:thrift_spec = ()def read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakelse:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('reloadProperties_args')oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)class reloadProperties_result:thrift_spec = ()def read(self, iprot):if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))returniprot.readStructBegin()while True:(fname, ftype, fid) = iprot.readFieldBegin()if ftype == TType.STOP:breakelse:iprot.skip(ftype)iprot.readFieldEnd()iprot.readStructEnd()def write(self, oprot):if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))returnoprot.writeStructBegin('reloadProperties_result')oprot.writeFieldStop()oprot.writeStructEnd()def validate(self):returndef __repr__(self):L = ['%s=%r' % (key, value)for key, value in self.__dict__.iteritems()]return '%s(%s)' % (self.__class__.__name__, ', '.join(L))def __eq__(self, other):return isinstance(other, self.__class__) and self.__dict__ == other.__dict__def __ne__(self, other):return not (self == other)