Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
305 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.datalogger;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class DataLogger {
27
 
28
  public interface Iface {
29
 
764 rajveer 30
    public void closeSession() throws TException;
31
 
305 ashish 32
    public void log(MsgType messageType, String message) throws TException;
33
 
34
  }
35
 
36
  public static class Client implements Iface {
37
    public Client(TProtocol prot)
38
    {
39
      this(prot, prot);
40
    }
41
 
42
    public Client(TProtocol iprot, TProtocol oprot)
43
    {
44
      iprot_ = iprot;
45
      oprot_ = oprot;
46
    }
47
 
48
    protected TProtocol iprot_;
49
    protected TProtocol oprot_;
50
 
51
    protected int seqid_;
52
 
53
    public TProtocol getInputProtocol()
54
    {
55
      return this.iprot_;
56
    }
57
 
58
    public TProtocol getOutputProtocol()
59
    {
60
      return this.oprot_;
61
    }
62
 
764 rajveer 63
    public void closeSession() throws TException
64
    {
65
      send_closeSession();
66
      recv_closeSession();
67
    }
68
 
69
    public void send_closeSession() throws TException
70
    {
71
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
72
      closeSession_args args = new closeSession_args();
73
      args.write(oprot_);
74
      oprot_.writeMessageEnd();
75
      oprot_.getTransport().flush();
76
    }
77
 
78
    public void recv_closeSession() throws TException
79
    {
80
      TMessage msg = iprot_.readMessageBegin();
81
      if (msg.type == TMessageType.EXCEPTION) {
82
        TApplicationException x = TApplicationException.read(iprot_);
83
        iprot_.readMessageEnd();
84
        throw x;
85
      }
86
      closeSession_result result = new closeSession_result();
87
      result.read(iprot_);
88
      iprot_.readMessageEnd();
89
      return;
90
    }
91
 
305 ashish 92
    public void log(MsgType messageType, String message) throws TException
93
    {
94
      send_log(messageType, message);
95
      recv_log();
96
    }
97
 
98
    public void send_log(MsgType messageType, String message) throws TException
99
    {
100
      oprot_.writeMessageBegin(new TMessage("log", TMessageType.CALL, seqid_));
101
      log_args args = new log_args();
102
      args.messageType = messageType;
103
      args.message = message;
104
      args.write(oprot_);
105
      oprot_.writeMessageEnd();
106
      oprot_.getTransport().flush();
107
    }
108
 
109
    public void recv_log() throws TException
110
    {
111
      TMessage msg = iprot_.readMessageBegin();
112
      if (msg.type == TMessageType.EXCEPTION) {
113
        TApplicationException x = TApplicationException.read(iprot_);
114
        iprot_.readMessageEnd();
115
        throw x;
116
      }
117
      log_result result = new log_result();
118
      result.read(iprot_);
119
      iprot_.readMessageEnd();
120
      return;
121
    }
122
 
123
  }
124
  public static class Processor implements TProcessor {
125
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
126
    public Processor(Iface iface)
127
    {
128
      iface_ = iface;
764 rajveer 129
      processMap_.put("closeSession", new closeSession());
305 ashish 130
      processMap_.put("log", new log());
131
    }
132
 
133
    protected static interface ProcessFunction {
134
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
135
    }
136
 
137
    private Iface iface_;
138
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
139
 
140
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
141
    {
142
      TMessage msg = iprot.readMessageBegin();
143
      ProcessFunction fn = processMap_.get(msg.name);
144
      if (fn == null) {
145
        TProtocolUtil.skip(iprot, TType.STRUCT);
146
        iprot.readMessageEnd();
147
        TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'");
148
        oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));
149
        x.write(oprot);
150
        oprot.writeMessageEnd();
151
        oprot.getTransport().flush();
152
        return true;
153
      }
154
      fn.process(msg.seqid, iprot, oprot);
155
      return true;
156
    }
157
 
764 rajveer 158
    private class closeSession implements ProcessFunction {
159
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
160
      {
161
        closeSession_args args = new closeSession_args();
162
        args.read(iprot);
163
        iprot.readMessageEnd();
164
        closeSession_result result = new closeSession_result();
165
        iface_.closeSession();
166
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
167
        result.write(oprot);
168
        oprot.writeMessageEnd();
169
        oprot.getTransport().flush();
170
      }
171
 
172
    }
