Subversion Repositories SmartDukaan

Rev

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

Rev 784 Rev 896
Line 61... Line 61...
61
 
61
 
62
    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException;
62
    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException;
63
 
63
 
64
    public boolean updatePassword(long userid, String oldPassword, String newPassword) throws UserContextException, TException;
64
    public boolean updatePassword(long userid, String oldPassword, String newPassword) throws UserContextException, TException;
65
 
65
 
66
    public boolean forgotPassword(String email) throws UserContextException, TException;
66
    public boolean forgotPassword(String email, String newPassword) throws UserContextException, TException;
67
 
67
 
68
    public List<Address> getAllAddressesForUser(long userId) throws UserContextException, TException;
68
    public List<Address> getAllAddressesForUser(long userId) throws UserContextException, TException;
69
 
69
 
70
    public long getDefaultAddressId(long userId) throws UserContextException, TException;
70
    public long getDefaultAddressId(long userId) throws UserContextException, TException;
71
 
71
 
Line 723... Line 723...
723
        throw result.ucx;
723
        throw result.ucx;
724
      }
724
      }
725
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
725
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "updatePassword failed: unknown result");
726
    }
726
    }
727
 
727
 
728
    public boolean forgotPassword(String email) throws UserContextException, TException
728
    public boolean forgotPassword(String email, String newPassword) throws UserContextException, TException
729
    {
729
    {
730
      send_forgotPassword(email);
730
      send_forgotPassword(email, newPassword);
731
      return recv_forgotPassword();
731
      return recv_forgotPassword();
732
    }
732
    }
733
 
733
 
734
    public void send_forgotPassword(String email) throws TException
734
    public void send_forgotPassword(String email, String newPassword) throws TException
735
    {
735
    {
736
      oprot_.writeMessageBegin(new TMessage("forgotPassword", TMessageType.CALL, seqid_));
736
      oprot_.writeMessageBegin(new TMessage("forgotPassword", TMessageType.CALL, seqid_));
737
      forgotPassword_args args = new forgotPassword_args();
737
      forgotPassword_args args = new forgotPassword_args();
738
      args.email = email;
738
      args.email = email;
-
 
739
      args.newPassword = newPassword;
739
      args.write(oprot_);
740
      args.write(oprot_);
740
      oprot_.writeMessageEnd();
741
      oprot_.writeMessageEnd();
741
      oprot_.getTransport().flush();
742
      oprot_.getTransport().flush();
742
    }
743
    }
743
 
744
 
Line 2173... Line 2174...
2173
        forgotPassword_args args = new forgotPassword_args();
2174
        forgotPassword_args args = new forgotPassword_args();
2174
        args.read(iprot);
2175
        args.read(iprot);
2175
        iprot.readMessageEnd();
2176
        iprot.readMessageEnd();
2176
        forgotPassword_result result = new forgotPassword_result();
2177
        forgotPassword_result result = new forgotPassword_result();
