Class BrowserIntent

java.lang.Object
com.tccc.kos.core.service.browser.BrowserNav
com.tccc.kos.core.service.browser.BrowserIntent
Direct Known Subclasses:
AppBrowserIntent

public class BrowserIntent extends BrowserNav
A BrowserIntent is a generic way to describe how to navigate a given browser to a particular page. An intent is defined as a type and collection of properties that capture the goal of the intent. Resolvers can then process the intent and transform it into another intent to be resolved again, or ultimately a BrowserUrl which contains an actual url.

An intent captures the target browser for the navigation by way of BrowserId which is a combination of NodeId and browserName. If not specified, the target browser is the default browser on the current node. When transforming intents, the BrowserId from the original intent should be used in the new intent to ensure that it still targets the same browser.

Since:
1.0
Version:
2024-02-12
  • Constructor Details

    • BrowserIntent

      public BrowserIntent(String type)
      Create a browser intent for the default browser on the current node with the specified type.
      Parameters:
      type - type of the intent
    • BrowserIntent

      public BrowserIntent(String type, Map<String,Object> properties)
      Create a browser intent for the default browser on the current node with the specified type and properties
      Parameters:
      type - type of the intent
      properties - properties of the intent
    • BrowserIntent

      public BrowserIntent(NodeId nodeId, String browserName, String type)
      Create a browser intent for the specified browser in the specified node with the specified type.
      Parameters:
      nodeId - the node the browser is running on
      browserName - the name of the browser on the node
      type - type of the intent
    • BrowserIntent

      public BrowserIntent(NodeId nodeId, String browserName, String type, Map<String,Object> properties)
      Create a browser intent for the specified browser in the specified node with the specified type and properties.
      Parameters:
      nodeId - the node the browser is running on
      browserName - the name of the browser on the node
      type - type of the intent
      properties - properties of the intent
    • BrowserIntent

      public BrowserIntent(BrowserIntent intent, String type)
      Create a browser intent targeting the browser contained in the specified intent. This is used when transforming one intent to another so that the target browser doesn't get lost.
      Parameters:
      intent - the original intent containing the target browser
      type - type of the new intent
    • BrowserIntent

      public BrowserIntent(BrowserIntent intent, String type, Map<String,Object> properties)
      Create a browser intent targeting the browser contained in the specified intent. This is used when transforming one intent to another so that the target browser doesn't get lost.
      Parameters:
      intent - the original intent containing the target browser
      type - type of the new intent
      properties - properties of the new intent
    • BrowserIntent

      public BrowserIntent(BrowserId browserId, String type)
      Create a browser intent targeting the specified browser.
      Parameters:
      browserId - the browser to target
      type - type of the new intent
    • BrowserIntent

      public BrowserIntent(BrowserId browserId, String type, Map<String,Object> properties)
      Create a browser intent targeting the specified browser.
      Parameters:
      browserId - the browser to target
      properties - type of the new intent
  • Method Details

    • getType

      public String getType()
      Return the type of the intent.
    • getProperty

      public Object getProperty(String name)
      Return the named property.
      Parameters:
      name - the property name
    • getStrProperty

      public String getStrProperty(String name)
      Return the named property as a string. This is simply a convenience method that casts the resulting object.
      Parameters:
      name - the property name
    • setProperty

      public BrowserIntent setProperty(String name, Object val)
      Add a property to the intent.
      Parameters:
      name - property name
      val - property value
    • getProperties

      public Map<String,Object> getProperties()
      Return the properties from this intent.
    • toString

      public String toString()
      Overrides:
      toString in class BrowserNav