Subversion Repositories SmartDukaan

Rev

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

Rev 3103 Rev 3374
Line 23... Line 23...
23
import org.apache.thrift.meta_data.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
24
import org.apache.thrift.protocol.*;
25
 
25
 
26
public class LogisticsService {
26
public class LogisticsService {
27
 
27
 
28
  public interface Iface {
-
 
29
 
-
 
30
    /**
-
 
31
     * For closing the open session in sqlalchemy
-
 
32
     */
-
 
33
    public void closeSession() throws TException;
28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
34
 
29
 
35
    /**
30
    /**
36
     * Returns a provider for a given provider ID. Throws an exception if none found.
31
     * Returns a provider for a given provider ID. Throws an exception if none found.
37
     * 
32
     * 
38
     * @param providerId
33
     * @param providerId
Line 113... Line 108...
113
     */
108
     */
114
    public boolean isCodAllowed(String destination_pincode) throws TException;
109
    public boolean isCodAllowed(String destination_pincode) throws TException;
115
 
110
 
116
  }
111
  }
117
 
112
 
118
  public static class Client implements Iface {
113
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
119
    public Client(TProtocol prot)
114
    public Client(TProtocol prot)
120
    {
115
    {
121
      this(prot, prot);
116
      this(prot, prot);
122
    }
117
    }
123
 
118
 
124
    public Client(TProtocol iprot, TProtocol oprot)
119
    public Client(TProtocol iprot, TProtocol oprot)
125
    {
120
    {
126
      iprot_ = iprot;
-
 
127
      oprot_ = oprot;
121
      super(iprot, oprot);
128
    }
-
 
129
 
-
 
130
    protected TProtocol iprot_;
-
 
131
    protected TProtocol oprot_;
-
 
132
 
-
 
133
    protected int seqid_;
-
 
134
 
-
 
135
    public TProtocol getInputProtocol()
-
 
136
    {
-
 
137
      return this.iprot_;
-
 
138
    }
-
 
139
 
-
 
140
    public TProtocol getOutputProtocol()
-
 
141
    {
-
 
142
      return this.oprot_;
-
 
143
    }
-
 
144
 
-
 
145
    public void closeSession() throws TException
-
 
146
    {
-
 
147
      send_closeSession();
-
 
148
      recv_closeSession();
-
 
149
    }
-
 
150
 
-
 
151
    public void send_closeSession() throws TException
-
 
152
    {
-
 
153
      oprot_.writeMessageBegin(new TMessage("closeSession", TMessageType.CALL, seqid_));
-
 
154
      closeSession_args args = new closeSession_args();
-
 
155
      args.write(oprot_);
-
 
156
      oprot_.writeMessageEnd();
-
 
157
      oprot_.getTransport().flush();
-
 
158
    }
-
 
159
 
-
 
160
    public void recv_closeSession() throws TException
-
 
161
    {
-
 
162
      TMessage msg = iprot_.readMessageBegin();
-
 
163
      if (msg.type == TMessageType.EXCEPTION) {
-
 
164
        TApplicationException x = TApplicationException.read(iprot_);
-
 
165
        iprot_.readMessageEnd();
-
 
166
        throw x;
-
 
167
      }
-
 
168
      closeSession_result result = new closeSession_result();
-
 
169
      result.read(iprot_);
-
 
170
      iprot_.readMessageEnd();
-
 
171
      return;
-
 
172
    }
122
    }
173
 
123
 
174
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException
124
    public Provider getProvider(long providerId) throws LogisticsServiceException, TException
175
    {
125
    {
176
      send_getProvider(providerId);
126
      send_getProvider(providerId);
Line 527... Line 477...
527
      }
477
      }
528
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
478
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
529
    }
479
    }
530
 
480
 
531
  }
481
  }
