public class ScopeServices extends Object implements ConnectionHandler
| Constructor and Description |
|---|
ScopeServices(SortedSet<ScopeService> requiredServices,
int port,
boolean manualConnect)
Creates the Scope server on specified address and port, as well as enabling the required Scope
services.
|
| Modifier and Type | Method and Description |
|---|---|
void |
captureOperaIdle()
Enables the capturing on OperaIdle events.
|
void |
close()
Close the connection and cleanup the channel
|
void |
enableServices(Collection<Service> services) |
UmsProtos.Response |
executeMessage(Message message,
com.google.protobuf.AbstractMessage.Builder<?> builder)
Sends a message and wait for the response.
|
UmsProtos.Response |
executeMessage(Message message,
com.google.protobuf.AbstractMessage.Builder<?> builder,
long timeout) |
Map<ScopeService,String> |
getAvailableServices() |
StpConnection |
getConnection() |
ConsoleLogger |
getConsoleLogger() |
CookieManager |
getCookieManager() |
Core |
getCore() |
Debugger |
getDebugger() |
DesktopUtils |
getDesktopUtils() |
DesktopWindowManager |
getDesktopWindowManager() |
Exec |
getExec() |
Prefs |
getPrefs() |
Selftest |
getSelftest() |
ScopeSystemInputManager |
getSystemInputManager() |
WindowManager |
getWindowManager() |
void |
init()
Gets the supported services from Opera and calls methods to enable the ones we requested.
|
boolean |
isConnected() |
boolean |
isOperaIdleAvailable() |
boolean |
onConnected(StpConnection con)
This event is emitted if the STP connection thread has accepted a connection.
|
void |
onDesktopWindowActivated(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDesktopWindowClosed(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDesktopWindowLoaded(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDesktopWindowPageChanged(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDesktopWindowShown(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDesktopWindowUpdated(DesktopWmProtos.DesktopWindowInfo info) |
void |
onDisconnect()
This event is triggered whenever the STP connection is closed.
|
void |
onException(Exception exception)
This event is triggered if an exception is thrown on the STP connection thread.
|
void |
onHandshake(boolean stp1)
This event is triggered when we have received a response to
StpConnection.sendEnableStp1(). |
void |
onOperaIdle() |
void |
onQuickMenuClosed(DesktopWmProtos.QuickMenuID id) |
void |
onQuickMenuItemPressed(DesktopWmProtos.QuickMenuItemID menuItemID) |
void |
onQuickMenuShown(DesktopWmProtos.QuickMenuInfo info) |
void |
onRequest(int windowId) |
void |
onResponseReceived(int tag,
UmsProtos.Response response)
This event is triggered whenever a command error response is received.
|
void |
onSelftestDone() |
void |
onServiceList(List<String> services)
This event is triggered upon receiving an initial service list from Opera.
|
void |
onWindowClosed(int id) |
void |
onWindowLoaded(int id) |
void |
quit() |
void |
quit(OperaRunner runner) |
void |
quitOpera(OperaRunner runner) |
void |
setConsoleLogger(ConsoleLogger consoleLogger) |
void |
setCookieManager(CookieManager cookieManager) |
void |
setCore(Core core) |
void |
setDebugger(EcmascriptDebugger debugger) |
void |
setDesktopUtils(DesktopUtils desktopUtils) |
void |
setDesktopWindowManager(DesktopWindowManager desktopWindowManager) |
void |
setExec(Exec exec) |
void |
setPrefs(Prefs prefs) |
void |
setSelftest(Selftest selftest) |
void |
setSystemInputManager(ScopeSystemInputManager manager) |
void |
setWindowManager(WindowManager windowManager) |
void |
shutdown() |
void |
startStpThread() |
WaitState |
waitFor() |
int |
waitForDesktopWindowActivated(String windowName,
long timeout) |
int |
waitForDesktopWindowClosed(String windowName,
long timeout) |
int |
waitForDesktopWindowLoaded(String windowName,
long timeout) |
int |
waitForDesktopWindowPageChanged(String windowName,
long timeout) |
int |
waitForDesktopWindowShown(String windowName,
long timeout) |
int |
waitForDesktopWindowUpdated(String windowName,
long timeout) |
String |
waitForMenuClosed(String menuName,
long timeout) |
String |
waitForMenuItemPressed(String menuItemText,
long timeout) |
String |
waitForMenuShown(String menuName,
long timeout) |
void |
waitForOperaIdle(long timeout)
Waits for an OperaIdle event before continuing.
|
void |
waitForWindowLoaded(int activeWindowId,
long timeout) |
void |
waitStart() |
public ScopeServices(SortedSet<ScopeService> requiredServices, int port, boolean manualConnect) throws IOException
requiredServices - set of required servicesport - the port on which to start the Scope servermanualConnect - whether to output ready message with port number when startingIOException - if an I/O error occurspublic void init()
public boolean isConnected()
public void shutdown()
public void enableServices(Collection<Service> services)
public void quitOpera(OperaRunner runner) throws IOException
IOExceptionpublic Map<ScopeService,String> getAvailableServices()
public void quit()
throws IOException
IOExceptionpublic void quit(OperaRunner runner) throws IOException
IOExceptionpublic boolean onConnected(StpConnection con)
ConnectionHandleronConnected in interface ConnectionHandlercon - the connection that has been acceptedpublic void onServiceList(List<String> services)
ConnectionHandleronServiceList in interface ConnectionHandlerservices - the list of services available in the connected Opera instancepublic void onWindowLoaded(int id)
public void onWindowClosed(int id)
public void onDesktopWindowShown(DesktopWmProtos.DesktopWindowInfo info)
public void onDesktopWindowUpdated(DesktopWmProtos.DesktopWindowInfo info)
public void onDesktopWindowClosed(DesktopWmProtos.DesktopWindowInfo info)
public void onDesktopWindowActivated(DesktopWmProtos.DesktopWindowInfo info)
public void onDesktopWindowLoaded(DesktopWmProtos.DesktopWindowInfo info)
public void onDesktopWindowPageChanged(DesktopWmProtos.DesktopWindowInfo info)
public void onQuickMenuShown(DesktopWmProtos.QuickMenuInfo info)
public void onQuickMenuItemPressed(DesktopWmProtos.QuickMenuItemID menuItemID)
public void onQuickMenuClosed(DesktopWmProtos.QuickMenuID id)
public void onHandshake(boolean stp1)
ConnectionHandlerStpConnection.sendEnableStp1().onHandshake in interface ConnectionHandlerstp1 - true if handshake was an STP/1 responsepublic void onDisconnect()
ConnectionHandleronDisconnect in interface ConnectionHandlerpublic void onOperaIdle()
public void onSelftestDone()
public void waitForWindowLoaded(int activeWindowId,
long timeout)
public WaitState waitFor()
public boolean isOperaIdleAvailable()
public void captureOperaIdle()
public void waitForOperaIdle(long timeout)
timeout - Time in milliseconds to wait before abortingpublic void waitStart()
public int waitForDesktopWindowLoaded(String windowName, long timeout)
public int waitForDesktopWindowShown(String windowName, long timeout)
public int waitForDesktopWindowUpdated(String windowName, long timeout)
public int waitForDesktopWindowActivated(String windowName, long timeout)
public int waitForDesktopWindowClosed(String windowName, long timeout)
public int waitForDesktopWindowPageChanged(String windowName, long timeout)
public void onResponseReceived(int tag,
UmsProtos.Response response)
ConnectionHandleronResponseReceived in interface ConnectionHandlertag - the internal command tag corresponding to the requestresponse - the response, or null if the response was an errorpublic void onException(Exception exception)
ConnectionHandleronException in interface ConnectionHandlerexception - the exception thrown on the STP connection threadpublic void close()
public UmsProtos.Response executeMessage(Message message, com.google.protobuf.AbstractMessage.Builder<?> builder)
public UmsProtos.Response executeMessage(Message message, com.google.protobuf.AbstractMessage.Builder<?> builder, long timeout)
public void startStpThread()
public void onRequest(int windowId)
public StpConnection getConnection()
public Debugger getDebugger()
public void setDebugger(EcmascriptDebugger debugger)
public Exec getExec()
public void setExec(Exec exec)
public WindowManager getWindowManager()
public void setWindowManager(WindowManager windowManager)
public ConsoleLogger getConsoleLogger()
public void setConsoleLogger(ConsoleLogger consoleLogger)
public Core getCore()
public void setCore(Core core)
public Prefs getPrefs()
public void setPrefs(Prefs prefs)
public DesktopWindowManager getDesktopWindowManager()
public void setDesktopWindowManager(DesktopWindowManager desktopWindowManager)
public DesktopUtils getDesktopUtils()
public void setDesktopUtils(DesktopUtils desktopUtils)
public ScopeSystemInputManager getSystemInputManager()
public void setSystemInputManager(ScopeSystemInputManager manager)
public CookieManager getCookieManager()
public void setCookieManager(CookieManager cookieManager)
public Selftest getSelftest()
public void setSelftest(Selftest selftest)
Copyright © 2013. All Rights Reserved.