Subversion Repositories SmartDukaan

Rev

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

Rev 495 Rev 750
Line 41... Line 41...
41
 
41
 
42
    public boolean addUser(String username, String password, long warehouseId) throws HelperServiceException, TException;
42
    public boolean addUser(String username, String password, long warehouseId) throws HelperServiceException, TException;
43
 
43
 
44
    public boolean deleteUser(String username) throws HelperServiceException, TException;
44
    public boolean deleteUser(String username) throws HelperServiceException, TException;
45
 
45
 
-
 
46
    /**
-
 
47
     * Returns the warehouseId for the given user if the password matches. Returns -1 otherwise.
-
 
48
     * The loggedOn timestamp for the dashboard user is updated as a timestamp.
-
 
49
     * It's unclear to me when an exception is thrown : Chandranshu
-
 
50
     * 
-
 
51
     * @param username
-
 
52
     * @param password
-
 
53
     */
46
    public long authenticateUser(String username, String password) throws HelperServiceException, TException;
54
    public long authenticateUser(String username, String password) throws HelperServiceException, TException;
47
 
55
 
48
    public boolean updatePassword(String username, String oldPassword, String newPassword) throws HelperServiceException, TException;
56
    public boolean updatePassword(String username, String oldPassword, String newPassword) throws HelperServiceException, TException;
49
 
57
 
-
 
58
    /**
-
 
59
     * Returns the LogisticsUser struct associated with the given username and password if they match.
-
 
60
     * Throws an exception otherwise.
-
 
61
     * 
-
 
62
     * @param username
-
 
63
     * @param password
-
 
64
     */
-
 
65
    public LogisticsUser authenticateLogisticsUser(String username, String password) throws HelperServiceException, TException;
-
 
66
 
50
  }
67
  }
51
 
68
 
52
  public static class Client implements Iface {
69
  public static class Client implements Iface {
53
    public Client(TProtocol prot)
70
    public Client(TProtocol prot)
54
    {
71
    {
Line 429... Line 446...
429
        throw result.se;
446
        throw result.se;
430
      }
447
      }
431
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
448
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
432
    }
449
    }
433
 
450
 
-
 
451
    public LogisticsUser authenticateLogisticsUser(String username, String password) throws HelperServiceException, TException
-
 
452
    {
-
 
453
      send_authenticateLogisticsUser(username, password);
-
 
454
      return recv_authenticateLogisticsUser();
-
 
455
    }
-
 
456
 
-
 
457
    public void send_authenticateLogisticsUser(String username, String password) throws TException
-
 
458
    {
-
 
459
      oprot_.writeMessageBegin(new TMessage("authenticateLogisticsUser", TMessageType.CALL, seqid_));
-
 
460
      authenticateLogisticsUser_args args = new authenticateLogisticsUser_args();
-
 
461
      args.username = username;
-
 
462
      args.password = password;
-
 
463
      args.write(oprot_);
-
 
464
      oprot_.writeMessageEnd();
-
 
465
      oprot_.getTransport().flush();
-
 
466
    }
-
 
467
 
-
 
468
    public LogisticsUser recv_authenticateLogisticsUser() throws HelperServiceException, TException
-
 
469
    {
-
 
470
      TMessage msg = iprot_.readMessageBegin();
-
 
471
      if (msg.type == TMessageType.EXCEPTION) {
-
 
472
        TApplicationException x = TApplicationException.read(iprot_);
-
 
473
        iprot_.readMessageEnd();
-
 
474
        throw x;
-
 
475
      }
-
 
476
      authenticateLogisticsUser_result result = new authenticateLogisticsUser_result();
-
 
477
      result.read(iprot_);
-
 
478
      iprot_.readMessageEnd();
-
 
479
      if (result.isSetSuccess()) {
-
 
480
        return result.success;
-
 
481
      }
-
 
482
      if (result.hse != null) {
-
 
483
        throw result.hse;
-
 
484
      }
-
 
485
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "authenticateLogisticsUser failed: unknown result");
-
 
486
    }
-
 
487
 
434
  }
488
  }
