1 /**
2 * .
3 */
4 package org.sirius.client.web;
5
6 import java.rmi.RemoteException;
7
8 import org.sirius.client.web.core.Dimension;
9 import org.sirius.client.web.core.Point;
10 import org.sirius.client.web.core.WebCore;
11 import org.sirius.client.web.core.WebCoreProxy;
12 import org.sirius.client.web.select.WebSelectProxy;
13
14 /**
15 * Contains core API for interaction with the Web applications.
16 * It's purely core and plain API which is the basis for high-level window classes library
17 * in the <b>org.sirius.client.web.classes</b> package.
18 * @author Myk Kolisnyk
19 */
20 public class WebClientCoreProxy extends WebCoreProxy {
21
22 /**
23 * Contains the value of currently open browser session.
24 * All other methods implicitly reference this token while making the calls.
25 */
26 private String token = "";
27
28 /**
29 * Additional reference to the proxy class responsible for interacting with the Web lists.
30 */
31 private WebSelectProxy select;
32
33 /**
34 * Initializes Core Web proxy instance using default host: <b>http://localhost:21212</b>.
35 */
36 public WebClientCoreProxy() {
37 select = new WebSelectProxy();
38 }
39
40 /**
41 * Initializes Core Web proxy instance using specified end-point host
42 * @param endpoint the host where remote Server module listens to
43 */
44 public WebClientCoreProxy(final String endpoint) {
45 super(endpoint);
46 }
47
48 /**
49 * .
50 * @throws RemoteException .
51 */
52 public final void back() throws RemoteException {
53
54 super.back(this.token);
55 }
56
57 /**
58 * .
59 * @param arg1 .
60 * @param arg2 .
61 * @throws RemoteException .
62 */
63 public final void clear(final String arg1, final String arg2)
64 throws RemoteException {
65
66 super.clear(this.token, arg1, arg2);
67 }
68
69 /**
70 * .
71 * @param arg1 .
72 * @param arg2 .
73 * @throws RemoteException .
74 */
75 public final void click(final String arg1, final String arg2)
76 throws RemoteException {
77
78 super.click(this.token, arg1, arg2);
79 }
80
81 /**
82 * @param arg1 .
83 * @param arg2 .
84 * @throws RemoteException .
85 * @see org.sirius.client.web.select.WebSelectProxy#deselectAll
86 * (java.lang.String, java.lang.String, java.lang.String)
87 */
88 public final void deselectAll(final String arg1, final String arg2)
89 throws RemoteException {
90 select.deselectAll(this.token, arg1, arg2);
91 }
92
93 /**
94 * @param arg1
95 * .
96 * @param arg2
97 * .
98 * @param arg3
99 * .
100 * @throws RemoteException .
101 * @see org.sirius.client.web.select.WebSelectProxy#deselectByIndex
102 * (java.lang.String, java.lang.String, java.lang.String, int)
103 */
104 public final void deselectByIndex(final String arg1, final String arg2,
105 final int arg3) throws RemoteException {
106 select.deselectByIndex(this.token, arg1, arg2, arg3);
107 }
108
109 /**
110 * @param arg1
111 * .
112 * @param arg2
113 * .
114 * @param arg3
115 * .
116 * @throws RemoteException .
117 * @see org.sirius.client.web.select.WebSelectProxy
118 * #deselectByValue(java.lang.String,java.lang.String,
119 * java.lang.String, java.lang.String)
120 */
121 public final void deselectByValue(final String arg1, final String arg2,
122 final String arg3) throws RemoteException {
123 select.deselectByValue(this.token, arg1, arg2, arg3);
124 }
125
126 /**
127 * @param arg1
128 * .
129 * @param arg2
130 * .
131 * @param arg3
132 * .
133 * @throws RemoteException .
134 * @see org.sirius.client.web.select.WebSelectProxy
135 * #deselectByVisibleText(java.lang.String, java.lang.String,
136 * java.lang.String, java.lang.String)
137 */
138 public final void deselectByVisibleText(final String arg1,
139 final String arg2, final String arg3) throws RemoteException {
140 select.deselectByVisibleText(this.token, arg1, arg2, arg3);
141 }
142
143 /**
144 * .
145 * @throws RemoteException .
146 */
147 public final void forward() throws RemoteException {
148 super.forward(this.token);
149 }
150
151 /**
152 * @param arg1 .
153 * @param arg2 .
154 * @return .
155 * @throws RemoteException .
156 * @see org.sirius.client.web.select.WebSelectProxy
157 * #getAllOptions(java.lang.String, java.lang.String, java.lang.String)
158 */
159 public final String[] getAllOptions(final String arg1, final String arg2)
160 throws RemoteException {
161 return select.getAllOptions(this.token, arg1, arg2);
162 }
163
164 /**
165 * @param arg1
166 * .
167 * @param arg2
168 * .
169 * @return .
170 * @throws RemoteException .
171 * @see org.sirius.client.web.select.WebSelectProxy
172 * #getAllSelectedOptions(java.lang.String, java.lang.String,
173 * java.lang.String)
174 */
175 public final String[] getAllSelectedOptions(final String arg1,
176 final String arg2) throws RemoteException {
177 return select.getAllSelectedOptions(this.token, arg1, arg2);
178 }
179
180 /**
181 * @param arg1
182 * .
183 * @param arg2
184 * .
185 * @param arg3
186 * .
187 * @return .
188 * @throws RemoteException .
189 */
190 public final String getAttribute(final String arg1, final String arg2,
191 final String arg3) throws RemoteException {
192 return super.getAttribute(this.token, arg1, arg2, arg3);
193 }
194
195 /**
196 * @param arg1
197 * .
198 * @param arg2
199 * .
200 * @param arg3
201 * .
202 * @return .
203 * @throws RemoteException .
204 */
205 public final String getCssValue(final String arg1, final String arg2,
206 final String arg3) throws RemoteException {
207
208 return super.getCssValue(this.token, arg1, arg2, arg3);
209 }
210
211 @Override
212 public final String getEndpoint() {
213
214 return super.getEndpoint();
215 }
216
217 /**
218 * @param arg1
219 * .
220 * @param arg2
221 * .
222 * @return .
223 * @throws RemoteException .
224 * @see org.sirius.client.web.select.WebSelectProxy
225 * #getFirstSelectedOption(java.lang.String, java.lang.String,
226 * java.lang.String)
227 */
228 public final String getFirstSelectedOption(final String arg1,
229 final String arg2) throws RemoteException {
230 return select.getFirstSelectedOption(this.token, arg1, arg2);
231 }
232
233 /**
234 * @param arg1
235 * .
236 * @param arg2
237 * .
238 * @return .
239 * @throws RemoteException .
240 */
241 public final Point getLocation(final String arg1, final String arg2)
242 throws RemoteException {
243 return super.getLocation(this.token, arg1, arg2);
244 }
245
246 /**
247 * .
248 * @return .
249 * @throws RemoteException .
250 */
251 public final String getPageSource() throws RemoteException {
252
253 return super.getPageSource(this.token);
254 }
255
256 /**
257 * @param arg1
258 * .
259 * @param arg2
260 * .
261 * @return .
262 * @throws RemoteException .
263 */
264 public final Dimension getSize(final String arg1, final String arg2)
265 throws RemoteException {
266 return super.getSize(this.token, arg1, arg2);
267 }
268
269 /**
270 * @param arg1
271 * .
272 * @param arg2
273 * .
274 * @return .
275 * @throws RemoteException .
276 */
277 public final String getTagName(final String arg1, final String arg2)
278 throws RemoteException {
279 return super.getTagName(this.token, arg1, arg2);
280 }
281
282 /**
283 * @param arg1
284 * .
285 * @param arg2
286 * .
287 * @return .
288 * @throws RemoteException .
289 */
290 public final String getText(final String arg1, final String arg2)
291 throws RemoteException {
292 return super.getText(this.token, arg1, arg2);
293 }
294
295 /**
296 * .
297 * @return .
298 * @throws RemoteException .
299 */
300 public final String getTitle() throws RemoteException {
301
302 return super.getTitle(this.token);
303 }
304
305 /**
306 * .
307 * @return .
308 * @throws RemoteException .
309 */
310 public final String getURL() throws RemoteException {
311 return super.getURL(this.token);
312 }
313
314 @Override
315 public final WebCore getWebCore() {
316
317 return super.getWebCore();
318 }
319
320 /**
321 * .
322 * @return .
323 * @throws RemoteException .
324 */
325 public final String getWindowHandle() throws RemoteException {
326
327 return super.getWindowHandle(this.token);
328 }
329
330 /**
331 * .
332 * @param arg1 .
333 * @param arg2 .
334 * @return .
335 * @throws RemoteException .
336 */
337 public final boolean isDisplayed(final String arg1, final String arg2)
338 throws RemoteException {
339
340 return super.isDisplayed(this.token, arg1, arg2);
341 }
342
343 /**
344 * .
345 * @param arg1 .
346 * @param arg2 .
347 * @return .
348 * @throws RemoteException .
349 */
350 public final boolean isEnabled(final String arg1, final String arg2)
351 throws RemoteException {
352
353 return super.isEnabled(this.token, arg1, arg2);
354 }
355
356 /**
357 * @param arg1
358 * .
359 * @param arg2
360 * .
361 * @return .
362 * @throws RemoteException .
363 * @see org.sirius.client.web.select.WebSelectProxy
364 * #isMultiple(java.lang.String, java.lang.String, java.lang.String)
365 */
366 public final boolean isMultiple(final String arg1, final String arg2)
367 throws RemoteException {
368 return select.isMultiple(this.token, arg1, arg2);
369 }
370
371 /**
372 * .
373 * @param arg1
374 * .
375 * @param arg2
376 * .
377 * @return .
378 * @throws RemoteException .
379 */
380 public final boolean isSelected(final String arg1, final String arg2)
381 throws RemoteException {
382 return super.isSelected(this.token, arg1, arg2);
383 }
384
385 /**
386 * .
387 * @param arg1
388 * .
389 * @throws RemoteException .
390 */
391 public final void open(final String arg1) throws RemoteException {
392 super.open(this.token, arg1);
393 }
394
395 /**
396 * .
397 * @throws RemoteException .
398 */
399 public final void refresh() throws RemoteException {
400
401 super.refresh(this.token);
402 }
403
404 /**
405 * .
406 * @throws RemoteException .
407 */
408 public final void selectAlert() throws RemoteException {
409
410 super.selectAlert(this.token);
411 }
412
413 /**
414 * @param arg1
415 * .
416 * @param arg2
417 * .
418 * @param arg3
419 * .
420 * @throws RemoteException .
421 * @see org.sirius.client.web.select.WebSelectProxy
422 * #selectByIndex(java.lang.String, java.lang.String, java.lang.String,
423 * int)
424 */
425 public final void selectByIndex(final String arg1, final String arg2,
426 final int arg3) throws RemoteException {
427 select.selectByIndex(this.token, arg1, arg2, arg3);
428 }
429
430 /**
431 * @param arg1
432 * .
433 * @param arg2
434 * .
435 * @param arg3
436 * .
437 * @throws RemoteException .
438 * @see org.sirius.client.web.select.WebSelectProxy
439 * #selectByValue(java.lang.String, java.lang.String, java.lang.String,
440 * java.lang.String)
441 */
442 public final void selectByValue(final String arg1, final String arg2,
443 final String arg3) throws RemoteException {
444 select.selectByValue(this.token, arg1, arg2, arg3);
445 }
446
447 /**
448 * @param arg1
449 * .
450 * @param arg2
451 * .
452 * @param arg3
453 * .
454 * @throws RemoteException .
455 * @see org.sirius.client.web.select.WebSelectProxy
456 * #selectByVisibleText(java.lang.String, java.lang.String,
457 * java.lang.String, java.lang.String)
458 */
459 public final void selectByVisibleText(final String arg1, final String arg2,
460 final String arg3) throws RemoteException {
461 select.selectByVisibleText(this.token, arg1, arg2, arg3);
462 }
463
464 /**
465 * .
466 * @throws RemoteException .
467 */
468 public final void selectDefaultContent() throws RemoteException {
469 super.selectDefaultContent(this.token);
470 }
471
472 /**
473 * .
474 * @param arg1
475 * .
476 * @throws RemoteException .
477 */
478 public final void selectFrameByIndex(final int arg1)
479 throws RemoteException {
480
481 super.selectFrameByIndex(this.token, arg1);
482 }
483
484 /**
485 * .
486 * @param arg1
487 * .
488 * @throws RemoteException .
489 */
490 public final void selectFrameByName(final String arg1)
491 throws RemoteException {
492
493 super.selectFrameByName(this.token, arg1);
494 }
495
496 /**
497 * .
498 * @param arg1
499 * .
500 * @throws RemoteException .
501 */
502 public final void selectWindow(final String arg1) throws RemoteException {
503
504 super.selectWindow(this.token, arg1);
505 }
506
507 /**
508 * .
509 * @param arg1
510 * .
511 * @param arg2
512 * .
513 * @param arg3
514 * .
515 * @throws RemoteException .
516 */
517 public final void sendKeys(final String arg1, final String arg2,
518 final String arg3) throws RemoteException {
519
520 super.sendKeys(this.token, arg1, arg2, arg3);
521 }
522
523 @Override
524 public final String start(final String browser) throws RemoteException {
525 this.token = super.start(browser);
526 return this.token;
527 }
528
529 /**
530 * .
531 * @throws RemoteException .
532 */
533 public final void stop() throws RemoteException {
534 super.stop(this.token);
535 }
536
537 /**
538 * .
539 * @param arg1
540 * .
541 * @param arg2
542 * .
543 * @throws RemoteException .
544 */
545 public final void submit(final String arg1, final String arg2)
546 throws RemoteException {
547 super.submit(this.token, arg1, arg2);
548 }
549
550 /**
551 * .
552 * @return .
553 */
554 public final String token() {
555 return token;
556 }
557 }