Subversion Repositories SmartDukaan

Rev

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

Rev 3893 Rev 3896
Line 22... Line 22...
22
 
22
 
23
public class ContentService {
23
public class ContentService {
24
 
24
 
25
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
25
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
26
 
26
 
-
 
27
    /**
-
 
28
     * Push the content of the given entity to production
-
 
29
     * 
-
 
30
     * @param entityId
-
 
31
     */
27
    public void pushContentToProduction(long entityId) throws org.apache.thrift.TException;
32
    public boolean pushContentToProduction(long entityId) throws ContentServiceException, org.apache.thrift.TException;
28
 
33
 
29
  }
34
  }
30
 
35
 
31
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
36
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
32
 
37
 
Line 52... Line 57...
52
 
57
 
53
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
58
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
54
      super(iprot, oprot);
59
      super(iprot, oprot);
55
    }
60
    }
56
 
61
 
57
    public void pushContentToProduction(long entityId) throws org.apache.thrift.TException
62
    public boolean pushContentToProduction(long entityId) throws ContentServiceException, org.apache.thrift.TException
58
    {
63
    {
59
      send_pushContentToProduction(entityId);
64
      send_pushContentToProduction(entityId);
60
      recv_pushContentToProduction();
65
      return recv_pushContentToProduction();
61
    }
66
    }
62
 
67
 
63
    public void send_pushContentToProduction(long entityId) throws org.apache.thrift.TException
68
    public void send_pushContentToProduction(long entityId) throws org.apache.thrift.TException
64
    {
69
    {
65
      pushContentToProduction_args args = new pushContentToProduction_args();
70
      pushContentToProduction_args args = new pushContentToProduction_args();
66
      args.setEntityId(entityId);
71
      args.setEntityId(entityId);
67
      sendBase("pushContentToProduction", args);
72
      sendBase("pushContentToProduction", args);
68
    }
73
    }
69
 
74
 
70
    public void recv_pushContentToProduction() throws org.apache.thrift.TException
75
    public boolean recv_pushContentToProduction() throws ContentServiceException, org.apache.thrift.TException
71
    {
76
    {
72
      pushContentToProduction_result result = new pushContentToProduction_result();
77
      pushContentToProduction_result result = new pushContentToProduction_result();
73
      receiveBase(result, "pushContentToProduction");
78
      receiveBase(result, "pushContentToProduction");
-
 
79
      if (result.isSetSuccess()) {
-
 
80
        return result.success;
74
      return;
81
      }
-
 
82
      if (result.cse != null) {
-
 
83
        throw result.cse;
-
 
84
      }
-
 
85
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");
75
    }
86
    }
76
 
87
 
77
  }
88
  }
78
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
89
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
79
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
90
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
Line 112... Line 123...
112
        args.setEntityId(entityId);
123
        args.setEntityId(entityId);
113
        args.write(prot);
124
        args.write(prot);
114
        prot.writeMessageEnd();
125
        prot.writeMessageEnd();
115
      }
126
      }
116
 
127
 
117
      public void getResult() throws org.apache.thrift.TException {
128
      public boolean getResult() throws ContentServiceException, org.apache.thrift.TException {
118
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
129
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
119
          throw new IllegalStateException("Method call not finished!");
130
          throw new IllegalStateException("Method call not finished!");
120
        }
131
        }
121
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
132
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
122
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
133
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
123
        (new Client(prot)).recv_pushContentToProduction();
134
        return (new Client(prot)).recv_pushContentToProduction();
124
      }
135
      }
125
    }
136
    }
126
 
137
 
127
  }
138
  }
128
 
139
 
Line 150... Line 161...
150
        return new pushContentToProduction_args();
161
        return new pushContentToProduction_args();
151
      }
162
      }
152
 
163
 
153
      protected pushContentToProduction_result getResult(I iface, pushContentToProduction_args args) throws org.apache.thrift.TException {
164
      protected pushContentToProduction_result getResult(I iface, pushContentToProduction_args args) throws org.apache.thrift.TException {
154
        pushContentToProduction_result result = new pushContentToProduction_result();
165
        pushContentToProduction_result result = new pushContentToProduction_result();
-
 
166
        try {
155
        iface.pushContentToProduction(args.entityId);
167
          result.success = iface.pushContentToProduction(args.entityId);
-
 
168
          result.setSuccessIsSet(true);
-
 
169
        } catch (ContentServiceException cse) {
-
 
170
          result.cse = cse;
-
 
171
        }
156
        return result;
172
        return result;
157
      }
173
      }
