Subversion Repositories SmartDukaan

Rev

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

Rev 3390 Rev 3405
Line 35... Line 35...
35
 
35
 
36
    public long insertTicket(Ticket ticket, Activity activity) throws TException;
36
    public long insertTicket(Ticket ticket, Activity activity) throws TException;
37
 
37
 
38
    public List<Activity> getActivities(SearchFilter searchFilter) throws TException;
38
    public List<Activity> getActivities(SearchFilter searchFilter) throws TException;
39
 
39
 
40
    public void insertActivity(Activity activity) throws TException;
40
    public long insertActivity(Activity activity) throws TException;
41
 
41
 
42
    public void markAsRead(long activityId, long agentId) throws TException;
42
    public void markAsRead(long activityId, long agentId) throws TException;
43
 
43
 
44
    public List<Agent> getAgents(SearchFilter searchFilter) throws TException;
44
    public List<Agent> getAgents(SearchFilter searchFilter) throws TException;
45
 
45
 
Line 227... Line 227...
227
        return result.success;
227
        return result.success;
228
      }
228
      }
229
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getActivities failed: unknown result");
229
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getActivities failed: unknown result");
230
    }
230
    }
231
 
231
 
232
    public void insertActivity(Activity activity) throws TException
232
    public long insertActivity(Activity activity) throws TException
233
    {
233
    {
234
      send_insertActivity(activity);
234
      send_insertActivity(activity);
235
      recv_insertActivity();
235
      return recv_insertActivity();
236
    }
236
    }
237
 
237
 
238
    public void send_insertActivity(Activity activity) throws TException
238
    public void send_insertActivity(Activity activity) throws TException
239
    {
239
    {
240
      oprot_.writeMessageBegin(new TMessage("insertActivity", TMessageType.CALL, seqid_));
240
      oprot_.writeMessageBegin(new TMessage("insertActivity", TMessageType.CALL, seqid_));
Line 243... Line 243...
243
      args.write(oprot_);
243
      args.write(oprot_);
244
      oprot_.writeMessageEnd();
244
      oprot_.writeMessageEnd();
245
      oprot_.getTransport().flush();
245
      oprot_.getTransport().flush();
246
    }
246
    }
247
 
247
 
248
    public void recv_insertActivity() throws TException
248
    public long recv_insertActivity() throws TException
249
    {
249
    {
250
      TMessage msg = iprot_.readMessageBegin();
250
      TMessage msg = iprot_.readMessageBegin();
251
      if (msg.type == TMessageType.EXCEPTION) {
251
      if (msg.type == TMessageType.EXCEPTION) {
252
        TApplicationException x = TApplicationException.read(iprot_);
252
        TApplicationException x = TApplicationException.read(iprot_);
253
        iprot_.readMessageEnd();
253
        iprot_.readMessageEnd();
254
        throw x;
254
        throw x;
255
      }
255
      }
256
      insertActivity_result result = new insertActivity_result();
256
      insertActivity_result result = new insertActivity_result();
257
      result.read(iprot_);
257
      result.read(iprot_);
258
      iprot_.readMessageEnd();
258
      iprot_.readMessageEnd();
-
 
259
      if (result.isSetSuccess()) {
-
 
260
        return result.success;
259
      return;
261
      }
-
 
262
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "insertActivity failed: unknown result");
260
    }
263
    }
261
 
264
 
262
    public void markAsRead(long activityId, long agentId) throws TException
265
    public void markAsRead(long activityId, long agentId) throws TException
263
    {
266
    {
264
      send_markAsRead(activityId, agentId);
267
      send_markAsRead(activityId, agentId);
Line 610... Line 613...
610
      {
613
      {
611
        insertActivity_args args = new insertActivity_args();
614
        insertActivity_args args = new insertActivity_args();
612
        args.read(iprot);
615
        args.read(iprot);
613
        iprot.readMessageEnd();
616
        iprot.readMessageEnd();
614
        insertActivity_result result = new insertActivity_result();
617
        insertActivity_result result = new insertActivity_result();
615
        iface_.insertActivity(args.activity);
618
        result.success = iface_.insertActivity(args.activity);
-
 
619
        result.setSuccessIsSet(true);
616
        oprot.writeMessageBegin(new TMessage("insertActivity", TMessageType.REPLY, seqid));
620
        oprot.writeMessageBegin(new TMessage("insertActivity", TMessageType.REPLY, seqid));
617
        result.write(oprot);
621
        result.write(oprot);
618
        oprot.writeMessageEnd();
622
        oprot.writeMessageEnd();
619
        oprot.getTransport().flush();
623
        oprot.getTransport().flush();
620
      }
624
      }
Line 3931... Line 3935...
3931
  }
3935
  }
3932
 
3936
 
