Subversion Repositories SmartDukaan

Rev

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

Rev 4496 Rev 4541
Line 54... Line 54...
54
    /**
54
    /**
55
     * Retrieves serialized inventory item given a serial number
55
     * Retrieves serialized inventory item given a serial number
56
     * 
56
     * 
57
     * @param serialNumber
57
     * @param serialNumber
58
     */
58
     */
59
    public InventoryItem getInventoryItem(String serialNumber) throws org.apache.thrift.TException;
59
    public InventoryItem getInventoryItem(String serialNumber) throws WarehouseServiceException, org.apache.thrift.TException;
60
 
60
 
61
    /**
61
    /**
62
     * Retrieves non-serialized inventory items from a given supplier
62
     * Retrieves non-serialized inventory items from a given supplier
63
     * 
63
     * 
64
     * @param itemId
64
     * @param itemId
Line 270... Line 270...
270
        throw result.wex;
270
        throw result.wex;
271
      }
271
      }
272
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createInventoryItem failed: unknown result");
272
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createInventoryItem failed: unknown result");
273
    }
273
    }
274
 
274
 
275
    public InventoryItem getInventoryItem(String serialNumber) throws org.apache.thrift.TException
275
    public InventoryItem getInventoryItem(String serialNumber) throws WarehouseServiceException, org.apache.thrift.TException
276
    {
276
    {
277
      send_getInventoryItem(serialNumber);
277
      send_getInventoryItem(serialNumber);
278
      return recv_getInventoryItem();
278
      return recv_getInventoryItem();
279
    }
279
    }
280
 
280
 
Line 283... Line 283...
283
      getInventoryItem_args args = new getInventoryItem_args();
283
      getInventoryItem_args args = new getInventoryItem_args();
284
      args.setSerialNumber(serialNumber);
284
      args.setSerialNumber(serialNumber);
285
      sendBase("getInventoryItem", args);
285
      sendBase("getInventoryItem", args);
286
    }
286
    }
287
 
287
 
288
    public InventoryItem recv_getInventoryItem() throws org.apache.thrift.TException
288
    public InventoryItem recv_getInventoryItem() throws WarehouseServiceException, org.apache.thrift.TException
289
    {
289
    {
290
      getInventoryItem_result result = new getInventoryItem_result();
290
      getInventoryItem_result result = new getInventoryItem_result();
291
      receiveBase(result, "getInventoryItem");
291
      receiveBase(result, "getInventoryItem");
292
      if (result.isSetSuccess()) {
292
      if (result.isSetSuccess()) {
293
        return result.success;
293
        return result.success;
294
      }
294
      }
-
 
295
      if (result.wex != null) {
-
 
296
        throw result.wex;
-
 
297
      }
295
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItem failed: unknown result");
298
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getInventoryItem failed: unknown result");
296
    }
299
    }
297
 
300
 
298
    public List<InventoryItem> getNonSeralizedInventoryItems(long itemId, long quantity, long supplierId) throws org.apache.thrift.TException
301
    public List<InventoryItem> getNonSeralizedInventoryItems(long itemId, long quantity, long supplierId) throws org.apache.thrift.TException
299
    {
302
    {
Line 669... Line 672...
669
        args.setSerialNumber(serialNumber);
672
        args.setSerialNumber(serialNumber);
670
        args.write(prot);
673
        args.write(prot);
671
        prot.writeMessageEnd();
674
        prot.writeMessageEnd();
672
      }
675
      }
673
 
676
 
674
      public InventoryItem getResult() throws org.apache.thrift.TException {
677
      public InventoryItem getResult() throws WarehouseServiceException, org.apache.thrift.TException {
675
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
678
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
676
          throw new IllegalStateException("Method call not finished!");
679
          throw new IllegalStateException("Method call not finished!");
677
        }
680
        }
678
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
681
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
679
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
682
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
Line 1115... Line 1118...
1115
        return new getInventoryItem_args();
1118
        return new getInventoryItem_args();
1116
      }
1119
      }
1117
 
1120
 
1118
      protected getInventoryItem_result getResult(I iface, getInventoryItem_args args) throws org.apache.thrift.TException {
1121
      protected getInventoryItem_result getResult(I iface, getInventoryItem_args args) throws org.apache.thrift.TException {
1119
        getInventoryItem_result result = new getInventoryItem_result();
1122
        getInventoryItem_result result = new getInventoryItem_result();
-
 
1123
        try {
1120
        result.success = iface.getInventoryItem(args.serialNumber);
1124
          result.success = iface.getInventoryItem(args.serialNumber);
-
 
1125
        } catch (WarehouseServiceException wex) {
-
 
1126
          result.wex = wex;
-
 
1127
        }
1121
        return result;
1128
        return result;
1122
      }
1129
      }
1123
    }
1130
    }
1124
 
1131
 
1125
    private static class getNonSeralizedInventoryItems<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getNonSeralizedInventoryItems_args> {
1132
    private static class getNonSeralizedInventoryItems<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getNonSeralizedInventoryItems_args> {
Line 4119... Line 4126...
4119
 
4126
 
4120
  public static class getInventoryItem_result implements org.apache.thrift.TBase<getInventoryItem_result, getInventoryItem_result._Fields>, java.io.Serializable, Cloneable   {
4127
  public static class getInventoryItem_result implements org.apache.thrift.TBase<getInventoryItem_result, getInventoryItem_result._Fields>, java.io.Serializable, Cloneable   {
4121
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItem_result");
4128
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getInventoryItem_result");
4122
 
4129
 
4123
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
4130
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
-
 
4131
    private static final org.apache.thrift.protocol.TField WEX_FIELD_DESC = new org.apache.thrift.protocol.TField("wex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4124
 
4132
 
4125
    private InventoryItem success; // required
4133
    private InventoryItem success; // required
-
 
4134
    private WarehouseServiceException wex; // required
4126
 
4135
 
4127
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4136
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4128
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4137
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4129
      SUCCESS((short)0, "success");
4138
      SUCCESS((short)0, "success"),
-
 
4139
      WEX((short)1, "wex");
4130
 
4140
 
4131
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4141
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4132
 
4142
 
4133
      static {
4143
      static {
4134
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4144
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 4141... Line 4151...
4141
       */
