Subversion Repositories SmartDukaan

Rev

Rev 1998 | Rev 2642 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1998 Rev 2034
Line 123... Line 123...
123
 
123
 
124
    public List<Cart> getCartsByTime(long from_time, long to_time, CartStatus status) throws ShoppingCartException, TException;
124
    public List<Cart> getCartsByTime(long from_time, long to_time, CartStatus status) throws ShoppingCartException, TException;
125
 
125
 
126
    public void changeCartStatus(long cartId, CartStatus status) throws ShoppingCartException, TException;
126
    public void changeCartStatus(long cartId, CartStatus status) throws ShoppingCartException, TException;
127
 
127
 
128
    public void addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;
128
    public String addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;
129
 
129
 
130
    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException;
130
    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException;
131
 
131
 
132
    public void changeQuantity(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;
132
    public void changeQuantity(long cartId, long itemId, long quantity) throws ShoppingCartException, TException;
133
 
133
 
Line 1923... Line 1923...
1923
        throw result.scx;
1923
        throw result.scx;
1924
      }
1924
      }
1925
      return;
1925
      return;
1926
    }
1926
    }
1927
 
1927
 
1928
    public void addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException
1928
    public String addItemToCart(long cartId, long itemId, long quantity) throws ShoppingCartException, TException
1929
    {
1929
    {
1930
      send_addItemToCart(cartId, itemId, quantity);
1930
      send_addItemToCart(cartId, itemId, quantity);
1931
      recv_addItemToCart();
1931
      return recv_addItemToCart();
1932
    }
1932
    }
1933
 
1933
 
1934
    public void send_addItemToCart(long cartId, long itemId, long quantity) throws TException
1934
    public void send_addItemToCart(long cartId, long itemId, long quantity) throws TException
1935
    {
1935
    {
1936
      oprot_.writeMessageBegin(new TMessage("addItemToCart", TMessageType.CALL, seqid_));
1936
      oprot_.writeMessageBegin(new TMessage("addItemToCart", TMessageType.CALL, seqid_));
Line 1941... Line 1941...
1941
      args.write(oprot_);
1941
      args.write(oprot_);
1942
      oprot_.writeMessageEnd();
1942
      oprot_.writeMessageEnd();
1943
      oprot_.getTransport().flush();
1943
      oprot_.getTransport().flush();
1944
    }
1944
    }
1945
 
1945
 
1946
    public void recv_addItemToCart() throws ShoppingCartException, TException
1946
    public String recv_addItemToCart() throws ShoppingCartException, TException
1947
    {
1947
    {
1948
      TMessage msg = iprot_.readMessageBegin();
1948
      TMessage msg = iprot_.readMessageBegin();
1949
      if (msg.type == TMessageType.EXCEPTION) {
1949
      if (msg.type == TMessageType.EXCEPTION) {
1950
        TApplicationException x = TApplicationException.read(iprot_);
1950
        TApplicationException x = TApplicationException.read(iprot_);
1951
        iprot_.readMessageEnd();
1951
        iprot_.readMessageEnd();
1952
        throw x;
1952
        throw x;
1953
      }
1953
      }
1954
      addItemToCart_result result = new addItemToCart_result();
1954
      addItemToCart_result result = new addItemToCart_result();
1955
      result.read(iprot_);
1955
      result.read(iprot_);
1956
      iprot_.readMessageEnd();
1956
      iprot_.readMessageEnd();
-
 
1957
      if (result.isSetSuccess()) {
-
 
1958
        return result.success;
-
 
1959
      }
1957
      if (result.scx != null) {
1960
      if (result.scx != null) {
1958
        throw result.scx;
1961
        throw result.scx;
1959
      }
1962
      }
1960
      return;
1963
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addItemToCart failed: unknown result");
1961
    }
1964
    }
1962
 
1965
 
1963
    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException
1966
    public void deleteItemFromCart(long cartId, long itemId) throws ShoppingCartException, TException
