Subversion Repositories SmartDukaan

Rev

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

Rev 3086 Rev 3206
Line 31... Line 31...
31
     * For closing the open session in sqlalchemy
31
     * For closing the open session in sqlalchemy
32
     */
32
     */
33
    public void closeSession() throws TException;
33
    public void closeSession() throws TException;
34
 
34
 
35
    /**
35
    /**
36
     * Save email details, to be sent later
36
     * Save email details, to be sent later; Also returns its identifier.
37
     * 
37
     * 
38
     * @param emailTo
38
     * @param emailTo
39
     * @param emailFrom
39
     * @param emailFrom
40
     * @param subject
40
     * @param subject
41
     * @param body
41
     * @param body
42
     * @param source
42
     * @param source
43
     * @param emailType
43
     * @param emailType
44
     */
44
     */
45
    public void saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws HelperServiceException, TException;
45
    public long 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
     */
49
     */
50
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException;
50
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException;
Line 190... Line 190...
190
      result.read(iprot_);
190
      result.read(iprot_);
191
      iprot_.readMessageEnd();
191
      iprot_.readMessageEnd();
192
      return;
192
      return;
193
    }
193
    }
194
 
194
 
195
    public void saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws HelperServiceException, TException
195
    public long saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws HelperServiceException, TException
196
    {
196
    {
197
      send_saveUserEmailForSending(emailTo, emailFrom, subject, body, source, emailType);
197
      send_saveUserEmailForSending(emailTo, emailFrom, subject, body, source, emailType);
198
      recv_saveUserEmailForSending();
198
      return recv_saveUserEmailForSending();
199
    }
199
    }
200
 
200
 
201
    public void send_saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws TException
201
    public void send_saveUserEmailForSending(String emailTo, String emailFrom, String subject, String body, String source, String emailType) throws TException
202
    {
202
    {
203
      oprot_.writeMessageBegin(new TMessage("saveUserEmailForSending", TMessageType.CALL, seqid_));
203
      oprot_.writeMessageBegin(new TMessage("saveUserEmailForSending", TMessageType.CALL, seqid_));
Line 211... Line 211...
211
      args.write(oprot_);
211
      args.write(oprot_);
212
      oprot_.writeMessageEnd();
212
      oprot_.writeMessageEnd();
213
      oprot_.getTransport().flush();
213
      oprot_.getTransport().flush();
214
    }
214
    }
215
 
215
 
216
    public void recv_saveUserEmailForSending() throws HelperServiceException, TException
216
    public long recv_saveUserEmailForSending() throws HelperServiceException, TException
217
    {
217
    {
218
      TMessage msg = iprot_.readMessageBegin();
218
      TMessage msg = iprot_.readMessageBegin();
219
      if (msg.type == TMessageType.EXCEPTION) {
219
      if (msg.type == TMessageType.EXCEPTION) {
220
        TApplicationException x = TApplicationException.read(iprot_);
220
        TApplicationException x = TApplicationException.read(iprot_);
221
        iprot_.readMessageEnd();
221
        iprot_.readMessageEnd();
222
        throw x;
222
        throw x;
223
      }
223
      }
224
      saveUserEmailForSending_result result = new saveUserEmailForSending_result();
224
      saveUserEmailForSending_result result = new saveUserEmailForSending_result();
225
      result.read(iprot_);
225
      result.read(iprot_);
226
      iprot_.readMessageEnd();
226
      iprot_.readMessageEnd();
-
 
227
      if (result.isSetSuccess()) {
-
 
228
        return result.success;
-
 
229
      }
227
      if (result.se != null) {
230
      if (result.se != null) {
228
        throw result.se;
231
        throw result.se;
229
      }
232
      }
230
      return;
233
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "saveUserEmailForSending failed: unknown result");
231
    }
234
    }
232
 
235
 
233
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException
236
    public List<UserEmail> getEmailsToBeSent() throws HelperServiceException, TException