173
 
305 ashish 174
    private class log implements ProcessFunction {
175
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
176
      {
177
        log_args args = new log_args();
178
        args.read(iprot);
179
        iprot.readMessageEnd();
180
        log_result result = new log_result();
181
        iface_.log(args.messageType, args.message);
182
        oprot.writeMessageBegin(new TMessage("log", TMessageType.REPLY, seqid));
183
        result.write(oprot);
184
        oprot.writeMessageEnd();
185
        oprot.getTransport().flush();
186
      }
187
 
188
    }
189
 
190
  }
191
 
764 rajveer 192
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
193
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
194
 
195
 
196
 
197
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
198
    public enum _Fields implements TFieldIdEnum {
199
;
200
 
201
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
202
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
203
 
204
      static {
205
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
206
          byId.put((int)field._thriftId, field);
207
          byName.put(field.getFieldName(), field);
208
        }
209
      }
210
 
211
      /**
212
       * Find the _Fields constant that matches fieldId, or null if its not found.
213
       */
214
      public static _Fields findByThriftId(int fieldId) {
215
        return byId.get(fieldId);
216
      }
217
 
218
      /**
219
       * Find the _Fields constant that matches fieldId, throwing an exception
220
       * if it is not found.
221
       */
222
      public static _Fields findByThriftIdOrThrow(int fieldId) {
223
        _Fields fields = findByThriftId(fieldId);
224
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
225
        return fields;
226
      }
227
 
228
      /**
229
       * Find the _Fields constant that matches name, or null if its not found.
230
       */
231
      public static _Fields findByName(String name) {
232
        return byName.get(name);
233
      }
234
 
235
      private final short _thriftId;
236
      private final String _fieldName;
237
 
238
      _Fields(short thriftId, String fieldName) {
239
        _thriftId = thriftId;
240
        _fieldName = fieldName;
241
      }
242
 
243
      public short getThriftFieldId() {
244
        return _thriftId;
245
      }
246
 
247
      public String getFieldName() {
248
        return _fieldName;
249
      }
250
    }
251
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
252
    }});
253
 
254
    static {
255
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
256
    }
257
 
258
    public closeSession_args() {
259
    }
260
 
261
    /**
262
     * Performs a deep copy on <i>other</i>.
263
     */
264
    public closeSession_args(closeSession_args other) {
265
    }
266
 
267
    public closeSession_args deepCopy() {
268
      return new closeSession_args(this);
269
    }
270
 
271
    @Deprecated
272
    public closeSession_args clone() {
273
      return new closeSession_args(this);
274
    }
275
 
276
    public void setFieldValue(_Fields field, Object value) {
277
      switch (field) {
278
      }
279
    }
280
 
281
    public void setFieldValue(int fieldID, Object value) {
282
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
283
    }
284
 
285
    public Object getFieldValue(_Fields field) {
286
      switch (field) {
287
      }
288
      throw new IllegalStateException();
289
    }
290
 
291
    public Object getFieldValue(int fieldId) {
292
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
293
    }
294
 
295
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
296
    public boolean isSet(_Fields field) {
297
      switch (field) {
298
      }
299
      throw new IllegalStateException();
300
    }
301
 
302
    public boolean isSet(int fieldID) {
303
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
304
    }
305
 
306
    @Override
307
    public boolean equals(Object that) {
308
      if (that == null)
309
        return false;
310
      if (that instanceof closeSession_args)
311
        return this.equals((closeSession_args)that);
312
      return false;
313
    }
314
 
315
    public boolean equals(closeSession_args that) {
316
      if (that == null)
317
        return false;
318
 
319
      return true;
320
    }
321
 
322
    @Override
323
    public int hashCode() {
324
      return 0;
325
    }
326
 
327
    public int compareTo(closeSession_args other) {
328
      if (!getClass().equals(other.getClass())) {
329
        return getClass().getName().compareTo(other.getClass().getName());
330
      }
331
 
332
      int lastComparison = 0;
333
      closeSession_args typedOther = (closeSession_args)other;
334
 
335
      return 0;
336
    }
337
 
