|
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: ConnectionInterface.php 20096 2010-01-06 02:05:09Z bkarwin $ |
|
21 */ |
|
22 |
|
23 /** |
|
24 * The Stomp client interacts with a Stomp server. |
|
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_Client_ConnectionInterface |
|
33 { |
|
34 /** |
|
35 * @param string $scheme ['tcp', 'udp'] |
|
36 * @param string host |
|
37 * @param integer port |
|
38 * @param string class - create a connection with this class; class must support Zend_Queue_Stomp_Client_Connection_Interface |
|
39 * @return boolean |
|
40 */ |
|
41 public function open($scheme, $host, $port); |
|
42 |
|
43 /** |
|
44 * @param boolean $destructor |
|
45 * @return void |
|
46 */ |
|
47 public function close($destructor = false); |
|
48 |
|
49 /** |
|
50 * Check whether we are connected to the server |
|
51 * |
|
52 * @return true |
|
53 * @throws Zend_Queue_Exception |
|
54 */ |
|
55 public function ping(); |
|
56 |
|
57 /** |
|
58 * write a frame to the stomp server |
|
59 * |
|
60 * example: $response = $client->write($frame)->read(); |
|
61 * |
|
62 * @param Zend_Queue_Stomp_FrameInterface $frame |
|
63 * @return $this |
|
64 */ |
|
65 public function write(Zend_Queue_Stomp_FrameInterface $frame); |
|
66 |
|
67 /** |
|
68 * tests the socket to see if there is data for us |
|
69 */ |
|
70 public function canRead(); |
|
71 |
|
72 /** |
|
73 * reads in a frame from the socket or returns false. |
|
74 * |
|
75 * @return Zend_Queue_Stomp_Frame|false |
|
76 * @throws Zend_Queue_Exception |
|
77 */ |
|
78 public function read(); |
|
79 |
|
80 /** |
|
81 * Set the frame class to be used |
|
82 * |
|
83 * This must be a Zend_Queue_Stomp_FrameInterface. |
|
84 * |
|
85 * @param string $class |
|
86 * @return Zend_Queue_Stomp_Client_ConnectionInterface; |
|
87 */ |
|
88 public function setFrameClass($class); |
|
89 |
|
90 /** |
|
91 * Get the frameClass |
|
92 * |
|
93 * @return string |
|
94 */ |
|
95 public function getFrameClass(); |
|
96 |
|
97 /** |
|
98 * create an empty frame |
|
99 * |
|
100 * @return Zend_Queue_Stomp_FrameInterface class |
|
101 */ |
|
102 public function createFrame(); |
|
103 } |