234
    {
237
    {
235
      send_getEmailsToBeSent();
238
      send_getEmailsToBeSent();
Line 909... Line 912...
909
        saveUserEmailForSending_args args = new saveUserEmailForSending_args();
912
        saveUserEmailForSending_args args = new saveUserEmailForSending_args();
910
        args.read(iprot);
913
        args.read(iprot);
911
        iprot.readMessageEnd();
914
        iprot.readMessageEnd();
912
        saveUserEmailForSending_result result = new saveUserEmailForSending_result();
915
        saveUserEmailForSending_result result = new saveUserEmailForSending_result();
913
        try {
916
        try {
914
          iface_.saveUserEmailForSending(args.emailTo, args.emailFrom, args.subject, args.body, args.source, args.emailType);
917
          result.success = iface_.saveUserEmailForSending(args.emailTo, args.emailFrom, args.subject, args.body, args.source, args.emailType);
-
 
918
          result.setSuccessIsSet(true);
915
        } catch (HelperServiceException se) {
919
        } catch (HelperServiceException se) {
916
          result.se = se;
920
          result.se = se;
917
        } catch (Throwable th) {
921
        } catch (Throwable th) {
918
          LOGGER.error("Internal error processing saveUserEmailForSending", th);
922
          LOGGER.error("Internal error processing saveUserEmailForSending", th);
919
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing saveUserEmailForSending");
923
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing saveUserEmailForSending");
Line 2483... Line 2487...
2483
  }
2487
  }
2484
 
2488
 
2485
  public static class saveUserEmailForSending_result implements TBase<saveUserEmailForSending_result._Fields>, java.io.Serializable, Cloneable, Comparable<saveUserEmailForSending_result>   {
2489
  public static class saveUserEmailForSending_result implements TBase<saveUserEmailForSending_result._Fields>, java.io.Serializable, Cloneable, Comparable<saveUserEmailForSending_result>   {
2486
    private static final TStruct STRUCT_DESC = new TStruct("saveUserEmailForSending_result");
2490
    private static final TStruct STRUCT_DESC = new TStruct("saveUserEmailForSending_result");
2487
 
2491
 
-
 
2492
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
2488
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
2493
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
2489
 
2494
 
-
 
2495
    private long success;
2490
    private HelperServiceException se;
2496
    private HelperServiceException se;
2491
 
2497
 
2492
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2498
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2493
    public enum _Fields implements TFieldIdEnum {
2499
    public enum _Fields implements TFieldIdEnum {
-
 
2500
      SUCCESS((short)0, "success"),
2494
      SE((short)1, "se");
2501
      SE((short)1, "se");
2495
 
2502
 
2496
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2503
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
2497
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2504
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2498
 
2505
 
Line 2543... Line 2550...
2543
        return _fieldName;
2550
        return _fieldName;
2544
      }
2551
      }
2545
    }
2552
    }
2546
 
2553
 
2547
    // isset id assignments
2554
    // isset id assignments
-
 
2555
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
2556
    private BitSet __isset_bit_vector = new BitSet(1);
2548
 
2557
 
2549
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
2558
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
2559
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
2560
          new FieldValueMetaData(TType.I64)));
2550
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
2561
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
2551
          new FieldValueMetaData(TType.STRUCT)));
2562
          new FieldValueMetaData(TType.STRUCT)));
2552
    }});
2563
    }});
2553
 
2564
 