435
  public static class Processor implements TProcessor {
489
  public static class Processor implements TProcessor {
436
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
490
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
437
    public Processor(Iface iface)
491
    public Processor(Iface iface)
438
    {
492
    {
Line 445... Line 499...
445
      processMap_.put("getSubstitutedMessage", new getSubstitutedMessage());
499
      processMap_.put("getSubstitutedMessage", new getSubstitutedMessage());
446
      processMap_.put("addUser", new addUser());
500
      processMap_.put("addUser", new addUser());
447
      processMap_.put("deleteUser", new deleteUser());
501
      processMap_.put("deleteUser", new deleteUser());
448
      processMap_.put("authenticateUser", new authenticateUser());
502
      processMap_.put("authenticateUser", new authenticateUser());
449
      processMap_.put("updatePassword", new updatePassword());
503
      processMap_.put("updatePassword", new updatePassword());
-
 
504
      processMap_.put("authenticateLogisticsUser", new authenticateLogisticsUser());
450
    }
505
    }
451
 
506
 
452
    protected static interface ProcessFunction {
507
    protected static interface ProcessFunction {
453
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
508
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
454
    }
509
    }
Line 756... Line 811...
756
        oprot.getTransport().flush();
811
        oprot.getTransport().flush();
757
      }
812
      }
758
 
813
 
759
    }
814
    }
760
 
815
 
-
 
816
    private class authenticateLogisticsUser implements ProcessFunction {
-
 
817
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
818
      {
-
 
819
        authenticateLogisticsUser_args args = new authenticateLogisticsUser_args();
-
 
820
        args.read(iprot);
-
 
821
        iprot.readMessageEnd();
-
 
822
        authenticateLogisticsUser_result result = new authenticateLogisticsUser_result();
-
 
823
        try {
-
 
824
          result.success = iface_.authenticateLogisticsUser(args.username, args.password);
-
 
825
        } catch (HelperServiceException hse) {
-
 
826
          result.hse = hse;
-
 
827
        } catch (Throwable th) {
-
 
828
          LOGGER.error("Internal error processing authenticateLogisticsUser", th);
-
 
829
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing authenticateLogisticsUser");
-
 
830
          oprot.writeMessageBegin(new TMessage("authenticateLogisticsUser", TMessageType.EXCEPTION, seqid));
-
 
831
          x.write(oprot);
-
 
832
          oprot.writeMessageEnd();
-
 
833
          oprot.getTransport().flush();
-
 
834
          return;
-
 
835
        }
-
 
836
        oprot.writeMessageBegin(new TMessage("authenticateLogisticsUser", TMessageType.REPLY, seqid));
-
 
837
        result.write(oprot);
-
 
838
        oprot.writeMessageEnd();
-
 
839
        oprot.getTransport().flush();
-
 
840
      }
-
 
841
 
-
 
842
    }
-
 
843
 
761
  }
844
  }
762
 
845
 
763
  public static class sendMail_args implements TBase<sendMail_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_args>   {
846
  public static class sendMail_args implements TBase<sendMail_args._Fields>, java.io.Serializable, Cloneable, Comparable<sendMail_args>   {
764
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_args");
847
    private static final TStruct STRUCT_DESC = new TStruct("sendMail_args");
765
 
848
 
Line 7464... Line 7547...
7464
      }
7547
      }
7465
      first = false;
7548
      first = false;
7466
      sb.append(")");
7549
      sb.append(")");
7467
      return sb.toString();
7550
      return sb.toString();
7468
    }
7551
    }
-
 
7552
 
-
 
7553
    public void validate() throws TException {
-
 
7554
      // check for required fields
-
 
7555
    }
-
 
7556
 
-
 
7557
  }
-
 
7558
 
-
 
7559
  public static class authenticateLogisticsUser_args implements TBase<authenticateLogisticsUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<authenticateLogisticsUser_args>   {
-
 
7560
    private static final TStruct STRUCT_DESC = new TStruct("authenticateLogisticsUser_args");
-
 
7561
 
-
 
7562
    private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)1);
-
 
7563
    private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);
-
 
7564
 
-
 
7565
    private String username;
-
 
7566
    private String password;
-
 
7567
 
-
 
7568
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7569
    public enum _Fields implements TFieldIdEnum {
-
 
7570
      USERNAME((short)1, "username"),
-
 
7571
      PASSWORD((short)2, "password");
-
 
7572
 
-
 
7573
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
7574
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7575
 
-
 
7576
      static {
-
 
7577
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7578
          byId.put((int)field._thriftId, field);
-
 
7579
          byName.put(field.getFieldName(), field);
-
 
7580
        }
-
 
7581
      }
-
 
7582
 
-
 
7583
      /**
-
 
7584
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7585
       */
-
 
7586
      public static _Fields findByThriftId(int fieldId) {
-
 
7587
        return byId.get(fieldId);
-
 
7588
      }
-
 
7589
 
-
 
7590
      /**
-
 
7591
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7592
       * if it is not found.
-
 
7593
       */
-
 
7594
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7595
        _Fields fields = findByThriftId(fieldId);
-
 
7596
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7597
        return fields;