2177
        try {
2178
        try {
2178
          result.success = iface_.forgotPassword(args.email);
2179
          result.success = iface_.forgotPassword(args.email, args.newPassword);
2179
          result.setSuccessIsSet(true);
2180
          result.setSuccessIsSet(true);
2180
        } catch (UserContextException ucx) {
2181
        } catch (UserContextException ucx) {
2181
          result.ucx = ucx;
2182
          result.ucx = ucx;
2182
        } catch (Throwable th) {
2183
        } catch (Throwable th) {
2183
          LOGGER.error("Internal error processing forgotPassword", th);
2184
          LOGGER.error("Internal error processing forgotPassword", th);
Line 13010... Line 13011...
13010
 
13011
 
13011
  public static class forgotPassword_args implements TBase<forgotPassword_args._Fields>, java.io.Serializable, Cloneable, Comparable<forgotPassword_args>   {
13012
  public static class forgotPassword_args implements TBase<forgotPassword_args._Fields>, java.io.Serializable, Cloneable, Comparable<forgotPassword_args>   {
13012
    private static final TStruct STRUCT_DESC = new TStruct("forgotPassword_args");
13013
    private static final TStruct STRUCT_DESC = new TStruct("forgotPassword_args");
13013
 
13014
 
13014
    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
13015
    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
-
 
13016
    private static final TField NEW_PASSWORD_FIELD_DESC = new TField("newPassword", TType.STRING, (short)2);
13015
 
13017
 
13016
    private String email;
13018
    private String email;
-
 
13019
    private String newPassword;
13017
 
13020
 
13018
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13021
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13019
    public enum _Fields implements TFieldIdEnum {
13022
    public enum _Fields implements TFieldIdEnum {
13020
      EMAIL((short)1, "email");
13023
      EMAIL((short)1, "email"),
-
 
13024
      NEW_PASSWORD((short)2, "newPassword");
13021
 
13025
 
13022
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13026
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
13023
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13027
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13024
 
13028
 
13025
      static {
13029
      static {
Line 13073... Line 13077...
13073
    // isset id assignments
13077
    // isset id assignments
13074
 
13078
 
13075
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
13079
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
13076
      put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
13080
      put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
13077
          new FieldValueMetaData(TType.STRING)));
13081
          new FieldValueMetaData(TType.STRING)));
-
 
13082
      put(_Fields.NEW_PASSWORD, new FieldMetaData("newPassword", TFieldRequirementType.DEFAULT, 
-
 
13083
          new FieldValueMetaData(TType.STRING)));
13078
    }});
13084
    }});
13079
 
13085
 
13080
    static {
13086
    static {
13081
      FieldMetaData.addStructMetaDataMap(forgotPassword_args.class, metaDataMap);
13087
      FieldMetaData.addStructMetaDataMap(forgotPassword_args.class, metaDataMap);
13082
    }
13088
    }
13083
 
13089
 
13084
    public forgotPassword_args() {
13090
    public forgotPassword_args() {
13085
    }
13091
    }
13086
 
13092
 
13087
    public forgotPassword_args(
13093
    public forgotPassword_args(
13088
      String email)
13094
      String email,
-
 
13095
      String newPassword)
13089
    {
13096
    {
13090
      this();
13097
      this();
13091
      this.email = email;
13098
      this.email = email;
-
 
13099
      this.newPassword = newPassword;
13092
    }
13100
    }
13093
 
13101
 
13094
    /**
13102
    /**
13095
     * Performs a deep copy on <i>other</i>.
13103
     * Performs a deep copy on <i>other</i>.
13096
     */
13104
     */
13097
    public forgotPassword_args(forgotPassword_args other) {
13105
    public forgotPassword_args(forgotPassword_args other) {
13098
      if (other.isSetEmail()) {
13106
      if (other.isSetEmail()) {
13099
        this.email = other.email;
13107
        this.email = other.email;
13100
      }
13108
      }
-
 
13109
      if (other.isSetNewPassword()) {
-
 
13110
        this.newPassword = other.newPassword;
-
 
13111
      }
13101
    }
13112
    }
13102
 
13113
 
13103
    public forgotPassword_args deepCopy() {
13114
    public forgotPassword_args deepCopy() {
13104
      return new forgotPassword_args(this);
13115
      return new forgotPassword_args(this);
13105
    }
13116
    }
Line 13131... Line 13142...
13131
      if (!value) {
13142
      if (!value) {
13132
        this.email = null;
13143
        this.email = null;
13133
      }
13144
      }
13134
    }
13145
    }
13135
 
13146
 
-
 
13147
    public String getNewPassword() {
-
 
13148
      return this.newPassword;
-
 
13149
    }
-
 
13150
 
-
 
13151
    public forgotPassword_args setNewPassword(String newPassword) {
-
 
13152
      this.newPassword = newPassword;
-
 
13153
      return this;
-
 
13154
    }
-
 
13155
 
