Class JavaScriptBuilderElementBuilder

java.lang.Object
fiftyone.pipeline.javascriptbuilder.flowelements.JavaScriptBuilderElementBuilder

public class JavaScriptBuilderElementBuilder extends Object
Builder for the JavaScriptBuilderElement
  • Field Details

    • ENABLE_COOKIES

      public static final boolean ENABLE_COOKIES
      See Also:
    • host

      protected String host
    • endpoint

      protected String endpoint
    • protocol

      protected String protocol
    • contextRoot

      protected String contextRoot
    • objName

      protected String objName
  • Constructor Details

    • JavaScriptBuilderElementBuilder

      public JavaScriptBuilderElementBuilder(org.slf4j.ILoggerFactory loggerFactory)
      Construct a new instance.
      Parameters:
      loggerFactory - the ILoggerFactory to use when creating loggers for the element
  • Method Details

    • setHost

      @DefaultValue("The host from the request") public JavaScriptBuilderElementBuilder setHost(String host)
      Set the host that the client JavaScript should query for updates.

      By default, the host from the request will be used.

      Parameters:
      host - the hostname
      Returns:
      this builder
    • setEndpoint

      @DefaultValue("Empty string") public JavaScriptBuilderElementBuilder setEndpoint(String endpoint)
      Set the endpoint which will be queried on the host. e.g /api/v4/json

      By default, this value is an empty string

      Parameters:
      endpoint - the endpoint
      Returns:
      this builder
    • setContextRoot

      @DefaultValue("Value from evidence server.contextroot") public JavaScriptBuilderElementBuilder setContextRoot(String contextRoot)
      Set the evidence value for the context root

      Default is value from evidence "server.contextroot"

      Parameters:
      contextRoot -
      Returns:
      this builder
    • setProtocol

      @DefaultValue("The protocol from the request") public JavaScriptBuilderElementBuilder setProtocol(String protocol)
      The protocol that the client JavaScript will use when querying for updates.

      By default, the protocol from the request will be used.

      Parameters:
      protocol - The protocol to use (http / https)
      Returns:
      this builder
    • setObjectName

      @DefaultValue("fod") public JavaScriptBuilderElementBuilder setObjectName(String objName)
      The default name of the object instantiated by the client JavaScript.

      Default is "fod"

      Parameters:
      objName - the object name to use
      Returns:
      this builder
    • setEnableCookies

      @DefaultValue(booleanValue=true) public JavaScriptBuilderElementBuilder setEnableCookies(boolean enableCookies)
      Set whether the client JavaScript stores results of client side processing in cookies. If set to false, the JavaScript will not populate any cookies, and will instead use session storage.

      This can also be set per request, using the "query.fod-js-enable-cookies" evidence key. For more details on personal data policy, see http://51degrees.com/terms/client-services-privacy-policy/

      Default is true

      Parameters:
      enableCookies - should enable cookies?
      Returns:
      this builder
    • build

      public JavaScriptBuilderElement build()
      Returns:
      new JavaScriptBuilderElement instance