org.springframework.extensions.webscripts
Class ScriptRemote

java.lang.Object
  extended by 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

Constructor Summary
ScriptRemote()
           
 
Method Summary
 Response call(String uri)
          Invoke a specific URI on the default endpoint
 ScriptRemoteConnector connect()
          Constructs a remote connector to a default endpoint (if configured).
 ScriptRemoteConnector connect(String endpointId)
          Constructs a RemoteClient to a specific endpoint.
 String getEndpointDescription(String endpointId)
          Returns the description of an endpoint
 String[] getEndpointIds()
          Returns a list of the application endpoint ids
 String getEndpointName(String endpointId)
          Returns the name of an endpoint
 String getEndpointURL(String endpointId)
          Returns the configured URL for the given endpoint
 boolean isEndpointPersistent(String id)
           
 void setConfigService(ConfigService configService)
          Sets the configuration service.
 void setConnectorProvider(ConnectorProvider connectorProvider)
          Sets the connector provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptRemote

public ScriptRemote()
Method Detail

setConfigService

public void setConfigService(ConfigService configService)
Sets the configuration service.

Parameters:
configService -

setConnectorProvider

public void setConnectorProvider(ConnectorProvider connectorProvider)
Sets the connector provider.

Parameters:
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:

getEndpointName

public String getEndpointName(String endpointId)
Returns the name of an endpoint

Parameters:
endpointId -
Returns:

getEndpointDescription

public String getEndpointDescription(String endpointId)
Returns the description of an endpoint

Parameters:
endpointId -
Returns:

isEndpointPersistent

public boolean isEndpointPersistent(String id)

getEndpointURL

public String getEndpointURL(String endpointId)
Returns the configured URL for the given endpoint

Parameters:
endpointId -
Returns:
the endpoint url


Copyright © 2009 SpringSource, Inc. All Rights Reserved.