158
    }
174
    }
159
 
175
 
160
  }
176
  }
Line 454... Line 470...
454
  }
470
  }
455
 
471
 
456
  public static class pushContentToProduction_result implements org.apache.thrift.TBase<pushContentToProduction_result, pushContentToProduction_result._Fields>, java.io.Serializable, Cloneable   {
472
  public static class pushContentToProduction_result implements org.apache.thrift.TBase<pushContentToProduction_result, pushContentToProduction_result._Fields>, java.io.Serializable, Cloneable   {
457
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pushContentToProduction_result");
473
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pushContentToProduction_result");
458
 
474
 
-
 
475
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
-
 
476
    private static final org.apache.thrift.protocol.TField CSE_FIELD_DESC = new org.apache.thrift.protocol.TField("cse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
459
 
477
 
-
 
478
    private boolean success; // required
-
 
479
    private ContentServiceException cse; // required
460
 
480
 
461
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
481
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
462
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
482
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
463
;
-
 
-
 
483
      SUCCESS((short)0, "success"),
-
 
484
      CSE((short)1, "cse");
464
 
485
 
465
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
486
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
466
 
487
 
467
      static {
488
      static {
468
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
489
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 473... Line 494...
473
      /**
494
      /**
474
       * Find the _Fields constant that matches fieldId, or null if its not found.
495
       * Find the _Fields constant that matches fieldId, or null if its not found.
475
       */
496
       */
476
      public static _Fields findByThriftId(int fieldId) {
497
      public static _Fields findByThriftId(int fieldId) {
477
        switch(fieldId) {
498
        switch(fieldId) {
-
 
499
          case 0: // SUCCESS
-
 
500
            return SUCCESS;
-
 
501
          case 1: // CSE
-
 
502
            return CSE;
478
          default:
503
          default:
479
            return null;
504
            return null;
480
        }
505
        }
481
      }
506
      }
482
 
507
 
Line 511... Line 536...
511
 
536
 
512
      public String getFieldName() {
537
      public String getFieldName() {
513
        return _fieldName;
538
        return _fieldName;
514
      }
539
      }
515
    }
540
    }
-
 
541
 
-
 
542
    // isset id assignments
-
 
543
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
544
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
545
 
516
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
546
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
517
    static {
547
    static {
518
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
548
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
549
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
550
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-
 
551
      tmpMap.put(_Fields.CSE, new org.apache.thrift.meta_data.FieldMetaData("cse", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
552
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
519
      metaDataMap = Collections.unmodifiableMap(tmpMap);
553
      metaDataMap = Collections.unmodifiableMap(tmpMap);
520
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pushContentToProduction_result.class, metaDataMap);
554
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pushContentToProduction_result.class, metaDataMap);
521
    }
555
    }
522
 
556
 
523
    public pushContentToProduction_result() {
557
    public pushContentToProduction_result() {
524
    }
558
    }
525
 
559
 
-
 
560
    public pushContentToProduction_result(
-
 
561
      boolean success,
-
 
562
      ContentServiceException cse)
-
 
563
    {
-
 
564
      this();
-
 
565
      this.success = success;
-
 
566
      setSuccessIsSet(true);
-
 
567
      this.cse = cse;
-
 
568
    }
-
 
569
 
526
    /**
570
    /**
527
     * Performs a deep copy on <i>other</i>.
571
     * Performs a deep copy on <i>other</i>.
528
     */
572
     */
529
    public pushContentToProduction_result(pushContentToProduction_result other) {
573
    public pushContentToProduction_result(pushContentToProduction_result other) {
-
 
574
      __isset_bit_vector.clear();
-
 
575
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
576
      this.success = other.success;
-
 
577
      if (other.isSetCse()) {
-
 
578
        this.cse = new ContentServiceException(other.cse);
-
 
579
      }
530
    }
580
    }
531
 
581
 
532
    public pushContentToProduction_result deepCopy() {
582
    public pushContentToProduction_result deepCopy() {
533
      return new pushContentToProduction_result(this);
583
      return new pushContentToProduction_result(this);
534
    }
584
    }
535
 
585
 
536
    @Override
586
    @Override
537
    public void clear() {
587
    public void clear() {
-
 
588
      setSuccessIsSet(false);
-
 
589
      this.success = false;
-
 
590
      this.cse = null;
-
 
591
    }
-
 
592
 
-
 
593
    public boolean isSuccess() {
-
 
594
      return this.success;
-
 
595
    }
-
 
596
 
-
 
597
    public void setSuccess(boolean success) {
-
 
598
      this.success = success;
-
 
599
      setSuccessIsSet(true);
-
 
600
    }
-
 
601
 
-
 
602
    public void unsetSuccess() {
-
 
603
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
604
    }
-
 
605
 
-
 
606
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
-
 
607
    public boolean isSetSuccess() {
-
 
608
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
609
    }
-
 
610
 
-
 
611
    public void setSuccessIsSet(boolean value) {
-
 
612
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
613
    }
-
 
614
 
-
 
615
    public ContentServiceException getCse() {
-
 
616
      return this.cse;
-
 
617
    }
-
 
618
 
-
 
619
    public void setCse(ContentServiceException cse) {
-
 
620
      this.cse = cse;
-
 
621
    }
-
 
622
 
-
 
623
    public void unsetCse() {
-
 
624
      this.cse = null;
-
 
625
    }
-
 
626
 
-
 
627
    /** Returns true if field cse is set (has been assigned a value) and false otherwise */
-
 
628
    public boolean isSetCse() {
-
 
629
      return this.cse != null;
-
 
630
    }
-
 
631
 
-
 
632
    public void setCseIsSet(boolean value) {
-
 
633
      if (!value) {
-
 
634
        this.cse = null;
-
 
635
      }
538
    }
636
    }
539
 
637
 
540
    public void setFieldValue(_Fields field, Object value) {
638
    public void setFieldValue(_Fields field, Object value) {
541
      switch (field) {
639
      switch (field) {
-
 
640
      case SUCCESS:
-
 
641
        if (value == null) {
-
 
642
          unsetSuccess();
-
 
643
        } else {
-
 
644
          setSuccess((Boolean)value);
-
 
645
        }
-
 
646
        break;
-
 
647
 
-
 
648
      case CSE:
-
 
649
        if (value == null) {
-
 
650
          unsetCse();
-
 
651
        } else {
-
 
652
          setCse((ContentServiceException)value);
-
 
653
        }
-
 
654
        break;
-
 
655
 
542
      }
656
      }
543
    }
657
    }
544
 
658
 
545
    public Object getFieldValue(_Fields field) {
659
    public Object getFieldValue(_Fields field) {
546
      switch (field) {
660
      switch (field) {
-
 
661
      case SUCCESS:
-
 
662
        return Boolean.valueOf(isSuccess());
-
 
663
 
-
 
664
      case CSE:
-
 
665
        return getCse();
-
 
666
 
547
      }
667
      }
548
      throw new IllegalStateException();
668
      throw new IllegalStateException();
549
    }
669
    }
550
 
670
 
551
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
671
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 553... Line 673...
553
      if (field == null) {
673
      if (field == null) {
554
        throw new IllegalArgumentException();
674
        throw new IllegalArgumentException();
555
      }
675
      }
556
 
676
 
557
      switch (field) {
677
      switch (field) {
-
 
678
      case SUCCESS:
-
 
679
        return isSetSuccess();
-
 
680
      case CSE:
-
 
681
        return isSetCse();
558
      }
682
      }
559
      throw new IllegalStateException();
683
      throw new IllegalStateException();
560
    }
684
    }
561
 
685
 
562
    @Override
686
    @Override
Line 570... Line 694...
570
 
694
 
571
    public boolean equals(pushContentToProduction_result that) {
695
    public boolean equals(pushContentToProduction_result that) {
572
      if (that == null)
696
      if (that == null)
573
        return false;
697
        return false;
574
 
698
 
-
 
699
      boolean this_present_success = true;
-
 
700
      boolean that_present_success = true;
-
 
701
      if (this_present_success || that_present_success) {
-
 
702
        if (!(this_present_success && that_present_success))
-
 
703
          return false;
-
 
704
        if (this.success != that.success)
-
 
705
          return false;
-
 
706
      }
-
 
707
 
-
 
708
      boolean this_present_cse = true && this.isSetCse();
-
 
709
      boolean that_present_cse = true && that.isSetCse();
-
 
710
      if (this_present_cse || that_present_cse) {
-
 
711
        if (!(this_present_cse && that_present_cse))
-
 
712
          return false;
-
 
713
        if (!this.cse.equals(that.cse))
-
 
714
          return false;
-
 
715
      }
-
 
716
 
575
      return true;
717
      return true;
576
    }
718
    }
577
 
719
 
578
    @Override
720
    @Override
579
    public int hashCode() {
721
    public int hashCode() {
Line 586... Line 728...
586
      }
728
      }
587
 
729
 
588
      int lastComparison = 0;
730
      int lastComparison = 0;
589
      pushContentToProduction_result typedOther = (pushContentToProduction_result)other;
731
      pushContentToProduction_result typedOther = (pushContentToProduction_result)other;
590
 
732
 
-
 
733
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
-
 
734
      if (lastComparison != 0) {
-
 
735
        return lastComparison;
-
 
736
      }
-
 
737
      if (isSetSuccess()) {
-
 
738
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
-
 
739
        if (lastComparison != 0) {
-
 
740
          return lastComparison;
-
 
741
        }
-
 
742
      }
-
 
743
      lastComparison = Boolean.valueOf(isSetCse()).compareTo(typedOther.isSetCse());
-
 
744
      if (lastComparison != 0) {
-
 
745
        return lastComparison;
-
 
746
      }
-
 
747
      if (isSetCse()) {
-
 
748
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cse, typedOther.cse);
-
 
749
        if (lastComparison != 0) {
-
 
750
          return lastComparison;
-
 
751
        }
-
 
752
      }
