Class BrowserService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.browser.BrowserService
- All Implemented Interfaces:
- CtxEventListener,- ContextHandleAware,- HandleAware,- Ready,- ReadyListener
Service that manages browsers connected to this service. In a typical
 single-node environment that has a screen, there is a single browser
 instance running on the same node as this service. In more complex
 devices, other nodes may run browsers that are controlled by the node
 this service is running on. For example, consider a device with a main
 control node and one or more display nodes. The display nodes may run
 just a browser that connects back to the main control node. In this
 case each browser instance is identified by the nodeId of the node it
 is running on and the name of the browser.
 
Typically, a node will run a single browser. In this case the browser has no name (empty string). This service provides several methods for fetching a browser. Use the one the best matches the needs of your device.
 A Browser object is a logical browser abstraction and allows
 navigation commands to be sent to the browser. Browser objects
 can exist without a corresponding browser instance. For example, the
 browser may be on another node and that node is powered off. The
 Browser object is still accessible and can accept commands.
 When the actual browser instance connects, the last navigation command
 will be sent to the browser.
- Since:
- 1.0
- Version:
- 2023-03-06
- 
Method SummaryModifier and TypeMethodDescriptiongetBrowser(NodeId nodeId, String name) Returns the named browser on the specified nodeId.getBrowser(BrowserId browserId) Returns theBrowserwith the specifiedBrowserId, which is simply the combination of a nodeId and name.Returns a collection of existingBrowserobjects.Returns the defaultBrowserrunning on the local node.voidgoToIntent(NodeId nodeId, String type) Navigates the default browser on the specified node to the specified intent.voidgoToIntent(NodeId nodeId, String name, String type) Navigates the named browser on the specified node to the specified intent.booleangoToIntent(BrowserIntent intent) Resolve the specified intent and navigate the browser accordingly.voidgoToIntent(String type) Navigates the browser on the current node to the specified intent.voidNavigates the default browser on the specified node to the specified URL.voidNavigates the named browser on the specified node to the specified URL.voidgoToUrl(BrowserUrl request) Navigates to the url contained in the navigation request.voidNavigates the browser on the current node to the specified URL.voidNavigates the browser on the current node to the specified URL with optional redirect.Methods inherited from class com.tccc.kos.commons.core.service.AbstractServicegetHandle, getHandlePrefixMethods inherited from class com.tccc.kos.commons.util.ready.ReadyBeangetReady, onBeanReady, onDependenciesReadyMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.context.CtxEventListeneronCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompletedMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAwareaddHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyListeneronDependenciesGroupReady
- 
Method Details- 
getLocalBrowserReturns the defaultBrowserrunning on the local node. This is a convenience method for a typical single-node device that runs a single browser locally. User code can interact with theBrowserobject but will have no effect until a correspondingBrowserSessionconnects to the service. At that point, the currentBrowserobject state is sent to the actual browser instance. This allows URLs to be sent before the browser is actually available.
- 
getBrowserReturns the named browser on the specified nodeId. If there is noBrowserthen it is created. User code can interact with theBrowserobject but will have no effect until a correspondingBrowserSessionconnects to the service. At that point, the currentBrowserobject state is sent to the actual browser instance. This allows URLs to be sent before the browser is actually available.- Parameters:
- nodeId- the node to return the browser for.
- name- the name of the browser on the node
 
- 
getBrowserReturns theBrowserwith the specifiedBrowserId, which is simply the combination of a nodeId and name. If there is noBrowserwith the specified id then it is created. User code can interact with theBrowserobject but will have no effect until a correspondingBrowserSessionconnects to the service. At that point, the currentBrowserobject state is sent to the actual browser instance. This allows URLs to be sent before the browser is actually available.- Parameters:
- browserId- the id of the browser to return
 
- 
getBrowsersReturns a collection of existingBrowserobjects. These may or may not be connected to a real browser instance.
- 
goToUrlNavigates the browser on the current node to the specified URL.- Parameters:
- url- the URL to navigate to
 
- 
goToUrlNavigates the browser on the current node to the specified URL with optional redirect.- Parameters:
- url- the URL to navigate to
- redirect- if true, bounce through a redirect URL
 
- 
goToUrlNavigates the default browser on the specified node to the specified URL.- Parameters:
- nodeId- use the default browser on the node, null will use the local node
- url- the URL to navigate to
- redirect- if true, bounce through a redirect URL
 
- 
goToUrlNavigates the named browser on the specified node to the specified URL.- Parameters:
- nodeId- use the named browser on the node, null will use the local node
- name- name of the browser instance to use
- url- the URL to navigate to
- redirect- if true, bounce through a redirect URL
 
- 
goToUrlNavigates to the url contained in the navigation request.- Parameters:
- request- the browser url request
 
- 
goToIntentNavigates the browser on the current node to the specified intent.- Parameters:
- type- the intent type to navigate to
 
- 
goToIntentNavigates the default browser on the specified node to the specified intent.- Parameters:
- nodeId- use the default browser on the node, null will use the local node
- type- the intent type to navigate to
 
- 
goToIntentNavigates the named browser on the specified node to the specified intent.- Parameters:
- nodeId- use the named browser on the node, null will use the local node
- name- name of the browser instance to use
- type- the intent type to navigate to
 
- 
goToIntentResolve the specified intent and navigate the browser accordingly. Returns true if the intent resolved to a url.- Parameters:
- intent- the intent of the navigation
 
 
-