Exemplo n.º 1
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, execute_result struct)
     throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField schemeField;
   iprot.readStructBegin();
   while (true) {
     schemeField = iprot.readFieldBegin();
     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (schemeField.id) {
       case 0: // SUCCESS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.success = iprot.readString();
           struct.set_success_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 1: // E
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.e = new DRPCExecutionException();
           struct.e.read(iprot);
           struct.set_e_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // AZE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.aze = new AuthorizationException();
           struct.aze.read(iprot);
           struct.set_aze_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   struct.validate();
 }
Exemplo n.º 2
0
      public void write(org.apache.thrift.protocol.TProtocol oprot, execute_result struct)
          throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeString(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.e != null) {
          oprot.writeFieldBegin(E_FIELD_DESC);
          struct.e.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.aze != null) {
          oprot.writeFieldBegin(AZE_FIELD_DESC);
          struct.aze.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }