Subversion Repositories SmartDukaan

Rev

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

Rev 2975 Rev 2983
Line 41... Line 41...
41
 
41
 
42
    public long updateItem(Item item) throws InventoryServiceException, TException;
42
    public long updateItem(Item item) throws InventoryServiceException, TException;
43
 
43
 
44
    public long addWarehouse(Warehouse warehouse) throws InventoryServiceException, TException;
44
    public long addWarehouse(Warehouse warehouse) throws InventoryServiceException, TException;
45
 
45
 
-
 
46
    /**
-
 
47
     * Checks if the item given to the corresponding itemId is active. If it's active,
-
 
48
     * whether it's risky and if it's risky, its inventory position.
-
 
49
     * 
-
 
50
     * @param itemId
-
 
51
     */
46
    public boolean isActive(long itemId) throws InventoryServiceException, TException;
52
    public ItemShippingInfo isActive(long itemId) throws InventoryServiceException, TException;
47
 
53
 
48
    public String getItemStatusDescription(long itemId) throws InventoryServiceException, TException;
54
    public String getItemStatusDescription(long itemId) throws InventoryServiceException, TException;
49
 
55
 
50
    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, TException;
56
    public void updateInventory(long warehouse_id, String timestamp, Map<String,Long> availability) throws InventoryServiceException, TException;
51
 
57
 
Line 426... Line 432...
426
        throw result.cex;
432
        throw result.cex;
427
      }
433
      }
428
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addWarehouse failed: unknown result");
434
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "addWarehouse failed: unknown result");
429
    }
435
    }
430
 
436
 
431
    public boolean isActive(long itemId) throws InventoryServiceException, TException
437
    public ItemShippingInfo isActive(long itemId) throws InventoryServiceException, TException
432
    {
438
    {
433
      send_isActive(itemId);
439
      send_isActive(itemId);
434
      return recv_isActive();
440
      return recv_isActive();
435
    }
441
    }
436
 
442
 
Line 442... Line 448...
442
      args.write(oprot_);
448
      args.write(oprot_);
443
      oprot_.writeMessageEnd();
449
      oprot_.writeMessageEnd();
444
      oprot_.getTransport().flush();
450
      oprot_.getTransport().flush();
445
    }
451
    }
446
 
452
 
447
    public boolean recv_isActive() throws InventoryServiceException, TException
453
    public ItemShippingInfo recv_isActive() throws InventoryServiceException, TException
448
    {
454
    {
449
      TMessage msg = iprot_.readMessageBegin();
455
      TMessage msg = iprot_.readMessageBegin();
450
      if (msg.type == TMessageType.EXCEPTION) {
456
      if (msg.type == TMessageType.EXCEPTION) {
451
        TApplicationException x = TApplicationException.read(iprot_);
457
        TApplicationException x = TApplicationException.read(iprot_);
452
        iprot_.readMessageEnd();
458
        iprot_.readMessageEnd();
Line 2285... Line 2291...
2285
        args.read(iprot);
2291
        args.read(iprot);
2286
        iprot.readMessageEnd();
2292
        iprot.readMessageEnd();
2287
        isActive_result result = new isActive_result();
2293
        isActive_result result = new isActive_result();
2288
        try {
2294
        try {
2289
          result.success = iface_.isActive(args.itemId);
2295
          result.success = iface_.isActive(args.itemId);
2290
          result.setSuccessIsSet(true);
-
 
2291
        } catch (InventoryServiceException isex) {
2296
        } catch (InventoryServiceException isex) {
2292
          result.isex = isex;
2297
          result.isex = isex;
2293
        } catch (Throwable th) {
2298
        } catch (Throwable th) {
2294
          LOGGER.error("Internal error processing isActive", th);
2299
          LOGGER.error("Internal error processing isActive", th);
2295
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing isActive");
2300
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing isActive");
Line 6033... Line 6038...
6033
  }
6038
  }
6034
 
6039
 
6035
  public static class isActive_result implements TBase<isActive_result._Fields>, java.io.Serializable, Cloneable, Comparable<isActive_result>   {
6040
  public static class isActive_result implements TBase<isActive_result._Fields>, java.io.Serializable, Cloneable, Comparable<isActive_result>   {
6036
    private static final TStruct STRUCT_DESC = new TStruct("isActive_result");
6041
    private static final TStruct STRUCT_DESC = new TStruct("isActive_result");
6037
 
6042
 
6038
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
6043
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
6039
    private static final TField ISEX_FIELD_DESC = new TField("isex", TType.STRUCT, (short)1);
6044
    private static final TField ISEX_FIELD_DESC = new TField("isex", TType.STRUCT, (short)1);
6040
 
6045
 
6041
    private boolean success;
6046
    private ItemShippingInfo success;
6042
    private InventoryServiceException isex;
6047
    private InventoryServiceException isex;
6043
 
6048
 
6044
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6049
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
6045
    public enum _Fields implements TFieldIdEnum {
6050
    public enum _Fields implements TFieldIdEnum {
6046
      SUCCESS((short)0, "success"),
6051
      SUCCESS((short)0, "success"),
Line 6096... Line 6101...
6096
        return _fieldName;
6101
        return _fieldName;
6097
      }
6102
      }
6098
    }
6103
    }
6099
 
6104
 
6100
    // isset id assignments
6105
    // isset id assignments
6101
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
6102
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
6103
 
6106
 
6104
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6107
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
6105
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
6108
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
6106
          new FieldValueMetaData(TType.BOOL)));
6109
          new StructMetaData(TType.STRUCT, ItemShippingInfo.class)));
6107
      put(_Fields.ISEX, new FieldMetaData("isex", TFieldRequirementType.DEFAULT, 
6110
      put(_Fields.ISEX, new FieldMetaData("isex", TFieldRequirementType.DEFAULT, 
6108
          new FieldValueMetaData(TType.STRUCT)));
6111
          new FieldValueMetaData(TType.STRUCT)));
6109
    }});
6112
    }});
6110
 
6113
 
6111
    static {
6114
    static {
Line 6114... Line 6117...
6114
 
6117
 
6115
    public isActive_result() {
6118
    public isActive_result() {
6116
    }
6119
    }
6117
 
6120
 
6118
    public isActive_result(
6121
    public isActive_result(
6119
      boolean success,
6122
      ItemShippingInfo success,
6120
      InventoryServiceException isex)
6123
      InventoryServiceException isex)
6121
    {
6124
    {
6122
      this();
6125
      this();
6123
      this.success = success;
6126
      this.success = success;
6124
      setSuccessIsSet(true);
-
 
6125
      this.isex = isex;
6127
      this.isex = isex;
6126
    }
6128
    }
6127
 
6129
 
6128
    /**
6130
    /**
6129
     * Performs a deep copy on <i>other</i>.
6131
     * Performs a deep copy on <i>other</i>.
6130
     */
6132
     */
6131
    public isActive_result(isActive_result other) {
6133
    public isActive_result(isActive_result other) {
6132
      __isset_bit_vector.clear();
6134
      if (other.isSetSuccess()) {
6133
      __isset_bit_vector.or(other.__isset_bit_vector);
6135
        this.success = new ItemShippingInfo(other.success);
6134
      this.success = other.success;
6136
      }
6135
      if (other.isSetIsex()) {
6137
      if (other.isSetIsex()) {
6136
        this.isex = new InventoryServiceException(other.isex);
6138
        this.isex = new InventoryServiceException(other.isex);
6137
      }
6139
      }
6138
    }
6140
    }
6139
 
6141
 
Line 6144... Line 6146...
6144
    @Deprecated
6146
    @Deprecated
6145
    public isActive_result clone() {
6147
    public isActive_result clone() {
6146
      return new isActive_result(this);
6148
      return new isActive_result(this);
6147
    }
6149
    }
6148
 
6150
 
6149
    public boolean isSuccess() {
6151
    public ItemShippingInfo getSuccess() {
6150
      return this.success;
6152
      return this.success;
6151
    }
6153
    }
6152
 
6154
 
6153
    public isActive_result setSuccess(boolean success) {
6155
    public isActive_result setSuccess(ItemShippingInfo success) {
6154
      this.success = success;
6156
      this.success = success;
6155
      setSuccessIsSet(true);
-
 
6156
      return this;
6157
      return this;
6157
    }
6158
    }
6158
 
6159
 
6159
    public void unsetSuccess() {
6160
    public void unsetSuccess() {
6160
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
6161
      this.success = null;
6161
    }
6162
    }
6162
 
6163
 
6163
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
6164
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
6164
    public boolean isSetSuccess() {
6165
    public boolean isSetSuccess() {
6165
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
6166
      return this.success != null;
6166
    }
6167
    }
6167
 
6168
 
6168
    public void setSuccessIsSet(boolean value) {
6169
    public void setSuccessIsSet(boolean value) {
-
 
6170
      if (!value) {
6169
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
6171
        this.success = null;
-
 
6172
      }
6170
    }
6173
    }
6171
 
6174
 
6172
    public InventoryServiceException getIsex() {
6175
    public InventoryServiceException getIsex() {
6173
      return this.isex;
6176
      return this.isex;
6174
    }
6177
    }
Line 6197... Line 6200...
6197
      switch (field) {
6200
      switch (field) {
6198
      case SUCCESS:
6201
      case SUCCESS:
6199
        if (value == null) {
6202
        if (value == null) {
6200
          unsetSuccess();
6203
          unsetSuccess();
6201
        } else {
6204
        } else {
6202
          setSuccess((Boolean)value);
6205
          setSuccess((ItemShippingInfo)value);
6203
        }
6206
        }
6204
        break;
6207
        break;
6205
 
6208
 
6206
      case ISEX:
6209
      case ISEX:
6207
        if (value == null) {
6210
        if (value == null) {
Line 6219... Line 6222...
6219
    }
6222
    }
6220
 
6223
 
6221
    public Object getFieldValue(_Fields field) {
6224
    public Object getFieldValue(_Fields field) {
6222
      switch (field) {
6225
      switch (field) {
6223
      case SUCCESS:
6226
      case SUCCESS:
6224
        return new Boolean(isSuccess());
6227
        return getSuccess();
6225
 
6228
 
6226
      case ISEX:
6229
      case ISEX:
6227
        return getIsex();
6230
        return getIsex();
6228
 
6231
 
6229
      }
6232
      }
Line 6260... Line 6263...
6260
 
6263
 
6261
    public boolean equals(isActive_result that) {
6264
    public boolean equals(isActive_result that) {
6262
      if (that == null)
6265
      if (that == null)
6263
        return false;
6266
        return false;
6264
 
6267
 
6265
      boolean this_present_success = true;
6268
      boolean this_present_success = true && this.isSetSuccess();
6266
      boolean that_present_success = true;
6269
      boolean that_present_success = true && that.isSetSuccess();
6267
      if (this_present_success || that_present_success) {
6270
      if (this_present_success || that_present_success) {
6268
        if (!(this_present_success && that_present_success))
6271
        if (!(this_present_success && that_present_success))
6269
          return false;
6272
          return false;
6270
        if (this.success != that.success)
6273
        if (!this.success.equals(that.success))
6271
          return false;
6274
          return false;
6272
      }
6275
      }
6273
 
6276
 
6274
      boolean this_present_isex = true && this.isSetIsex();
6277
      boolean this_present_isex = true && this.isSetIsex();
6275
      boolean that_present_isex = true && that.isSetIsex();
6278
      boolean that_present_isex = true && that.isSetIsex();
Line 6328... Line 6331...
6328
        if (fieldId == null) {
6331
        if (fieldId == null) {
6329
          TProtocolUtil.skip(iprot, field.type);
6332
          TProtocolUtil.skip(iprot, field.type);
6330
        } else {
6333
        } else {
6331
          switch (fieldId) {
6334
          switch (fieldId) {
6332
            case SUCCESS:
6335
            case SUCCESS:
6333
              if (field.type == TType.BOOL) {
6336
              if (field.type == TType.STRUCT) {
6334
                this.success = iprot.readBool();
6337
                this.success = new ItemShippingInfo();
6335
                setSuccessIsSet(true);
6338
                this.success.read(iprot);
6336
              } else { 
6339
              } else { 
6337
                TProtocolUtil.skip(iprot, field.type);
6340
                TProtocolUtil.skip(iprot, field.type);
6338
              }
6341
              }
6339
              break;
6342
              break;
6340
            case ISEX:
6343
            case ISEX:
Line 6356... Line 6359...
6356
    public void write(TProtocol oprot) throws TException {
6359
    public void write(TProtocol oprot) throws TException {
6357
      oprot.writeStructBegin(STRUCT_DESC);
6360
      oprot.writeStructBegin(STRUCT_DESC);
6358
 
6361
 
6359
      if (this.isSetSuccess()) {
6362
      if (this.isSetSuccess()) {
6360
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6363
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6361
        oprot.writeBool(this.success);
6364
        this.success.write(oprot);
6362
        oprot.writeFieldEnd();
6365
        oprot.writeFieldEnd();
6363
      } else if (this.isSetIsex()) {
6366
      } else if (this.isSetIsex()) {
6364
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
6367
        oprot.writeFieldBegin(ISEX_FIELD_DESC);
6365
        this.isex.write(oprot);
6368
        this.isex.write(oprot);
6366
        oprot.writeFieldEnd();
6369
        oprot.writeFieldEnd();
Line 6373... Line 6376...
6373
    public String toString() {
6376
    public String toString() {
6374
      StringBuilder sb = new StringBuilder("isActive_result(");
6377
      StringBuilder sb = new StringBuilder("isActive_result(");
6375
      boolean first = true;
6378
      boolean first = true;
6376
 
6379
 
6377
      sb.append("success:");
6380
      sb.append("success:");
-
 
6381
      if (this.success == null) {
-
 
6382
        sb.append("null");
-
 
6383
      } else {
6378
      sb.append(this.success);
6384
        sb.append(this.success);
-
 
6385
      }
6379
      first = false;
6386
      first = false;
6380
      if (!first) sb.append(", ");
6387
      if (!first) sb.append(", ");
6381
      sb.append("isex:");
6388
      sb.append("isex:");
6382
      if (this.isex == null) {
6389
      if (this.isex == null) {
6383
        sb.append("null");
6390
        sb.append("null");