Subversion Repositories SmartDukaan

Rev

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

Rev 7330 Rev 7340
Line 354... Line 354...
354
 
354
 
355
    public List<VoucherItemMapping> getAllItemVouchers(long itemId) throws org.apache.thrift.TException;
355
    public List<VoucherItemMapping> getAllItemVouchers(long itemId) throws org.apache.thrift.TException;
356
 
356
 
357
    public boolean isValidCatalogItemId(long catalog_item_id) throws org.apache.thrift.TException;
357
    public boolean isValidCatalogItemId(long catalog_item_id) throws org.apache.thrift.TException;
358
 
358
 
359
    public double getVatPercentageForItem(long itemId, long stateId, double price) throws org.apache.thrift.TException;
359
    public double getVatPercentageForItem(long itemId, long stateId, double price) throws CatalogServiceException, org.apache.thrift.TException;
360
 
360
 
361
    public double getVatAmountForItem(long itemId, double price) throws org.apache.thrift.TException;
361
    public double getVatAmountForItem(long itemId, double price) throws org.apache.thrift.TException;
362
 
362
 
363
    public List<Item> getAllIgnoredInventoryUpdateItemsList(int offset, int limit) throws org.apache.thrift.TException;
363
    public List<Item> getAllIgnoredInventoryUpdateItemsList(int offset, int limit) throws org.apache.thrift.TException;
364
 
364
 
Line 2451... Line 2451...
2451
        return result.success;
2451
        return result.success;
2452
      }
2452
      }
2453
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isValidCatalogItemId failed: unknown result");
2453
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isValidCatalogItemId failed: unknown result");
2454
    }
2454
    }
2455
 
2455
 
2456
    public double getVatPercentageForItem(long itemId, long stateId, double price) throws org.apache.thrift.TException
2456
    public double getVatPercentageForItem(long itemId, long stateId, double price) throws CatalogServiceException, org.apache.thrift.TException
2457
    {
2457
    {
2458
      send_getVatPercentageForItem(itemId, stateId, price);
2458
      send_getVatPercentageForItem(itemId, stateId, price);
2459
      return recv_getVatPercentageForItem();
2459
      return recv_getVatPercentageForItem();
2460
    }
2460
    }
2461
 
2461
 
Line 2466... Line 2466...
2466
      args.setStateId(stateId);
2466
      args.setStateId(stateId);
2467
      args.setPrice(price);
2467
      args.setPrice(price);
2468
      sendBase("getVatPercentageForItem", args);
2468
      sendBase("getVatPercentageForItem", args);
2469
    }
2469
    }
2470
 
2470
 
2471
    public double recv_getVatPercentageForItem() throws org.apache.thrift.TException
2471
    public double recv_getVatPercentageForItem() throws CatalogServiceException, org.apache.thrift.TException
2472
    {
2472
    {
2473
      getVatPercentageForItem_result result = new getVatPercentageForItem_result();
2473
      getVatPercentageForItem_result result = new getVatPercentageForItem_result();
2474
      receiveBase(result, "getVatPercentageForItem");
2474
      receiveBase(result, "getVatPercentageForItem");
2475
      if (result.isSetSuccess()) {
2475
      if (result.isSetSuccess()) {
2476
        return result.success;
2476
        return result.success;
2477
      }
2477
      }
-
 
2478
      if (result.cex != null) {
-
 
2479
        throw result.cex;
-
 
2480
      }
2478
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVatPercentageForItem failed: unknown result");
2481
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVatPercentageForItem failed: unknown result");
2479
    }
2482
    }
2480
 
2483
 
2481
    public double getVatAmountForItem(long itemId, double price) throws org.apache.thrift.TException
2484
    public double getVatAmountForItem(long itemId, double price) throws org.apache.thrift.TException
2482
    {
2485
    {
Line 5464... Line 5467...
5464
        args.setPrice(price);
5467
        args.setPrice(price);
5465
        args.write(prot);
5468
        args.write(prot);
5466
        prot.writeMessageEnd();
5469
        prot.writeMessageEnd();
5467
      }
5470
      }
5468
 
5471
 
5469
      public double getResult() throws org.apache.thrift.TException {
5472
      public double getResult() throws CatalogServiceException, org.apache.thrift.TException {
5470
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
5473
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
5471
          throw new IllegalStateException("Method call not finished!");
5474
          throw new IllegalStateException("Method call not finished!");
5472
        }
5475
        }
5473
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
5476
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
5474
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
5477
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
Line 7636... Line 7639...
7636
        return new getVatPercentageForItem_args();
7639
        return new getVatPercentageForItem_args();
7637
      }
7640
      }
