Subversion Repositories SmartDukaan

Rev

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

Rev 668 Rev 674
Line 33... Line 33...
33
     * @param providerId
33
     * @param providerId
34
     */
34
     */
35
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException;
35
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException;
36
 
36
 
37
    /**
37
    /**
-
 
38
     * Returns a list containing all the providers.
-
 
39
     */
-
 
40
    public List<Provider> getAllProviders() throws LogisticsServiceException, TException;
-
 
41
 
-
 
42
    /**
38
     * Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
43
     * Returns a LogisticsInfo structure w/o an airway bill number. Use this method during the estimation phase.
39
     * Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
44
     * Raises an exception if this pincode is not allocated to any warehouse zone or provider. Also, if the pincode
40
     * is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
45
     * is allocated to a warehouse zone but there are no actual warehouses in that zone, an exception is raised.
41
     * 
46
     * 
42
     * @param itemId
47
     * @param itemId
Line 130... Line 135...
130
        throw result.lse;
135
        throw result.lse;
131
      }
136
      }
132
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");
137
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getProvider failed: unknown result");
133
    }
138
    }
134
 
139
 
-
 
140
    public List<Provider> getAllProviders() throws LogisticsServiceException, TException
-
 
141
    {
-
 
142
      send_getAllProviders();
-
 
143
      return recv_getAllProviders();
-
 
144
    }
-
 
145
 
-
 
146
    public void send_getAllProviders() throws TException
-
 
147
    {
-
 
148
      oprot_.writeMessageBegin(new TMessage("getAllProviders", TMessageType.CALL, seqid_));
-
 
149
      getAllProviders_args args = new getAllProviders_args();
-
 
150
      args.write(oprot_);
-
 
151
      oprot_.writeMessageEnd();
-
 
152
      oprot_.getTransport().flush();
-
 
153
    }
-
 
154
 
-
 
155
    public List<Provider> recv_getAllProviders() throws LogisticsServiceException, TException
-
 
156
    {
-
 
157
      TMessage msg = iprot_.readMessageBegin();
-
 
158
      if (msg.type == TMessageType.EXCEPTION) {
-
 
159
        TApplicationException x = TApplicationException.read(iprot_);
-
 
160
        iprot_.readMessageEnd();
-
 
161
        throw x;
-
 
162
      }
-
 
163
      getAllProviders_result result = new getAllProviders_result();
-
 
164
      result.read(iprot_);
-
 
165
      iprot_.readMessageEnd();
-
 
166
      if (result.isSetSuccess()) {
-
 
167
        return result.success;
-
 
168
      }
-
 
169
      if (result.lse != null) {
-
 
170
        throw result.lse;
-
 
171
      }
-
 
172
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getAllProviders failed: unknown result");
-
 
173
    }
-
 
174
 
135
    public LogisticsInfo getLogisticsEstimation(long itemId, String destination_pin) throws LogisticsServiceException, TException
175
    public LogisticsInfo getLogisticsEstimation(long itemId, String destination_pin) throws LogisticsServiceException, TException
136
    {
176
    {
137
      send_getLogisticsEstimation(itemId, destination_pin);
177
      send_getLogisticsEstimation(itemId, destination_pin);
138
      return recv_getLogisticsEstimation();
178
      return recv_getLogisticsEstimation();
139
    }
179
    }
Line 284... Line 324...
284
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
324
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
285
    public Processor(Iface iface)
325
    public Processor(Iface iface)
286
    {
326
    {
287
      iface_ = iface;
327
      iface_ = iface;
288
      processMap_.put("getProvider", new getProvider());
328
      processMap_.put("getProvider", new getProvider());
-
 
329
      processMap_.put("getAllProviders", new getAllProviders());
289
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
330
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
290
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
331
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
291
      processMap_.put("getEmptyAWB", new getEmptyAWB());
332
      processMap_.put("getEmptyAWB", new getEmptyAWB());
292
      processMap_.put("getShipmentInfo", new getShipmentInfo());
333
      processMap_.put("getShipmentInfo", new getShipmentInfo());
293
    }
334
    }
Line 343... Line 384...
343
        oprot.getTransport().flush();
384
        oprot.getTransport().flush();
344
      }
385
      }
345
 
386
 
346
    }
387
    }
347
 
388
 
-
 
389
    private class getAllProviders implements ProcessFunction {
-
 
390
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
391
      {
-
 
392
        getAllProviders_args args = new getAllProviders_args();
-
 
393
        args.read(iprot);
-
 
394
        iprot.readMessageEnd();
-
 
395
        getAllProviders_result result = new getAllProviders_result();
-
 
396
        try {
-
 
397
          result.success = iface_.getAllProviders();
-
 
398
        } catch (LogisticsServiceException lse) {
-
 
399
          result.lse = lse;
-
 
400
        } catch (Throwable th) {
-
 
401
          LOGGER.error("Internal error processing getAllProviders", th);
-
 
402
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getAllProviders");
-
 
403
          oprot.writeMessageBegin(new TMessage("getAllProviders", TMessageType.EXCEPTION, seqid));
-
 
404
          x.write(oprot);
-
 
405
          oprot.writeMessageEnd();
-
 
406
          oprot.getTransport().flush();
-
 
407
          return;
-
 
408
        }
-
 
409
        oprot.writeMessageBegin(new TMessage("getAllProviders", TMessageType.REPLY, seqid));
-
 
410
        result.write(oprot);
-
 
411
        oprot.writeMessageEnd();
-
 
412
        oprot.getTransport().flush();
-
 
413
      }
-
 
414
 
-
 
415
    }
-
 
416
 
348
    private class getLogisticsEstimation implements ProcessFunction {
417
    private class getLogisticsEstimation implements ProcessFunction {
349
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
418
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
350
      {
419
      {
351
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
420
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
352
        args.read(iprot);
421
        args.read(iprot);
Line 1100... Line 1169...
1100
      // check for required fields
1169
      // check for required fields
1101
    }
1170
    }
1102
 
1171
 
1103
  }
1172
  }
1104
 
1173
 
-
 
1174
  public static class getAllProviders_args implements TBase<getAllProviders_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllProviders_args>   {
-
 
1175
    private static final TStruct STRUCT_DESC = new TStruct("getAllProviders_args");
-
 
1176
 
-
 
1177
 
-
 
1178
 
-
 
1179
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
1180
    public enum _Fields implements TFieldIdEnum {
-
 
1181
;
-
 
1182
 
-
 
1183
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
1184
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
1185
 
-
 
1186
      static {
-
 
1187
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
1188
          byId.put((int)field._thriftId, field);
-
 
1189
          byName.put(field.getFieldName(), field);
-
 
1190
        }
-
 
1191
      }
-
 
1192
 
-
 
1193
      /**
-
 
1194
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
1195
       */