338
    public void read(TProtocol iprot) throws TException {
339
      TField field;
340
      iprot.readStructBegin();
341
      while (true)
342
      {
343
        field = iprot.readFieldBegin();
344
        if (field.type == TType.STOP) { 
345
          break;
346
        }
347
        _Fields fieldId = _Fields.findByThriftId(field.id);
348
        if (fieldId == null) {
349
          TProtocolUtil.skip(iprot, field.type);
350
        } else {
351
          switch (fieldId) {
352
          }
353
          iprot.readFieldEnd();
354
        }
355
      }
356
      iprot.readStructEnd();
357
      validate();
358
    }
359
 
360
    public void write(TProtocol oprot) throws TException {
361
      validate();
362
 
363
      oprot.writeStructBegin(STRUCT_DESC);
364
      oprot.writeFieldStop();
365
      oprot.writeStructEnd();
366
    }
367
 
368
    @Override
369
    public String toString() {
370
      StringBuilder sb = new StringBuilder("closeSession_args(");
371
      boolean first = true;
372
 
373
      sb.append(")");
374
      return sb.toString();
375
    }
376
 
377
    public void validate() throws TException {
378
      // check for required fields
379
    }
380
 
381
  }
382
 
383
  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
384
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");
385
 
386
 
387
 
388
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
389
    public enum _Fields implements TFieldIdEnum {
390
;
391
 
392
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
393
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
394
 
395
      static {
396
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
397
          byId.put((int)field._thriftId, field);
398
          byName.put(field.getFieldName(), field);
399
        }
400
      }
401
 
402
      /**
403
       * Find the _Fields constant that matches fieldId, or null if its not found.
404
       */
405
      public static _Fields findByThriftId(int fieldId) {
406
        return byId.get(fieldId);
407
      }
408
 
409
      /**
410
       * Find the _Fields constant that matches fieldId, throwing an exception
411
       * if it is not found.
412
       */
413
      public static _Fields findByThriftIdOrThrow(int fieldId) {
414
        _Fields fields = findByThriftId(fieldId);
415
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
416
        return fields;
417
      }
418
 
419
      /**
420
       * Find the _Fields constant that matches name, or null if its not found.
421
       */
422
      public static _Fields findByName(String name) {
423
        return byName.get(name);
424
      }
425
 
426
      private final short _thriftId;
427
      private final String _fieldName;
428
 
429
      _Fields(short thriftId, String fieldName) {
430
        _thriftId = thriftId;
431
        _fieldName = fieldName;
432
      }
433
 
434
      public short getThriftFieldId() {
435
        return _thriftId;
436
      }
437
 
438
      public String getFieldName() {
439
        return _fieldName;
440
      }
441
    }
442
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
443
    }});
444
 
445
    static {
446
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
447
    }
448
 
449
    public closeSession_result() {
450
    }
451
 
452
    /**
453
     * Performs a deep copy on <i>other</i>.
454
     */
455
    public closeSession_result(closeSession_result other) {
456
    }
457
 
458
    public closeSession_result deepCopy() {
459
      return new closeSession_result(this);
460
    }
461
 
462
    @Deprecated
463
    public closeSession_result clone() {
464
      return new closeSession_result(this);
465
    }
466
 
467
    public void setFieldValue(_Fields field, Object value) {
468
      switch (field) {
469
      }
470
    }
471
 
472
    public void setFieldValue(int fieldID, Object value) {
473
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
474
    }
475
 
476
    public Object getFieldValue(_Fields field) {
477
      switch (field) {
478
      }
479
      throw new IllegalStateException();
480
    }
481
 
482
    public Object getFieldValue(int fieldId) {
483
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
484
    }
485
 
486
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
487
    public boolean isSet(_Fields field) {
488
      switch (field) {
489
      }
490
      throw new IllegalStateException();
491
    }
492
 
493
    public boolean isSet(int fieldID) {
494
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
495
    }
496
 
497
    @Override
498
    public boolean equals(Object that) {
499
      if (that == null)
500
        return false;
501
      if (that instanceof closeSession_result)
502
        return this.equals((closeSession_result)that);
503
      return false;
504
    }
505
 
506
    public boolean equals(closeSession_result that) {
507
      if (that == null)
508
        return false;
509
 
510
      return true;
511
    }
512
 
513
    @Override
514
    public int hashCode() {
515
      return 0;
516
    }
517
 
518
    public int compareTo(closeSession_result other) {
519
      if (!getClass().equals(other.getClass())) {
520
        return getClass().getName().compareTo(other.getClass().getName());
521
      }
522
 
523
      int lastComparison = 0;
524
      closeSession_result typedOther = (closeSession_result)other;
525
 
526
      return 0;
527
    }