3933
  public static class insertActivity_result implements TBase<insertActivity_result._Fields>, java.io.Serializable, Cloneable, Comparable<insertActivity_result>   {
3937
  public static class insertActivity_result implements TBase<insertActivity_result._Fields>, java.io.Serializable, Cloneable, Comparable<insertActivity_result>   {
3934
    private static final TStruct STRUCT_DESC = new TStruct("insertActivity_result");
3938
    private static final TStruct STRUCT_DESC = new TStruct("insertActivity_result");
3935
 
3939
 
-
 
3940
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0);
3936
 
3941
 
-
 
3942
    private long success;
3937
 
3943
 
3938
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3944
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3939
    public enum _Fields implements TFieldIdEnum {
3945
    public enum _Fields implements TFieldIdEnum {
3940
;
-
 
-
 
3946
      SUCCESS((short)0, "success");
3941
 
3947
 
3942
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3948
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
3943
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3949
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3944
 
3950
 
3945
      static {
3951
      static {
Line 3987... Line 3993...
3987
 
3993
 
3988
      public String getFieldName() {
3994
      public String getFieldName() {
3989
        return _fieldName;
3995
        return _fieldName;
3990
      }
3996
      }
3991
    }
3997
    }
-
 
3998
 
-
 
3999
    // isset id assignments
-
 
4000
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
4001
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
4002
 
3992
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
4003
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
4004
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
4005
          new FieldValueMetaData(TType.I64)));
3993
    }});
4006
    }});
3994
 
4007
 
3995
    static {
4008
    static {
3996
      FieldMetaData.addStructMetaDataMap(insertActivity_result.class, metaDataMap);
4009
      FieldMetaData.addStructMetaDataMap(insertActivity_result.class, metaDataMap);
3997
    }
4010
    }
3998
 
4011
 
3999
    public insertActivity_result() {
4012
    public insertActivity_result() {
4000
    }
4013
    }
4001
 
4014
 
-
 
4015
    public insertActivity_result(
-
 
4016
      long success)
-
 
4017
    {
-
 
4018
      this();
-
 
4019
      this.success = success;
-
 
4020
      setSuccessIsSet(true);
-
 
4021
    }
-
 
4022
 
4002
    /**
4023
    /**
4003
     * Performs a deep copy on <i>other</i>.
4024
     * Performs a deep copy on <i>other</i>.
4004
     */
4025
     */
4005
    public insertActivity_result(insertActivity_result other) {
4026
    public insertActivity_result(insertActivity_result other) {
-
 
4027
      __isset_bit_vector.clear();
-
 
4028
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
4029
      this.success = other.success;
4006
    }
4030
    }
4007
 
4031
 
4008
    public insertActivity_result deepCopy() {
4032
    public insertActivity_result deepCopy() {
4009
      return new insertActivity_result(this);
4033
      return new insertActivity_result(this);
4010
    }
4034
    }
Line 4012... Line 4036...
4012
    @Deprecated
4036
    @Deprecated
4013
    public insertActivity_result clone() {
4037
    public insertActivity_result clone() {
4014
      return new insertActivity_result(this);
4038
      return new insertActivity_result(this);
4015
    }
4039
    }
4016
 
4040
 
-
 
4041
    public long getSuccess() {
-
 
4042
      return this.success;
-
 
4043
    }
-
 
4044
 
-
 
4045
    public insertActivity_result setSuccess(long success) {
-
 
4046
      this.success = success;
-
 
4047
      setSuccessIsSet(true);
-
 
4048
      return this;
-
 
4049
    }
-
 
4050
 
-
 
4051
    public void unsetSuccess() {
-
 
4052
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
4053
    }
-
 
4054
 
-
 
4055
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
4056
    public boolean isSetSuccess() {
-
 
4057
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
4058
    }
-
 
4059
 
-
 
4060
    public void setSuccessIsSet(boolean value) {
-
 
4061
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
4062
    }
-
 
4063
 
4017
    public void setFieldValue(_Fields field, Object value) {
4064
    public void setFieldValue(_Fields field, Object value) {
4018
      switch (field) {
4065
      switch (field) {
-
 
4066
      case SUCCESS:
-
 
4067
        if (value == null) {
-
 
4068
          unsetSuccess();
-
 
4069
        } else {
-
 
4070
          setSuccess((Long)value);
-
 
4071
        }
-
 
4072
        break;
-
 
4073
 
4019
      }
4074
      }
4020
    }
4075
    }
4021
 
4076
 
4022
    public void setFieldValue(int fieldID, Object value) {
4077
    public void setFieldValue(int fieldID, Object value) {
4023
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4078
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
4024
    }
4079
    }
4025
 
4080
 
4026
    public Object getFieldValue(_Fields field) {
4081
    public Object getFieldValue(_Fields field) {
4027
      switch (field) {
4082
      switch (field) {
-
 
4083
      case SUCCESS:
-
 
4084
        return new Long(getSuccess());
-
 
4085
 
4028
      }
4086
      }
4029
      throw new IllegalStateException();
4087
      throw new IllegalStateException();
4030
    }
4088
    }
4031
 
4089
 
4032
    public Object getFieldValue(int fieldId) {
4090
    public Object getFieldValue(int fieldId) {
Line 4034... Line 4092...
4034
    }
4092
    }