-
 
1196
      public static _Fields findByThriftId(int fieldId) {
-
 
1197
        return byId.get(fieldId);
-
 
1198
      }
-
 
1199
 
-
 
1200
      /**
-
 
1201
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
1202
       * if it is not found.
-
 
1203
       */
-
 
1204
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
1205
        _Fields fields = findByThriftId(fieldId);
-
 
1206
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
1207
        return fields;
-
 
1208
      }
-
 
1209
 
-
 
1210
      /**
-
 
1211
       * Find the _Fields constant that matches name, or null if its not found.
-
 
1212
       */
-
 
1213
      public static _Fields findByName(String name) {
-
 
1214
        return byName.get(name);
-
 
1215
      }
-
 
1216
 
-
 
1217
      private final short _thriftId;
-
 
1218
      private final String _fieldName;
-
 
1219
 
-
 
1220
      _Fields(short thriftId, String fieldName) {
-
 
1221
        _thriftId = thriftId;
-
 
1222
        _fieldName = fieldName;
-
 
1223
      }
-
 
1224
 
-
 
1225
      public short getThriftFieldId() {
-
 
1226
        return _thriftId;
-
 
1227
      }
-
 
1228
 
-
 
1229
      public String getFieldName() {
-
 
1230
        return _fieldName;
-
 
1231
      }