528
 
529
    public void read(TProtocol iprot) throws TException {
530
      TField field;
531
      iprot.readStructBegin();
532
      while (true)
533
      {
534
        field = iprot.readFieldBegin();
535
        if (field.type == TType.STOP) { 
536
          break;
537
        }
538
        _Fields fieldId = _Fields.findByThriftId(field.id);
539
        if (fieldId == null) {
540
          TProtocolUtil.skip(iprot, field.type);
541
        } else {
542
          switch (fieldId) {
543
          }
544
          iprot.readFieldEnd();
545
        }
546
      }
547
      iprot.readStructEnd();
548
      validate();
549
    }
550
 
551
    public void write(TProtocol oprot) throws TException {
552
      oprot.writeStructBegin(STRUCT_DESC);
553
 
554
      oprot.writeFieldStop();
555
      oprot.writeStructEnd();
556
    }
557
 
558
    @Override
559
    public String toString() {
560
      StringBuilder sb = new StringBuilder("closeSession_result(");
561
      boolean first = true;
562
 
563
      sb.append(")");
564
      return sb.toString();
565
    }
566
 
567
    public void validate() throws TException {
568
      // check for required fields
569
    }
570
 
571
  }
572
 
305 ashish 573
  public static class log_args implements TBase<log_args._Fields>, java.io.Serializable, Cloneable, Comparable<log_args>   {
574
    private static final TStruct STRUCT_DESC = new TStruct("log_args");
575
 
576
    private static final TField MESSAGE_TYPE_FIELD_DESC = new TField("messageType", TType.I32, (short)1);
577
    private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)2);
578
 
579
    private MsgType messageType;
580
    private String message;
581
 
582
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
583
    public enum _Fields implements TFieldIdEnum {
584
      /**
585
       * 
586
       * @see MsgType
587
       */
588
      MESSAGE_TYPE((short)1, "messageType"),
589
      MESSAGE((short)2, "message");
590
 
591
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
592
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
593
 
594
      static {
595
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
596
          byId.put((int)field._thriftId, field);
597
          byName.put(field.getFieldName(), field);
598
        }
599
      }
600
 
601
      /**
602
       * Find the _Fields constant that matches fieldId, or null if its not found.
603
       */
604
      public static _Fields findByThriftId(int fieldId) {
605
        return byId.get(fieldId);
606
      }
607
 
608
      /**
609
       * Find the _Fields constant that matches fieldId, throwing an exception
610
       * if it is not found.
611
       */
612
      public static _Fields findByThriftIdOrThrow(int fieldId) {
613
        _Fields fields = findByThriftId(fieldId);
614
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
615
        return fields;
616
      }
617
 
618
      /**
619
       * Find the _Fields constant that matches name, or null if its not found.
620
       */
621
      public static _Fields findByName(String name) {
622
        return byName.get(name);
623
      }
624
 
625
      private final short _thriftId;
626
      private final String _fieldName;
627
 
628
      _Fields(short thriftId, String fieldName) {
629
        _thriftId = thriftId;
630
        _fieldName = fieldName;
631
      }
632
 
633
      public short getThriftFieldId() {
634
        return _thriftId;
635
      }
636
 
637
      public String getFieldName() {
638
        return _fieldName;
639
      }
640
    }
641
 
642
    // isset id assignments
643
 
644
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
645
      put(_Fields.MESSAGE_TYPE, new FieldMetaData("messageType", TFieldRequirementType.DEFAULT, 
646
          new EnumMetaData(TType.ENUM, MsgType.class)));
647
      put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
648
          new FieldValueMetaData(TType.STRING)));
649
    }});
650
 
651
    static {
652
      FieldMetaData.addStructMetaDataMap(log_args.class, metaDataMap);
653
    }
654
 
655
    public log_args() {
656
    }
657
 
658
    public log_args(
659
      MsgType messageType,
660
      String message)
661
    {
662
      this();
663
      this.messageType = messageType;
664
      this.message = message;
665
    }
666
 
667
    /**
668
     * Performs a deep copy on <i>other</i>.
669
     */
670
    public log_args(log_args other) {
671
      if (other.isSetMessageType()) {
672
        this.messageType = other.messageType;
673
      }
674
      if (other.isSetMessage()) {
675
        this.message = other.message;
676
      }
677
    }
