Subversion Repositories SmartDukaan

Rev

Rev 708 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 708 Rev 764
Line 28... Line 28...
28
  /**
28
  /**
29
   * service
29
   * service
30
   */
30
   */
31
  public interface Iface {
31
  public interface Iface {
32
 
32
 
-
 
33
    /**
-
 
34
     * For closing the open session in sqlalchemy
-
 
35
     */
-
 
36
    public void closeSession() throws TException;
-
 
37
 
33
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException;
38
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException;
34
 
39
 
35
    public User getUserById(long userId) throws UserContextException, TException;
40
    public User getUserById(long userId) throws UserContextException, TException;
36
 
41
 
37
    public User createUser(User user) throws UserContextException, TException;
42
    public User createUser(User user) throws UserContextException, TException;
Line 183... Line 188...
183
    public TProtocol getOutputProtocol()
188
    public TProtocol getOutputProtocol()
184
    {
189
    {
185
      return this.oprot_;
190
      return this.oprot_;
186
    }
191
    }
187
 
192
 
-
 
193
    public void closeSession() throws TException
-
 
194
    {
-
 
195
      send_closeSession();
-
 
196
      recv_closeSession();
-
 
197
    }
-
 
198
 
-
 
199
    public void send_closeSession() throws TException
-
 
200
    {
-
 
201
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
-
 
202
      closeSession_args args = new closeSession_args();
-
 
203
      args.write(oprot_);
-
 
204
      oprot_.writeMessageEnd();
-
 
205
      oprot_.getTransport().flush();
-
 
206
    }
-
 
207
 
-
 
208
    public void recv_closeSession() throws TException
-
 
209
    {
-
 
210
      TMessage msg = iprot_.readMessageBegin();
-
 
211
      if (msg.type == TMessageType.EXCEPTION) {
-
 
212
        TApplicationException x = TApplicationException.read(iprot_);
-
 
213
        iprot_.readMessageEnd();
-
 
214
        throw x;
-
 
215
      }
-
 
216
      closeSession_result result = new closeSession_result();
-
 
217
      result.read(iprot_);
-
 
218
      iprot_.readMessageEnd();
-
 
219
      return;
-
 
220
    }
-
 
221
 
188
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException
222
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException
189
    {
223
    {
190
      send_createAnonymousUser(jsessionId);
224
      send_createAnonymousUser(jsessionId);
191
      return recv_createAnonymousUser();
225
      return recv_createAnonymousUser();
192
    }
226
    }
Line 1865... Line 1899...
1865
  public static class Processor implements TProcessor {
1899
  public static class Processor implements TProcessor {
1866
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1900
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1867
    public Processor(Iface iface)
1901
    public Processor(Iface iface)
1868
    {
1902
    {
1869
      iface_ = iface;
1903
      iface_ = iface;
-
 
1904
      processMap_.put("closeSession", new closeSession());
1870
      processMap_.put("createAnonymousUser", new createAnonymousUser());
1905
      processMap_.put("createAnonymousUser", new createAnonymousUser());
1871
      processMap_.put("getUserById", new getUserById());
1906
      processMap_.put("getUserById", new getUserById());
1872
      processMap_.put("createUser", new createUser());
1907
      processMap_.put("createUser", new createUser());
1873
      processMap_.put("updateUser", new updateUser());
1908
      processMap_.put("updateUser", new updateUser());
1874
      processMap_.put("deleteUser", new deleteUser());
1909
      processMap_.put("deleteUser", new deleteUser());
Line 1939... Line 1974...
1939
      }
1974
      }
1940
      fn.process(msg.seqid, iprot, oprot);
1975
      fn.process(msg.seqid, iprot, oprot);
1941
      return true;
1976
      return true;
1942
    }
1977
    }
1943
 
1978
 
-
 
1979
    private class closeSession implements ProcessFunction {
-
 
1980
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
1981
      {
-
 
1982
        closeSession_args args = new closeSession_args();
-
 
1983
        args.read(iprot);
-
 
1984
        iprot.readMessageEnd();
-
 
1985
        closeSession_result result = new closeSession_result();
-
 
1986
        iface_.closeSession();
-
 
1987
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
-
 
1988
        result.write(oprot);
-
 
1989
        oprot.writeMessageEnd();
-
 
1990
        oprot.getTransport().flush();
-
 
1991
      }
-
 
1992
 
-
 
1993
    }
-
 
1994
 
1944
    private class createAnonymousUser implements ProcessFunction {
1995
    private class createAnonymousUser implements ProcessFunction {
1945
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1996
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1946
      {
1997
      {
1947
        createAnonymousUser_args args = new createAnonymousUser_args();
1998
        createAnonymousUser_args args = new createAnonymousUser_args();
1948
        args.read(iprot);
1999
        args.read(iprot);
Line 3237... Line 3288...
3237
 
3288
 
3238
    }
3289
    }
3239
 
3290
 
3240
  }
3291
  }
3241
 
3292
 
-
 
3293
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
-
 
3294
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
-
 
3295
 
-
 
3296
 
-
 
3297
 
-
 
3298
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
3299
    public enum _Fields implements TFieldIdEnum {
-
 
3300
;
-
 
3301
 
-
 
3302
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
3303
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
3304
 
-
 
3305
      static {
-
 
3306
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
3307
          byId.put((int)field._thriftId, field);
-
 
3308
          byName.put(field.getFieldName(), field);
-
 
3309
        }
-
 
3310
      }
-
 
3311
 
-
 
3312
      /**
-
 
3313
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
3314
       */
-
 
3315
      public static _Fields findByThriftId(int fieldId) {
-
 
3316
        return byId.get(fieldId);
-
 
3317
      }
-
 
3318
 
-
 
3319
      /**
-
 
3320
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
3321
       * if it is not found.
-
 
3322
       */
-
 
3323
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
3324
        _Fields fields = findByThriftId(fieldId);
-
 
3325
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
3326
        return fields;
-
 
3327
      }
-
 
3328
 
-
 
3329
      /**
-
 
3330
       * Find the _Fields constant that matches name, or null if its not found.
-
 
3331
       */
-
 
3332
      public static _Fields findByName(String name) {
-
 
3333
        return byName.get(name);
-
 
3334
      }
-
 
3335
 
-
 
3336
      private final short _thriftId;
-
 
3337
      private final String _fieldName;
-
 
3338
 
-
 
3339
      _Fields(short thriftId, String fieldName) {
-
 
3340
        _thriftId = thriftId;
-
 
3341
        _fieldName = fieldName;
-
 
3342
      }
-
 
3343
 
-
 
3344
      public short getThriftFieldId() {
-
 
3345
        return _thriftId;
-
 
3346
      }
-
 
3347
 
-
 
3348
      public String getFieldName() {
-
 
3349
        return _fieldName;
-
 
3350
      }
-
 
3351
    }
