|
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-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
20 * @version $Id: FrameInterface.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
21 */ |
|
22 |
|
23 /** |
|
24 * This class represents a Stomp Frame Interface |
|
25 * |
|
26 * @category Zend |
|
27 * @package Zend_Queue |
|
28 * @subpackage Stomp |
|
29 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
|
30 * @license http://framework.zend.com/license/new-bsd New BSD License |
|
31 */ |
|
32 interface Zend_Queue_Stomp_FrameInterface |
|
33 { |
|
34 /** |
|
35 * Get the status of the auto content length |
|
36 * |
|
37 * If AutoContentLength is true this code will automatically put the |
|
38 * content-length header in, even if it is already set by the user. |
|
39 * |
|
40 * This is done to make the message sending more reliable. |
|
41 * |
|
42 * @return boolean |
|
43 */ |
|
44 public function getAutoContentLength(); |
|
45 |
|
46 /** |
|
47 * setAutoContentLength() |
|
48 * |
|
49 * Set the value on or off. |
|
50 * |
|
51 * @param boolean $auto |
|
52 * @return $this; |
|
53 * @throws Zend_Queue_Exception |
|
54 */ |
|
55 public function setAutoContentLength($auto); |
|
56 |
|
57 /** |
|
58 * Get the headers |
|
59 * |
|
60 * @return array |
|
61 */ |
|
62 public function getHeaders(); |
|
63 |
|
64 /** |
|
65 * Set the headers |
|
66 * |
|
67 * Throws an exception if the array values are not strings. |
|
68 * |
|
69 * @param array $headers |
|
70 * @return $this |
|
71 * @throws Zend_Queue_Exception |
|
72 */ |
|
73 public function setHeaders(array $headers); |
|
74 |
|
75 /** |
|
76 * Returns a value for a header |
|
77 * returns false if the header does not exist |
|
78 * |
|
79 * @param string $header |
|
80 * @return $string |
|
81 * @throws Zend_Queue_Exception |
|
82 */ |
|
83 public function getHeader($header); |
|
84 |
|
85 /** |
|
86 * Returns a value for a header |
|
87 * returns false if the header does not exist |
|
88 * |
|
89 * @param string $header |
|
90 * @param string $value |
|
91 * @return $this |
|
92 * @throws Zend_Queue_Exception |
|
93 */ |
|
94 public function setHeader($header, $value); |
|
95 |
|
96 /** |
|
97 * Return the body for this frame |
|
98 * returns false if the body does not exist |
|
99 * |
|
100 * @return $this |
|
101 */ |
|
102 public function getBody(); |
|
103 |
|
104 /** |
|
105 * Set the body for this frame |
|
106 * returns false if the body does not exist |
|
107 * |
|
108 * Set to null for no body. |
|
109 * |
|
110 * @param string|null $body |
|
111 * @return $this |
|
112 * @throws Zend_Queue_Exception |
|
113 */ |
|
114 public function setBody($body); |
|
115 |
|
116 /** |
|
117 * Return the command for this frame |
|
118 * return false if the command does not exist |
|
119 * |
|
120 * @return $this |
|
121 */ |
|
122 public function getCommand(); |
|
123 |
|
124 /** |
|
125 * Set the body for this frame |
|
126 * returns false if the body does not exist |
|
127 * |
|
128 * @return $this |
|
129 * @throws Zend_Queue_Exception |
|
130 */ |
|
131 public function setCommand($command); |
|
132 |
|
133 |
|
134 /** |
|
135 * Takes the current parameters and returns a Stomp Frame |
|
136 * |
|
137 * @throws Zend_Queue_Exception |
|
138 * @return string |
|
139 */ |
|
140 public function toFrame(); |
|
141 |
|
142 /** |
|
143 * @see toFrame() |
|
144 */ |
|
145 public function __toString(); |
|
146 |
|
147 /** |
|
148 * Accepts a frame and deconstructs the frame into its' component parts |
|
149 * |
|
150 * @param string $frame - a stomp frame |
|
151 * @return $this |
|
152 */ |
|
153 public function fromFrame($frame); |
|
154 } |