-
 
1232
    }
-
 
1233
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1234
    }});
-
 
1235
 
-
 
1236
    static {
-
 
1237
      FieldMetaData.addStructMetaDataMap(getAllProviders_args.class, metaDataMap);
-
 
1238
    }
-
 
1239
 
-
 
1240
    public getAllProviders_args() {
-
 
1241
    }
-
 
1242
 
-
 
1243
    /**
-
 
1244
     * Performs a deep copy on <i>other</i>.
-
 
1245
     */
-
 
1246
    public getAllProviders_args(getAllProviders_args other) {
-
 
1247
    }
-
 
1248
 
-
 
1249
    public getAllProviders_args deepCopy() {
-
 
1250
      return new getAllProviders_args(this);
-
 
1251
    }
-
 
1252
 
-
 
1253
    @Deprecated
-
 
1254
    public getAllProviders_args clone() {
-
 
1255
      return new getAllProviders_args(this);
-
 
1256
    }
-
 
1257
 
-
 
1258
    public void setFieldValue(_Fields field, Object value) {
-
 
1259
      switch (field) {
-
 
1260
      }
-
 
1261
    }
-
 
1262
 
-
 
1263
    public void setFieldValue(int fieldID, Object value) {
-
 
1264
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
1265
    }
-
 
1266
 
-
 
1267
    public Object getFieldValue(_Fields field) {
-
 
1268
      switch (field) {
-
 
1269
      }
-
 
1270
      throw new IllegalStateException();
-
 
1271
    }
-
 
1272
 
-
 
1273
    public Object getFieldValue(int fieldId) {
-
 
1274
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
1275
    }
-
 
1276
 
-
 
1277
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1278
    public boolean isSet(_Fields field) {
-
 
1279
      switch (field) {
-
 
1280
      }
-
 
1281
      throw new IllegalStateException();
-
 
1282
    }
-
 
1283
 
-
 
1284
    public boolean isSet(int fieldID) {
-
 
1285
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1286
    }
-
 
1287
 
-
 
1288
    @Override
-
 
1289
    public boolean equals(Object that) {
-
 
1290
      if (that == null)
-
 
1291
        return false;
-
 
1292
      if (that instanceof getAllProviders_args)
-
 
1293
        return this.equals((getAllProviders_args)that);
-
 
1294
      return false;
-
 
1295
    }
-
 
1296
 
-
 
1297
    public boolean equals(getAllProviders_args that) {
-
 
1298
      if (that == null)
-
 
1299
        return false;
-
 
1300
 
-
 
1301
      return true;
-
 
1302
    }
-
 
1303
 
-
 
1304
    @Override
-
 
1305
    public int hashCode() {
-
 
1306
      return 0;
-
 
1307
    }
-
 
1308
 
-
 
1309
    public int compareTo(getAllProviders_args other) {
-
 
1310
      if (!getClass().equals(other.getClass())) {
-
 
1311
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1312
      }
-
 
1313
 
-
 
1314
      int lastComparison = 0;
-
 
1315
      getAllProviders_args typedOther = (getAllProviders_args)other;
-
 
1316
 
-
 
1317
      return 0;
-
 
1318
    }
-
 
1319
 
-
 
1320
    public void read(TProtocol iprot) throws TException {
-
 
1321
      TField field;
-
 
1322
      iprot.readStructBegin();
-
 
1323
      while (true)
-
 
1324
      {
-
 
1325
        field = iprot.readFieldBegin();
-
 
1326
        if (field.type == TType.STOP) { 
-
 
1327
          break;
-
 
1328
        }
-
 
1329
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1330
        if (fieldId == null) {
-
 
1331
          TProtocolUtil.skip(iprot, field.type);
-
 
1332
        } else {
-
 
1333
          switch (fieldId) {
-
 
1334
          }
-
 
1335
          iprot.readFieldEnd();
-
 
1336
        }
-
 
1337
      }
-
 
1338
      iprot.readStructEnd();
-
 
1339
      validate();
-
 
1340
    }
