Subversion Repositories SmartDukaan

Rev

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

Rev 2779 Rev 3086
Line 44... Line 44...
44
     */
44
     */
45
    public void saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws HelperServiceException, TException;
45
    public void saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws HelperServiceException, TException;
46
 
46
 
47
    /**
47
    /**
48
     * Retreives all the emails pending for dispatch
48
     * Retreives all the emails pending for dispatch
49
     * 
-
 
50
     * @param emailType
-
 
51
     */
49
     */
52
    public List<UserEmail> getEmailsToBeSent(String emailType) throws HelperServiceException, TException;
50
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException;
53
 
51
 
54
    /**
52
    /**
55
     * Marks email as sent after successful dispatch
53
     * Marks email as sent after successful dispatch
56
     * 
54
     * 
57
     * @param emailId
55
     * @param emailId
Line 230... Line 228...
230
        throw result.se;
228
        throw result.se;
231
      }
229
      }
232
      return;
230
      return;
233
    }
231
    }
234
 
232
 
235
    public List<UserEmail> getEmailsToBeSent(String emailType) throws HelperServiceException, TException
233
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException
236
    {
234
    {
237
      send_getEmailsToBeSent(emailType);
235
      send_getEmailsToBeSent();
238
      return recv_getEmailsToBeSent();
236
      return recv_getEmailsToBeSent();
239
    }
237
    }
240
 
238
 
241
    public void send_getEmailsToBeSent(String emailType) throws TException
239
    public void send_getEmailsToBeSent() throws TException
242
    {
240
    {
243
      oprot_.writeMessageBegin(new TMessage("getEmailsToBeSent", TMessageType.CALL, seqid_));
241
      oprot_.writeMessageBegin(new TMessage("getEmailsToBeSent", TMessageType.CALL, seqid_));
244
      getEmailsToBeSent_args args = new getEmailsToBeSent_args();
242
      getEmailsToBeSent_args args = new getEmailsToBeSent_args();
245
      args.emailType = emailType;
-
 
246
      args.write(oprot_);
243
      args.write(oprot_);
247
      oprot_.writeMessageEnd();
244
      oprot_.writeMessageEnd();
248
      oprot_.getTransport().flush();
245
      oprot_.getTransport().flush();
249
    }
246
    }
250
 
247
 
Line 940... Line 937...
940
        getEmailsToBeSent_args args = new getEmailsToBeSent_args();
937
        getEmailsToBeSent_args args = new getEmailsToBeSent_args();
941
        args.read(iprot);
938
        args.read(iprot);
942
        iprot.readMessageEnd();
939
        iprot.readMessageEnd();
943
        getEmailsToBeSent_result result = new getEmailsToBeSent_result();
940
        getEmailsToBeSent_result result = new getEmailsToBeSent_result();
944
        try {
941
        try {
945
          result.success = iface_.getEmailsToBeSent(args.emailType);
942
          result.success = iface_.getEmailsToBeSent();
946
        } catch (HelperServiceException se) {
943
        } catch (HelperServiceException se) {
947
          result.se = se;
944
          result.se = se;
948
        } catch (Throwable th) {
945
        } catch (Throwable th) {
949
          LOGGER.error("Internal error processing getEmailsToBeSent", th);
946
          LOGGER.error("Internal error processing getEmailsToBeSent", th);
950
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getEmailsToBeSent");
947
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getEmailsToBeSent");
Line 2767... Line 2764...
2767
  }
2764
  }
2768
 
2765
 
2769
  public static class getEmailsToBeSent_args implements TBase<getEmailsToBeSent_args._Fields>, java.io.Serializable, Cloneable, Comparable<getEmailsToBeSent_args>   {
2766
  public static class getEmailsToBeSent_args implements TBase<getEmailsToBeSent_args._Fields>, java.io.Serializable, Cloneable, Comparable<getEmailsToBeSent_args>   {
2770
    private static final TStruct STRUCT_DESC = new TStruct("getEmailsToBeSent_args");
2767
    private static final TStruct STRUCT_DESC = new TStruct("getEmailsToBeSent_args");
2771
 
2768
 
2772
    private static final TField EMAIL_TYPE_FIELD_DESC = new TField("emailType", TType.STRING, (short)1);
-
 
2773
 
2769
 
2774
    private String emailType;
-
 
2775
 
2770
 
2776
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2771
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2777
    public enum _Fields implements TFieldIdEnum {
2772
    public enum _Fields implements TFieldIdEnum {
2778
      EMAIL_TYPE((short)1, "emailType");
-
 
-
 
2773
;
2779
 
2774
 
2780
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2775
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2781
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2776
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2782
 
2777
 
2783
      static {
2778
      static {
Line 2825... Line 2820...
2825
 
2820
 
2826
      public String getFieldName() {
2821
      public String getFieldName() {
2827
        return _fieldName;
2822
        return _fieldName;
2828
      }
2823
      }
2829
    }
2824
    }
2830
 
-
 
2831
    // isset id assignments
-
 
2832
 
-
 
2833
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2825
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2834
      put(_Fields.EMAIL_TYPE, new FieldMetaData("emailType", TFieldRequirementType.DEFAULT, 
-
 
2835
          new FieldValueMetaData(TType.STRING)));
-
 
2836
    }});
2826
    }});
2837
 
2827
 
2838
    static {
2828
    static {
2839
      FieldMetaData.addStructMetaDataMap(getEmailsToBeSent_args.class, metaDataMap);
2829
      FieldMetaData.addStructMetaDataMap(getEmailsToBeSent_args.class, metaDataMap);
2840
    }
2830
    }
2841
 
2831
 
2842
    public getEmailsToBeSent_args() {
2832
    public getEmailsToBeSent_args() {
2843
    }
2833
    }
2844
 
2834
 
2845
    public getEmailsToBeSent_args(
-
 
2846
      String emailType)
-
 
2847
    {
-
 
2848
      this();
-
 
2849
      this.emailType = emailType;
-
 
2850
    }
-
 
2851
 
-
 
2852
    /**
2835
    /**
2853
     * Performs a deep copy on <i>other</i>.
2836
     * Performs a deep copy on <i>other</i>.
2854
     */