-
 
7598
      }
-
 
7599
 
-
 
7600
      /**
-
 
7601
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7602
       */
-
 
7603
      public static _Fields findByName(String name) {
-
 
7604
        return byName.get(name);
-
 
7605
      }
-
 
7606
 
-
 
7607
      private final short _thriftId;
-
 
7608
      private final String _fieldName;
-
 
7609
 
-
 
7610
      _Fields(short thriftId, String fieldName) {
-
 
7611
        _thriftId = thriftId;
-
 
7612
        _fieldName = fieldName;
-
 
7613
      }
-
 
7614
 
-
 
7615
      public short getThriftFieldId() {
-
 
7616
        return _thriftId;
-
 
7617
      }
-
 
7618
 
-
 
7619
      public String getFieldName() {
-
 
7620
        return _fieldName;
-
 
7621
      }
-
 
7622
    }
-
 
7623
 
-
 
7624
    // isset id assignments
-
 
7625
 
-
 
7626
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
7627
      put(_Fields.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
-
 
7628
          new FieldValueMetaData(TType.STRING)));
-
 
7629
      put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
-
 
7630
          new FieldValueMetaData(TType.STRING)));
-
 
7631
    }});
-
 
7632
 
-
 
7633
    static {
-
 
7634
      FieldMetaData.addStructMetaDataMap(authenticateLogisticsUser_args.class, metaDataMap);
-
 
7635
    }
-
 
7636
 
-
 
7637
    public authenticateLogisticsUser_args() {
-
 
7638
    }
-
 
7639
 
-
 
7640
    public authenticateLogisticsUser_args(
-
 
7641
      String username,
-
 
7642
      String password)
-
 
7643
    {
-
 
7644
      this();
-
 
7645
      this.username = username;
-
 
7646
      this.password = password;
-
 
7647
    }
-
 
7648
 
-
 
7649
    /**
-
 
7650
     * Performs a deep copy on <i>other</i>.
-
 
7651
     */
-
 
7652
    public authenticateLogisticsUser_args(authenticateLogisticsUser_args other) {
-
 
7653
      if (other.isSetUsername()) {
-
 
7654
        this.username = other.username;
-
 
7655
      }
-
 
7656
      if (other.isSetPassword()) {
-
 
7657
        this.password = other.password;
-
 
7658
      }
-
 
7659
    }
-
 
7660
 
-
 
7661
    public authenticateLogisticsUser_args deepCopy() {
-
 
7662
      return new authenticateLogisticsUser_args(this);
-
 
7663
    }
-
 
7664
 
-
 
7665
    @Deprecated
-
 
7666
    public authenticateLogisticsUser_args clone() {
-
 
7667
      return new authenticateLogisticsUser_args(this);
-
 
7668
    }
-
 
7669
 
-
 
7670
    public String getUsername() {
-
 
7671
      return this.username;
-
 
7672
    }
-
 
7673
 
-
 
7674
    public authenticateLogisticsUser_args setUsername(String username) {
-
 
7675
      this.username = username;
-
 
7676
      return this;
-
 
7677
    }
-
 
7678
 
-
 
7679
    public void unsetUsername() {
-
 
7680
      this.username = null;
-
 
7681
    }
-
 
7682
 
-
 
7683
    /** Returns true if field username is set (has been asigned a value) and false otherwise */
-
 
7684
    public boolean isSetUsername() {
-
 
7685
      return this.username != null;
-
 
7686
    }
-
 
7687
 
-
 
7688
    public void setUsernameIsSet(boolean value) {
-
 
7689
      if (!value) {
-
 
7690
        this.username = null;
-
 
7691
      }
-
 
7692
    }
-
 
7693
 
-
 
7694
    public String getPassword() {
-
 
7695
      return this.password;
-
 
7696
    }
-
 
7697
 
-
 
7698
    public authenticateLogisticsUser_args setPassword(String password) {
-
 
7699
      this.password = password;
-
 
7700
      return this;
-
 
7701
    }
-
 
7702
 
-
 
7703
    public void unsetPassword() {
-
 
7704
      this.password = null;
-
 
7705
    }
-
 
7706
 
-
 
7707
    /** Returns true if field password is set (has been asigned a value) and false otherwise */
-
 
7708
    public boolean isSetPassword() {
-
 
7709
      return this.password != null;
-
 
7710
    }
-
 
7711
 
-
 
7712
    public void setPasswordIsSet(boolean value) {
-
 
7713
      if (!value) {
-
 
7714
        this.password = null;
-
 
7715
      }
-
 
7716
    }
-
 
7717
 
-
 