591
      return 0;
753
      return 0;
592
    }
754
    }
593
 
755
 
594
    public _Fields fieldForId(int fieldId) {
756
    public _Fields fieldForId(int fieldId) {
595
      return _Fields.findByThriftId(fieldId);
757
      return _Fields.findByThriftId(fieldId);
Line 603... Line 765...
603
        field = iprot.readFieldBegin();
765
        field = iprot.readFieldBegin();
604
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
766
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
605
          break;
767
          break;
606
        }
768
        }
607
        switch (field.id) {
769
        switch (field.id) {
-
 
770
          case 0: // SUCCESS
-
 
771
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
-
 
772
              this.success = iprot.readBool();
-
 
773
              setSuccessIsSet(true);
-
 
774
            } else { 
-
 
775
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
776
            }
-
 
777
            break;
-
 
778
          case 1: // CSE
-
 
779
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
-
 
780
              this.cse = new ContentServiceException();
-
 
781
              this.cse.read(iprot);
-
 
782
            } else { 
-
 
783
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
784
            }
-
 
785
            break;
608
          default:
786
          default:
609
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
787
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
610
        }
788
        }
611
        iprot.readFieldEnd();
789
        iprot.readFieldEnd();
612
      }
790
      }
Line 615... Line 793...
615
    }