1964
    {
1967
    {
1965
      send_deleteItemFromCart(cartId, itemId);
1968
      send_deleteItemFromCart(cartId, itemId);
Line 4010... Line 4013...
4010
        addItemToCart_args args = new addItemToCart_args();
4013
        addItemToCart_args args = new addItemToCart_args();
4011
        args.read(iprot);
4014
        args.read(iprot);
4012
        iprot.readMessageEnd();
4015
        iprot.readMessageEnd();
4013
        addItemToCart_result result = new addItemToCart_result();
4016
        addItemToCart_result result = new addItemToCart_result();
4014
        try {
4017
        try {
4015
          iface_.addItemToCart(args.cartId, args.itemId, args.quantity);
4018
          result.success = iface_.addItemToCart(args.cartId, args.itemId, args.quantity);
4016
        } catch (ShoppingCartException scx) {
4019
        } catch (ShoppingCartException scx) {
4017
          result.scx = scx;
4020
          result.scx = scx;
4018
        } catch (Throwable th) {
4021
        } catch (Throwable th) {
4019
          LOGGER.error("Internal error processing addItemToCart", th);
4022
          LOGGER.error("Internal error processing addItemToCart", th);
4020
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItemToCart");
4023
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing addItemToCart");
Line 37119... Line 37122...
37119
  }
37122
  }
37120
 
37123
 
37121
  public static class addItemToCart_result implements TBase<addItemToCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCart_result>   {
37124
  public static class addItemToCart_result implements TBase<addItemToCart_result._Fields>, java.io.Serializable, Cloneable, Comparable<addItemToCart_result>   {
37122
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCart_result");
37125
    private static final TStruct STRUCT_DESC = new TStruct("addItemToCart_result");
37123
 
37126
 
-
 
37127
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0);
37124
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);
37128
    private static final TField SCX_FIELD_DESC = new TField("scx", TType.STRUCT, (short)1);
37125
 
37129
 
-
 
37130
    private String success;
37126
    private ShoppingCartException scx;
37131
    private ShoppingCartException scx;
37127
 
37132
 
37128
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37133
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37129
    public enum _Fields implements TFieldIdEnum {
37134
    public enum _Fields implements TFieldIdEnum {
-
 
37135
      SUCCESS((short)0, "success"),
37130
      SCX((short)1, "scx");
37136
      SCX((short)1, "scx");
37131
 
37137
 
37132
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
37138
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
37133
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
37139
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
37134
 
37140
 
Line 37181... Line 37187...
37181
    }
37187
    }
37182
 
37188
 
37183
    // isset id assignments
37189
    // isset id assignments
37184
 
37190
 
37185
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
37191
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
37192
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
37193
          new FieldValueMetaData(TType.STRING)));
37186
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
37194
      put(_Fields.SCX, new FieldMetaData("scx", TFieldRequirementType.DEFAULT, 
37187
          new FieldValueMetaData(TType.STRUCT)));
37195
          new FieldValueMetaData(TType.STRUCT)));
37188
    }});
37196
    }});
37189
 
37197
 
37190
    static {
37198
    static {
Line 37193... Line 37201...
37193
 
37201
 
37194
    public addItemToCart_result() {
37202
    public addItemToCart_result() {
37195
    }
37203
    }
37196
 
37204
 
37197
    public addItemToCart_result(
37205
    public addItemToCart_result(
-
 
37206
      String success,
37198
      ShoppingCartException scx)
37207
      ShoppingCartException scx)
37199
    {
37208
    {
37200
      this();
37209
      this();
-
 
37210
      this.success = success;
37201
      this.scx = scx;
37211
      this.scx = scx;
37202
    }
37212
    }
37203
 
37213
 
37204
    /**
37214
    /**
37205
     * Performs a deep copy on <i>other</i>.
37215
     * Performs a deep copy on <i>other</i>.
37206
     */
37216
     */
37207
    public addItemToCart_result(addItemToCart_result other) {
37217
    public addItemToCart_result(addItemToCart_result other) {
-
 
37218
      if (other.isSetSuccess()) {
-
 
37219
        this.success = other.success;
-
 
37220
      }
37208
      if (other.isSetScx()) {
37221
      if (other.isSetScx()) {
37209
        this.scx = new ShoppingCartException(other.scx);
37222
        this.scx = new ShoppingCartException(other.scx);
37210
      }
37223
      }
37211
    }
37224
    }
37212
 
37225
 
Line 37217... Line 37230...
37217
    @Deprecated
37230
    @Deprecated
37218
    public addItemToCart_result clone() {
37231
    public addItemToCart_result clone() {
37219
      return new addItemToCart_result(this);
37232
      return new addItemToCart_result(this);
37220
    }
37233
    }
37221
 
37234
 
-
 
37235
    public String getSuccess() {
-
 
37236
      return this.success;
-
 
37237
    }
-
 
37238
 
-
 
37239
    public addItemToCart_result setSuccess(String success) {
-
 
37240
      this.success = success;
-
 
37241
      return this;
-
 
37242
    }
-
 
37243
 
-
 
37244
    public void unsetSuccess() {
-
 
37245
      this.success = null;
-
 
37246
    }
-
 
37247
 
-
 
37248
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
37249
    public boolean isSetSuccess() {
-
 
37250
      return this.success != null;
-
 
37251
    }
-
 
37252
 
-
 
37253
    public void setSuccessIsSet(boolean value) {
-
 
37254
      if (!value) {
-
 
37255
        this.success = null;
-
 
37256
      }
-
 
37257
    }
-
 
37258
 
37222
    public ShoppingCartException getScx() {
37259
    public ShoppingCartException getScx() {
37223
      return this.scx;
37260
      return this.scx;
37224
    }
37261
    }
37225
 
37262
 
37226
    public addItemToCart_result setScx(ShoppingCartException scx) {
37263
    public addItemToCart_result setScx(ShoppingCartException scx) {
Line 37243... Line 37280...
37243
      }
37280
      }
37244
    }
37281
    }
