OperationInterface.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Bulk;
  7. /**
  8. * Interface OperationInterface
  9. * @api
  10. * @since 102.0.1
  11. */
  12. interface OperationInterface extends \Magento\Framework\Api\ExtensibleDataInterface
  13. {
  14. /**#@+
  15. * Constants for keys of data array. Identical to the name of the getter in snake case
  16. */
  17. const ID = 'id';
  18. const BULK_ID = 'bulk_uuid';
  19. const TOPIC_NAME = 'topic_name';
  20. const SERIALIZED_DATA = 'serialized_data';
  21. const RESULT_SERIALIZED_DATA = 'result_serialized_data';
  22. const STATUS = 'status';
  23. const RESULT_MESSAGE = 'result_message';
  24. const ERROR_CODE = 'error_code';
  25. /**#@-*/
  26. /**#@+
  27. * Status types
  28. */
  29. const STATUS_TYPE_COMPLETE = 1;
  30. const STATUS_TYPE_RETRIABLY_FAILED = 2;
  31. const STATUS_TYPE_NOT_RETRIABLY_FAILED = 3;
  32. const STATUS_TYPE_OPEN = 4;
  33. const STATUS_TYPE_REJECTED = 5;
  34. /**#@-*/
  35. /**
  36. * Operation id
  37. *
  38. * @return int
  39. * @since 102.0.1
  40. */
  41. public function getId();
  42. /**
  43. * Set operation id
  44. *
  45. * @param int $id
  46. * @return $this
  47. * @since 102.0.1
  48. */
  49. public function setId($id);
  50. /**
  51. * Get bulk uuid
  52. *
  53. * @return string
  54. * @since 102.0.1
  55. */
  56. public function getBulkUuid();
  57. /**
  58. * Set bulk uuid
  59. *
  60. * @param string $bulkId
  61. * @return $this
  62. * @since 102.0.1
  63. */
  64. public function setBulkUuid($bulkId);
  65. /**
  66. * Message Queue Topic
  67. *
  68. * @return string
  69. * @since 102.0.1
  70. */
  71. public function getTopicName();
  72. /**
  73. * Set message queue topic
  74. *
  75. * @param string $topic
  76. * @return $this
  77. * @since 102.0.1
  78. */
  79. public function setTopicName($topic);
  80. /**
  81. * Serialized Data
  82. *
  83. * @return string
  84. * @since 102.0.1
  85. */
  86. public function getSerializedData();
  87. /**
  88. * Set serialized data
  89. *
  90. * @param string $serializedData
  91. * @return $this
  92. * @since 102.0.1
  93. */
  94. public function setSerializedData($serializedData);
  95. /**
  96. * Result serialized Data
  97. *
  98. * @return string
  99. * @since 102.0.1
  100. */
  101. public function getResultSerializedData();
  102. /**
  103. * Set result serialized data
  104. *
  105. * @param string $resultSerializedData
  106. * @return $this
  107. * @since 102.0.1
  108. */
  109. public function setResultSerializedData($resultSerializedData);
  110. /**
  111. * Get operation status
  112. *
  113. * OPEN | COMPLETE | RETRIABLY_FAILED | NOT_RETRIABLY_FAILED
  114. *
  115. * @return int
  116. * @since 102.0.1
  117. */
  118. public function getStatus();
  119. /**
  120. * Set status
  121. *
  122. * @param int $status
  123. * @return $this
  124. * @since 102.0.1
  125. */
  126. public function setStatus($status);
  127. /**
  128. * Get result message
  129. *
  130. * @return string
  131. * @since 102.0.1
  132. */
  133. public function getResultMessage();
  134. /**
  135. * Set result message
  136. *
  137. * @param string $resultMessage
  138. * @return $this
  139. * @since 102.0.1
  140. */
  141. public function setResultMessage($resultMessage);
  142. /**
  143. * Get error code
  144. *
  145. * @return int
  146. * @since 102.0.1
  147. */
  148. public function getErrorCode();
  149. /**
  150. * Set error code
  151. *
  152. * @param int $errorCode
  153. * @return $this
  154. * @since 102.0.1
  155. */
  156. public function setErrorCode($errorCode);
  157. }