532
  public static class Processor implements TProcessor {
482
  public static class Processor extends in.shop2020.generic.GenericService.Processor implements TProcessor {
533
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
483
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
534
    public Processor(Iface iface)
484
    public Processor(Iface iface)
535
    {
485
    {
-
 
486
      super(iface);
536
      iface_ = iface;
487
      iface_ = iface;
537
      processMap_.put("closeSession", new closeSession());
-
 
538
      processMap_.put("getProvider", new getProvider());
488
      processMap_.put("getProvider", new getProvider());
539
      processMap_.put("getAllProviders", new getAllProviders());
489
      processMap_.put("getAllProviders", new getAllProviders());
540
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
490
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
541
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
491
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
542
      processMap_.put("getEmptyAWB", new getEmptyAWB());
492
      processMap_.put("getEmptyAWB", new getEmptyAWB());
Line 545... Line 495...
545
      processMap_.put("getFreeAwbCount", new getFreeAwbCount());
495
      processMap_.put("getFreeAwbCount", new getFreeAwbCount());
546
      processMap_.put("getHolidays", new getHolidays());
496
      processMap_.put("getHolidays", new getHolidays());
547
      processMap_.put("isCodAllowed", new isCodAllowed());
497
      processMap_.put("isCodAllowed", new isCodAllowed());
548
    }
498
    }
549
 
499
 
550
    protected static interface ProcessFunction {
-
 
551
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;
-
 
552
    }
-
 
553
 
-
 
554
    private Iface iface_;
500
    private Iface iface_;
555
    protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>();
-
 
556
 
501
 
557
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
502
    public boolean process(TProtocol iprot, TProtocol oprot) throws TException
558
    {
503
    {
559
      TMessage msg = iprot.readMessageBegin();
504
      TMessage msg = iprot.readMessageBegin();
560
      ProcessFunction fn = processMap_.get(msg.name);
505
      ProcessFunction fn = processMap_.get(msg.name);
Line 570... Line 515...
570
      }
515
      }
571
      fn.process(msg.seqid, iprot, oprot);
516
      fn.process(msg.seqid, iprot, oprot);
572
      return true;
517
      return true;
573
    }
518
    }
574
 
519
 
575
    private class closeSession implements ProcessFunction {
-
 
576
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
577
      {
-
 
578
        closeSession_args args = new closeSession_args();
-
 
579
        args.read(iprot);
-
 
580
        iprot.readMessageEnd();
-
 
581
        closeSession_result result = new closeSession_result();
-
 
582
        iface_.closeSession();
-
 
583
        oprot.writeMessageBegin(new TMessage("closeSession", TMessageType.REPLY, seqid));
-
 
584
        result.write(oprot);
-
 
585
        oprot.writeMessageEnd();
-
 
586
        oprot.getTransport().flush();
-
 
587
      }
-
 
588
 
-
 
589
    }
-
 
590
 
-
 
591
    private class getProvider implements ProcessFunction {
520
    private class getProvider implements ProcessFunction {
592
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
521
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
593
      {
522
      {
594
        getProvider_args args = new getProvider_args();
523
        getProvider_args args = new getProvider_args();
595
        args.read(iprot);
524
        args.read(iprot);
Line 834... Line 763...
834
 
763
 
835
    }
764
    }
836
 
765
 
837
  }
766
  }
838
 
767
 
839
  public static class closeSession_args implements TBase<closeSession_args._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_args>   {
-
 
840
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_args");
-
 
841
 
-
 
842
 
-
 
843
 
-
 
844
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
845
    public enum _Fields implements TFieldIdEnum {
-
 
846
;
-
 
847
 
-
 
848
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
849
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
850
 
-
 
851
      static {
-
 
852
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
853
          byId.put((int)field._thriftId, field);
-
 
854
          byName.put(field.getFieldName(), field);
-
 
855
        }
-
 
856
      }
-
 
857
 
-
 
858
      /**
-
 
859
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
860
       */
-
 
861
      public static _Fields findByThriftId(int fieldId) {
-
 
862
        return byId.get(fieldId);
-
 
863
      }
-
 
864
 
-
 
865
      /**
-
 
866
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
867
       * if it is not found.
-
 
868
       */
-
 
869
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
870
        _Fields fields = findByThriftId(fieldId);
-
 
871
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
872
        return fields;
-
 
873
      }
-
 
874
 
-
 
875
      /**
-
 
876
       * Find the _Fields constant that matches name, or null if its not found.
-
 
877
       */
-
 
878
      public static _Fields findByName(String name) {
-
 
879
        return byName.get(name);
-
 
880
      }
