Class ScriptRemote
- java.lang.Object
-
- org.springframework.extensions.webscripts.ScriptRemote
-
public class ScriptRemote extends java.lang.ObjectRoot-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 Summary
Constructors Constructor Description ScriptRemote()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Responsecall(java.lang.String uri)Invoke a specific URI on the default endpointScriptRemoteConnectorconnect()Constructs a remote connector to a default endpoint (if configured).ScriptRemoteConnectorconnect(java.lang.String endpointId)Constructs a RemoteClient to a specific endpoint.java.lang.StringgetEndpointDescription(java.lang.String endpointId)Returns the description of an endpointjava.lang.String[]getEndpointIds()Returns a list of the application endpoint idsjava.lang.StringgetEndpointName(java.lang.String endpointId)Returns the name of an endpointjava.lang.StringgetEndpointURL(java.lang.String endpointId)Returns the configured URL for the given endpointbooleanisEndpointPersistent(java.lang.String id)voidsetConnectorProvider(ConnectorProvider connectorProvider)Sets the connector provider.voidsetConnectorService(ConnectorService connectorService)Sets the Connector Service.
-
-
-
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
-
-