Subversion Repositories SmartDukaan

Rev

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

Rev 3028 Rev 3293
Line 105... Line 105...
105
 
105
 
106
    public long addTrackLog(long affiliateId, long userId, String event, String url, String data, long addedOn) throws UserAffiliateException, TException;
106
    public long addTrackLog(long affiliateId, long userId, String event, String url, String data, long addedOn) throws UserAffiliateException, TException;
107
 
107
 
108
    public TrackLog getTrackLogById(long id) throws UserAffiliateException, TException;
108
    public TrackLog getTrackLogById(long id) throws UserAffiliateException, TException;
109
 
109
 
110
    public List<TrackLog> getTrackLogsByAffiliate(long affiliateId) throws UserAffiliateException, TException;
110
    public List<TrackLog> getTrackLogsByAffiliate(long affiliateId, long startDate, long endDate) throws UserAffiliateException, TException;
111
 
111
 
112
    public List<TrackLog> getTrackLogsByUser(long userId) throws UserAffiliateException, TException;
112
    public List<TrackLog> getTrackLogsByUser(long userId) throws UserAffiliateException, TException;
113
 
113
 
114
    public List<TrackLog> getTrackLogs(long userId, String event, String url) throws UserAffiliateException, TException;
114
    public List<TrackLog> getTrackLogs(long userId, String event, String url) throws UserAffiliateException, TException;
115
 
115
 
Line 1625... Line 1625...
1625
        throw result.utx;
1625
        throw result.utx;
1626
      }
1626
      }
1627
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTrackLogById failed: unknown result");
1627
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getTrackLogById failed: unknown result");
1628
    }
1628
    }
1629
 
1629
 
1630
    public List<TrackLog> getTrackLogsByAffiliate(long affiliateId) throws UserAffiliateException, TException
1630
    public List<TrackLog> getTrackLogsByAffiliate(long affiliateId, long startDate, long endDate) throws UserAffiliateException, TException
1631
    {
1631
    {
1632
      send_getTrackLogsByAffiliate(affiliateId);
1632
      send_getTrackLogsByAffiliate(affiliateId, startDate, endDate);
1633
      return recv_getTrackLogsByAffiliate();
1633
      return recv_getTrackLogsByAffiliate();
1634
    }
1634
    }
1635
 
1635
 
1636
    public void send_getTrackLogsByAffiliate(long affiliateId) throws TException
1636
    public void send_getTrackLogsByAffiliate(long affiliateId, long startDate, long endDate) throws TException
1637
    {
1637
    {
1638
      oprot_.writeMessageBegin(new TMessage("getTrackLogsByAffiliate", TMessageType.CALL, seqid_));
1638
      oprot_.writeMessageBegin(new TMessage("getTrackLogsByAffiliate", TMessageType.CALL, seqid_));
1639
      getTrackLogsByAffiliate_args args = new getTrackLogsByAffiliate_args();
1639
      getTrackLogsByAffiliate_args args = new getTrackLogsByAffiliate_args();
1640
      args.affiliateId = affiliateId;
1640
      args.affiliateId = affiliateId;
-
 
1641
      args.startDate = startDate;
-
 
1642
      args.endDate = endDate;
1641
      args.write(oprot_);
1643
      args.write(oprot_);
1642
      oprot_.writeMessageEnd();
1644
      oprot_.writeMessageEnd();
1643
      oprot_.getTransport().flush();
1645
      oprot_.getTransport().flush();
1644
    }
1646
    }
1645
 
1647
 
Line 3865... Line 3867...
3865
        getTrackLogsByAffiliate_args args = new getTrackLogsByAffiliate_args();
3867
        getTrackLogsByAffiliate_args args = new getTrackLogsByAffiliate_args();
3866
        args.read(iprot);
3868
        args.read(iprot);
3867
        iprot.readMessageEnd();
3869
        iprot.readMessageEnd();
3868
        getTrackLogsByAffiliate_result result = new getTrackLogsByAffiliate_result();
3870
        getTrackLogsByAffiliate_result result = new getTrackLogsByAffiliate_result();