2554
    static {
2565
    static {
Line 2557... Line 2568...
2557
 
2568
 
2558
    public saveUserEmailForSending_result() {
2569
    public saveUserEmailForSending_result() {
2559
    }
2570
    }
2560
 
2571
 
2561
    public saveUserEmailForSending_result(
2572
    public saveUserEmailForSending_result(
-
 
2573
      long success,
2562
      HelperServiceException se)
2574
      HelperServiceException se)
2563
    {
2575
    {
2564
      this();
2576
      this();
-
 
2577
      this.success = success;
-
 
2578
      setSuccessIsSet(true);
2565
      this.se = se;
2579
      this.se = se;
2566
    }
2580
    }
2567
 
2581
 
2568
    /**
2582
    /**
2569
     * Performs a deep copy on <i>other</i>.
2583
     * Performs a deep copy on <i>other</i>.
2570
     */
2584
     */
2571
    public saveUserEmailForSending_result(saveUserEmailForSending_result other) {
2585
    public saveUserEmailForSending_result(saveUserEmailForSending_result other) {
-
 
2586
      __isset_bit_vector.clear();
-
 
2587
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
2588
      this.success = other.success;
2572
      if (other.isSetSe()) {
2589
      if (other.isSetSe()) {
2573
        this.se = new HelperServiceException(other.se);
2590
        this.se = new HelperServiceException(other.se);
2574
      }
2591
      }
2575
    }
2592
    }
2576
 
2593
 
Line 2581... Line 2598...
2581
    @Deprecated
2598
    @Deprecated
2582
    public saveUserEmailForSending_result clone() {
2599
    public saveUserEmailForSending_result clone() {
2583
      return new saveUserEmailForSending_result(this);
2600
      return new saveUserEmailForSending_result(this);
2584
    }
2601
    }
2585
 
2602
 
-
 
2603
    public long getSuccess() {
-
 
2604
      return this.success;
-
 
2605
    }
-
 
2606
 
-
 
2607
    public saveUserEmailForSending_result setSuccess(long success) {
-
 
2608
      this.success = success;
-
 
2609
      setSuccessIsSet(true);
-
 
2610
      return this;
-
 
2611
    }
-
 
2612
 
-
 
2613
    public void unsetSuccess() {
-
 
2614
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
2615
    }
-
 
2616
 
-
 
2617
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
2618
    public boolean isSetSuccess() {
-
 
2619
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
2620
    }
-
 
2621
 
-
 
2622
    public void setSuccessIsSet(boolean value) {
-
 
2623
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
2624
    }
-
 
2625
 
2586
    public HelperServiceException getSe() {
2626
    public HelperServiceException getSe() {
2587
      return this.se;
2627
      return this.se;
2588
    }
2628
    }
2589
 
2629
 
2590
    public saveUserEmailForSending_result setSe(HelperServiceException se) {
2630
    public saveUserEmailForSending_result setSe(HelperServiceException se) {
Line 2607... Line 2647...
2607
      }
2647
      }
2608
    }
2648
    }
2609
 
2649
 