678
 
679
    public log_args deepCopy() {
680
      return new log_args(this);
681
    }
682
 
683
    @Deprecated
684
    public log_args clone() {
685
      return new log_args(this);
686
    }
687
 
688
    /**
689
     * 
690
     * @see MsgType
691
     */
692
    public MsgType getMessageType() {
693
      return this.messageType;
694
    }
695
 
696
    /**
697
     * 
698
     * @see MsgType
699
     */
700
    public log_args setMessageType(MsgType messageType) {
701
      this.messageType = messageType;
702
      return this;
703
    }
704
 
705
    public void unsetMessageType() {
706
      this.messageType = null;
707
    }
708
 
709
    /** Returns true if field messageType is set (has been asigned a value) and false otherwise */
710
    public boolean isSetMessageType() {
711
      return this.messageType != null;
712
    }
713
 
714
    public void setMessageTypeIsSet(boolean value) {
715
      if (!value) {
716
        this.messageType = null;
717
      }
718
    }
719
 
720
    public String getMessage() {
721
      return this.message;
722
    }
723
 
724
    public log_args setMessage(String message) {
725
      this.message = message;
726
      return this;
727
    }
728
 
729
    public void unsetMessage() {
730
      this.message = null;
731
    }
732
 
733
    /** Returns true if field message is set (has been asigned a value) and false otherwise */
734
    public boolean isSetMessage() {
735
      return this.message != null;
736
    }
737
 
738
    public void setMessageIsSet(boolean value) {
739
      if (!value) {
740
        this.message = null;
741
      }
742
    }
743
 
744
    public void setFieldValue(_Fields field, Object value) {
745
      switch (field) {
746
      case MESSAGE_TYPE:
747
        if (value == null) {
748
          unsetMessageType();
749
        } else {
750
          setMessageType((MsgType)value);
751
        }
752
        break;
753
 
754
      case MESSAGE:
755
        if (value == null) {
756
          unsetMessage();
757
        } else {
758
          setMessage((String)value);
759
        }
760
        break;
761
 
762
      }
763
    }
764
 
765
    public void setFieldValue(int fieldID, Object value) {
766
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
767
    }
768
 
769
    public Object getFieldValue(_Fields field) {
770
      switch (field) {
771
      case MESSAGE_TYPE:
772
        return getMessageType();
773
 
774
      case MESSAGE:
775
        return getMessage();
776
 
777
      }
778
      throw new IllegalStateException();
779
    }
780
 
781
    public Object getFieldValue(int fieldId) {
782
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
783
    }
784
 
785
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
786
    public boolean isSet(_Fields field) {
787
      switch (field) {
788
      case MESSAGE_TYPE:
789
        return isSetMessageType();
790
      case MESSAGE:
791
        return isSetMessage();
792
      }
793
      throw new IllegalStateException();
794
    }
795
 
796
    public boolean isSet(int fieldID) {
797
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
798
    }
799
 
800
    @Override
801
    public boolean equals(Object that) {
802
      if (that == null)
803
        return false;
804
      if (that instanceof log_args)
805
        return this.equals((log_args)that);
806
      return false;
807
    }
808
 
809
    public boolean equals(log_args that) {
810
      if (that == null)
811
        return false;
812
 
813
      boolean this_present_messageType = true && this.isSetMessageType();
814
      boolean that_present_messageType = true && that.isSetMessageType();
815
      if (this_present_messageType || that_present_messageType) {
816
        if (!(this_present_messageType && that_present_messageType))
817
          return false;
818
        if (!this.messageType.equals(that.messageType))
819
          return false;
820
      }
821
 
822
      boolean this_present_message = true && this.isSetMessage();
823
      boolean that_present_message = true && that.isSetMessage();
824
      if (this_present_message || that_present_message) {
825
        if (!(this_present_message && that_present_message))
826
          return false;
827
        if (!this.message.equals(that.message))
828
          return false;
829
      }
830
 
831
      return true;
832
    }
833
 
834
    @Override
835
    public int hashCode() {
836
      return 0;
837
    }
838
 