4151
       */
4142
      public static _Fields findByThriftId(int fieldId) {
4152
      public static _Fields findByThriftId(int fieldId) {
4143
        switch(fieldId) {
4153
        switch(fieldId) {
4144
          case 0: // SUCCESS
4154
          case 0: // SUCCESS
4145
            return SUCCESS;
4155
            return SUCCESS;
-
 
4156
          case 1: // WEX
-
 
4157
            return WEX;
4146
          default:
4158
          default:
4147
            return null;
4159
            return null;
4148
        }
4160
        }
4149
      }
4161
      }
4150
 
4162
 
Line 4187... Line 4199...
4187
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4199
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4188
    static {
4200
    static {
4189
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4201
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4190
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4202
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4191
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
4203
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InventoryItem.class)));
-
 
4204
      tmpMap.put(_Fields.WEX, new org.apache.thrift.meta_data.FieldMetaData("wex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
4205
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4192
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4206
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4193
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItem_result.class, metaDataMap);
4207
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getInventoryItem_result.class, metaDataMap);
4194
    }
4208
    }
4195
 
4209
 
4196
    public getInventoryItem_result() {
4210
    public getInventoryItem_result() {
4197
    }
4211
    }
4198
 
4212
 
4199
    public getInventoryItem_result(
4213
    public getInventoryItem_result(
4200
      InventoryItem success)
4214
      InventoryItem success,
-
 
4215
      WarehouseServiceException wex)
4201
    {
4216
    {
4202
      this();
4217
      this();
4203
      this.success = success;
4218
      this.success = success;
-
 
4219
      this.wex = wex;
4204
    }
4220
    }
4205
 
4221
 
4206
    /**
4222
    /**
4207
     * Performs a deep copy on <i>other</i>.
4223
     * Performs a deep copy on <i>other</i>.
4208
     */
4224
     */
4209
    public getInventoryItem_result(getInventoryItem_result other) {
4225
    public getInventoryItem_result(getInventoryItem_result other) {
4210
      if (other.isSetSuccess()) {
4226
      if (other.isSetSuccess()) {
4211
        this.success = new InventoryItem(other.success);
4227
        this.success = new InventoryItem(other.success);
4212
      }
4228
      }
-
 
4229
      if (other.isSetWex()) {
-
 
4230
        this.wex = new WarehouseServiceException(other.wex);
-
 
4231
      }
4213
    }
4232
    }