-
 
1341
 
-
 
1342
    public void write(TProtocol oprot) throws TException {
-
 
1343
      validate();
-
 
1344
 
-
 
1345
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1346
      oprot.writeFieldStop();
-
 
1347
      oprot.writeStructEnd();
-
 
1348
    }
-
 
1349
 
-
 
1350
    @Override
-
 
1351
    public String toString() {
-
 
1352
      StringBuilder sb = new StringBuilder("getAllProviders_args(");
-
 
1353
      boolean first = true;
-
 
1354
 
-
 
1355
      sb.append(")");
-
 
1356
      return sb.toString();
-
 
1357
    }
-
 
1358
 
-
 
1359
    public void validate() throws TException {
-
 
1360
      // check for required fields
-
 
1361
    }
-
 
1362
 
-
 
1363
  }
-
 
1364
 
-
 
1365
  public static class getAllProviders_result implements TBase<getAllProviders_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllProviders_result>   {
-
 
1366
    private static final TStruct STRUCT_DESC = new TStruct("getAllProviders_result");
-
 
1367
 
-
 
1368
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
-
 
1369
    private static final TField LSE_FIELD_DESC = new TField("lse", TType.STRUCT, (short)1);
-
 
1370
 
-
 
1371
    private List<Provider> success;
-
 
1372
    private LogisticsServiceException lse;
-
 
1373
 
-
 
1374
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
1375
    public enum _Fields implements TFieldIdEnum {
-
 
1376
      SUCCESS((short)0, "success"),
-
 
1377
      LSE((short)1, "lse");
-
 
1378
 
-
 
1379
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
1380
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
1381
 
-
 
1382
      static {
-
 
1383
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
1384
          byId.put((int)field._thriftId, field);
-
 
1385
          byName.put(field.getFieldName(), field);
-
 
1386
        }
-
 
1387
      }
-
 
1388
 
-
 
1389
      /**
-
 
1390
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
1391
       */
-
 
1392
      public static _Fields findByThriftId(int fieldId) {
-
 
1393
        return byId.get(fieldId);
-
 
1394
      }
-
 
1395
 
-
 
1396
      /**
-
 
1397
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
1398
       * if it is not found.
-
 
1399
       */
-
 
1400
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
1401
        _Fields fields = findByThriftId(fieldId);
-
 
1402
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
1403
        return fields;
-
 
1404
      }
-
 
1405
 
-
 
1406
      /**
-
 
1407
       * Find the _Fields constant that matches name, or null if its not found.
-
 
1408
       */
-
 
1409
      public static _Fields findByName(String name) {
-
 
1410
        return byName.get(name);
-
 
1411
      }
-
 
1412
 
-
 
1413
      private final short _thriftId;
-
 
1414
      private final String _fieldName;
-
 
1415
 
-
 
1416
      _Fields(short thriftId, String fieldName) {
-
 
1417
        _thriftId = thriftId;
-
 
1418
        _fieldName = fieldName;
-
 
1419
      }
-
 
1420
 
-
 
1421
      public short getThriftFieldId() {
-
 
1422
        return _thriftId;
-
 
1423
      }
-
 
1424
 
-
 
1425
      public String getFieldName() {
-
 
1426
        return _fieldName;
-
 
1427
      }
-
 
1428
    }
-
 
1429
 
-
 
1430
    // isset id assignments
-
 
1431
 
-
 
1432
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1433
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
1434
          new ListMetaData(TType.LIST, 
-
 
1435
              new StructMetaData(TType.STRUCT, Provider.class))));
-
 
1436
      put(_Fields.LSE, new FieldMetaData("lse", TFieldRequirementType.DEFAULT, 
-
 
1437
          new FieldValueMetaData(TType.STRUCT)));