4035
 
4093
 
4036
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4094
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
4037
    public boolean isSet(_Fields field) {
4095
    public boolean isSet(_Fields field) {
4038
      switch (field) {
4096
      switch (field) {
-
 
4097
      case SUCCESS:
-
 
4098
        return isSetSuccess();
4039
      }
4099
      }
4040
      throw new IllegalStateException();
4100
      throw new IllegalStateException();
4041
    }
4101
    }
4042
 
4102
 
4043
    public boolean isSet(int fieldID) {
4103
    public boolean isSet(int fieldID) {
Line 4055... Line 4115...
4055
 
4115
 
4056
    public boolean equals(insertActivity_result that) {
4116
    public boolean equals(insertActivity_result that) {
4057
      if (that == null)
4117
      if (that == null)
4058
        return false;
4118
        return false;
4059
 
4119
 
-
 
4120
      boolean this_present_success = true;
-
 
4121
      boolean that_present_success = true;
-
 
4122
      if (this_present_success || that_present_success) {
-
 
4123
        if (!(this_present_success && that_present_success))
-
 
4124
          return false;
-
 
4125
        if (this.success != that.success)
-
 
4126
          return false;
-
 
4127
      }
-
 
4128
 
4060
      return true;
4129
      return true;
4061
    }
4130
    }
4062
 
4131
 
4063
    @Override
4132
    @Override
4064
    public int hashCode() {
4133
    public int hashCode() {
Line 4071... Line 4140...
4071
      }
4140
      }
4072
 
4141
 
4073
      int lastComparison = 0;
4142
      int lastComparison = 0;
4074
      insertActivity_result typedOther = (insertActivity_result)other;
4143
      insertActivity_result typedOther = (insertActivity_result)other;
4075
 
4144
 
-
 
4145
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
4146
      if (lastComparison != 0) {
-
 
4147
        return lastComparison;
-
 
4148
      }
-
 
4149
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
4150
      if (lastComparison != 0) {
-
 
4151
        return lastComparison;
-
 
4152
      }
4076
      return 0;
4153
      return 0;
4077
    }
4154
    }
4078
 
4155
 
4079
    public void read(TProtocol iprot) throws TException {
4156
    public void read(TProtocol iprot) throws TException {
4080
      TField field;
4157
      TField field;
Line 4088... Line 4165...
4088
        _Fields fieldId = _Fields.findByThriftId(field.id);
4165
        _Fields fieldId = _Fields.findByThriftId(field.id);
4089
        if (fieldId == null) {
4166
        if (fieldId == null) {
4090
          TProtocolUtil.skip(iprot, field.type);
4167
          TProtocolUtil.skip(iprot, field.type);
4091
        } else {
4168
        } else {
4092
          switch (fieldId) {
4169
          switch (fieldId) {
-
 
4170
            case SUCCESS:
-
 
4171
              if (field.type == TType.I64) {
-
 
4172
                this.success = iprot.readI64();
-
 
4173
                setSuccessIsSet(true);
-
 
4174
              } else { 
-
 
4175
                TProtocolUtil.skip(iprot, field.type);
-
 
4176
              }
-
 
4177
              break;
4093
          }
4178
          }
4094
          iprot.readFieldEnd();
4179
          iprot.readFieldEnd();
4095
        }
4180
        }
4096
      }
4181
      }
4097
      iprot.readStructEnd();
4182
      iprot.readStructEnd();
Line 4099... Line 4184...
4099
    }
4184
    }
4100
 
4185
 
4101
    public void write(TProtocol oprot) throws TException {
4186
    public void write(TProtocol oprot) throws TException {
4102
      oprot.writeStructBegin(STRUCT_DESC);
4187
      oprot.writeStructBegin(STRUCT_DESC);
4103
 
4188
 
-
 
4189
      if (this.isSetSuccess()) {
-
 
4190
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
4191
        oprot.writeI64(this.success);
-
 
4192
        oprot.writeFieldEnd();
-
 
4193
      }
4104
      oprot.writeFieldStop();
4194
      oprot.writeFieldStop();
4105
      oprot.writeStructEnd();
4195
      oprot.writeStructEnd();
4106
    }
4196
    }
4107
 
4197
 
4108
    @Override
4198
    @Override
4109
    public String toString() {
4199
    public String toString() {
4110
      StringBuilder sb = new StringBuilder("insertActivity_result(");
4200
      StringBuilder sb = new StringBuilder("insertActivity_result(");
4111
      boolean first = true;
4201
      boolean first = true;
4112
 
4202
 
-
 
4203
      sb.append("success:");
-
 
4204
      sb.append(this.success);
-
 
4205
      first = false;
4113
      sb.append(")");
4206
      sb.append(")");
4114
      return sb.toString();
4207
      return sb.toString();
4115
    }
4208
    }
4116
 
4209
 
4117
    public void validate() throws TException {
4210
    public void validate() throws TException {