3869
        try {
3871
        try {
3870
          result.success = iface_.getTrackLogsByAffiliate(args.affiliateId);
3872
          result.success = iface_.getTrackLogsByAffiliate(args.affiliateId, args.startDate, args.endDate);
3871
        } catch (UserAffiliateException utx) {
3873
        } catch (UserAffiliateException utx) {
3872
          result.utx = utx;
3874
          result.utx = utx;
3873
        } catch (Throwable th) {
3875
        } catch (Throwable th) {
3874
          LOGGER.error("Internal error processing getTrackLogsByAffiliate", th);
3876
          LOGGER.error("Internal error processing getTrackLogsByAffiliate", th);
3875
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTrackLogsByAffiliate");
3877
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getTrackLogsByAffiliate");
Line 30334... Line 30336...
30334
 
30336
 
30335
  public static class getTrackLogsByAffiliate_args implements TBase<getTrackLogsByAffiliate_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTrackLogsByAffiliate_args>   {
30337
  public static class getTrackLogsByAffiliate_args implements TBase<getTrackLogsByAffiliate_args._Fields>, java.io.Serializable, Cloneable, Comparable<getTrackLogsByAffiliate_args>   {
30336
    private static final TStruct STRUCT_DESC = new TStruct("getTrackLogsByAffiliate_args");
30338
    private static final TStruct STRUCT_DESC = new TStruct("getTrackLogsByAffiliate_args");
30337
 
30339
 
30338
    private static final TField AFFILIATE_ID_FIELD_DESC = new TField("affiliateId", TType.I64, (short)1);
30340
    private static final TField AFFILIATE_ID_FIELD_DESC = new TField("affiliateId", TType.I64, (short)1);
-
 
30341
    private static final TField START_DATE_FIELD_DESC = new TField("startDate", TType.I64, (short)2);
-
 
30342
    private static final TField END_DATE_FIELD_DESC = new TField("endDate", TType.I64, (short)3);
30339
 
30343
 
30340
    private long affiliateId;
30344
    private long affiliateId;
-
 
30345
    private long startDate;
-
 
30346
    private long endDate;
30341
 
30347
 
30342
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
30348
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
30343
    public enum _Fields implements TFieldIdEnum {
30349
    public enum _Fields implements TFieldIdEnum {
30344
      AFFILIATE_ID((short)1, "affiliateId");
30350
      AFFILIATE_ID((short)1, "affiliateId"),
-
 
30351
      START_DATE((short)2, "startDate"),
-
 
30352
      END_DATE((short)3, "endDate");
30345
 
30353
 
30346
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
30354
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
30347
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
30355
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
30348
 
30356
 
30349
      static {
30357
      static {
Line 30394... Line 30402...
30394
      }
30402
      }
30395
    }
30403
    }
30396
 
30404
 
30397
    // isset id assignments
30405
    // isset id assignments
30398
    private static final int __AFFILIATEID_ISSET_ID = 0;
30406
    private static final int __AFFILIATEID_ISSET_ID = 0;
-
 
30407
    private static final int __STARTDATE_ISSET_ID = 1;
-
 
30408
    private static final int __ENDDATE_ISSET_ID = 2;
30399
    private BitSet __isset_bit_vector = new BitSet(1);
30409
    private BitSet __isset_bit_vector = new BitSet(3);
30400
 
30410
 
30401
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
30411
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
30402
      put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
30412
      put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
30403
          new FieldValueMetaData(TType.I64)));
30413
          new FieldValueMetaData(TType.I64)));
-
 
30414
      put(_Fields.START_DATE, new FieldMetaData("startDate", TFieldRequirementType.DEFAULT, 
-
 
30415
          new FieldValueMetaData(TType.I64)));
-
 
30416
      put(_Fields.END_DATE, new FieldMetaData("endDate", TFieldRequirementType.DEFAULT, 
-
 
30417
          new FieldValueMetaData(TType.I64)));
30404
    }});
30418
    }});
30405
 
30419
 
30406
    static {
30420
    static {
30407
      FieldMetaData.addStructMetaDataMap(getTrackLogsByAffiliate_args.class, metaDataMap);
30421
      FieldMetaData.addStructMetaDataMap(getTrackLogsByAffiliate_args.class, metaDataMap);
30408
    }
30422
    }
30409
 
30423
 
30410
    public getTrackLogsByAffiliate_args() {
30424
    public getTrackLogsByAffiliate_args() {
30411
    }
30425
    }
30412
 
30426
 