7718
    public void setFieldValue(_Fields field, Object value) {
-
 
7719
      switch (field) {
-
 
7720
      case USERNAME:
-
 
7721
        if (value == null) {
-
 
7722
          unsetUsername();
-
 
7723
        } else {
-
 
7724
          setUsername((String)value);
-
 
7725
        }
-
 
7726
        break;
-
 
7727
 
-
 
7728
      case PASSWORD:
-
 
7729
        if (value == null) {
-
 
7730
          unsetPassword();
-
 
7731
        } else {
-
 
7732
          setPassword((String)value);
-
 
7733
        }
-
 
7734
        break;
-
 
7735
 
-
 
7736
      }
-
 
7737
    }
-
 
7738
 
-
 
7739
    public void setFieldValue(int fieldID, Object value) {
-
 
7740
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
7741
    }
-
 
7742
 
-
 
7743
    public Object getFieldValue(_Fields field) {
-
 
7744
      switch (field) {
-
 
7745
      case USERNAME:
-
 
7746
        return getUsername();
-
 
7747
 
-
 
7748
      case PASSWORD:
-
 
7749
        return getPassword();
-
 
7750
 
-
 
7751
      }
-
 
7752
      throw new IllegalStateException();
-
 
7753
    }
-
 
7754
 
-
 
7755
    public Object getFieldValue(int fieldId) {
-
 
7756
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
7757
    }
-
 
7758
 
-
 
7759
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
7760
    public boolean isSet(_Fields field) {
-
 
7761
      switch (field) {
-
 
7762
      case USERNAME:
-
 
7763
        return isSetUsername();
-
 
7764
      case PASSWORD:
-
 
7765
        return isSetPassword();
-
 
7766
      }
-
 
7767
      throw new IllegalStateException();
-
 
7768
    }
-
 
7769
 
-
 
7770
    public boolean isSet(int fieldID) {
-
 
7771
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
7772
    }
-
 
7773
 
-
 
7774
    @Override
-
 
7775
    public boolean equals(Object that) {
-
 
7776
      if (that == null)
-
 
7777
        return false;
-
 
7778
      if (that instanceof authenticateLogisticsUser_args)
-
 
7779
        return this.equals((authenticateLogisticsUser_args)that);
-
 
7780
      return false;
-
 
7781
    }
-
 
7782
 
-
 
7783
    public boolean equals(authenticateLogisticsUser_args that) {
-
 
7784
      if (that == null)
-
 
7785
        return false;
-
 
7786
 
-
 
7787
      boolean this_present_username = true && this.isSetUsername();
-
 
7788
      boolean that_present_username = true && that.isSetUsername();
-
 
7789
      if (this_present_username || that_present_username) {
-
 
7790
        if (!(this_present_username && that_present_username))
-
 
7791
          return false;
-
 
7792
        if (!this.username.equals(that.username))
-
 
7793
          return false;
-
 
7794
      }
-
 
7795
 
-
 
7796
      boolean this_present_password = true && this.isSetPassword();
-
 
7797
      boolean that_present_password = true && that.isSetPassword();
-
 
7798
      if (this_present_password || that_present_password) {
-
 
7799
        if (!(this_present_password && that_present_password))
-
 
7800
          return false;
-
 
7801
        if (!this.password.equals(that.password))
-
 
7802
          return false;
-
 
7803
      }
-
 
7804
 
-
 
7805
      return true;
-
 
7806
    }
-
 
7807
 
-
 
7808
    @Override
-
 
7809
    public int hashCode() {
-
 
7810
      return 0;
-
 
7811
    }
-
 
7812
 
-
 
7813
    public int compareTo(authenticateLogisticsUser_args other) {
-
 
7814
      if (!getClass().equals(other.getClass())) {
-
 
7815
        return getClass().getName().compareTo(other.getClass().getName());
-
 
7816
      }
-
 
7817
 
-
 
7818
      int lastComparison = 0;
-
 
7819
      authenticateLogisticsUser_args typedOther = (authenticateLogisticsUser_args)other;
-
 
7820
 
-
 
7821
      lastComparison = Boolean.valueOf(isSetUsername()).compareTo(isSetUsername());
-
 
7822
      if (lastComparison != 0) {
-
 
7823
        return lastComparison;
-
 
7824
      }
-
 
7825
      lastComparison = TBaseHelper.compareTo(username, typedOther.username);
-
 
7826
      if (lastComparison != 0) {
-
 
7827
        return lastComparison;
-
 
7828
      }
-
 
7829
      lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
-
 
7830
      if (lastComparison != 0) {
-
 
7831
        return lastComparison;
-
 
7832
      }
-
 
7833
      lastComparison = TBaseHelper.compareTo(password, typedOther.password);
-
 
7834
      if (lastComparison != 0) {
-
 
7835
        return lastComparison;
-
 
7836
      }
-
 
7837
      return 0;
-
 
7838
    }
