Subversion Repositories SmartDukaan

Rev

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

Rev 2358 Rev 2447
Line 106... Line 106...
106
    Parameters:
106
    Parameters:
107
     - username
107
     - username
108
    """
108
    """
109
    pass
109
    pass
110
 
110
 
111
  def authenticateUser(self, username, password):
111
  def authenticateDashboardUser(self, username, password):
112
    """
112
    """
113
    Returns the warehouseId for the given user if the password matches. Returns -1 otherwise.
113
    Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
114
    The loggedOn timestamp for the dashboard user is updated as a timestamp.
114
    The loggedOn timestamp for the dashboard user is updated .
115
    It's unclear to me when an exception is thrown : Chandranshu
-
 
116
    
115
    
117
    Parameters:
116
    Parameters:
118
     - username
117
     - username
119
     - password
118
     - password
120
    """
119
    """
121
    pass
120
    pass
122
 
121
 
123
  def updatePassword(self, username, oldPassword, newPassword):
122
  def updatePassword(self, username, oldPassword, newPassword):
124
    """
123
    """
-
 
124
    Update the password of the dashboard user. Currently, there is no place where this method is called.
-
 
125
    
125
    Parameters:
126
    Parameters:
126
     - username
127
     - username
127
     - oldPassword
128
     - oldPassword
128
     - newPassword
129
     - newPassword
129
    """
130
    """
Line 573... Line 574...
573
      return result.success
574
      return result.success
574
    if result.se != None:
575
    if result.se != None:
575
      raise result.se
576
      raise result.se
576
    raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
577
    raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteUser failed: unknown result");
577
 
578
 
578
  def authenticateUser(self, username, password):
579
  def authenticateDashboardUser(self, username, password):
579
    """
580
    """
580
    Returns the warehouseId for the given user if the password matches. Returns -1 otherwise.
581
    Returns the dashboard user if the supplied username and password match. Raises an exception otherwise.
581
    The loggedOn timestamp for the dashboard user is updated as a timestamp.
582
    The loggedOn timestamp for the dashboard user is updated .
582
    It's unclear to me when an exception is thrown : Chandranshu
-
 
583
    
583
    
584
    Parameters:
584
    Parameters:
585
     - username
585
     - username
586
     - password
586
     - password
587
    """
587
    """
588
    self.send_authenticateUser(username, password)
588
    self.send_authenticateDashboardUser(username, password)
589
    return self.recv_authenticateUser()
589
    return self.recv_authenticateDashboardUser()
590
 
590
 
591
  def send_authenticateUser(self, username, password):
591
  def send_authenticateDashboardUser(self, username, password):
592
    self._oprot.writeMessageBegin('authenticateUser', TMessageType.CALL, self._seqid)
592
    self._oprot.writeMessageBegin('authenticateDashboardUser', TMessageType.CALL, self._seqid)
593
    args = authenticateUser_args()
593
    args = authenticateDashboardUser_args()
594
    args.username = username
594
    args.username = username
595
    args.password = password
595
    args.password = password
596
    args.write(self._oprot)
596
    args.write(self._oprot)
597
    self._oprot.writeMessageEnd()
597
    self._oprot.writeMessageEnd()
598
    self._oprot.trans.flush()
598
    self._oprot.trans.flush()
599
 
599
 
600
  def recv_authenticateUser(self, ):
600
  def recv_authenticateDashboardUser(self, ):
601
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
601
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
602
    if mtype == TMessageType.EXCEPTION:
602
    if mtype == TMessageType.EXCEPTION:
603
      x = TApplicationException()
603
      x = TApplicationException()
604
      x.read(self._iprot)
604
      x.read(self._iprot)
605
      self._iprot.readMessageEnd()
605
      self._iprot.readMessageEnd()
606
      raise x
606
      raise x
607
    result = authenticateUser_result()
607
    result = authenticateDashboardUser_result()
608
    result.read(self._iprot)
608
    result.read(self._iprot)
609
    self._iprot.readMessageEnd()
609
    self._iprot.readMessageEnd()
610
    if result.success != None:
610
    if result.success != None:
611
      return result.success
611
      return result.success
612
    if result.se != None:
612
    if result.se != None:
613
      raise result.se
613
      raise result.se
614
    raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateUser failed: unknown result");