-
 
3352
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
3353
    }});
-
 
3354
 
-
 
3355
    static {
-
 
3356
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
-
 
3357
    }
-
 
3358
 
-
 
3359
    public closeSession_args() {
-
 
3360
    }
-
 
3361
 
-
 
3362
    /**
-
 
3363
     * Performs a deep copy on <i>other</i>.
-
 
3364
     */
-
 
3365
    public closeSession_args(closeSession_args other) {
-
 
3366
    }
-
 
3367
 
-
 
3368
    public closeSession_args deepCopy() {
-
 
3369
      return new closeSession_args(this);
-
 
3370
    }
-
 
3371
 
-
 
3372
    @Deprecated
-
 
3373
    public closeSession_args clone() {
-
 
3374
      return new closeSession_args(this);
-
 
3375
    }
-
 
3376
 
-
 
3377
    public void setFieldValue(_Fields field, Object value) {
-
 
3378
      switch (field) {
-
 
3379
      }
-
 
3380
    }
-
 
3381
 
-
 
3382
    public void setFieldValue(int fieldID, Object value) {
-
 
3383
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
3384
    }
-
 
3385
 
-
 
3386
    public Object getFieldValue(_Fields field) {
-
 
3387
      switch (field) {
-
 
3388
      }
-
 
3389
      throw new IllegalStateException();
-
 
3390
    }
-
 
3391
 
-
 
3392
    public Object getFieldValue(int fieldId) {
-
 
3393
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
3394
    }
-
 
3395
 
-
 
3396
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
3397
    public boolean isSet(_Fields field) {
-
 
3398
      switch (field) {
-
 
3399
      }
-
 
3400
      throw new IllegalStateException();
-
 
3401
    }
-
 
3402
 
-
 
3403
    public boolean isSet(int fieldID) {
-
 
3404
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
3405
    }
-
 
3406
 
-
 
3407
    @Override
-
 
3408
    public boolean equals(Object that) {
-
 
3409
      if (that == null)
-
 
3410
        return false;
-
 
3411
      if (that instanceof closeSession_args)
-
 
3412
        return this.equals((closeSession_args)that);
-
 
3413
      return false;
-
 
3414
    }
-
 
3415
 
-
 
3416
    public boolean equals(closeSession_args that) {
-
 
3417
      if (that == null)
-
 
3418
        return false;
-
 
3419
 
-
 
3420
      return true;
-
 
3421
    }
-
 
3422
 
-
 
3423
    @Override
-
 
3424
    public int hashCode() {
-
 
3425
      return 0;
-
 
3426
    }
-
 
3427
 
-
 