-
 
7839
 
-
 
7840
    public void read(TProtocol iprot) throws TException {
-
 
7841
      TField field;
-
 
7842
      iprot.readStructBegin();
-
 
7843
      while (true)
-
 
7844
      {
-
 
7845
        field = iprot.readFieldBegin();
-
 
7846
        if (field.type == TType.STOP) { 
-
 
7847
          break;
-
 
7848
        }
-
 
7849
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
7850
        if (fieldId == null) {
-
 
7851
          TProtocolUtil.skip(iprot, field.type);
-
 
7852
        } else {
-
 
7853
          switch (fieldId) {
-
 
7854
            case USERNAME:
-
 
7855
              if (field.type == TType.STRING) {
-
 
7856
                this.username = iprot.readString();
-
 
7857
              } else { 
-
 
7858
                TProtocolUtil.skip(iprot, field.type);
-
 
7859
              }
-
 
7860
              break;
-
 
7861
            case PASSWORD:
-
 
7862
              if (field.type == TType.STRING) {
-
 
7863
                this.password = iprot.readString();
-
 
7864
              } else { 
-
 
7865
                TProtocolUtil.skip(iprot, field.type);
-
 
7866
              }
-
 
7867
              break;
-
 
7868
          }
-
 
7869
          iprot.readFieldEnd();
-
 
7870
        }
-
 
7871
      }
-
 
7872
      iprot.readStructEnd();
-
 
7873
      validate();
-
 
7874
    }
-
 
7875
 
-
 
7876
    public void write(TProtocol oprot) throws TException {
-
 
7877
      validate();
-
 
7878
 
-
 
7879
      oprot.writeStructBegin(STRUCT_DESC);
-
 
7880
      if (this.username != null) {
-
 
7881
        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
-
 
7882
        oprot.writeString(this.username);
-
 
7883
        oprot.writeFieldEnd();
-
 
7884
      }
-
 
7885
      if (this.password != null) {
-
 
7886
        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
-
 
7887
        oprot.writeString(this.password);
-
 
7888
        oprot.writeFieldEnd();
-
 
7889
      }
-
 
7890
      oprot.writeFieldStop();
-
 
7891
      oprot.writeStructEnd();
-
 
7892
    }
-
 
7893
 
-
 
7894
    @Override
-
 
7895
    public String toString() {
-
 
7896
      StringBuilder sb = new StringBuilder("authenticateLogisticsUser_args(");
-
 
7897
      boolean first = true;
-
 
7898
 
-
 
7899
      sb.append("username:");
-
 
7900
      if (this.username == null) {
-
 
7901
        sb.append("null");
-
 
7902
      } else {
-
 
7903
        sb.append(this.username);
-
 
7904
      }
-
 
7905
      first = false;
-
 
7906
      if (!first) sb.append(", ");
-
 
7907
      sb.append("password:");
-
 
7908
      if (this.password == null) {
-
 
7909
        sb.append("null");
-
 
7910
      } else {
-
 
7911
        sb.append(this.password);
-
 
7912
      }
-
 
7913
      first = false;
-
 
7914
      sb.append(")");
-
 
7915
      return sb.toString();
-
 
7916
    }
-
 
7917
 
-
 
7918
    public void validate() throws TException {
-
 
7919
      // check for required fields
-
 
7920
    }
-
 
7921
 
-
 
7922
  }
-
 
7923
 
-
 
7924
  public static class authenticateLogisticsUser_result implements TBase<authenticateLogisticsUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<authenticateLogisticsUser_result>   {
-
 
7925
    private static final TStruct STRUCT_DESC = new TStruct("authenticateLogisticsUser_result");
-
 
7926
 
-
 
7927
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
7928
    private static final TField HSE_FIELD_DESC = new TField("hse", TType.STRUCT, (short)1);
-
 
7929
 
-
 
7930
    private LogisticsUser success;
-
 
7931
    private HelperServiceException hse;
-
 
7932
 
-
 
7933
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
7934
    public enum _Fields implements TFieldIdEnum {
-
 
7935
      SUCCESS((short)0, "success"),
-
 
7936
      HSE((short)1, "hse");
-
 
7937
 
-
 
7938
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
7939
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
7940
 
-
 
7941
      static {
-
 
7942
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
7943
          byId.put((int)field._thriftId, field);
-
 
7944
          byName.put(field.getFieldName(), field);
-
 
7945
        }
-
 
7946
      }
-
 
7947
 
-
 
7948
      /**
-
 
7949
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
7950
       */
-
 
7951
      public static _Fields findByThriftId(int fieldId) {
-
 
7952
        return byId.get(fieldId);
-
 
7953
      }
-
 
7954
 
-
 
7955
      /**
-
 
7956
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
7957
       * if it is not found.
-
 
7958
       */
-
 
7959
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
7960
        _Fields fields = findByThriftId(fieldId);
-
 
7961
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
7962
        return fields;
-
 
7963
      }
