Subversion Repositories SmartDukaan

Rev

Rev 3374 | Details | Compare with Previous | Last modification | View Log | RSS feed

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