2837
     */
2855
    public getEmailsToBeSent_args(getEmailsToBeSent_args other) {
2838
    public getEmailsToBeSent_args(getEmailsToBeSent_args other) {
2856
      if (other.isSetEmailType()) {
-
 
2857
        this.emailType = other.emailType;
-
 
2858
      }
-
 
2859
    }
2839
    }
2860
 
2840
 
2861
    public getEmailsToBeSent_args deepCopy() {
2841
    public getEmailsToBeSent_args deepCopy() {
2862
      return new getEmailsToBeSent_args(this);
2842
      return new getEmailsToBeSent_args(this);
2863
    }
2843
    }
Line 2865... Line 2845...
2865
    @Deprecated
2845
    @Deprecated
2866
    public getEmailsToBeSent_args clone() {
2846
    public getEmailsToBeSent_args clone() {
2867
      return new getEmailsToBeSent_args(this);
2847
      return new getEmailsToBeSent_args(this);
2868
    }
2848
    }
2869
 
2849
 
2870
    public String getEmailType() {
-
 
2871
      return this.emailType;
-
 
2872
    }
-
 
2873
 
-
 
2874
    public getEmailsToBeSent_args setEmailType(String emailType) {
-
 
2875
      this.emailType = emailType;
-
 
2876
      return this;
-
 
2877
    }
-
 
2878
 
-
 
2879
    public void unsetEmailType() {
-
 
2880
      this.emailType = null;
-
 
2881
    }
-
 
2882
 
-
 
2883
    /** Returns true if field emailType is set (has been asigned a value) and false otherwise */
-
 
2884
    public boolean isSetEmailType() {
-
 
2885
      return this.emailType != null;
-
 
2886
    }
-
 
2887
 
-
 
2888
    public void setEmailTypeIsSet(boolean value) {
-
 
2889
      if (!value) {
-
 
2890
        this.emailType = null;
-
 
2891
      }
-
 
2892
    }
-
 
2893
 
-
 
2894
    public void setFieldValue(_Fields field, Object value) {
2850
    public void setFieldValue(_Fields field, Object value) {
2895
      switch (field) {
2851
      switch (field) {
2896
      case EMAIL_TYPE:
-
 
2897
        if (value == null) {
-
 
2898
          unsetEmailType();
-
 
2899
        } else {
-
 
2900
          setEmailType((String)value);
-
 
2901
        }
-
 
2902
        break;
-
 
2903
 
-
 
2904
      }
2852
      }
2905
    }
2853
    }
2906
 
2854
 
2907
    public void setFieldValue(int fieldID, Object value) {
2855
    public void setFieldValue(int fieldID, Object value) {
2908
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2856
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2909
    }
2857
    }
2910
 
2858
 
2911
    public Object getFieldValue(_Fields field) {
2859
    public Object getFieldValue(_Fields field) {
2912
      switch (field) {
2860
      switch (field) {
2913
      case EMAIL_TYPE:
-
 
2914
        return getEmailType();
-
 
2915
 
-
 
2916
      }
2861
      }
2917
      throw new IllegalStateException();
2862
      throw new IllegalStateException();
2918
    }
2863
    }
2919
 
2864
 
2920
    public Object getFieldValue(int fieldId) {
2865
    public Object getFieldValue(int fieldId) {
Line 2922... Line 2867...
2922
    }
2867
    }
2923
 
2868
 
2924
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2869
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2925
    public boolean isSet(_Fields field) {
2870
    public boolean isSet(_Fields field) {
2926
      switch (field) {
2871
      switch (field) {
2927
      case EMAIL_TYPE:
-
 
2928
        return isSetEmailType();
-
 
2929
      }
2872
      }
2930
      throw new IllegalStateException();
2873
      throw new IllegalStateException();
2931
    }
2874
    }
2932
 
2875
 