-
 
7964
 
-
 
7965
      /**
-
 
7966
       * Find the _Fields constant that matches name, or null if its not found.
-
 
7967
       */
-
 
7968
      public static _Fields findByName(String name) {
-
 
7969
        return byName.get(name);
-
 
7970
      }
-
 
7971
 
-
 
7972
      private final short _thriftId;
-
 
7973
      private final String _fieldName;
-
 
7974
 
-
 
7975
      _Fields(short thriftId, String fieldName) {
-
 
7976
        _thriftId = thriftId;
-
 
7977
        _fieldName = fieldName;
-
 
7978
      }
-
 
7979
 
-
 
7980
      public short getThriftFieldId() {
-
 
7981
        return _thriftId;
-
 
7982
      }
-
 
7983
 
-
 
7984
      public String getFieldName() {
-
 
7985
        return _fieldName;
-
 
7986
      }
-
 
7987
    }
-
 
7988
 
-
 
7989
    // isset id assignments
-
 
7990
 
-
 
7991
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
7992
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
7993
          new StructMetaData(TType.STRUCT, LogisticsUser.class)));
-
 
7994
      put(_Fields.HSE, new FieldMetaData("hse", TFieldRequirementType.DEFAULT, 
-
 
7995
          new FieldValueMetaData(TType.STRUCT)));
-
 
7996
    }});
-
 
7997
 
-
 
7998
    static {
-
 
7999
      FieldMetaData.addStructMetaDataMap(authenticateLogisticsUser_result.class, metaDataMap);
-
 
8000
    }
-
 
8001
 
-
 
8002
    public authenticateLogisticsUser_result() {
-
 
8003
    }
-
 
8004
 
-
 
8005
    public authenticateLogisticsUser_result(
-
 
8006
      LogisticsUser success,
-
 
8007
      HelperServiceException hse)
-
 
8008
    {
-
 
8009
      this();
-
 
8010
      this.success = success;
-
 
8011
      this.hse = hse;
-
 
8012
    }
-
 
8013
 
-
 
8014
    /**
-
 
8015
     * Performs a deep copy on <i>other</i>.
-
 
8016
     */
-
 
8017
    public authenticateLogisticsUser_result(authenticateLogisticsUser_result other) {
-
 
8018
      if (other.isSetSuccess()) {
-
 
8019
        this.success = new LogisticsUser(other.success);
-
 
8020
      }
-
 
8021
      if (other.isSetHse()) {
-
 
8022
        this.hse = new HelperServiceException(other.hse);
-
 
8023
      }
-
 
8024
    }
-
 
8025
 
-
 
8026
    public authenticateLogisticsUser_result deepCopy() {
-
 
8027
      return new authenticateLogisticsUser_result(this);
-
 
8028
    }
-
 
8029
 
-
 
8030
    @Deprecated
-
 
8031
    public authenticateLogisticsUser_result clone() {
-
 
8032
      return new authenticateLogisticsUser_result(this);
-
 
8033
    }
-
 
8034
 
-
 
8035
    public LogisticsUser getSuccess() {
-
 
8036
      return this.success;
-
 
8037
    }
-
 
8038
 
-
 
8039
    public authenticateLogisticsUser_result setSuccess(LogisticsUser success) {
-
 
8040
      this.success = success;
-
 
8041
      return this;
-
 
8042
    }
-
 
8043
 
-
 
8044
    public void unsetSuccess() {
-
 
8045
      this.success = null;
-
 
8046
    }
-
 
8047
 
-
 
8048
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
8049
    public boolean isSetSuccess() {
-
 
8050
      return this.success != null;
-
 
8051
    }
-
 
8052
 
-
 
8053
    public void setSuccessIsSet(boolean value) {
-
 
8054
      if (!value) {
-
 
8055
        this.success = null;
-
 
8056
      }
-
 
8057
    }
-
 
8058
 
-
 
8059
    public HelperServiceException getHse() {
-
 
8060
      return this.hse;
-
 
8061
    }