7638
 
7641
 
7639
      protected getVatPercentageForItem_result getResult(I iface, getVatPercentageForItem_args args) throws org.apache.thrift.TException {
7642
      protected getVatPercentageForItem_result getResult(I iface, getVatPercentageForItem_args args) throws org.apache.thrift.TException {
7640
        getVatPercentageForItem_result result = new getVatPercentageForItem_result();
7643
        getVatPercentageForItem_result result = new getVatPercentageForItem_result();
-
 
7644
        try {
7641
        result.success = iface.getVatPercentageForItem(args.itemId, args.stateId, args.price);
7645
          result.success = iface.getVatPercentageForItem(args.itemId, args.stateId, args.price);
7642
        result.setSuccessIsSet(true);
7646
          result.setSuccessIsSet(true);
-
 
7647
        } catch (CatalogServiceException cex) {
-
 
7648
          result.cex = cex;
-
 
7649
        }
7643
        return result;
7650
        return result;
7644
      }
7651
      }
7645
    }
7652
    }
7646
 
7653
 
7647
    private static class getVatAmountForItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getVatAmountForItem_args> {
7654
    private static class getVatAmountForItem<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getVatAmountForItem_args> {
Line 58776... Line 58783...
58776
 
58783
 
58777
  public static class getVatPercentageForItem_result implements org.apache.thrift.TBase<getVatPercentageForItem_result, getVatPercentageForItem_result._Fields>, java.io.Serializable, Cloneable   {
58784
  public static class getVatPercentageForItem_result implements org.apache.thrift.TBase<getVatPercentageForItem_result, getVatPercentageForItem_result._Fields>, java.io.Serializable, Cloneable   {
58778
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVatPercentageForItem_result");
58785
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVatPercentageForItem_result");
58779
 
58786
 
58780
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.DOUBLE, (short)0);
58787
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.DOUBLE, (short)0);
-
 
58788
    private static final org.apache.thrift.protocol.TField CEX_FIELD_DESC = new org.apache.thrift.protocol.TField("cex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
58781
 
58789
 
58782
    private double success; // required
58790
    private double success; // required
-
 
58791
    private CatalogServiceException cex; // required
58783
 
58792
 
58784
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58793
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58785
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
58794
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
58786
      SUCCESS((short)0, "success");
58795
      SUCCESS((short)0, "success"),
-
 
58796
      CEX((short)1, "cex");
58787
 
58797
 
58788
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
58798
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
58789
 
58799
 
58790
      static {
58800
      static {
58791
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
58801
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 58798... Line 58808...
58798
       */
58808
       */
58799
      public static _Fields findByThriftId(int fieldId) {
58809
      public static _Fields findByThriftId(int fieldId) {
58800
        switch(fieldId) {
58810
        switch(fieldId) {
58801
          case 0: // SUCCESS
58811
          case 0: // SUCCESS
58802
            return SUCCESS;
58812
            return SUCCESS;
-
 
58813
          case 1: // CEX
-
 
58814
            return CEX;
58803
          default:
58815
          default:
58804
            return null;
58816
            return null;
58805
        }
58817
        }
58806
      }
58818
      }
58807
 
58819
 
Line 58846... Line 58858...
58846
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
58858
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
58847
    static {
58859
    static {
58848
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
58860
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
58849
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
58861
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
58850
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
58862
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
58863
      tmpMap.put(_Fields.CEX, new org.apache.thrift.meta_data.FieldMetaData("cex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
58864
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
58851
      metaDataMap = Collections.unmodifiableMap(tmpMap);
58865
      metaDataMap = Collections.unmodifiableMap(tmpMap);
58852
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVatPercentageForItem_result.class, metaDataMap);
58866
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVatPercentageForItem_result.class, metaDataMap);
58853
    }
58867
    }
58854
 
58868
 
58855
    public getVatPercentageForItem_result() {
58869
    public getVatPercentageForItem_result() {
58856
    }
58870
    }
58857
 
58871
 
58858
    public getVatPercentageForItem_result(
58872
    public getVatPercentageForItem_result(
58859
      double success)
58873
      double success,
-
 
58874
      CatalogServiceException cex)
58860
    {
58875
    {
58861
      this();
58876
      this();
58862
      this.success = success;
58877
      this.success = success;
58863
      setSuccessIsSet(true);
58878
      setSuccessIsSet(true);
-
 
58879
      this.cex = cex;
58864
    }
58880
    }
58865
 
58881
 
58866
    /**
58882
    /**
58867
     * Performs a deep copy on <i>other</i>.
58883
     * Performs a deep copy on <i>other</i>.
58868
     */
58884
     */
58869
    public getVatPercentageForItem_result(getVatPercentageForItem_result other) {
58885
    public getVatPercentageForItem_result(getVatPercentageForItem_result other) {
58870
      __isset_bit_vector.clear();
58886
      __isset_bit_vector.clear();
58871
      __isset_bit_vector.or(other.__isset_bit_vector);
58887
      __isset_bit_vector.or(other.__isset_bit_vector);
58872
      this.success = other.success;
58888
      this.success = other.success;
-
 
58889
      if (other.isSetCex()) {
-
 
58890
        this.cex = new CatalogServiceException(other.cex);
-
 
58891
      }
58873
    }
58892
    }
58874
 
58893
 
58875
    public getVatPercentageForItem_result deepCopy() {
58894
    public getVatPercentageForItem_result deepCopy() {
58876
      return new getVatPercentageForItem_result(this);
58895
      return new getVatPercentageForItem_result(this);
58877
    }
58896
    }
58878
 
58897
 
58879
    @Override
58898
    @Override
58880
    public void clear() {
58899
    public void clear() {
58881
      setSuccessIsSet(false);
58900
      setSuccessIsSet(false);
58882
      this.success = 0.0;
58901
      this.success = 0.0;
-
 
58902
      this.cex = null;
58883
    }
58903
    }
58884
 
58904
 
58885
    public double getSuccess() {
58905
    public double getSuccess() {
58886
      return this.success;
58906
      return this.success;
58887
    }
58907
    }
Line 58902... Line 58922...
58902
 
58922
 
58903
    public void setSuccessIsSet(boolean value) {
58923
    public void setSuccessIsSet(boolean value) {
58904
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
58924
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
58905
    }
58925
    }
58906
 
58926
 
-
 
58927
    public CatalogServiceException getCex() {
-
 
58928
      return this.cex;
-
 
58929
    }
-
 
58930
 
-
 
58931
    public void setCex(CatalogServiceException cex) {
-
 
58932
      this.cex = cex;
-
 
58933
    }
-
 
58934
 
-
 
58935
    public void unsetCex() {
-
 
58936
      this.cex = null;
-
 
58937
    }
-
 
58938
 
-
 
58939
    /** Returns true if field cex is set (has been assigned a value) and false otherwise */
-
 
58940
    public boolean isSetCex() {
-
 
58941
      return this.cex != null;
-
 
58942
    }
-
 
58943
 
-
 
58944
    public void setCexIsSet(boolean value) {
-
 
58945
      if (!value) {
-
 
58946
        this.cex = null;
-
 
58947
      }
-
 
58948
    }
-
 
58949
 
58907
    public void setFieldValue(_Fields field, Object value) {
58950
    public void setFieldValue(_Fields field, Object value) {
58908
      switch (field) {
58951
      switch (field) {
58909
      case SUCCESS:
58952
      case SUCCESS:
58910
        if (value == null) {
58953
        if (value == null) {
58911
          unsetSuccess();
58954
          unsetSuccess();
58912
        } else {
58955
        } else {
58913
          setSuccess((Double)value);
58956
          setSuccess((Double)value);
58914
        }
58957
        }
58915
        break;
58958
        break;
58916
 
58959
 
-
 
58960
      case CEX:
-
 
58961
        if (value == null) {
-
 
58962
          unsetCex();
-
 
58963
        } else {
-
 
58964
          setCex((CatalogServiceException)value);
-
 
58965
        }
-
 
58966
        break;
-
 
58967
 
58917
      }
58968
      }
58918
    }
58969
    }
58919
 
58970
 
58920
    public Object getFieldValue(_Fields field) {
58971
    public Object getFieldValue(_Fields field) {
58921
      switch (field) {
58972
      switch (field) {
58922
      case SUCCESS:
58973
      case SUCCESS:
58923
        return Double.valueOf(getSuccess());
58974
        return Double.valueOf(getSuccess());
58924
 
58975
 
-
 
58976
      case CEX:
-
 
58977
        return getCex();
-
 
58978
 
58925
      }
58979
      }
58926
      throw new IllegalStateException();
58980
      throw new IllegalStateException();
58927
    }
58981
    }
58928
 
58982
 
58929
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
58983
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 58933... Line 58987...
58933
      }
58987
      }
58934
 
58988
 
58935
      switch (field) {
58989
      switch (field) {
58936
      case SUCCESS:
58990
      case SUCCESS:
58937
        return isSetSuccess();
58991
        return isSetSuccess();
-
 
58992
      case CEX:
-
 
58993
        return isSetCex();
58938
      }
58994
      }
58939
      throw new IllegalStateException();
58995
      throw new IllegalStateException();
58940
    }
58996
    }
58941
 
58997
 
58942
    @Override
58998
    @Override
Line 58959... Line 59015...
58959
          return false;
59015
          return false;
58960
        if (this.success != that.success)
59016
        if (this.success != that.success)
58961
          return false;
59017
          return false;
58962
      }