614
    raise TApplicationException(TApplicationException.MISSING_RESULT, "authenticateDashboardUser failed: unknown result");
615
 
615
 
616
  def updatePassword(self, username, oldPassword, newPassword):
616
  def updatePassword(self, username, oldPassword, newPassword):
617
    """
617
    """
-
 
618
    Update the password of the dashboard user. Currently, there is no place where this method is called.
-
 
619
    
618
    Parameters:
620
    Parameters:
619
     - username
621
     - username
620
     - oldPassword
622
     - oldPassword
621
     - newPassword
623
     - newPassword
622
    """
624
    """
Line 846... Line 848...
846
    self._processMap["updateMessage"] = Processor.process_updateMessage
848
    self._processMap["updateMessage"] = Processor.process_updateMessage
847
    self._processMap["getMessage"] = Processor.process_getMessage
849
    self._processMap["getMessage"] = Processor.process_getMessage
848
    self._processMap["getSubstitutedMessage"] = Processor.process_getSubstitutedMessage
850
    self._processMap["getSubstitutedMessage"] = Processor.process_getSubstitutedMessage
849
    self._processMap["addUser"] = Processor.process_addUser
851
    self._processMap["addUser"] = Processor.process_addUser
850
    self._processMap["deleteUser"] = Processor.process_deleteUser
852
    self._processMap["deleteUser"] = Processor.process_deleteUser
851
    self._processMap["authenticateUser"] = Processor.process_authenticateUser
853
    self._processMap["authenticateDashboardUser"] = Processor.process_authenticateDashboardUser
852
    self._processMap["updatePassword"] = Processor.process_updatePassword
854
    self._processMap["updatePassword"] = Processor.process_updatePassword
853
    self._processMap["authenticateLogisticsUser"] = Processor.process_authenticateLogisticsUser
855
    self._processMap["authenticateLogisticsUser"] = Processor.process_authenticateLogisticsUser
854
    self._processMap["authenticateStatisticsUser"] = Processor.process_authenticateStatisticsUser
856
    self._processMap["authenticateStatisticsUser"] = Processor.process_authenticateStatisticsUser
855
    self._processMap["authenticateReportUser"] = Processor.process_authenticateReportUser
857
    self._processMap["authenticateReportUser"] = Processor.process_authenticateReportUser
856
    self._processMap["getReports"] = Processor.process_getReports
858
    self._processMap["getReports"] = Processor.process_getReports
Line 1034... Line 1036...
1034
    oprot.writeMessageBegin("deleteUser", TMessageType.REPLY, seqid)
1036
    oprot.writeMessageBegin("deleteUser", TMessageType.REPLY, seqid)
1035
    result.write(oprot)
1037
    result.write(oprot)
1036
    oprot.writeMessageEnd()
1038
    oprot.writeMessageEnd()
1037
    oprot.trans.flush()
1039
    oprot.trans.flush()
1038
 
1040
 
1039
  def process_authenticateUser(self, seqid, iprot, oprot):
1041
  def process_authenticateDashboardUser(self, seqid, iprot, oprot):
1040
    args = authenticateUser_args()
1042
    args = authenticateDashboardUser_args()
1041
    args.read(iprot)
1043
    args.read(iprot)
1042
    iprot.readMessageEnd()
1044
    iprot.readMessageEnd()
1043
    result = authenticateUser_result()
1045
    result = authenticateDashboardUser_result()
1044
    try:
1046
    try:
1045
      result.success = self._handler.authenticateUser(args.username, args.password)
1047
      result.success = self._handler.authenticateDashboardUser(args.username, args.password)
1046
    except HelperServiceException, se:
1048
    except HelperServiceException, se:
1047
      result.se = se
1049
      result.se = se
1048
    oprot.writeMessageBegin("authenticateUser", TMessageType.REPLY, seqid)
1050
    oprot.writeMessageBegin("authenticateDashboardUser", TMessageType.REPLY, seqid)
1049
    result.write(oprot)
1051
    result.write(oprot)
1050
    oprot.writeMessageEnd()
1052
    oprot.writeMessageEnd()
1051
    oprot.trans.flush()
1053
    oprot.trans.flush()
1052
 
1054
 
1053
  def process_updatePassword(self, seqid, iprot, oprot):
1055
  def process_updatePassword(self, seqid, iprot, oprot):