2610
    public void setFieldValue(_Fields field, Object value) {
2650
    public void setFieldValue(_Fields field, Object value) {
2611
      switch (field) {
2651
      switch (field) {
-
 
2652
      case SUCCESS:
-
 
2653
        if (value == null) {
-
 
2654
          unsetSuccess();
-
 
2655
        } else {
-
 
2656
          setSuccess((Long)value);
-
 
2657
        }
-
 
2658
        break;
-
 
2659
 
2612
      case SE:
2660
      case SE:
2613
        if (value == null) {
2661
        if (value == null) {
2614
          unsetSe();
2662
          unsetSe();
2615
        } else {
2663
        } else {
2616
          setSe((HelperServiceException)value);
2664
          setSe((HelperServiceException)value);
Line 2624... Line 2672...
2624
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2672
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
2625
    }
2673
    }
2626
 
2674
 
2627
    public Object getFieldValue(_Fields field) {
2675
    public Object getFieldValue(_Fields field) {
2628
      switch (field) {
2676
      switch (field) {
-
 
2677
      case SUCCESS:
-
 
2678
        return new Long(getSuccess());
-
 
2679
 
2629
      case SE:
2680
      case SE:
2630
        return getSe();
2681
        return getSe();
2631
 
2682
 
2632
      }
2683
      }
2633
      throw new IllegalStateException();
2684
      throw new IllegalStateException();
Line 2638... Line 2689...
2638
    }
2689
    }
2639
 
2690
 
2640
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2691
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
2641
    public boolean isSet(_Fields field) {
2692
    public boolean isSet(_Fields field) {
2642
      switch (field) {
2693
      switch (field) {
-
 
2694
      case SUCCESS:
-
 
2695
        return isSetSuccess();
2643
      case SE:
2696
      case SE:
2644
        return isSetSe();
2697
        return isSetSe();
2645
      }
2698
      }
2646
      throw new IllegalStateException();
2699
      throw new IllegalStateException();
2647
    }
2700
    }
Line 2661... Line 2714...
2661
 
2714
 
2662
    public boolean equals(saveUserEmailForSending_result that) {
2715
    public boolean equals(saveUserEmailForSending_result that) {
2663
      if (that == null)
2716
      if (that == null)
2664
        return false;
2717
        return false;
2665
 
2718
 
-
 
2719
      boolean this_present_success = true;
-
 
2720
      boolean that_present_success = true;
-
 
2721
      if (this_present_success || that_present_success) {
-
 
2722
        if (!(this_present_success && that_present_success))
-
 
2723
          return false;
-
 
2724
        if (this.success != that.success)
-
 
2725
          return false;
-
 
2726
      }
-
 
2727
 
2666
      boolean this_present_se = true && this.isSetSe();
2728
      boolean this_present_se = true && this.isSetSe();
2667
      boolean that_present_se = true && that.isSetSe();
2729
      boolean that_present_se = true && that.isSetSe();
2668
      if (this_present_se || that_present_se) {
2730
      if (this_present_se || that_present_se) {
2669
        if (!(this_present_se && that_present_se))
2731
        if (!(this_present_se && that_present_se))
2670
          return false;
2732
          return false;
Line 2686... Line 2748...
2686
      }
2748
      }
2687
 
2749
 
2688
      int lastComparison = 0;
2750
      int lastComparison = 0;
2689
      saveUserEmailForSending_result typedOther = (saveUserEmailForSending_result)other;
2751
      saveUserEmailForSending_result typedOther = (saveUserEmailForSending_result)other;
2690
 
2752
 
-
 
2753
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
2754
      if (lastComparison != 0) {
-
 
2755
        return lastComparison;
-
 
2756
      }
-
 
2757
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
2758
      if (lastComparison != 0) {
-
 
2759
        return lastComparison;
-
 
2760
      }
2691
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
2761
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
2692
      if (lastComparison != 0) {
2762
      if (lastComparison != 0) {
2693
        return lastComparison;
2763
        return lastComparison;
2694
      }
2764
      }
2695
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
2765
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
Line 2711... Line 2781...
2711
        _Fields fieldId = _Fields.findByThriftId(field.id);
2781
        _Fields fieldId = _Fields.findByThriftId(field.id);
2712
        if (fieldId == null) {
2782
        if (fieldId == null) {
2713
          TProtocolUtil.skip(iprot, field.type);
2783
          TProtocolUtil.skip(iprot, field.type);
2714
        } else {
2784
        } else {
2715
          switch (fieldId) {
2785
          switch (fieldId) {
-
 
2786
            case SUCCESS:
-
 
2787
              if (field.type == TType.I64) {
-
 
2788
                this.success = iprot.readI64();
-
 
2789
                setSuccessIsSet(true);
-
 
2790
              } else { 
-
 
2791
                TProtocolUtil.skip(iprot, field.type);
-
 
2792
              }
-
 
2793
              break;
2716
            case SE:
2794
            case SE:
2717
              if (field.type == TType.STRUCT) {
2795
              if (field.type == TType.STRUCT) {
2718
                this.se = new HelperServiceException();
2796
                this.se = new HelperServiceException();
2719
                this.se.read(iprot);
2797
                this.se.read(iprot);
2720
              } else { 
2798
              } else { 
Line 2730... Line 2808...
2730
    }
2808
    }
2731
 
2809
 
2732
    public void write(TProtocol oprot) throws TException {
2810
    public void write(TProtocol oprot) throws TException {
2733
      oprot.writeStructBegin(STRUCT_DESC);
2811
      oprot.writeStructBegin(STRUCT_DESC);
2734
 
2812
 
2735
      if (this.isSetSe()) {
2813
      if (this.isSetSuccess()) {
-
 
2814
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
2815
        oprot.writeI64(this.success);
-
 
2816
        oprot.writeFieldEnd();
-
 
2817
      } else if (this.isSetSe()) {
2736
        oprot.writeFieldBegin(SE_FIELD_DESC);
2818
        oprot.writeFieldBegin(SE_FIELD_DESC);
2737
        this.se.write(oprot);
2819
        this.se.write(oprot);
2738
        oprot.writeFieldEnd();
2820
        oprot.writeFieldEnd();
2739
      }
2821
      }
2740
      oprot.writeFieldStop();
2822
      oprot.writeFieldStop();
Line 2744... Line 2826...
2744
    @Override
2826
    @Override
2745
    public String toString() {
2827
    public String toString() {
2746
      StringBuilder sb = new StringBuilder("saveUserEmailForSending_result(");
2828
      StringBuilder sb = new StringBuilder("saveUserEmailForSending_result(");
2747
      boolean first = true;
2829
      boolean first = true;
2748
 
2830
 
-
 
2831
      sb.append("success:");
-
 
2832
      sb.append(this.success);
-
 
2833
      first = false;
-
 
2834
      if (!first) sb.append(", ");
2749
      sb.append("se:");
2835
      sb.append("se:");
2750
      if (this.se == null) {
2836
      if (this.se == null) {
2751
        sb.append("null");
2837
        sb.append("null");
2752
      } else {
2838
      } else {
2753
        sb.append(this.se);
2839
        sb.append(this.se);