30413
    public getTrackLogsByAffiliate_args(
30427
    public getTrackLogsByAffiliate_args(
30414
      long affiliateId)
30428
      long affiliateId,
-
 
30429
      long startDate,
-
 
30430
      long endDate)
30415
    {
30431
    {
30416
      this();
30432
      this();
30417
      this.affiliateId = affiliateId;
30433
      this.affiliateId = affiliateId;
30418
      setAffiliateIdIsSet(true);
30434
      setAffiliateIdIsSet(true);
-
 
30435
      this.startDate = startDate;
-
 
30436
      setStartDateIsSet(true);
-
 
30437
      this.endDate = endDate;
-
 
30438
      setEndDateIsSet(true);
30419
    }
30439
    }
30420
 
30440
 
30421
    /**
30441
    /**
30422
     * Performs a deep copy on <i>other</i>.
30442
     * Performs a deep copy on <i>other</i>.
30423
     */
30443
     */
30424
    public getTrackLogsByAffiliate_args(getTrackLogsByAffiliate_args other) {
30444
    public getTrackLogsByAffiliate_args(getTrackLogsByAffiliate_args other) {
30425
      __isset_bit_vector.clear();
30445
      __isset_bit_vector.clear();
30426
      __isset_bit_vector.or(other.__isset_bit_vector);
30446
      __isset_bit_vector.or(other.__isset_bit_vector);
30427
      this.affiliateId = other.affiliateId;
30447
      this.affiliateId = other.affiliateId;
-
 
30448
      this.startDate = other.startDate;
-
 
30449
      this.endDate = other.endDate;
30428
    }
30450
    }
30429
 
30451
 
30430
    public getTrackLogsByAffiliate_args deepCopy() {
30452
    public getTrackLogsByAffiliate_args deepCopy() {
30431
      return new getTrackLogsByAffiliate_args(this);
30453
      return new getTrackLogsByAffiliate_args(this);
30432
    }
30454
    }
Line 30457... Line 30479...
30457
 
30479
 
30458
    public void setAffiliateIdIsSet(boolean value) {
30480
    public void setAffiliateIdIsSet(boolean value) {
30459
      __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
30481
      __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
30460
    }
30482
    }
30461
 
30483
 
-
 
30484
    public long getStartDate() {
-
 
30485
      return this.startDate;
-
 
30486
    }
-
 
30487
 
-
 
30488
    public getTrackLogsByAffiliate_args setStartDate(long startDate) {
-
 
30489
      this.startDate = startDate;
-
 
30490
      setStartDateIsSet(true);
-
 
30491
      return this;
-
 
30492
    }
-
 
30493
 
-
 
30494
    public void unsetStartDate() {
-
 
30495
      __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
-
 
30496
    }
-
 
30497
 
-
 
30498
    /** Returns true if field startDate is set (has been asigned a value) and false otherwise */
-
 
30499
    public boolean isSetStartDate() {
-
 
30500
      return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
-
 
30501
    }
-
 
30502
 
-
 
30503
    public void setStartDateIsSet(boolean value) {
-
 
30504
      __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
-
 
30505
    }
-
 
30506
 
-
 
30507
    public long getEndDate() {
-
 
30508
      return this.endDate;
-
 
30509
    }
-
 
30510
 
-
 
30511
    public getTrackLogsByAffiliate_args setEndDate(long endDate) {
-
 
30512
      this.endDate = endDate;
-
 
30513
      setEndDateIsSet(true);
-
 
30514
      return this;
-
 
30515
    }
-
 
30516
 
-
 
30517
    public void unsetEndDate() {
-
 
30518
      __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
-
 
30519
    }
-
 
30520
 
-
 
30521
    /** Returns true if field endDate is set (has been asigned a value) and false otherwise */
-
 
30522
    public boolean isSetEndDate() {
-
 
30523
      return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
-
 
30524
    }
-
 
30525
 
-
 
30526
    public void setEndDateIsSet(boolean value) {
-
 
30527
      __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
-
 
30528
    }
-
 
30529
 