-
 
1438
    }});
-
 
1439
 
-
 
1440
    static {
-
 
1441
      FieldMetaData.addStructMetaDataMap(getAllProviders_result.class, metaDataMap);
-
 
1442
    }
-
 
1443
 
-
 
1444
    public getAllProviders_result() {
-
 
1445
    }
-
 
1446
 
-
 
1447
    public getAllProviders_result(
-
 
1448
      List<Provider> success,
-
 
1449
      LogisticsServiceException lse)
-
 
1450
    {
-
 
1451
      this();
-
 
1452
      this.success = success;
-
 
1453
      this.lse = lse;
-
 
1454
    }
-
 
1455
 
-
 
1456
    /**
-
 
1457
     * Performs a deep copy on <i>other</i>.
-
 
1458
     */
-
 
1459
    public getAllProviders_result(getAllProviders_result other) {
-
 
1460
      if (other.isSetSuccess()) {
-
 
1461
        List<Provider> __this__success = new ArrayList<Provider>();
-
 
1462
        for (Provider other_element : other.success) {
-
 
1463
          __this__success.add(new Provider(other_element));
-
 
1464
        }
-
 
1465
        this.success = __this__success;
-
 
1466
      }
-
 
1467
      if (other.isSetLse()) {
-
 
1468
        this.lse = new LogisticsServiceException(other.lse);
-
 
1469
      }
-
 
1470
    }
-
 
1471
 
-
 
1472
    public getAllProviders_result deepCopy() {
-
 
1473
      return new getAllProviders_result(this);
-
 
1474
    }
-
 
1475
 
-
 
1476
    @Deprecated
-
 
1477
    public getAllProviders_result clone() {
-
 
1478
      return new getAllProviders_result(this);
-
 
1479
    }
-
 
1480
 
-
 
1481
    public int getSuccessSize() {
-
 
1482
      return (this.success == null) ? 0 : this.success.size();
-
 
1483
    }
-
 
1484
 
-
 
1485
    public java.util.Iterator<Provider> getSuccessIterator() {
-
 
1486
      return (this.success == null) ? null : this.success.iterator();
-
 
1487
    }
-
 
1488
 
-
 
1489
    public void addToSuccess(Provider elem) {
-
 
1490
      if (this.success == null) {
-
 
1491
        this.success = new ArrayList<Provider>();
-
 
1492
      }
-
 
1493
      this.success.add(elem);
-
 
1494
    }
-
 
1495
 
-
 
1496
    public List<Provider> getSuccess() {
-
 
1497
      return this.success;
-
 
1498
    }
-
 
1499
 
-
 
1500
    public getAllProviders_result setSuccess(List<Provider> success) {
-
 
1501
      this.success = success;
-
 
1502
      return this;
-
 
1503
    }
-
 
1504
 
-
 
1505
    public void unsetSuccess() {
-
 
1506
      this.success = null;
-
 
1507
    }
-
 
1508
 
-
 
1509
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
1510
    public boolean isSetSuccess() {
-
 
1511
      return this.success != null;
-
 
1512
    }
-
 
1513
 
-
 
1514
    public void setSuccessIsSet(boolean value) {
-
 
1515
      if (!value) {
-
 
1516
        this.success = null;
-
 
1517
      }
-
 
1518
    }
-
 
1519
 
-
 
1520
    public LogisticsServiceException getLse() {
-
 
1521
      return this.lse;
-
 
1522
    }
-
 
1523
 
-
 
1524
    public getAllProviders_result setLse(LogisticsServiceException lse) {
-
 
1525
      this.lse = lse;
-
 
1526
      return this;
-
 
1527
    }
-
 
1528
 
-
 
1529
    public void unsetLse() {
-
 
1530
      this.lse = null;
-
 
1531
    }
-
 
1532
 
-
 
1533
    /** Returns true if field lse is set (has been asigned a value) and false otherwise */
-
 