-
 
8062
 
-
 
8063
    public authenticateLogisticsUser_result setHse(HelperServiceException hse) {
-
 
8064
      this.hse = hse;
-
 
8065
      return this;
-
 
8066
    }
-
 
8067
 
-
 
8068
    public void unsetHse() {
-
 
8069
      this.hse = null;
-
 
8070
    }
-
 
8071
 
-
 
8072
    /** Returns true if field hse is set (has been asigned a value) and false otherwise */
-
 
8073
    public boolean isSetHse() {
-
 
8074
      return this.hse != null;
-
 
8075
    }
-
 
8076
 
-
 
8077
    public void setHseIsSet(boolean value) {
-
 
8078
      if (!value) {
-
 
8079
        this.hse = null;
-
 
8080
      }
-
 
8081
    }
-
 
8082
 
-
 
8083
    public void setFieldValue(_Fields field, Object value) {
-
 
8084
      switch (field) {
-
 
8085
      case SUCCESS:
-
 
8086
        if (value == null) {
-
 
8087
          unsetSuccess();
-
 
8088
        } else {
-
 
8089
          setSuccess((LogisticsUser)value);
-
 
8090
        }
-
 
8091
        break;
-
 
8092
 
-
 
8093
      case HSE:
-
 
8094
        if (value == null) {
-
 
8095
          unsetHse();
-
 
8096
        } else {
-
 
8097
          setHse((HelperServiceException)value);
-
 
8098
        }
-
 
8099
        break;
-
 
8100
 
-
 
8101
      }
-
 
8102
    }
-
 
8103
 
-
 
8104
    public void setFieldValue(int fieldID, Object value) {
-
 
8105
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
8106
    }
-
 
8107
 
-
 
8108
    public Object getFieldValue(_Fields field) {
-
 
8109
      switch (field) {
-
 
8110
      case SUCCESS:
-
 
8111
        return getSuccess();
-
 
8112
 
-
 
8113
      case HSE:
-
 
8114
        return getHse();
-
 
8115
 
-
 
8116
      }
-
 
8117
      throw new IllegalStateException();
-
 
8118
    }
-
 
8119
 
-
 
8120
    public Object getFieldValue(int fieldId) {
-
 
8121
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
8122
    }
-
 
8123
 
-
 
8124
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
8125
    public boolean isSet(_Fields field) {
-
 
8126
      switch (field) {
-
 
8127
      case SUCCESS:
-
 
8128
        return isSetSuccess();
-
 
8129
      case HSE:
-
 
8130
        return isSetHse();
-
 
8131
      }
-
 
8132
      throw new IllegalStateException();
-
 
8133
    }
-
 
8134
 
-
 
8135
    public boolean isSet(int fieldID) {
-
 
8136
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
8137
    }
-
 
8138
 
-
 
8139
    @Override
-
 
8140
    public boolean equals(Object that) {
-
 
8141
      if (that == null)
-
 
8142
        return false;
-
 
8143
      if (that instanceof authenticateLogisticsUser_result)
-
 
8144
        return this.equals((authenticateLogisticsUser_result)that);
-
 
8145
      return false;
-
 
8146
    }
-
 
8147
 
-
 
8148
    public boolean equals(authenticateLogisticsUser_result that) {
-
 
8149
      if (that == null)
-
 
8150
        return false;
-
 
8151
 
-
 
8152
      boolean this_present_success = true && this.isSetSuccess();
-
 
8153
      boolean that_present_success = true && that.isSetSuccess();
-
 
8154
      if (this_present_success || that_present_success) {
-
 
8155
        if (!(this_present_success && that_present_success))
-
 
8156
          return false;
-
 
8157
        if (!this.success.equals(that.success))
-
 
8158
          return false;
-
 
8159
      }
-
 
8160
 
-
 
8161
      boolean this_present_hse = true && this.isSetHse();
-
 
8162
      boolean that_present_hse = true && that.isSetHse();
-
 
8163
      if (this_present_hse || that_present_hse) {
-
 
8164
        if (!(this_present_hse && that_present_hse))
-
 
8165
          return false;
-
 
8166
        if (!this.hse.equals(that.hse))
-
 
8167
          return false;
-
 
8168
      }
-
 
8169
 
-
 
8170
      return true;
-
 
8171
    }
-
 
8172
 
-
 
8173
    @Override
-
 
8174
    public int hashCode() {
-
 
8175
      return 0;
-
 
8176
    }
-
 
8177
 
-
 