59018
      }
58963
 
59019
 
-
 
59020
      boolean this_present_cex = true && this.isSetCex();
-
 
59021
      boolean that_present_cex = true && that.isSetCex();
-
 
59022
      if (this_present_cex || that_present_cex) {
-
 
59023
        if (!(this_present_cex && that_present_cex))
-
 
59024
          return false;
-
 
59025
        if (!this.cex.equals(that.cex))
-
 
59026
          return false;
-
 
59027
      }
-
 
59028
 
58964
      return true;
59029
      return true;
58965
    }
59030
    }
58966
 
59031
 
58967
    @Override
59032
    @Override
58968
    public int hashCode() {
59033
    public int hashCode() {
Line 58985... Line 59050...
58985
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
59050
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
58986
        if (lastComparison != 0) {
59051
        if (lastComparison != 0) {
58987
          return lastComparison;
59052
          return lastComparison;
58988
        }
59053
        }
58989
      }
59054
      }
-
 
59055
      lastComparison = Boolean.valueOf(isSetCex()).compareTo(typedOther.isSetCex());
-
 
59056
      if (lastComparison != 0) {
-
 
59057
        return lastComparison;
-
 
59058
      }
-
 
59059
      if (isSetCex()) {
-
 
59060
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cex, typedOther.cex);
-
 