3428
    public int compareTo(closeSession_args other) {
-
 
3429
      if (!getClass().equals(other.getClass())) {
-
 
3430
        return getClass().getName().compareTo(other.getClass().getName());
-
 
3431
      }
-
 
3432
 
-
 
3433
      int lastComparison = 0;
-
 
3434
      closeSession_args typedOther = (closeSession_args)other;
-
 
3435
 
-
 
3436
      return 0;
-
 
3437
    }
-
 
3438
 
-
 
3439
    public void read(TProtocol iprot) throws TException {
-
 
3440
      TField field;
-
 
3441
      iprot.readStructBegin();
-
 
3442
      while (true)
-
 
3443
      {
-
 
3444
        field = iprot.readFieldBegin();
-
 
3445
        if (field.type == TType.STOP) { 
-
 
3446
          break;
-
 
3447
        }
-
 
3448
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
3449
        if (fieldId == null) {
-
 
3450
          TProtocolUtil.skip(iprot, field.type);
-
 
3451
        } else {
-
 
3452
          switch (fieldId) {
-
 
3453
          }
-
 
3454
          iprot.readFieldEnd();
-
 
3455
        }
-
 
3456
      }
-
 
3457
      iprot.readStructEnd();
-
 
3458
      validate();
-
 
3459
    }
-
 
3460
 
-
 
3461
    public void write(TProtocol oprot) throws TException {
-
 
3462
      validate();
-
 
3463
 
-
 
3464
      oprot.writeStructBegin(STRUCT_DESC);
-
 
3465
      oprot.writeFieldStop();
-
 
3466
      oprot.writeStructEnd();
-
 
3467
    }
-
 
3468
 
-
 
3469
    @Override
-
 
3470
    public String toString() {
-
 
3471
      StringBuilder sb = new StringBuilder("closeSession_args(");
-
 
3472
      boolean first = true;
-
 
3473
 
-
 
3474
      sb.append(")");
-
 
3475
      return sb.toString();
-
 
3476
    }
-
 
3477
 
-
 
3478
    public void validate() throws TException {
-
 
3479
      // check for required fields
-
 
3480
    }
-
 
3481
 
-
 
3482
  }
-
 
3483
 
-
 
3484
  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
-
 
3485
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");
-
 
3486
 
-
 
3487
 
-
 
3488
 
-
 
3489
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
3490
    public enum _Fields implements TFieldIdEnum {
-
 
3491
;
-
 
3492
 
-
 
3493
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
3494
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
3495
 
-
 
3496
      static {
-
 
3497
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
3498
          byId.put((int)field._thriftId, field);
-
 
3499
          byName.put(field.getFieldName(), field);
-
 
3500
        }
-
 
3501
      }
-
 
3502
 
-
 
3503
      /**
-
 
3504
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
3505
       */
-
 
3506
      public static _Fields findByThriftId(int fieldId) {
-
 
3507
        return byId.get(fieldId);
-
 
3508
      }
-
 
3509
 
-
 
3510
      /**
-
 
3511
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
3512
       * if it is not found.
-
 
3513
       */
-
 
3514
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
3515
        _Fields fields = findByThriftId(fieldId);
-
 
3516
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
3517
        return fields;
-
 
3518
      }
-
 
3519
 
-
 
3520
      /**
-
 
3521
       * Find the _Fields constant that matches name, or null if its not found.
-
 
3522
       */
-
 
3523
      public static _Fields findByName(String name) {
-
 
3524
        return byName.get(name);
-
 
3525
      }
-
 
3526
 
-
 
3527
      private final short _thriftId;
-
 
3528
      private final String _fieldName;
-
 
3529
 
-
 
3530
      _Fields(short thriftId, String fieldName) {
-
 
3531
        _thriftId = thriftId;
-
 
3532
        _fieldName = fieldName;
-
 
3533
      }
-
 
3534
 
-
 
3535
      public short getThriftFieldId() {
-
 
3536
        return _thriftId;
-
 
3537
      }
-
 
3538
 
-
 
3539
      public String getFieldName() {
-
 
3540
        return _fieldName;
-
 
3541
      }
-
 
3542
    }
-
 
3543
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
3544
    }});
-
 
3545
 
-
 
3546
    static {
-
 
3547
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
-
 
3548
    }
-
 
3549
 
-
 
3550
    public closeSession_result() {
-
 
3551
    }
-
 
3552
 
-
 
3553
    /**
-
 
3554
     * Performs a deep copy on <i>other</i>.
-
 
3555
     */
-
 
3556
    public closeSession_result(closeSession_result other) {
-
 
3557
    }
-
 
3558
 
-
 
3559
    public closeSession_result deepCopy() {
-
 
3560
      return new closeSession_result(this);
-
 
3561
    }
-
 
3562
 
-
 
3563
    @Deprecated
-
 