-
 
13156
    public void unsetNewPassword() {
-
 
13157
      this.newPassword = null;
-
 
13158
    }
-
 
13159
 
-
 
13160
    /** Returns true if field newPassword is set (has been asigned a value) and false otherwise */
-
 
13161
    public boolean isSetNewPassword() {
-
 
13162
      return this.newPassword != null;
-
 
13163
    }
-
 
13164
 
-
 
13165
    public void setNewPasswordIsSet(boolean value) {
-
 
13166
      if (!value) {
-
 
13167
        this.newPassword = null;
-
 
13168
      }
-
 
13169
    }
-
 
13170
 
13136
    public void setFieldValue(_Fields field, Object value) {
13171
    public void setFieldValue(_Fields field, Object value) {
13137
      switch (field) {
13172
      switch (field) {
13138
      case EMAIL:
13173
      case EMAIL:
13139
        if (value == null) {
13174
        if (value == null) {
13140
          unsetEmail();
13175
          unsetEmail();
13141
        } else {
13176
        } else {
13142
          setEmail((String)value);
13177
          setEmail((String)value);
13143
        }
13178
        }
13144
        break;
13179
        break;
13145
 
13180
 
-
 
13181
      case NEW_PASSWORD:
-
 
13182
        if (value == null) {
-
 
13183
          unsetNewPassword();
-
 
13184
        } else {
-
 
13185
          setNewPassword((String)value);
-
 
13186
        }
-
 
13187
        break;
-
 
13188
 
13146
      }
13189
      }
13147
    }
13190
    }
13148
 
13191
 
13149
    public void setFieldValue(int fieldID, Object value) {
13192
    public void setFieldValue(int fieldID, Object value) {
13150
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
13193
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 13153... Line 13196...
13153
    public Object getFieldValue(_Fields field) {
13196
    public Object getFieldValue(_Fields field) {
13154
      switch (field) {
13197
      switch (field) {
13155
      case EMAIL:
13198
      case EMAIL:
13156
        return getEmail();
13199
        return getEmail();
13157
 
13200
 
-
 
13201
      case NEW_PASSWORD:
-
 
13202
        return getNewPassword();
-
 
13203
 
13158
      }
13204
      }
13159
      throw new IllegalStateException();
13205
      throw new IllegalStateException();
13160
    }
13206
    }
13161
 
13207
 
13162
    public Object getFieldValue(int fieldId) {
13208
    public Object getFieldValue(int fieldId) {
Line 13166... Line 13212...
13166
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
13212
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
13167
    public boolean isSet(_Fields field) {
13213
    public boolean isSet(_Fields field) {
13168
      switch (field) {
13214
      switch (field) {
13169
      case EMAIL:
13215
      case EMAIL:
13170
        return isSetEmail();
13216
        return isSetEmail();
-
 
13217
      case NEW_PASSWORD:
-
 
13218
        return isSetNewPassword();
13171
      }
13219
      }
13172
      throw new IllegalStateException();
13220
      throw new IllegalStateException();
13173
    }
13221
    }
13174
 
13222
 
13175
    public boolean isSet(int fieldID) {
13223
    public boolean isSet(int fieldID) {
Line 13196... Line 13244...
13196
          return false;
13244
          return false;
13197
        if (!this.email.equals(that.email))
13245
        if (!this.email.equals(that.email))
13198
          return false;
13246
          return false;
13199
      }
13247
      }
13200
 
13248
 
-
 
13249
      boolean this_present_newPassword = true && this.isSetNewPassword();
-
 
13250
      boolean that_present_newPassword = true && that.isSetNewPassword();
-
 
13251
      if (this_present_newPassword || that_present_newPassword) {
-
 
13252
        if (!(this_present_newPassword && that_present_newPassword))
-
 
13253
          return false;
-
 
13254
        if (!this.newPassword.equals(that.newPassword))
-
 
13255
          return false;
-
 
13256
      }
-
 
13257
 
13201
      return true;
13258
      return true;
13202
    }
13259
    }
13203
 
13260
 
13204
    @Override
13261
    @Override
13205
    public int hashCode() {
13262
    public int hashCode() {
Line 13220... Line 13277...
13220
      }
13277
      }
13221
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
13278
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
13222
      if (lastComparison != 0) {
13279
      if (lastComparison != 0) {
13223
        return lastComparison;
13280
        return lastComparison;
13224
      }
13281
      }
-
 
13282
      lastComparison = Boolean.valueOf(isSetNewPassword()).compareTo(isSetNewPassword());
-
 
13283
      if (lastComparison != 0) {
-
 
13284
        return lastComparison;
-
 
13285
      }
-
 
13286
      lastComparison = TBaseHelper.compareTo(newPassword, typedOther.newPassword);
-
 
13287
      if (lastComparison != 0) {
-
 
13288
        return lastComparison;
-
 
13289
      }
13225
      return 0;
13290
      return 0;
13226
    }
13291
    }