8178
    public int compareTo(authenticateLogisticsUser_result other) {
-
 
8179
      if (!getClass().equals(other.getClass())) {
-
 
8180
        return getClass().getName().compareTo(other.getClass().getName());
-
 
8181
      }
-
 
8182
 
-
 
8183
      int lastComparison = 0;
-
 
8184
      authenticateLogisticsUser_result typedOther = (authenticateLogisticsUser_result)other;
-
 
8185
 
-
 
8186
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
8187
      if (lastComparison != 0) {
-
 
8188
        return lastComparison;
-
 
8189
      }
-
 
8190
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
8191
      if (lastComparison != 0) {
-
 
8192
        return lastComparison;
-
 
8193
      }
-
 
8194
      lastComparison = Boolean.valueOf(isSetHse()).compareTo(isSetHse());
-
 
8195
      if (lastComparison != 0) {
-
 
8196
        return lastComparison;
-
 
8197
      }
-
 
8198
      lastComparison = TBaseHelper.compareTo(hse, typedOther.hse);
-
 
8199
      if (lastComparison != 0) {
-
 
8200
        return lastComparison;
-
 
8201
      }
-
 
8202
      return 0;
-
 
8203
    }
-
 
8204
 
-
 
8205
    public void read(TProtocol iprot) throws TException {
-
 
8206
      TField field;
-
 
8207
      iprot.readStructBegin();
-
 
8208
      while (true)
-
 
8209
      {
-
 
8210
        field = iprot.readFieldBegin();
-
 
8211
        if (field.type == TType.STOP) { 
-
 
8212
          break;
-
 
8213
        }
-
 
8214
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
8215
        if (fieldId == null) {
-
 
8216
          TProtocolUtil.skip(iprot, field.type);
-
 
8217
        } else {
-
 
8218
          switch (fieldId) {
-
 
8219
            case SUCCESS:
-
 
8220
              if (field.type == TType.STRUCT) {
-
 
8221
                this.success = new LogisticsUser();
-
 
8222
                this.success.read(iprot);
-
 
8223
              } else { 
-
 
8224
                TProtocolUtil.skip(iprot, field.type);
-
 
8225
              }
-
 
8226
              break;
-
 
8227
            case HSE:
-
 
8228
              if (field.type == TType.STRUCT) {
-
 
8229
                this.hse = new HelperServiceException();
-
 
8230
                this.hse.read(iprot);
-
 
8231
              } else { 
-
 
8232
                TProtocolUtil.skip(iprot, field.type);
-
 
8233
              }
-
 
8234
              break;
-
 
8235
          }
-
 
8236
          iprot.readFieldEnd();
-
 
8237
        }
-
 
8238
      }
-
 
8239
      iprot.readStructEnd();
-
 
8240
      validate();
-
 
8241
    }
-
 
8242
 
-
 
8243
    public void write(TProtocol oprot) throws TException {
-
 
8244
      oprot.writeStructBegin(STRUCT_DESC);
-
 
8245
 
-
 
8246
      if (this.isSetSuccess()) {
-
 
8247
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
8248
        this.success.write(oprot);
-
 
8249
        oprot.writeFieldEnd();
-
 
8250
      } else if (this.isSetHse()) {
-
 
8251
        oprot.writeFieldBegin(HSE_FIELD_DESC);
-
 
8252
        this.hse.write(oprot);
-
 
8253
        oprot.writeFieldEnd();
-
 
8254
      }
-
 
8255
      oprot.writeFieldStop();
-
 
8256
      oprot.writeStructEnd();
-
 
8257
    }
-
 
8258
 
-
 
8259
    @Override
-
 
8260
    public String toString() {
-
 
8261
      StringBuilder sb = new StringBuilder("authenticateLogisticsUser_result(");
-
 
8262
      boolean first = true;
-
 
8263
 
-
 
8264
      sb.append("success:");
-
 
8265
      if (this.success == null) {
-
 
8266
        sb.append("null");
-
 
8267
      } else {
-
 
8268
        sb.append(this.success);
-
 
8269
      }
-
 
8270
      first = false;
-
 
8271
      if (!first) sb.append(", ");
-
 
8272
      sb.append("hse:");
-
 
8273
      if (this.hse == null) {
-
 
8274
        sb.append("null");
-
 
8275
      } else {
-
 
8276
        sb.append(this.hse);
-
 
8277
      }
-
 
8278
      first = false;
-
 
8279
      sb.append(")");
-
 
8280
      return sb.toString();
-
 
8281
    }
7469
 
8282
 
7470
    public void validate() throws TException {
8283
    public void validate() throws TException {
7471
      // check for required fields
8284
      // check for required fields
7472
    }
8285
    }
7473
 
8286