1 | <?php |
||
32 | class RemoteMethodCall implements RemoteMethodInterface |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * The name of the webapp this call originates from |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $appName; |
||
41 | |||
42 | /** |
||
43 | * The class name to invoke the method on. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $className = null; |
||
48 | |||
49 | /** |
||
50 | * The method name to invoke on the class. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $methodName = null; |
||
55 | |||
56 | /** |
||
57 | * Parameters for the method. |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $parameters = array(); |
||
62 | |||
63 | /** |
||
64 | * The session ID to use for the method call. |
||
65 | * |
||
66 | * @var string |
||
67 | */ |
||
68 | protected $sessionId = null; |
||
69 | |||
70 | /** |
||
71 | * The client's socket server IP address to send the response to. |
||
72 | * |
||
73 | * @var string |
||
74 | */ |
||
75 | protected $address = '127.0.0.1'; |
||
76 | |||
77 | /** |
||
78 | * The client's socket server port to send the response to. |
||
79 | * |
||
80 | * @var integer |
||
81 | */ |
||
82 | protected $port = 0; |
||
83 | |||
84 | /** |
||
85 | * Initialize the instance with the necessary params. |
||
86 | * |
||
87 | * @param string $className The class name to invoke the method on |
||
88 | * @param string $methodName The method name to invoke |
||
89 | * @param string $sessionId The session ID to use for the method call |
||
90 | */ |
||
91 | 2 | public function __construct($className, $methodName, $sessionId = null) |
|
97 | |||
98 | /** |
||
99 | * Adds passed parameter to the array with the parameters. |
||
100 | * |
||
101 | * @param integer $key The parameter name |
||
102 | * @param mixed $value The parameter value |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | public function addParameter($key, $value) |
||
110 | |||
111 | /** |
||
112 | * Returns the parameter with the passed key. |
||
113 | * |
||
114 | * @param string $key The name of the parameter to return |
||
115 | * |
||
116 | * @return mixed The parameter's value |
||
117 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getParameter() |
||
118 | */ |
||
119 | public function getParameter($key) |
||
123 | |||
124 | /** |
||
125 | * Returns the parameters for the method. |
||
126 | * |
||
127 | * @return array The method's parameters |
||
128 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getParameters() |
||
129 | */ |
||
130 | public function getParameters() |
||
134 | |||
135 | /** |
||
136 | * Returns the class name to invoke the method on. |
||
137 | * |
||
138 | * @return string The class name |
||
139 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getClassName() |
||
140 | */ |
||
141 | 1 | public function getClassName() |
|
145 | |||
146 | /** |
||
147 | * Returns the method name to invoke on the class. |
||
148 | * |
||
149 | * @return string The method name |
||
150 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getMethodName() |
||
151 | */ |
||
152 | 1 | public function getMethodName() |
|
156 | |||
157 | /** |
||
158 | * Returns the session ID to use for the method call. |
||
159 | * |
||
160 | * @return string The session ID |
||
161 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getSessionId() |
||
162 | */ |
||
163 | public function getSessionId() |
||
167 | |||
168 | /** |
||
169 | * Sets the client's socket server IP address. |
||
170 | * |
||
171 | * @param string $address The client's socket server IP address |
||
172 | * |
||
173 | * @return void |
||
174 | */ |
||
175 | public function setAddress($address) |
||
179 | |||
180 | /** |
||
181 | * Returns the client's server socket IP address. |
||
182 | * |
||
183 | * @return string The client's server socket IP address |
||
184 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getAddress() |
||
185 | */ |
||
186 | public function getAddress() |
||
190 | |||
191 | /** |
||
192 | * Sets the webapp name the call comes from |
||
193 | * |
||
194 | * @param string $appName Name of the webapp using this client connection |
||
195 | * |
||
196 | * @return void |
||
197 | */ |
||
198 | public function setAppName($appName) |
||
202 | |||
203 | /** |
||
204 | * Returns the name of the webapp this call comes from |
||
205 | * |
||
206 | * @return string The webapp name |
||
207 | */ |
||
208 | public function getAppName() |
||
212 | |||
213 | /** |
||
214 | * Sets the client's socket server port. |
||
215 | * |
||
216 | * @param integer $port The client's socket server port |
||
217 | * |
||
218 | * @return void |
||
219 | */ |
||
220 | public function setPort($port) |
||
224 | |||
225 | /** |
||
226 | * Returns the client's server socket port. |
||
227 | * |
||
228 | * @return string The client's server socket port |
||
229 | * @see \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface::getPort() |
||
230 | */ |
||
231 | public function getPort() |
||
235 | } |
||
236 |