839
    public int compareTo(log_args other) {
840
      if (!getClass().equals(other.getClass())) {
841
        return getClass().getName().compareTo(other.getClass().getName());
842
      }
843
 
844
      int lastComparison = 0;
845
      log_args typedOther = (log_args)other;
846
 
847
      lastComparison = Boolean.valueOf(isSetMessageType()).compareTo(isSetMessageType());
848
      if (lastComparison != 0) {
849
        return lastComparison;
850
      }
851
      lastComparison = TBaseHelper.compareTo(messageType, typedOther.messageType);
852
      if (lastComparison != 0) {
853
        return lastComparison;
854
      }
855
      lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
856
      if (lastComparison != 0) {
857
        return lastComparison;
858
      }
859
      lastComparison = TBaseHelper.compareTo(message, typedOther.message);
860
      if (lastComparison != 0) {
861
        return lastComparison;
862
      }
863
      return 0;
864
    }
865
 
866
    public void read(TProtocol iprot) throws TException {
867
      TField field;
868
      iprot.readStructBegin();
869
      while (true)
870
      {
871
        field = iprot.readFieldBegin();
872
        if (field.type == TType.STOP) { 
873
          break;
874
        }
875
        _Fields fieldId = _Fields.findByThriftId(field.id);
876
        if (fieldId == null) {
877
          TProtocolUtil.skip(iprot, field.type);
878
        } else {
879
          switch (fieldId) {
880
            case MESSAGE_TYPE:
881
              if (field.type == TType.I32) {
882
                this.messageType = MsgType.findByValue(iprot.readI32());
883
              } else { 
884
                TProtocolUtil.skip(iprot, field.type);
885
              }
886
              break;
887
            case MESSAGE:
888
              if (field.type == TType.STRING) {
889
                this.message = iprot.readString();
890
              } else { 
891
                TProtocolUtil.skip(iprot, field.type);
892
              }
893
              break;
894
          }
895
          iprot.readFieldEnd();
896
        }
897
      }
898
      iprot.readStructEnd();
899
      validate();
900
    }
901
 
902
    public void write(TProtocol oprot) throws TException {
903
      validate();
904
 
905
      oprot.writeStructBegin(STRUCT_DESC);
906
      if (this.messageType != null) {
907
        oprot.writeFieldBegin(MESSAGE_TYPE_FIELD_DESC);
908
        oprot.writeI32(this.messageType.getValue());
909
        oprot.writeFieldEnd();
910
      }
911
      if (this.message != null) {
912
        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
913
        oprot.writeString(this.message);
914
        oprot.writeFieldEnd();
915
      }
916
      oprot.writeFieldStop();
917
      oprot.writeStructEnd();
918
    }
919
 
920
    @Override
921
    public String toString() {
922
      StringBuilder sb = new StringBuilder("log_args(");
923
      boolean first = true;
924
 
925
      sb.append("messageType:");
926
      if (this.messageType == null) {
927
        sb.append("null");
928
      } else {
929
        String messageType_name = messageType.name();
930
        if (messageType_name != null) {
931
          sb.append(messageType_name);
932
          sb.append(" (");
933
        }
934
        sb.append(this.messageType);
935
        if (messageType_name != null) {
936
          sb.append(")");
937
        }
938
      }
939
      first = false;
940
      if (!first) sb.append(", ");
941
      sb.append("message:");
942
      if (this.message == null) {
943
        sb.append("null");
944
      } else {
945
        sb.append(this.message);
946
      }
947
      first = false;
948
      sb.append(")");
949
      return sb.toString();
950
    }
951
 
952
    public void validate() throws TException {
953
      // check for required fields
954
    }
955
 
956
  }
957
 
958
  public static class log_result implements TBase<log_result._Fields>, java.io.Serializable, Cloneable, Comparable<log_result>   {
959
    private static final TStruct STRUCT_DESC = new TStruct("log_result");
960
 
961
 
962
 
963
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
964
    public enum _Fields implements TFieldIdEnum {
965
;
966
 
967
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
968
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
969
 
970
      static {
971
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
972
          byId.put((int)field._thriftId, field);
973
          byName.put(field.getFieldName(), field);
974
        }
975
      }
976
 
977
      /**
978
       * Find the _Fields constant that matches fieldId, or null if its not found.
979
       */
980
      public static _Fields findByThriftId(int fieldId) {
981
        return byId.get(fieldId);
982
      }
983
 
984
      /**
985
       * Find the _Fields constant that matches fieldId, throwing an exception
986
       * if it is not found.
987
       */
988
      public static _Fields findByThriftIdOrThrow(int fieldId) {
989
        _Fields fields = findByThriftId(fieldId);
990
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
991
        return fields;
992
      }
993
 
994
      /**
995
       * Find the _Fields constant that matches name, or null if its not found.
996
       */
997
      public static _Fields findByName(String name) {
998
        return byName.get(name);
999
      }
1000
 
1001
      private final short _thriftId;
1002
      private final String _fieldName;
1003
 
1004
      _Fields(short thriftId, String fieldName) {
1005
        _thriftId = thriftId;
1006
        _fieldName = fieldName;
1007
      }
1008
 
1009
      public short getThriftFieldId() {
1010
        return _thriftId;
1011
      }
1012
 
1013
      public String getFieldName() {
1014
        return _fieldName;
1015
      }
1016
    }
