GetCursorRequest.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. /**
  3. * Copyright (C) Alibaba Cloud Computing
  4. * All rights reserved
  5. */
  6. require_once realpath(dirname(__FILE__) . '/Request.php');
  7. /**
  8. * The request used to get cursor by fromTime or begin/end mode
  9. *
  10. * @author log service dev
  11. */
  12. class Aliyun_Log_Models_GetCursorRequest extends Aliyun_Log_Models_Request {
  13. /**
  14. * @var string logstore name
  15. */
  16. private $logstore;
  17. /**
  18. * @var string shard id
  19. */
  20. private $shardId;
  21. //mode and fromTime: choose one and another remains null
  22. /**
  23. * @var string value should be 'begin' or 'end'
  24. * begin:return cursor point to first loggroup
  25. * end:return cursor point to position after last loggroup
  26. * if $mode is set to not null,$fromTime must be set null
  27. */
  28. private $mode;
  29. /**
  30. * @var integer unix_timestamp
  31. * return cursor point to first loggroup whose time after $fromTime
  32. */
  33. private $fromTime;
  34. /**
  35. * Aliyun_Log_Models_GetCursorRequest Constructor
  36. * @param string $project
  37. * project name
  38. * @param string $logstore
  39. * logstore name
  40. * @param string $shardId
  41. * shard id
  42. * @param string $mode
  43. * query mode,value must be 'begin' or 'end'
  44. * @param string $fromTime
  45. * query by from time,unix_timestamp
  46. */
  47. public function __construct($project,$logstore,$shardId,$mode=null,$fromTime=-1) {
  48. parent::__construct ( $project );
  49. $this->logstore = $logstore;
  50. $this->shardId = $shardId;
  51. $this->mode = $mode;
  52. $this->fromTime = $fromTime;
  53. }
  54. /**
  55. * Get logstore name
  56. *
  57. * @return string logstore name
  58. */
  59. public function getLogstore(){
  60. return $this->logstore;
  61. }
  62. /**
  63. * Set logstore name
  64. *
  65. * @param string $logstore
  66. * logstore name
  67. */
  68. public function setLogstore($logstore){
  69. $this->logstore = $logstore;
  70. }
  71. /**
  72. * Get shard id
  73. *
  74. * @return string shard id
  75. */
  76. public function getShardId(){
  77. return $this->shardId;
  78. }
  79. /**
  80. * Set shard id
  81. *
  82. * @param string $shardId
  83. * shard id
  84. */
  85. public function setShardId($shardId){
  86. $this->shardId = $shardId;
  87. }
  88. /**
  89. * Get mode
  90. *
  91. * @return string mode
  92. */
  93. public function getMode(){
  94. return $this->mode;
  95. }
  96. /**
  97. * Set mode
  98. *
  99. * @param string $mode
  100. * value must be 'begin' or 'end'
  101. */
  102. public function setMode($mode){
  103. $this->mode = $mode;
  104. }
  105. /**
  106. * Get from time
  107. *
  108. * @return integer(unix_timestamp) from time
  109. */
  110. public function getFromTime(){
  111. return $this->fromTime;
  112. }
  113. /**
  114. * Set from time
  115. *
  116. * @param integer $fromTime
  117. * from time (unix_timestamp)
  118. */
  119. public function setFromTime($fromTime){
  120. $this->fromTime = $fromTime;
  121. }
  122. }