13227
 
13292
 
13228
    public void read(TProtocol iprot) throws TException {
13293
    public void read(TProtocol iprot) throws TException {
13229
      TField field;
13294
      TField field;
Line 13244... Line 13309...
13244
                this.email = iprot.readString();
13309
                this.email = iprot.readString();
13245
              } else { 
13310
              } else { 
13246
                TProtocolUtil.skip(iprot, field.type);
13311
                TProtocolUtil.skip(iprot, field.type);
13247
              }
13312
              }
13248
              break;
13313
              break;
-
 
13314
            case NEW_PASSWORD:
-
 
13315
              if (field.type == TType.STRING) {
-
 
13316
                this.newPassword = iprot.readString();
-
 
13317
              } else { 
-
 
13318
                TProtocolUtil.skip(iprot, field.type);
-
 
13319
              }
-
 
13320
              break;
13249
          }
13321
          }
13250
          iprot.readFieldEnd();
13322
          iprot.readFieldEnd();
13251
        }
13323
        }
13252
      }
13324
      }
13253
      iprot.readStructEnd();
13325
      iprot.readStructEnd();
Line 13261... Line 13333...
13261
      if (this.email != null) {
13333
      if (this.email != null) {
13262
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
13334
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
13263
        oprot.writeString(this.email);
13335
        oprot.writeString(this.email);
13264
        oprot.writeFieldEnd();
13336
        oprot.writeFieldEnd();
13265
      }
13337
      }
-
 
13338
      if (this.newPassword != null) {
-
 
13339
        oprot.writeFieldBegin(NEW_PASSWORD_FIELD_DESC);
-
 
13340
        oprot.writeString(this.newPassword);
-
 
13341
        oprot.writeFieldEnd();
-
 
13342
      }
13266
      oprot.writeFieldStop();
13343
      oprot.writeFieldStop();
13267
      oprot.writeStructEnd();
13344
      oprot.writeStructEnd();
13268
    }
13345
    }
13269
 
13346
 
13270
    @Override
13347
    @Override
Line 13277... Line 13354...
13277
        sb.append("null");
13354
        sb.append("null");
13278
      } else {
13355
      } else {
13279
        sb.append(this.email);
13356
        sb.append(this.email);
13280
      }
13357
      }
13281
      first = false;
13358
      first = false;
-
 
13359
      if (!first) sb.append(", ");
-
 
13360
      sb.append("newPassword:");
-
 
13361
      if (this.newPassword == null) {
-
 
13362
        sb.append("null");
-
 
13363
      } else {
-
 
13364
        sb.append(this.newPassword);
-
 
13365
      }
-
 
13366
      first = false;
13282
      sb.append(")");
13367
      sb.append(")");
13283
      return sb.toString();
13368
      return sb.toString();
13284
    }
13369
    }
13285
 
13370
 
13286
    public void validate() throws TException {
13371
    public void validate() throws TException {