Class ScriptRemote


  • public class ScriptRemote
    extends java.lang.Object
    Root-scope class that provides useful functions for working with endpoints, connectors and credentials.

    This class also implements methods from the Connector interface so as to allow application developers to use it straight away against the configured default endpoint.

    Author:
    muzquiano, Kevin Roast
    • Constructor Detail

      • ScriptRemote

        public ScriptRemote()
    • Method Detail

      • setConnectorService

        public void setConnectorService​(ConnectorService connectorService)
        Sets the Connector Service.
        Parameters:
        connectorService - ConnectorService
      • setConnectorProvider

        public void setConnectorProvider​(ConnectorProvider connectorProvider)
        Sets the connector provider.
        Parameters:
        connectorProvider - ConnectorProvider
      • connect

        public ScriptRemoteConnector connect()
        Constructs a remote connector to a default endpoint (if configured). If a default endpoint is not configured, null will be returned.
        Returns:
        the remote client
      • connect

        public ScriptRemoteConnector connect​(java.lang.String endpointId)
        Constructs a RemoteClient to a specific endpoint. If the endpoint does not exist, null is returned.
        Parameters:
        endpointId - the endpoint id
        Returns:
        the remote client
      • call

        public Response call​(java.lang.String uri)
        Invoke a specific URI on the default endpoint
        Parameters:
        uri - the uri
        Returns:
        the response
      • getEndpointIds

        public java.lang.String[] getEndpointIds()
        Returns a list of the application endpoint ids
        Returns:
        String[]
      • getEndpointName

        public java.lang.String getEndpointName​(java.lang.String endpointId)
        Returns the name of an endpoint
        Parameters:
        endpointId - String
        Returns:
        String
      • getEndpointDescription

        public java.lang.String getEndpointDescription​(java.lang.String endpointId)
        Returns the description of an endpoint
        Parameters:
        endpointId - String
        Returns:
        String
      • isEndpointPersistent

        public boolean isEndpointPersistent​(java.lang.String id)
      • getEndpointURL

        public java.lang.String getEndpointURL​(java.lang.String endpointId)
        Returns the configured URL for the given endpoint
        Parameters:
        endpointId - String
        Returns:
        the endpoint url