FrameInterface.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Queue
  17. * @subpackage Stomp
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * This class represents a Stomp Frame Interface
  24. *
  25. * @category Zend
  26. * @package Zend_Queue
  27. * @subpackage Stomp
  28. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. */
  31. interface Zend_Queue_Stomp_FrameInterface
  32. {
  33. /**
  34. * Get the status of the auto content length
  35. *
  36. * If AutoContentLength is true this code will automatically put the
  37. * content-length header in, even if it is already set by the user.
  38. *
  39. * This is done to make the message sending more reliable.
  40. *
  41. * @return boolean
  42. */
  43. public function getAutoContentLength();
  44. /**
  45. * setAutoContentLength()
  46. *
  47. * Set the value on or off.
  48. *
  49. * @param boolean $auto
  50. * @return $this;
  51. * @throws Zend_Queue_Exception
  52. */
  53. public function setAutoContentLength($auto);
  54. /**
  55. * Get the headers
  56. *
  57. * @return array
  58. */
  59. public function getHeaders();
  60. /**
  61. * Set the headers
  62. *
  63. * Throws an exception if the array values are not strings.
  64. *
  65. * @param array $headers
  66. * @return $this
  67. * @throws Zend_Queue_Exception
  68. */
  69. public function setHeaders(array $headers);
  70. /**
  71. * Returns a value for a header
  72. * returns false if the header does not exist
  73. *
  74. * @param string $header
  75. * @return $string
  76. * @throws Zend_Queue_Exception
  77. */
  78. public function getHeader($header);
  79. /**
  80. * Returns a value for a header
  81. * returns false if the header does not exist
  82. *
  83. * @param string $header
  84. * @param string $value
  85. * @return $this
  86. * @throws Zend_Queue_Exception
  87. */
  88. public function setHeader($header, $value);
  89. /**
  90. * Return the body for this frame
  91. * returns false if the body does not exist
  92. *
  93. * @return $this
  94. */
  95. public function getBody();
  96. /**
  97. * Set the body for this frame
  98. * returns false if the body does not exist
  99. *
  100. * Set to null for no body.
  101. *
  102. * @param string|null $body
  103. * @return $this
  104. * @throws Zend_Queue_Exception
  105. */
  106. public function setBody($body);
  107. /**
  108. * Return the command for this frame
  109. * return false if the command does not exist
  110. *
  111. * @return $this
  112. */
  113. public function getCommand();
  114. /**
  115. * Set the body for this frame
  116. * returns false if the body does not exist
  117. *
  118. * @return $this
  119. * @throws Zend_Queue_Exception
  120. */
  121. public function setCommand($command);
  122. /**
  123. * Takes the current parameters and returns a Stomp Frame
  124. *
  125. * @throws Zend_Queue_Exception
  126. * @return string
  127. */
  128. public function toFrame();
  129. /**
  130. * @see toFrame()
  131. */
  132. public function __toString();
  133. /**
  134. * Accepts a frame and deconstructs the frame into its' component parts
  135. *
  136. * @param string $frame - a stomp frame
  137. * @return $this
  138. */
  139. public function fromFrame($frame);
  140. }