793
    }
616
 
794
 
617
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
795
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
618
      oprot.writeStructBegin(STRUCT_DESC);
796
      oprot.writeStructBegin(STRUCT_DESC);
619
 
797
 
-
 
798
      if (this.isSetSuccess()) {
-
 
799
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
800
        oprot.writeBool(this.success);
-
 
801
        oprot.writeFieldEnd();
-
 
802
      } else if (this.isSetCse()) {
-
 
803
        oprot.writeFieldBegin(CSE_FIELD_DESC);
-
 
804
        this.cse.write(oprot);
-
 
805
        oprot.writeFieldEnd();
-
 
806
      }
620
      oprot.writeFieldStop();
807
      oprot.writeFieldStop();
621
      oprot.writeStructEnd();
808
      oprot.writeStructEnd();
622
    }
809
    }
623
 
810
 
624
    @Override
811
    @Override
625
    public String toString() {
812
    public String toString() {
626
      StringBuilder sb = new StringBuilder("pushContentToProduction_result(");
813
      StringBuilder sb = new StringBuilder("pushContentToProduction_result(");
627
      boolean first = true;
814
      boolean first = true;
628
 
815
 
-
 
816
      sb.append("success:");
-
 
817
      sb.append(this.success);
-
 
818
      first = false;
-
 
819
      if (!first) sb.append(", ");
-
 
820
      sb.append("cse:");
-
 
821
      if (this.cse == null) {
-
 
822
        sb.append("null");
-
 
823
      } else {
-
 
824
        sb.append(this.cse);
-
 
825
      }
-
 
826
      first = false;
629
      sb.append(")");
827
      sb.append(")");
630
      return sb.toString();
828
      return sb.toString();
631
    }
829
    }
632
 
830
 
633
    public void validate() throws org.apache.thrift.TException {
831
    public void validate() throws org.apache.thrift.TException {