1017
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
1018
    }});
1019
 
1020
    static {
1021
      FieldMetaData.addStructMetaDataMap(log_result.class, metaDataMap);
1022
    }
1023
 
1024
    public log_result() {
1025
    }
1026
 
1027
    /**
1028
     * Performs a deep copy on <i>other</i>.
1029
     */
1030
    public log_result(log_result other) {
1031
    }
1032
 
1033
    public log_result deepCopy() {
1034
      return new log_result(this);
1035
    }
1036
 
1037
    @Deprecated
1038
    public log_result clone() {
1039
      return new log_result(this);
1040
    }
1041
 
1042
    public void setFieldValue(_Fields field, Object value) {
1043
      switch (field) {
1044
      }
1045
    }
1046
 
1047
    public void setFieldValue(int fieldID, Object value) {
1048
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1049
    }
1050
 
1051
    public Object getFieldValue(_Fields field) {
1052
      switch (field) {
1053
      }
1054
      throw new IllegalStateException();
1055
    }
1056
 
1057
    public Object getFieldValue(int fieldId) {
1058
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
1059
    }
1060
 
1061
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
1062
    public boolean isSet(_Fields field) {
1063
      switch (field) {
1064
      }
1065
      throw new IllegalStateException();
1066
    }
1067
 
1068
    public boolean isSet(int fieldID) {
1069
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
1070
    }
1071
 
1072
    @Override
1073
    public boolean equals(Object that) {
1074
      if (that == null)
1075
        return false;
1076
      if (that instanceof log_result)
1077
        return this.equals((log_result)that);
1078
      return false;
1079
    }
1080
 
1081
    public boolean equals(log_result that) {
1082
      if (that == null)
1083
        return false;
1084
 
1085
      return true;
1086
    }
1087
 
1088
    @Override
1089
    public int hashCode() {
1090
      return 0;
1091
    }
1092
 
1093
    public int compareTo(log_result other) {
1094
      if (!getClass().equals(other.getClass())) {
1095
        return getClass().getName().compareTo(other.getClass().getName());
1096
      }
1097
 
1098
      int lastComparison = 0;
1099
      log_result typedOther = (log_result)other;
1100
 
1101
      return 0;
1102
    }
1103
 
1104
    public void read(TProtocol iprot) throws TException {
1105
      TField field;
1106
      iprot.readStructBegin();
1107
      while (true)
1108
      {
1109
        field = iprot.readFieldBegin();
1110
        if (field.type == TType.STOP) { 
1111
          break;
1112
        }
1113
        _Fields fieldId = _Fields.findByThriftId(field.id);
1114
        if (fieldId == null) {
1115
          TProtocolUtil.skip(iprot, field.type);
1116
        } else {
1117
          switch (fieldId) {
1118
          }
1119
          iprot.readFieldEnd();
1120
        }
1121
      }
1122
      iprot.readStructEnd();
1123
      validate();
1124
    }
1125
 
1126
    public void write(TProtocol oprot) throws TException {
1127
      oprot.writeStructBegin(STRUCT_DESC);
1128
 
1129
      oprot.writeFieldStop();
1130
      oprot.writeStructEnd();
1131
    }
1132
 
1133
    @Override
1134
    public String toString() {
1135
      StringBuilder sb = new StringBuilder("log_result(");
1136
      boolean first = true;
1137
 
1138
      sb.append(")");
1139
      return sb.toString();
1140
    }
1141
 
1142
    public void validate() throws TException {
1143
      // check for required fields
1144
    }
1145
 
1146
  }
1147
 
1148
}