Class ScriptRemote

java.lang.Object
org.springframework.extensions.webscripts.ScriptRemote

public class ScriptRemote extends 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 Details

    • ScriptRemote

      public ScriptRemote()
  • Method Details

    • 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(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(String uri)
      Invoke a specific URI on the default endpoint
      Parameters:
      uri - the uri
      Returns:
      the response
    • getEndpointIds

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

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

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

      public boolean isEndpointPersistent(String id)
    • getEndpointURL

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