1534
    public boolean isSetLse() {
-
 
1535
      return this.lse != null;
-
 
1536
    }
-
 
1537
 
-
 
1538
    public void setLseIsSet(boolean value) {
-
 
1539
      if (!value) {
-
 
1540
        this.lse = null;
-
 
1541
      }
-
 
1542
    }
-
 
1543
 
-
 
1544
    public void setFieldValue(_Fields field, Object value) {
-
 
1545
      switch (field) {
-
 
1546
      case SUCCESS:
-
 
1547
        if (value == null) {
-
 
1548
          unsetSuccess();
-
 
1549
        } else {
-
 
1550
          setSuccess((List<Provider>)value);
-
 
1551
        }
-
 
1552
        break;
-
 
1553
 
-
 
1554
      case LSE:
-
 
1555
        if (value == null) {
-
 
1556
          unsetLse();
-
 
1557
        } else {
-
 
1558
          setLse((LogisticsServiceException)value);
-
 
1559
        }
-
 
1560
        break;
-
 
1561
 
-
 
1562
      }
-
 
1563
    }
-
 
1564
 
-
 
1565
    public void setFieldValue(int fieldID, Object value) {
-
 
1566
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
1567
    }
-
 
1568
 
-
 
1569
    public Object getFieldValue(_Fields field) {
-
 
1570
      switch (field) {
-
 
1571
      case SUCCESS:
-
 
1572
        return getSuccess();
-
 
1573
 
-
 
1574
      case LSE:
-
 
1575
        return getLse();
-
 
1576
 
-
 
1577
      }
-
 
1578
      throw new IllegalStateException();
-
 
1579
    }
-
 
1580
 
-
 
1581
    public Object getFieldValue(int fieldId) {
-
 
1582
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
1583
    }
-
 
1584
 
-
 
1585
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1586
    public boolean isSet(_Fields field) {
-
 
1587
      switch (field) {
-
 
1588
      case SUCCESS:
-
 
1589
        return isSetSuccess();
-
 
1590
      case LSE:
-
 
1591
        return isSetLse();
-
 
1592
      }
-
 
1593
      throw new IllegalStateException();
-
 
1594
    }
-
 
1595
 
-
 
1596
    public boolean isSet(int fieldID) {
-
 
1597
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1598
    }
-
 
1599
 
-
 
1600
    @Override
-
 
1601
    public boolean equals(Object that) {
-
 
1602
      if (that == null)
-
 
1603
        return false;
-
 
1604
      if (that instanceof getAllProviders_result)
-
 
1605
        return this.equals((getAllProviders_result)that);
-
 
1606
      return false;
-
 
1607
    }
-
 
1608
 
-
 
1609
    public boolean equals(getAllProviders_result that) {
-
 
1610
      if (that == null)
-
 
1611
        return false;
-
 
1612
 
-
 
1613
      boolean this_present_success = true && this.isSetSuccess();
-
 
1614
      boolean that_present_success = true && that.isSetSuccess();
-
 
1615
      if (this_present_success || that_present_success) {
-
 
1616
        if (!(this_present_success && that_present_success))
-
 
1617
          return false;
-
 
1618
        if (!this.success.equals(that.success))
-
 
1619
          return false;
-
 
1620
      }
-
 
1621
 
-
 
1622
      boolean this_present_lse = true && this.isSetLse();
-
 
1623
      boolean that_present_lse = true && that.isSetLse();
-
 
1624
      if (this_present_lse || that_present_lse) {
-
 
1625
        if (!(this_present_lse && that_present_lse))
-
 
1626
          return false;
-
 
1627
        if (!this.lse.equals(that.lse))
-
 
1628
          return false;
-
 
1629
      }
-
 
1630
 
-
 
1631
      return true;
-
 
1632
    }
-
 
1633
 
-
 
1634
    @Override
-
 
1635
    public int hashCode() {
-
 
1636
      return 0;
-
 
1637
    }
-
 
1638
 
-
 