Line 2638... Line 2640...
2638
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2640
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2639
 
2641
 
2640
  def __ne__(self, other):
2642
  def __ne__(self, other):
2641
    return not (self == other)
2643
    return not (self == other)
2642
 
2644
 
2643
class authenticateUser_args:
2645
class authenticateDashboardUser_args:
2644
  """
2646
  """
2645
  Attributes:
2647
  Attributes:
2646
   - username
2648
   - username
2647
   - password
2649
   - password
2648
  """
2650
  """
Line 2683... Line 2685...
2683
 
2685
 
2684
  def write(self, oprot):
2686
  def write(self, oprot):
2685
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2687
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2686
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2688
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2687
      return
2689
      return
2688
    oprot.writeStructBegin('authenticateUser_args')
2690
    oprot.writeStructBegin('authenticateDashboardUser_args')
2689
    if self.username != None:
2691
    if self.username != None:
2690
      oprot.writeFieldBegin('username', TType.STRING, 1)
2692
      oprot.writeFieldBegin('username', TType.STRING, 1)
2691
      oprot.writeString(self.username)
2693
      oprot.writeString(self.username)
2692
      oprot.writeFieldEnd()
2694
      oprot.writeFieldEnd()
2693
    if self.password != None:
2695
    if self.password != None:
Line 2706... Line 2708...
2706
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2708
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
2707
 
2709
 
2708
  def __ne__(self, other):
2710
  def __ne__(self, other):
2709
    return not (self == other)
2711
    return not (self == other)
2710
 
2712
 
2711
class authenticateUser_result:
2713
class authenticateDashboardUser_result:
2712
  """
2714
  """
2713
  Attributes:
2715
  Attributes:
2714
   - success
2716
   - success
2715
   - se
2717
   - se
2716
  """
2718
  """
2717
 
2719
 
2718
  thrift_spec = (
2720
  thrift_spec = (
2719
    (0, TType.I64, 'success', None, None, ), # 0
2721
    (0, TType.STRUCT, 'success', (DashboardUser, DashboardUser.thrift_spec), None, ), # 0
2720
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
2722
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
2721
  )
2723
  )
2722
 
2724
 
2723
  def __init__(self, success=None, se=None,):
2725
  def __init__(self, success=None, se=None,):
2724
    self.success = success
2726
    self.success = success
Line 2732... Line 2734...
2732
    while True:
2734
    while True:
2733
      (fname, ftype, fid) = iprot.readFieldBegin()
2735
      (fname, ftype, fid) = iprot.readFieldBegin()
2734
      if ftype == TType.STOP:
2736
      if ftype == TType.STOP:
2735
        break
2737
        break
2736
      if fid == 0:
2738
      if fid == 0:
2737
        if ftype == TType.I64:
2739
        if ftype == TType.STRUCT:
2738
          self.success = iprot.readI64();
2740
          self.success = DashboardUser()
-
 
2741
          self.success.read(iprot)
2739
        else:
2742
        else:
2740
          iprot.skip(ftype)
2743
          iprot.skip(ftype)
2741
      elif fid == 1:
2744
      elif fid == 1:
2742
        if ftype == TType.STRUCT:
2745
        if ftype == TType.STRUCT:
2743
          self.se = HelperServiceException()
2746
          self.se = HelperServiceException()
Line 2751... Line 2754...
2751
 
2754
 
2752
  def write(self, oprot):
2755
  def write(self, oprot):
2753
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2756
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
2754
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2757
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
2755
      return
2758
      return
2756
    oprot.writeStructBegin('authenticateUser_result')
2759
    oprot.writeStructBegin('authenticateDashboardUser_result')
2757
    if self.success != None:
2760
    if self.success != None:
2758
      oprot.writeFieldBegin('success', TType.I64, 0)
2761
      oprot.writeFieldBegin('success', TType.STRUCT, 0)
2759
      oprot.writeI64(self.success)
2762
      self.success.write(oprot)
2760
      oprot.writeFieldEnd()
2763
      oprot.writeFieldEnd()
2761
    if self.se != None:
2764
    if self.se != None:
2762
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
2765
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
2763
      self.se.write(oprot)
2766
      self.se.write(oprot)
2764
      oprot.writeFieldEnd()
2767
      oprot.writeFieldEnd()