2933
    public boolean isSet(int fieldID) {
2876
    public boolean isSet(int fieldID) {
Line 2945... Line 2888...
2945
 
2888
 
2946
    public boolean equals(getEmailsToBeSent_args that) {
2889
    public boolean equals(getEmailsToBeSent_args that) {
2947
      if (that == null)
2890
      if (that == null)
2948
        return false;
2891
        return false;
2949
 
2892
 
2950
      boolean this_present_emailType = true && this.isSetEmailType();
-
 
2951
      boolean that_present_emailType = true && that.isSetEmailType();
-
 
2952
      if (this_present_emailType || that_present_emailType) {
-
 
2953
        if (!(this_present_emailType && that_present_emailType))
-
 
2954
          return false;
-
 
2955
        if (!this.emailType.equals(that.emailType))
-
 
2956
          return false;
-
 
2957
      }
-
 
2958
 
-
 
2959
      return true;
2893
      return true;
2960
    }
2894
    }
2961
 
2895
 
2962
    @Override
2896
    @Override
2963
    public int hashCode() {
2897
    public int hashCode() {
Line 2970... Line 2904...
2970
      }
2904
      }
2971
 
2905
 
2972
      int lastComparison = 0;
2906
      int lastComparison = 0;
2973
      getEmailsToBeSent_args typedOther = (getEmailsToBeSent_args)other;
2907
      getEmailsToBeSent_args typedOther = (getEmailsToBeSent_args)other;
2974
 
2908
 
2975
      lastComparison = Boolean.valueOf(isSetEmailType()).compareTo(isSetEmailType());
-
 
2976
      if (lastComparison != 0) {
-
 
2977
        return lastComparison;
-
 
2978
      }
-
 
2979
      lastComparison = TBaseHelper.compareTo(emailType, typedOther.emailType);
-
 
2980
      if (lastComparison != 0) {
-
 
2981
        return lastComparison;
-
 
2982
      }
-
 
2983
      return 0;
2909
      return 0;
2984
    }
2910
    }
2985
 
2911
 
2986
    public void read(TProtocol iprot) throws TException {
2912
    public void read(TProtocol iprot) throws TException {
2987
      TField field;
2913
      TField field;
Line 2995... Line 2921...
2995
        _Fields fieldId = _Fields.findByThriftId(field.id);
2921
        _Fields fieldId = _Fields.findByThriftId(field.id);
2996
        if (fieldId == null) {
2922
        if (fieldId == null) {
2997
          TProtocolUtil.skip(iprot, field.type);
2923
          TProtocolUtil.skip(iprot, field.type);
2998
        } else {
2924
        } else {
2999
          switch (fieldId) {
2925
          switch (fieldId) {
3000
            case EMAIL_TYPE:
-
 
3001
              if (field.type == TType.STRING) {
-
 
3002
                this.emailType = iprot.readString();
-
 
3003
              } else { 
-
 
3004
                TProtocolUtil.skip(iprot, field.type);
-
 
3005
              }
-
 
3006
              break;
-
 
3007
          }
2926
          }
3008
          iprot.readFieldEnd();
2927
          iprot.readFieldEnd();
3009
        }
2928
        }
3010
      }
2929
      }
3011
      iprot.readStructEnd();
2930
      iprot.readStructEnd();
Line 3014... Line 2933...
3014
 
2933
 
3015
    public void write(TProtocol oprot) throws TException {
2934
    public void write(TProtocol oprot) throws TException {
3016
      validate();
2935
      validate();
3017
 
2936
 
3018
      oprot.writeStructBegin(STRUCT_DESC);
2937
      oprot.writeStructBegin(STRUCT_DESC);
3019
      if (this.emailType != null) {
-
 
3020
        oprot.writeFieldBegin(EMAIL_TYPE_FIELD_DESC);
-
 
3021
        oprot.writeString(this.emailType);
-
 
3022
        oprot.writeFieldEnd();
-
 
3023
      }
-
 
3024
      oprot.writeFieldStop();
2938
      oprot.writeFieldStop();
3025
      oprot.writeStructEnd();
2939
      oprot.writeStructEnd();
3026
    }
2940
    }
3027
 
2941
 
3028
    @Override
2942
    @Override
3029
    public String toString() {
2943
    public String toString() {
3030
      StringBuilder sb = new StringBuilder("getEmailsToBeSent_args(");
2944
      StringBuilder sb = new StringBuilder("getEmailsToBeSent_args(");
3031
      boolean first = true;
2945
      boolean first = true;
3032
 
2946
 
3033
      sb.append("emailType:");
-
 
3034
      if (this.emailType == null) {
-
 
3035
        sb.append("null");
-
 
3036
      } else {
-
 
3037
        sb.append(this.emailType);
-
 
3038
      }
-
 
3039
      first = false;
-
 
3040
      sb.append(")");
2947
      sb.append(")");
3041
      return sb.toString();
2948
      return sb.toString();
3042
    }
2949
    }
3043
 
2950
 
3044
    public void validate() throws TException {
2951
    public void validate() throws TException {