1639
    public int compareTo(getAllProviders_result other) {
-
 
1640
      if (!getClass().equals(other.getClass())) {
-
 
1641
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1642
      }
-
 
1643
 
-
 
1644
      int lastComparison = 0;
-
 
1645
      getAllProviders_result typedOther = (getAllProviders_result)other;
-
 
1646
 
-
 
1647
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
1648
      if (lastComparison != 0) {
-
 
1649
        return lastComparison;
-
 
1650
      }
-
 
1651
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
1652
      if (lastComparison != 0) {
-
 
1653
        return lastComparison;
-
 
1654
      }
-
 
1655
      lastComparison = Boolean.valueOf(isSetLse()).compareTo(isSetLse());
-
 
1656
      if (lastComparison != 0) {
-
 
1657
        return lastComparison;
-
 
1658
      }
-
 
1659
      lastComparison = TBaseHelper.compareTo(lse, typedOther.lse);
-
 
1660
      if (lastComparison != 0) {
-
 
1661
        return lastComparison;
-
 
1662
      }
-
 
1663
      return 0;
-
 
1664
    }
-
 
1665
 
-
 
1666
    public void read(TProtocol iprot) throws TException {
-
 
1667
      TField field;
-
 
1668
      iprot.readStructBegin();
-
 
1669
      while (true)
-
 
1670
      {
-
 
1671
        field = iprot.readFieldBegin();
-
 
1672
        if (field.type == TType.STOP) { 
-
 
1673
          break;
-
 
1674
        }
-
 
1675
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1676
        if (fieldId == null) {
-
 
1677
          TProtocolUtil.skip(iprot, field.type);
-
 
1678
        } else {
-
 
1679
          switch (fieldId) {
-
 
1680
            case SUCCESS:
-
 
1681
              if (field.type == TType.LIST) {
-
 
1682
                {
-
 
1683
                  TList _list0 = iprot.readListBegin();
-
 
1684
                  this.success = new ArrayList<Provider>(_list0.size);
-
 
1685
                  for (int _i1 = 0; _i1 < _list0.size; ++_i1)
-
 
1686
                  {
-
 
1687
                    Provider _elem2;
-
 
1688
                    _elem2 = new Provider();
-
 
1689
                    _elem2.read(iprot);
-
 
1690
                    this.success.add(_elem2);
-
 
1691
                  }
-
 
1692
                  iprot.readListEnd();
-
 
1693
                }
-
 
1694
              } else { 
-
 
1695
                TProtocolUtil.skip(iprot, field.type);
-
 
1696
              }
-
 
1697
              break;
-
 
1698
            case LSE:
-
 
1699
              if (field.type == TType.STRUCT) {
-
 
1700
                this.lse = new LogisticsServiceException();
-
 
1701
                this.lse.read(iprot);
-
 
1702
              } else { 
-
 
1703
                TProtocolUtil.skip(iprot, field.type);
-
 
1704
              }
-
 
1705
              break;
-
 
1706
          }
-
 
1707
          iprot.readFieldEnd();
-
 
1708
        }
-
 
1709
      }
-
 
1710
      iprot.readStructEnd();
-
 
1711
      validate();
-
 
1712
    }
-
 
1713
 
-
 
1714
    public void write(TProtocol oprot) throws TException {
-
 
1715
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1716
 
-
 
1717
      if (this.isSetSuccess()) {
-
 
1718
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
1719
        {
-
 
1720
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
-
 
1721
          for (Provider _iter3 : this.success)
-
 
1722
          {
-
 
1723
            _iter3.write(oprot);
-
 
1724
          }
-
 
1725
          oprot.writeListEnd();
-
 
1726
        }
-
 
1727
        oprot.writeFieldEnd();
-
 
1728
      } else if (this.isSetLse()) {
-
 
1729
        oprot.writeFieldBegin(LSE_FIELD_DESC);
-
 
1730
        this.lse.write(oprot);
-
 
1731
        oprot.writeFieldEnd();
-
 
1732
      }
-
 
1733
      oprot.writeFieldStop();
-
 
1734
      oprot.writeStructEnd();
-
 
1735
    }
