1 /** 2 * . 3 */ 4 package org.sirius.client.web; 5 6 import java.rmi.RemoteException; 7 8 /** 9 * @author Myk Kolisnyk 10 */ 11 public class WebClient { 12 /** 13 * Constant indicating Internet Explorer browser. 14 */ 15 public static final String IE = "ie"; 16 /** 17 * Constant indicating Firefox browser. 18 */ 19 public static final String FIREFOX = "firefox"; 20 /** 21 * Constant indicating Firefox (unsecured mode) browser. 22 */ 23 public static final String FIREFOX_UNSECURED = "chrome"; 24 /** 25 * Constant indicating Google Chrome browser. 26 */ 27 public static final String CHROME = "googlechrome"; 28 /** 29 * Constant indicating Opera browser. 30 */ 31 public static final String OPERA = "opera"; 32 /** 33 * Constant indicating Html Unit browser. 34 */ 35 public static final String HTMLUNIT = "htmlunit"; 36 37 /** 38 * Provides interface for the core Web Client. 39 */ 40 private WebClientCoreProxy core = null; 41 42 /** 43 * Initializes instance of the Web Client using default host: <b>http://localhost:21212</b>. 44 */ 45 public WebClient() { 46 core = new WebClientCoreProxy(); 47 } 48 49 /** 50 * Returns interface for the Web Client Core proxy object. 51 * @return Web Client Core proxy object. 52 */ 53 public final WebClientCoreProxy core() { 54 return core; 55 } 56 57 /** 58 * Initiates new browser session. 59 * @param browser browser to start. 60 * @throws RemoteException thrown if no connection is made with the server or some other network issues. 61 */ 62 public final void start(final String browser) throws RemoteException { 63 core.start(browser); 64 } 65 66 /** 67 * Terminates recently open browser session. 68 * @throws RemoteException thrown if no connection is made with the server or some other network issues. 69 */ 70 public final void stop() throws RemoteException { 71 core.stop(); 72 } 73 }