59061
        if (lastComparison != 0) {
-
 
59062
          return lastComparison;
-
 
59063
        }
-
 
59064
      }
58990
      return 0;
59065
      return 0;
58991
    }
59066
    }
58992
 
59067
 
58993
    public _Fields fieldForId(int fieldId) {
59068
    public _Fields fieldForId(int fieldId) {
58994
      return _Fields.findByThriftId(fieldId);
59069
      return _Fields.findByThriftId(fieldId);
Line 59010... Line 59085...
59010
              setSuccessIsSet(true);
59085
              setSuccessIsSet(true);
59011
            } else { 
59086
            } else { 
59012
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
59087
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
59013
            }
59088
            }
59014
            break;
59089
            break;
-
 
59090
          case 1: // CEX
-
 
59091
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
59092
              this.cex = new CatalogServiceException();
-
 
59093
              this.cex.read(iprot);
-
 
59094
            } else { 
-
 
59095
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
59096
            }
-
 
59097
            break;
59015
          default:
59098
          default:
59016
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
59099
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
59017
        }
59100
        }
59018
        iprot.readFieldEnd();
59101
        iprot.readFieldEnd();
59019
      }
59102
      }
Line 59026... Line 59109...
59026
 
59109
 
59027
      if (this.isSetSuccess()) {
59110
      if (this.isSetSuccess()) {
59028
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
59111
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
59029
        oprot.writeDouble(this.success);
59112
        oprot.writeDouble(this.success);
59030
        oprot.writeFieldEnd();
59113
        oprot.writeFieldEnd();
-
 
59114
      } else if (this.isSetCex()) {
-
 
59115
        oprot.writeFieldBegin(CEX_FIELD_DESC);
-
 
59116
        this.cex.write(oprot);
-
 
59117
        oprot.writeFieldEnd();
59031
      }
59118
      }
59032
      oprot.writeFieldStop();
59119
      oprot.writeFieldStop();
59033
      oprot.writeStructEnd();
59120
      oprot.writeStructEnd();
59034
    }
59121
    }
59035
 
59122
 
Line 59039... Line 59126...
59039
      boolean first = true;
59126
      boolean first = true;
59040
 
59127
 
59041
      sb.append("success:");
59128
      sb.append("success:");
59042
      sb.append(this.success);
59129
      sb.append(this.success);
59043
      first = false;
59130
      first = false;
-
 
59131
      if (!first) sb.append(", ");
-
 
59132
      sb.append("cex:");
-
 
59133
      if (this.cex == null) {
-
 
59134
        sb.append("null");
-
 
59135
      } else {
-
 
59136
        sb.append(this.cex);
-
 
59137
      }
-
 
59138
      first = false;
59044
      sb.append(")");
59139
      sb.append(")");
59045
      return sb.toString();
59140
      return sb.toString();
59046
    }
59141
    }
59047
 
59142
 
59048
    public void validate() throws org.apache.thrift.TException {
59143
    public void validate() throws org.apache.thrift.TException {