3564
    public closeSession_result clone() {
-
 
3565
      return new closeSession_result(this);
-
 
3566
    }
-
 
3567
 
-
 
3568
    public void setFieldValue(_Fields field, Object value) {
-
 
3569
      switch (field) {
-
 
3570
      }
-
 
3571
    }
-
 
3572
 
-
 
3573
    public void setFieldValue(int fieldID, Object value) {
-
 
3574
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
3575
    }
-
 
3576
 
-
 
3577
    public Object getFieldValue(_Fields field) {
-
 
3578
      switch (field) {
-
 
3579
      }
-
 
3580
      throw new IllegalStateException();
-
 
3581
    }
-
 
3582
 
-
 
3583
    public Object getFieldValue(int fieldId) {
-
 
3584
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
3585
    }
-
 
3586
 
-
 
3587
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
3588
    public boolean isSet(_Fields field) {
-
 
3589
      switch (field) {
-
 
3590
      }
-
 
3591
      throw new IllegalStateException();
-
 
3592
    }
-
 
3593
 
-
 
3594
    public boolean isSet(int fieldID) {
-
 
3595
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
3596
    }
-
 
3597
 
-
 
3598
    @Override
-
 
3599
    public boolean equals(Object that) {
-
 
3600
      if (that == null)
-
 
3601
        return false;
-
 
3602
      if (that instanceof closeSession_result)
-
 
3603
        return this.equals((closeSession_result)that);
-
 
3604
      return false;
-
 
3605
    }
-
 
3606
 
-
 
3607
    public boolean equals(closeSession_result that) {
-
 
3608
      if (that == null)
-
 
3609
        return false;
-
 
3610
 
-
 
3611
      return true;
-
 
3612
    }
-
 
3613
 
-
 
3614
    @Override
-
 
3615
    public int hashCode() {
-
 
3616
      return 0;
-
 
3617
    }
-
 
3618
 
-
 
3619
    public int compareTo(closeSession_result other) {
-
 
3620
      if (!getClass().equals(other.getClass())) {
-
 
3621
        return getClass().getName().compareTo(other.getClass().getName());
-
 
3622
      }
-
 
3623
 
-
 
3624
      int lastComparison = 0;
-
 
3625
      closeSession_result typedOther = (closeSession_result)other;
-
 
3626
 
-
 
3627
      return 0;
-
 
3628
    }
-
 
3629
 
-
 
3630
    public void read(TProtocol iprot) throws TException {
-
 
3631
      TField field;
-
 
3632
      iprot.readStructBegin();
-
 
3633
      while (true)
-
 
3634
      {
-
 
3635
        field = iprot.readFieldBegin();
-
 
3636
        if (field.type == TType.STOP) { 
-
 
3637
          break;
-
 
3638
        }
-
 
3639
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
3640
        if (fieldId == null) {
-
 
3641
          TProtocolUtil.skip(iprot, field.type);
-
 
3642
        } else {
-
 
3643
          switch (fieldId) {
-
 
3644
          }
-
 
3645
          iprot.readFieldEnd();
-
 
3646
        }
-
 
3647
      }
-
 
3648
      iprot.readStructEnd();
-
 
3649
      validate();
-
 
3650
    }
-
 
3651
 
-
 
3652
    public void write(TProtocol oprot) throws TException {
-
 
3653
      oprot.writeStructBegin(STRUCT_DESC);
-
 
3654
 
-
 
3655
      oprot.writeFieldStop();
-
 
3656
      oprot.writeStructEnd();
-
 
3657
    }
-
 
3658
 
-
 
3659
    @Override
-
 
3660
    public String toString() {
-
 
3661
      StringBuilder sb = new StringBuilder("closeSession_result(");
-
 
3662
      boolean first = true;
-
 
3663
 
-
 
3664
      sb.append(")");
-
 
3665
      return sb.toString();
-
 
3666
    }
-
 
3667
 
-
 
3668
    public void validate() throws TException {
-
 
3669
      // check for required fields
-
 
3670
    }
-
 
3671
 
-
 
3672
  }
-
 
3673
 
3242
  public static class createAnonymousUser_args implements TBase<createAnonymousUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<createAnonymousUser_args>   {
3674
  public static class createAnonymousUser_args implements TBase<createAnonymousUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<createAnonymousUser_args>   {
3243
    private static final TStruct STRUCT_DESC = new TStruct("createAnonymousUser_args");
3675
    private static final TStruct STRUCT_DESC = new TStruct("createAnonymousUser_args");
3244
 
3676
 
3245
    private static final TField JSESSION_ID_FIELD_DESC = new TField("jsessionId", TType.STRING, (short)1);
3677
    private static final TField JSESSION_ID_FIELD_DESC = new TField("jsessionId", TType.STRING, (short)1);
3246
 
3678