-
 
881
 
-
 
882
      private final short _thriftId;
-
 
883
      private final String _fieldName;
-
 
884
 
-
 
885
      _Fields(short thriftId, String fieldName) {
-
 
886
        _thriftId = thriftId;
-
 
887
        _fieldName = fieldName;
-
 
888
      }
-
 
889
 
-
 
890
      public short getThriftFieldId() {
-
 
891
        return _thriftId;
-
 
892
      }
-
 
893
 
-
 
894
      public String getFieldName() {
-
 
895
        return _fieldName;
-
 
896
      }
-
 
897
    }
-
 
898
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
899
    }});
-
 
900
 
-
 
901
    static {
-
 
902
      FieldMetaData.addStructMetaDataMap(closeSession_args.class, metaDataMap);
-
 
903
    }
-
 
904
 
-
 
905
    public closeSession_args() {
-
 
906
    }
-
 
907
 
-
 
908
    /**
-
 
909
     * Performs a deep copy on <i>other</i>.
-
 
910
     */
-
 
911
    public closeSession_args(closeSession_args other) {
-
 
912
    }
-
 
913
 
-
 
914
    public closeSession_args deepCopy() {
-
 
915
      return new closeSession_args(this);
-
 
916
    }
-
 
917
 
-
 
918
    @Deprecated
-
 
919
    public closeSession_args clone() {
-
 
920
      return new closeSession_args(this);
-
 
921
    }
-
 
922
 
-
 
923
    public void setFieldValue(_Fields field, Object value) {
-
 
924
      switch (field) {
-
 
925
      }
-
 
926
    }
-
 
927
 
-
 
928
    public void setFieldValue(int fieldID, Object value) {
-
 
929
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
930
    }
-
 
931
 
-
 
932
    public Object getFieldValue(_Fields field) {
-
 
933
      switch (field) {
-
 
934
      }
-
 
935
      throw new IllegalStateException();
-
 
936
    }
-
 
937
 
-
 
938
    public Object getFieldValue(int fieldId) {
-
 
939
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
940
    }
-
 
941
 
-
 
942
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
943
    public boolean isSet(_Fields field) {
-
 
944
      switch (field) {
-
 
945
      }
-
 
946
      throw new IllegalStateException();
-
 
947
    }
-
 
948
 
-
 
949
    public boolean isSet(int fieldID) {
-
 
950
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
951
    }
-
 
952
 
-
 
953
    @Override
-
 
954
    public boolean equals(Object that) {
-
 
955
      if (that == null)
-
 
956
        return false;
-
 
957
      if (that instanceof closeSession_args)
-
 
958
        return this.equals((closeSession_args)that);
-
 
959
      return false;
-
 
960
    }
-
 
961
 
-
 
962
    public boolean equals(closeSession_args that) {
-
 
963
      if (that == null)
-
 
964
        return false;
-
 
965
 
-
 
966
      return true;
-
 
967
    }
-
 
968
 
-
 
969
    @Override
-
 
970
    public int hashCode() {
-
 
971
      return 0;
-
 
972
    }
-
 
973
 
-
 
974
    public int compareTo(closeSession_args other) {
-
 
975
      if (!getClass().equals(other.getClass())) {
-
 
976
        return getClass().getName().compareTo(other.getClass().getName());
-
 
977
      }
-
 
978
 
-
 
979
      int lastComparison = 0;
-
 
980
      closeSession_args typedOther = (closeSession_args)other;
-
 
981
 
-
 
982
      return 0;
-
 
983
    }
-
 
984
 
-
 
985
    public void read(TProtocol iprot) throws TException {
-
 
986
      TField field;
-
 
987
      iprot.readStructBegin();
-
 
988
      while (true)
-
 
989
      {
-
 
990
        field = iprot.readFieldBegin();
-
 
991
        if (field.type == TType.STOP) { 
-
 
992
          break;
-
 
993
        }
-
 
994
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
995
        if (fieldId == null) {
-
 
996
          TProtocolUtil.skip(iprot, field.type);
-
 
997
        } else {
-
 
998
          switch (fieldId) {
-
 
999
          }
-
 
1000
          iprot.readFieldEnd();
-
 
1001
        }
-
 
1002
      }
-
 
1003
      iprot.readStructEnd();
-
 
1004
      validate();
-
 
1005
    }