37245
 
37282
 
37246
    public void setFieldValue(_Fields field, Object value) {
37283
    public void setFieldValue(_Fields field, Object value) {
37247
      switch (field) {
37284
      switch (field) {
-
 
37285
      case SUCCESS:
-
 
37286
        if (value == null) {
-
 
37287
          unsetSuccess();
-
 
37288
        } else {
-
 
37289
          setSuccess((String)value);
-
 
37290
        }
-
 
37291
        break;
-
 
37292
 
37248
      case SCX:
37293
      case SCX:
37249
        if (value == null) {
37294
        if (value == null) {
37250
          unsetScx();
37295
          unsetScx();
37251
        } else {
37296
        } else {
37252
          setScx((ShoppingCartException)value);
37297
          setScx((ShoppingCartException)value);
Line 37260... Line 37305...
37260
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
37305
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
37261
    }
37306
    }
37262
 
37307
 
37263
    public Object getFieldValue(_Fields field) {
37308
    public Object getFieldValue(_Fields field) {
37264
      switch (field) {
37309
      switch (field) {
-
 
37310
      case SUCCESS:
-
 
37311
        return getSuccess();
-
 
37312
 
37265
      case SCX:
37313
      case SCX:
37266
        return getScx();
37314
        return getScx();
37267
 
37315
 
37268
      }
37316
      }
37269
      throw new IllegalStateException();
37317
      throw new IllegalStateException();
Line 37274... Line 37322...
37274
    }
37322
    }
37275
 
37323
 
37276
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
37324
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
37277
    public boolean isSet(_Fields field) {
37325
    public boolean isSet(_Fields field) {
37278
      switch (field) {
37326
      switch (field) {
-
 
37327
      case SUCCESS:
-
 
37328
        return isSetSuccess();
37279
      case SCX:
37329
      case SCX:
37280
        return isSetScx();
37330
        return isSetScx();
37281
      }
37331
      }
37282
      throw new IllegalStateException();
37332
      throw new IllegalStateException();
37283
    }
37333
    }
Line 37297... Line 37347...
37297
 
37347
 
37298
    public boolean equals(addItemToCart_result that) {
37348
    public boolean equals(addItemToCart_result that) {
37299
      if (that == null)
37349
      if (that == null)
37300
        return false;
37350
        return false;
37301
 
37351
 
-
 
37352
      boolean this_present_success = true && this.isSetSuccess();
-
 
37353
      boolean that_present_success = true && that.isSetSuccess();
-
 
37354
      if (this_present_success || that_present_success) {
-
 
37355
        if (!(this_present_success && that_present_success))
-
 
37356
          return false;
-
 
37357
        if (!this.success.equals(that.success))
-
 
37358
          return false;
-
 
37359
      }
-
 
37360
 
37302
      boolean this_present_scx = true && this.isSetScx();
37361
      boolean this_present_scx = true && this.isSetScx();
37303
      boolean that_present_scx = true && that.isSetScx();
37362
      boolean that_present_scx = true && that.isSetScx();
37304
      if (this_present_scx || that_present_scx) {
37363
      if (this_present_scx || that_present_scx) {
37305
        if (!(this_present_scx && that_present_scx))
37364
        if (!(this_present_scx && that_present_scx))
37306
          return false;
37365
          return false;
Line 37322... Line 37381...
37322
      }
37381
      }
37323
 
37382
 
37324
      int lastComparison = 0;
37383
      int lastComparison = 0;
37325
      addItemToCart_result typedOther = (addItemToCart_result)other;
37384
      addItemToCart_result typedOther = (addItemToCart_result)other;
37326
 
37385
 
-
 
37386
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
37387
      if (lastComparison != 0) {
-
 
37388
        return lastComparison;
-
 
37389
      }
-
 
37390
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
37391
      if (lastComparison != 0) {
-
 
37392
        return lastComparison;
-
 
37393
      }
37327
      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
37394
      lastComparison = Boolean.valueOf(isSetScx()).compareTo(isSetScx());
37328
      if (lastComparison != 0) {
37395
      if (lastComparison != 0) {
37329
        return lastComparison;
37396
        return lastComparison;
37330
      }
37397
      }
37331
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
37398
      lastComparison = TBaseHelper.compareTo(scx, typedOther.scx);
Line 37347... Line 37414...
37347
        _Fields fieldId = _Fields.findByThriftId(field.id);
37414
        _Fields fieldId = _Fields.findByThriftId(field.id);
37348
        if (fieldId == null) {
37415
        if (fieldId == null) {
37349
          TProtocolUtil.skip(iprot, field.type);
37416
          TProtocolUtil.skip(iprot, field.type);
37350
        } else {
37417
        } else {
37351
          switch (fieldId) {
37418
          switch (fieldId) {
-
 
37419
            case SUCCESS:
-
 
37420
              if (field.type == TType.STRING) {
-
 
37421
                this.success = iprot.readString();
-
 
37422
              } else { 
-
 
37423
                TProtocolUtil.skip(iprot, field.type);
-
 
37424
              }
-
 
37425
              break;
37352
            case SCX:
37426
            case SCX:
37353
              if (field.type == TType.STRUCT) {
37427
              if (field.type == TType.STRUCT) {
37354
                this.scx = new ShoppingCartException();
37428
                this.scx = new ShoppingCartException();
37355
                this.scx.read(iprot);
37429
                this.scx.read(iprot);
37356
              } else { 
37430
              } else { 
Line 37366... Line 37440...
37366
    }
37440
    }
37367
 
37441
 
37368
    public void write(TProtocol oprot) throws TException {
37442
    public void write(TProtocol oprot) throws TException {
37369
      oprot.writeStructBegin(STRUCT_DESC);
37443
      oprot.writeStructBegin(STRUCT_DESC);
37370
 
37444
 
37371
      if (this.isSetScx()) {
37445
      if (this.isSetSuccess()) {
-
 
37446
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
37447
        oprot.writeString(this.success);
-
 
37448
        oprot.writeFieldEnd();
-
 
37449
      } else if (this.isSetScx()) {
37372
        oprot.writeFieldBegin(SCX_FIELD_DESC);
37450
        oprot.writeFieldBegin(SCX_FIELD_DESC);
37373
        this.scx.write(oprot);
37451
        this.scx.write(oprot);
37374
        oprot.writeFieldEnd();
37452
        oprot.writeFieldEnd();
37375
      }
37453
      }
37376
      oprot.writeFieldStop();
37454
      oprot.writeFieldStop();
Line 37380... Line 37458...
37380
    @Override
37458
    @Override
37381
    public String toString() {
37459
    public String toString() {
37382
      StringBuilder sb = new StringBuilder("addItemToCart_result(");
37460
      StringBuilder sb = new StringBuilder("addItemToCart_result(");
37383
      boolean first = true;
37461
      boolean first = true;
37384
 
37462
 
-
 
37463
      sb.append("success:");
-
 
37464
      if (this.success == null) {
-
 
37465
        sb.append("null");
-
 
37466
      } else {
-
 
37467
        sb.append(this.success);
-
 
37468
      }
-
 
37469
      first = false;
-
 
37470
      if (!first) sb.append(", ");
37385
      sb.append("scx:");
37471
      sb.append("scx:");
37386
      if (this.scx == null) {
37472
      if (this.scx == null) {
37387
        sb.append("null");
37473
        sb.append("null");
37388
      } else {
37474
      } else {
37389
        sb.append(this.scx);
37475
        sb.append(this.scx);