4214
 
4233
 
4215
    public getInventoryItem_result deepCopy() {
4234
    public getInventoryItem_result deepCopy() {
4216
      return new getInventoryItem_result(this);
4235
      return new getInventoryItem_result(this);
4217
    }
4236
    }
4218
 
4237
 
4219
    @Override
4238
    @Override
4220
    public void clear() {
4239
    public void clear() {
4221
      this.success = null;
4240
      this.success = null;
-
 
4241
      this.wex = null;
4222
    }
4242
    }
4223
 
4243
 
4224
    public InventoryItem getSuccess() {
4244
    public InventoryItem getSuccess() {
4225
      return this.success;
4245
      return this.success;
4226
    }
4246
    }
Line 4242... Line 4262...
4242
      if (!value) {
4262
      if (!value) {
4243
        this.success = null;
4263
        this.success = null;
4244
      }
4264
      }
4245
    }
4265
    }
4246
 
4266
 
-
 
4267
    public WarehouseServiceException getWex() {
-
 
4268
      return this.wex;
-
 
4269
    }
-
 
4270
 
-
 
4271
    public void setWex(WarehouseServiceException wex) {
-
 
4272
      this.wex = wex;
-
 
4273
    }
-
 
4274
 
-
 
4275
    public void unsetWex() {
-
 
4276
      this.wex = null;
-
 
4277
    }
-
 
4278
 
-
 
4279
    /** Returns true if field wex is set (has been assigned a value) and false otherwise */
-
 
4280
    public boolean isSetWex() {
-
 
4281
      return this.wex != null;
-
 
4282
    }
-
 
4283
 
-
 
4284
    public void setWexIsSet(boolean value) {
-
 
4285
      if (!value) {
-
 
4286
        this.wex = null;
-
 
4287
      }
-
 
4288
    }
-
 
4289
 
4247
    public void setFieldValue(_Fields field, Object value) {
4290
    public void setFieldValue(_Fields field, Object value) {
4248
      switch (field) {
4291
      switch (field) {
4249
      case SUCCESS:
4292
      case SUCCESS:
4250
        if (value == null) {
4293
        if (value == null) {
4251
          unsetSuccess();
4294
          unsetSuccess();
4252
        } else {
4295
        } else {
4253
          setSuccess((InventoryItem)value);
4296
          setSuccess((InventoryItem)value);
4254
        }
4297
        }
4255
        break;
4298
        break;
4256
 
4299
 
-
 
4300
      case WEX:
-
 
4301
        if (value == null) {
-
 
4302
          unsetWex();
-
 
4303
        } else {
-
 
4304
          setWex((WarehouseServiceException)value);
-
 
4305
        }
-
 
4306
        break;
-
 
4307
 
4257
      }
4308
      }
4258
    }
4309
    }
4259
 
4310
 
4260
    public Object getFieldValue(_Fields field) {
4311
    public Object getFieldValue(_Fields field) {
4261
      switch (field) {
4312
      switch (field) {
4262
      case SUCCESS:
4313
      case SUCCESS:
4263
        return getSuccess();
4314
        return getSuccess();
4264
 
4315
 
-
 
4316
      case WEX:
-
 
4317
        return getWex();
-
 
4318
 
4265
      }
4319
      }
4266
      throw new IllegalStateException();
4320
      throw new IllegalStateException();
4267
    }
4321
    }
4268
 
4322
 
4269
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4323
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 4273... Line 4327...
4273
      }
4327
      }
4274
 
4328
 
4275
      switch (field) {
4329
      switch (field) {
4276
      case SUCCESS:
4330
      case SUCCESS:
4277
        return isSetSuccess();
4331
        return isSetSuccess();
-
 
4332
      case WEX:
-
 
4333
        return isSetWex();
4278
      }
4334
      }
4279
      throw new IllegalStateException();
4335
      throw new IllegalStateException();
4280
    }
4336
    }
4281
 
4337
 
4282
    @Override
4338
    @Override
Line 4299... Line 4355...
4299
          return false;
4355
          return false;
4300
        if (!this.success.equals(that.success))
4356
        if (!this.success.equals(that.success))