-
 
1006
 
-
 
1007
    public void write(TProtocol oprot) throws TException {
-
 
1008
      validate();
-
 
1009
 
-
 
1010
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1011
      oprot.writeFieldStop();
-
 
1012
      oprot.writeStructEnd();
-
 
1013
    }
-
 
1014
 
-
 
1015
    @Override
-
 
1016
    public String toString() {
-
 
1017
      StringBuilder sb = new StringBuilder("closeSession_args(");
-
 
1018
      boolean first = true;
-
 
1019
 
-
 
1020
      sb.append(")");
-
 
1021
      return sb.toString();
-
 
1022
    }
-
 
1023
 
-
 
1024
    public void validate() throws TException {
-
 
1025
      // check for required fields
-
 
1026
    }
-
 
1027
 
-
 
1028
  }
-
 
1029
 
-
 
1030
  public static class closeSession_result implements TBase<closeSession_result._Fields>, java.io.Serializable, Cloneable, Comparable<closeSession_result>   {
-
 
1031
    private static final TStruct STRUCT_DESC = new TStruct("closeSession_result");
-
 
1032
 
-
 
1033
 
-
 
1034
 
-
 
1035
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
1036
    public enum _Fields implements TFieldIdEnum {
-
 
1037
;
-
 
1038
 
-
 
1039
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
1040
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
1041
 
-
 
1042
      static {
-
 
1043
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
1044
          byId.put((int)field._thriftId, field);
-
 
1045
          byName.put(field.getFieldName(), field);
-
 
1046
        }
-
 
1047
      }
-
 
1048
 
-
 
1049
      /**
-
 
1050
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
1051
       */
-
 
1052
      public static _Fields findByThriftId(int fieldId) {
-
 
1053
        return byId.get(fieldId);
-
 
1054
      }
-
 
1055
 
-
 
1056
      /**
-
 
1057
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
1058
       * if it is not found.
-
 
1059
       */
-
 
1060
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
1061
        _Fields fields = findByThriftId(fieldId);
-
 
1062
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
1063
        return fields;
-
 
1064
      }
-
 
1065
 
-
 
1066
      /**
-
 
1067
       * Find the _Fields constant that matches name, or null if its not found.
-
 
1068
       */
-
 
1069
      public static _Fields findByName(String name) {
-
 
1070
        return byName.get(name);
-
 
1071
      }
-
 
1072
 
-
 
1073
      private final short _thriftId;
-
 
1074
      private final String _fieldName;
-
 
1075
 
-
 
1076
      _Fields(short thriftId, String fieldName) {
-
 
1077
        _thriftId = thriftId;
-
 
1078
        _fieldName = fieldName;
-
 
1079
      }
-
 
1080
 
-
 
1081
      public short getThriftFieldId() {
-
 
1082
        return _thriftId;
-
 
1083
      }
-
 
1084
 
-
 
1085
      public String getFieldName() {
-
 
1086
        return _fieldName;
-
 
1087
      }
-
 
1088
    }
-
 
1089
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1090
    }});
-
 
1091
 
-
 
1092
    static {
-
 
1093
      FieldMetaData.addStructMetaDataMap(closeSession_result.class, metaDataMap);
-
 
1094
    }
-
 
1095
 
-
 
1096
    public closeSession_result() {
-
 
1097
    }
-
 
1098
 
-
 
1099
    /**
-
 
1100
     * Performs a deep copy on <i>other</i>.
-
 
1101
     */
-
 
1102
    public closeSession_result(closeSession_result other) {
-
 
1103
    }
-
 
1104
 
-
 
1105
    public closeSession_result deepCopy() {
-
 
1106
      return new closeSession_result(this);
-
 
1107
    }
-
 
1108
 
-
 
1109
    @Deprecated
-
 
1110
    public closeSession_result clone() {
-
 
1111
      return new closeSession_result(this);
-
 
1112
    }
-
 
1113
 
-
 