30462
    public void setFieldValue(_Fields field, Object value) {
30530
    public void setFieldValue(_Fields field, Object value) {
30463
      switch (field) {
30531
      switch (field) {
30464
      case AFFILIATE_ID:
30532
      case AFFILIATE_ID:
30465
        if (value == null) {
30533
        if (value == null) {
30466
          unsetAffiliateId();
30534
          unsetAffiliateId();
30467
        } else {
30535
        } else {
30468
          setAffiliateId((Long)value);
30536
          setAffiliateId((Long)value);
30469
        }
30537
        }
30470
        break;
30538
        break;
30471
 
30539
 
-
 
30540
      case START_DATE:
-
 
30541
        if (value == null) {
-
 
30542
          unsetStartDate();
-
 
30543
        } else {
-
 
30544
          setStartDate((Long)value);
-
 
30545
        }
-
 
30546
        break;
-
 
30547
 
-
 
30548
      case END_DATE:
-
 
30549
        if (value == null) {
-
 
30550
          unsetEndDate();
-
 
30551
        } else {
-
 
30552
          setEndDate((Long)value);
-
 
30553
        }
-
 
30554
        break;
-
 
30555
 
30472
      }
30556
      }
30473
    }
30557
    }
30474
 
30558
 
30475
    public void setFieldValue(int fieldID, Object value) {
30559
    public void setFieldValue(int fieldID, Object value) {
30476
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
30560
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 30479... Line 30563...
30479
    public Object getFieldValue(_Fields field) {
30563
    public Object getFieldValue(_Fields field) {
30480
      switch (field) {
30564
      switch (field) {
30481
      case AFFILIATE_ID:
30565
      case AFFILIATE_ID:
30482
        return new Long(getAffiliateId());
30566
        return new Long(getAffiliateId());
30483
 
30567
 
-
 
30568
      case START_DATE:
-
 
30569
        return new Long(getStartDate());
-
 
30570
 
-
 
30571
      case END_DATE:
-
 
30572
        return new Long(getEndDate());
-
 
30573
 
30484
      }
30574
      }
30485
      throw new IllegalStateException();
30575
      throw new IllegalStateException();
30486
    }
30576
    }
30487
 
30577
 
30488
    public Object getFieldValue(int fieldId) {
30578
    public Object getFieldValue(int fieldId) {
Line 30492... Line 30582...
30492
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
30582
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
30493
    public boolean isSet(_Fields field) {
30583
    public boolean isSet(_Fields field) {
30494
      switch (field) {
30584
      switch (field) {
30495
      case AFFILIATE_ID:
30585
      case AFFILIATE_ID:
30496
        return isSetAffiliateId();
30586
        return isSetAffiliateId();
-
 
30587
      case START_DATE:
-
 
30588
        return isSetStartDate();
-
 
30589
      case END_DATE:
-
 
30590
        return isSetEndDate();
30497
      }
30591
      }
30498
      throw new IllegalStateException();
30592
      throw new IllegalStateException();
30499
    }
30593
    }
30500
 
30594
 
30501
    public boolean isSet(int fieldID) {
30595
    public boolean isSet(int fieldID) {
Line 30522... Line 30616...
30522
          return false;
30616
          return false;
30523
        if (this.affiliateId != that.affiliateId)
30617
        if (this.affiliateId != that.affiliateId)
30524
          return false;
30618
          return false;
30525
      }
30619
      }
30526
 
30620
 
-
 
30621
      boolean this_present_startDate = true;
-
 
30622
      boolean that_present_startDate = true;
-
 
30623
      if (this_present_startDate || that_present_startDate) {
-
 
30624
        if (!(this_present_startDate && that_present_startDate))
-
 
30625
          return false;
-
 
30626
        if (this.startDate != that.startDate)
-
 
30627
          return false;
-
 
30628
      }
-
 
30629
 
-
 
30630
      boolean this_present_endDate = true;
-
 
30631
      boolean that_present_endDate = true;
-
 
30632
      if (this_present_endDate || that_present_endDate) {
-
 
30633
        if (!(this_present_endDate && that_present_endDate))
-
 
30634
          return false;
-
 
30635
        if (this.endDate != that.endDate)
-
 
30636
          return false;
-
 
30637
      }
-
 
30638
 
30527
      return true;
30639
      return true;
30528
    }
30640
    }
30529
 
30641
 
30530
    @Override
30642
    @Override
30531
    public int hashCode() {
30643
    public int hashCode() {
Line 30546... Line 30658...
30546
      }
30658
      }
30547
      lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
30659
      lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
30548
      if (lastComparison != 0) {
30660
      if (lastComparison != 0) {
30549
        return lastComparison;
30661
        return lastComparison;
30550
      }
30662
      }
-
 
30663
      lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(isSetStartDate());
-
 
30664
      if (lastComparison != 0) {
-
 
30665
        return lastComparison;
-
 
30666
      }
-
 
30667
      lastComparison = TBaseHelper.compareTo(startDate, typedOther.startDate);
-
 
30668
      if (lastComparison != 0) {
-
 
30669
        return lastComparison;
-
 
30670
      }
-
 
30671
      lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(isSetEndDate());
-
 
30672
      if (lastComparison != 0) {
-
 
30673
        return lastComparison;
-
 
30674
      }
-
 
30675
      lastComparison = TBaseHelper.compareTo(endDate, typedOther.endDate);
-
 
30676
      if (lastComparison != 0) {
-
 
30677
        return lastComparison;
-
 
30678
      }
30551
      return 0;
30679
      return 0;
30552
    }
30680
    }