4301
          return false;
4357
          return false;
4302
      }
4358
      }
4303
 
4359
 
-
 
4360
      boolean this_present_wex = true && this.isSetWex();
-
 
4361
      boolean that_present_wex = true && that.isSetWex();
-
 
4362
      if (this_present_wex || that_present_wex) {
-
 
4363
        if (!(this_present_wex && that_present_wex))
-
 
4364
          return false;
-
 
4365
        if (!this.wex.equals(that.wex))
-
 
4366
          return false;
-
 
4367
      }
-
 
4368
 
4304
      return true;
4369
      return true;
4305
    }
4370
    }
4306
 
4371
 
4307
    @Override
4372
    @Override
4308
    public int hashCode() {
4373
    public int hashCode() {
Line 4325... Line 4390...
4325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4390
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4326
        if (lastComparison != 0) {
4391
        if (lastComparison != 0) {
4327
          return lastComparison;
4392
          return lastComparison;
4328
        }
4393
        }
4329
      }
4394
      }
-
 
4395
      lastComparison = Boolean.valueOf(isSetWex()).compareTo(typedOther.isSetWex());
-
 
4396
      if (lastComparison != 0) {
-
 
4397
        return lastComparison;
-
 
4398
      }
-
 
4399
      if (isSetWex()) {
-
 
4400
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wex, typedOther.wex);
-
 
4401
        if (lastComparison != 0) {
-
 
4402
          return lastComparison;
-
 
4403
        }
-
 
4404
      }
4330
      return 0;
4405
      return 0;
4331
    }
4406
    }
4332
 
4407
 
4333
    public _Fields fieldForId(int fieldId) {
4408
    public _Fields fieldForId(int fieldId) {
4334
      return _Fields.findByThriftId(fieldId);
4409
      return _Fields.findByThriftId(fieldId);
Line 4350... Line 4425...
4350
              this.success.read(iprot);
4425
              this.success.read(iprot);
4351
            } else { 
4426
            } else { 
4352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4427
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4353
            }
4428
            }
4354
            break;
4429
            break;
-
 
4430
          case 1: // WEX
-
 
4431
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
4432
              this.wex = new WarehouseServiceException();
-
 
4433
              this.wex.read(iprot);
-
 
4434
            } else { 
-
 
4435
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
4436
            }
-
 
4437
            break;
4355
          default:
4438
          default:
4356
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4439
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4357
        }
4440
        }
4358
        iprot.readFieldEnd();
4441
        iprot.readFieldEnd();
4359
      }
4442
      }
Line 4366... Line 4449...
4366
 
4449
 
4367
      if (this.isSetSuccess()) {
4450
      if (this.isSetSuccess()) {
4368
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4451
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4369
        this.success.write(oprot);
4452
        this.success.write(oprot);
4370
        oprot.writeFieldEnd();
4453
        oprot.writeFieldEnd();
-
 
4454
      } else if (this.isSetWex()) {
-
 
4455
        oprot.writeFieldBegin(WEX_FIELD_DESC);
-
 
4456
        this.wex.write(oprot);
-
 
4457
        oprot.writeFieldEnd();
4371
      }
4458
      }
4372
      oprot.writeFieldStop();
4459
      oprot.writeFieldStop();
4373
      oprot.writeStructEnd();
4460
      oprot.writeStructEnd();
4374
    }
4461
    }
4375
 
4462
 
Line 4383... Line 4470...
4383
        sb.append("null");
4470
        sb.append("null");
4384
      } else {
4471
      } else {
4385
        sb.append(this.success);
4472
        sb.append(this.success);
4386
      }
4473
      }
4387
      first = false;
4474
      first = false;
-
 
4475
      if (!first) sb.append(", ");
-
 
4476
      sb.append("wex:");
-
 
4477
      if (this.wex == null) {
-
 
4478
        sb.append("null");
-
 
4479
      } else {
-
 
4480
        sb.append(this.wex);
-
 
4481
      }
-
 
4482
      first = false;
4388
      sb.append(")");
4483
      sb.append(")");
4389
      return sb.toString();
4484
      return sb.toString();
4390
    }
4485
    }
4391
 
4486
 
4392
    public void validate() throws org.apache.thrift.TException {
4487
    public void validate() throws org.apache.thrift.TException {