1114
    public void setFieldValue(_Fields field, Object value) {
-
 
1115
      switch (field) {
-
 
1116
      }
-
 
1117
    }
-
 
1118
 
-
 
1119
    public void setFieldValue(int fieldID, Object value) {
-
 
1120
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
1121
    }
-
 
1122
 
-
 
1123
    public Object getFieldValue(_Fields field) {
-
 
1124
      switch (field) {
-
 
1125
      }
-
 
1126
      throw new IllegalStateException();
-
 
1127
    }
-
 
1128
 
-
 
1129
    public Object getFieldValue(int fieldId) {
-
 
1130
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
1131
    }
-
 
1132
 
-
 
1133
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1134
    public boolean isSet(_Fields field) {
-
 
1135
      switch (field) {
-
 
1136
      }
-
 
1137
      throw new IllegalStateException();
-
 
1138
    }
-
 
1139
 
-
 
1140
    public boolean isSet(int fieldID) {
-
 
1141
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1142
    }
-
 
1143
 
-
 
1144
    @Override
-
 
1145
    public boolean equals(Object that) {
-
 
1146
      if (that == null)
-
 
1147
        return false;
-
 
1148
      if (that instanceof closeSession_result)
-
 
1149
        return this.equals((closeSession_result)that);
-
 
1150
      return false;
-
 
1151
    }
-
 
1152
 
-
 
1153
    public boolean equals(closeSession_result that) {
-
 
1154
      if (that == null)
-
 
1155
        return false;
-
 
1156
 
-
 
1157
      return true;
-
 
1158
    }
-
 
1159
 
-
 
1160
    @Override
-
 
1161
    public int hashCode() {
-
 
1162
      return 0;
-
 
1163
    }
-
 
1164
 
-
 
1165
    public int compareTo(closeSession_result other) {
-
 
1166
      if (!getClass().equals(other.getClass())) {
-
 
1167
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1168
      }
-
 
1169
 
-
 
1170
      int lastComparison = 0;
-
 
1171
      closeSession_result typedOther = (closeSession_result)other;
-
 
1172
 
-
 
1173
      return 0;
-
 
1174
    }
-
 
1175
 
-
 
1176
    public void read(TProtocol iprot) throws TException {
-
 
1177
      TField field;
-
 
1178
      iprot.readStructBegin();
-
 
1179
      while (true)
-
 
1180
      {
-
 
1181
        field = iprot.readFieldBegin();
-
 
1182
        if (field.type == TType.STOP) { 
-
 
1183
          break;
-
 
1184
        }
-
 
1185
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1186
        if (fieldId == null) {
-
 
1187
          TProtocolUtil.skip(iprot, field.type);
-
 
1188
        } else {
-
 
1189
          switch (fieldId) {
-
 
1190
          }
-
 
1191
          iprot.readFieldEnd();
-
 
1192
        }
-
 
1193
      }
-
 
1194
      iprot.readStructEnd();
-
 
1195
      validate();
-
 
1196
    }
-
 
1197
 
-
 
1198
    public void write(TProtocol oprot) throws TException {
-
 
1199
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1200
 
-
 
1201
      oprot.writeFieldStop();
-
 
1202
      oprot.writeStructEnd();
-
 
1203
    }
-
 
1204
 
-
 
1205
    @Override
-
 
1206
    public String toString() {
-
 
1207
      StringBuilder sb = new StringBuilder("closeSession_result(");
-
 
1208
      boolean first = true;
-
 
1209
 
-
 
1210
      sb.append(")");
-
 
1211
      return sb.toString();
-
 
1212
    }
-
 
1213
 
-
 
1214
    public void validate() throws TException {
-
 
1215
      // check for required fields
-
 
1216
    }
-
 
1217
 
-
 
1218
  }
-
 
1219
 
-
 
1220
  public static class getProvider_args implements TBase<getProvider_args._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_args>   {
768
  public static class getProvider_args implements TBase<getProvider_args._Fields>, java.io.Serializable, Cloneable, Comparable<getProvider_args>   {
1221
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_args");
769
    private static final TStruct STRUCT_DESC = new TStruct("getProvider_args");
1222
 
770
 
1223
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
771
    private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)1);
1224
 
772