-
 
1736
 
-
 
1737
    @Override
-
 
1738
    public String toString() {
-
 
1739
      StringBuilder sb = new StringBuilder("getAllProviders_result(");
-
 
1740
      boolean first = true;
-
 
1741
 
-
 
1742
      sb.append("success:");
-
 
1743
      if (this.success == null) {
-
 
1744
        sb.append("null");
-
 
1745
      } else {
-
 
1746
        sb.append(this.success);
-
 
1747
      }
-
 
1748
      first = false;
-
 
1749
      if (!first) sb.append(", ");
-
 
1750
      sb.append("lse:");
-
 
1751
      if (this.lse == null) {
-
 
1752
        sb.append("null");
-
 
1753
      } else {
-
 
1754
        sb.append(this.lse);
-
 
1755
      }
-
 
1756
      first = false;
-
 
1757
      sb.append(")");
-
 
1758
      return sb.toString();
-
 
1759
    }
-
 
1760
 
-
 
1761
    public void validate() throws TException {
-
 
1762
      // check for required fields
-
 
1763
    }
-
 
1764
 
-
 
1765
  }
-
 
1766
 
1105
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_args>   {
1767
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_args>   {
1106
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
1768
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
1107
 
1769
 
1108
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
1770
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
1109
    private static final TField DESTINATION_PIN_FIELD_DESC = new TField("destination_pin", TType.STRING, (short)2);
1771
    private static final TField DESTINATION_PIN_FIELD_DESC = new TField("destination_pin", TType.STRING, (short)2);
Line 3879... Line 4541...
3879
        } else {
4541
        } else {
3880
          switch (fieldId) {
4542
          switch (fieldId) {
3881
            case SUCCESS:
4543
            case SUCCESS:
3882
              if (field.type == TType.LIST) {
4544
              if (field.type == TType.LIST) {
3883
                {
4545
                {
3884
                  TList _list0 = iprot.readListBegin();
4546
                  TList _list4 = iprot.readListBegin();
3885
                  this.success = new ArrayList<AwbUpdate>(_list0.size);
4547
                  this.success = new ArrayList<AwbUpdate>(_list4.size);
3886
                  for (int _i1 = 0; _i1 < _list0.size; ++_i1)
4548
                  for (int _i5 = 0; _i5 < _list4.size; ++_i5)
3887
                  {
4549
                  {
3888
                    AwbUpdate _elem2;
4550
                    AwbUpdate _elem6;
3889
                    _elem2 = new AwbUpdate();
4551
                    _elem6 = new AwbUpdate();
3890
                    _elem2.read(iprot);
4552
                    _elem6.read(iprot);
3891
                    this.success.add(_elem2);
4553
                    this.success.add(_elem6);
3892
                  }
4554
                  }
3893
                  iprot.readListEnd();
4555
                  iprot.readListEnd();
3894
                }
4556
                }
3895
              } else { 
4557
              } else { 
3896
                TProtocolUtil.skip(iprot, field.type);
4558
                TProtocolUtil.skip(iprot, field.type);
Line 3917... Line 4579...
3917
 
4579
 
3918
      if (this.isSetSuccess()) {
4580
      if (this.isSetSuccess()) {
3919
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4581
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3920
        {
4582
        {
3921
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
4583
          oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
3922
          for (AwbUpdate _iter3 : this.success)
4584
          for (AwbUpdate _iter7 : this.success)
3923
          {
4585
          {
3924
            _iter3.write(oprot);
4586
            _iter7.write(oprot);
3925
          }
4587
          }
3926
          oprot.writeListEnd();
4588
          oprot.writeListEnd();
3927
        }
4589
        }
3928
        oprot.writeFieldEnd();
4590
        oprot.writeFieldEnd();
3929
      } else if (this.isSetSe()) {
4591
      } else if (this.isSetSe()) {