Subversion Repositories SmartDukaan

Rev

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

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