30553
 
30681
 
30554
    public void read(TProtocol iprot) throws TException {
30682
    public void read(TProtocol iprot) throws TException {
30555
      TField field;
30683
      TField field;
Line 30571... Line 30699...
30571
                setAffiliateIdIsSet(true);
30699
                setAffiliateIdIsSet(true);
30572
              } else { 
30700
              } else { 
30573
                TProtocolUtil.skip(iprot, field.type);
30701
                TProtocolUtil.skip(iprot, field.type);
30574
              }
30702
              }
30575
              break;
30703
              break;
-
 
30704
            case START_DATE:
-
 
30705
              if (field.type == TType.I64) {
-
 
30706
                this.startDate = iprot.readI64();
-
 
30707
                setStartDateIsSet(true);
-
 
30708
              } else { 
-
 
30709
                TProtocolUtil.skip(iprot, field.type);
-
 
30710
              }
-
 
30711
              break;
-
 
30712
            case END_DATE:
-
 
30713
              if (field.type == TType.I64) {
-
 
30714
                this.endDate = iprot.readI64();
-
 
30715
                setEndDateIsSet(true);
-
 
30716
              } else { 
-
 
30717
                TProtocolUtil.skip(iprot, field.type);
-
 
30718
              }
-
 
30719
              break;
30576
          }
30720
          }
30577
          iprot.readFieldEnd();
30721
          iprot.readFieldEnd();
30578
        }
30722
        }
30579
      }
30723
      }
30580
      iprot.readStructEnd();
30724
      iprot.readStructEnd();
Line 30586... Line 30730...
30586
 
30730
 
30587
      oprot.writeStructBegin(STRUCT_DESC);
30731
      oprot.writeStructBegin(STRUCT_DESC);
30588
      oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
30732
      oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
30589
      oprot.writeI64(this.affiliateId);
30733
      oprot.writeI64(this.affiliateId);
30590
      oprot.writeFieldEnd();
30734
      oprot.writeFieldEnd();
-
 
30735
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
-
 
30736
      oprot.writeI64(this.startDate);
-
 
30737
      oprot.writeFieldEnd();
-
 
30738
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
-
 
30739
      oprot.writeI64(this.endDate);
-
 
30740
      oprot.writeFieldEnd();
30591
      oprot.writeFieldStop();
30741
      oprot.writeFieldStop();
30592
      oprot.writeStructEnd();
30742
      oprot.writeStructEnd();
30593
    }
30743
    }
30594
 
30744
 
30595
    @Override
30745
    @Override
Line 30598... Line 30748...
30598
      boolean first = true;
30748
      boolean first = true;
30599
 
30749
 
30600
      sb.append("affiliateId:");
30750
      sb.append("affiliateId:");
30601
      sb.append(this.affiliateId);
30751
      sb.append(this.affiliateId);
30602
      first = false;
30752
      first = false;
-
 
30753
      if (!first) sb.append(", ");
-
 
30754
      sb.append("startDate:");
-
 
30755
      sb.append(this.startDate);
-
 
30756
      first = false;
-
 
30757
      if (!first) sb.append(", ");
-
 
30758
      sb.append("endDate:");
-
 
30759
      sb.append(this.endDate);
-
 
30760
      first = false;
30603
      sb.append(")");
30761
      sb.append(")");
30604
      return sb.toString();
30762
      return sb.toString();
30605
    }
30763
    }
30606
 
30764
 
30607
    public void validate() throws TException {
30765
    public void validate() throws TException {