Class ScriptRemoteConnector
java.lang.Object
org.springframework.extensions.webscripts.ScriptRemoteConnector
Describes a connector to a remote endpoint.
This is a wrapper around the true connector object and it provides
Script-style interfaces for working with buffered response strings
and the like.
- Author:
- muzquiano, kevinr
-
Constructor Summary
ConstructorsConstructorDescriptionScriptRemoteConnector(Connector connector, RemoteConfigElement.EndpointDescriptor descriptor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionInvokes a URI on the endpoint via a GET request.Invokes a URI on a remote service as DELETE request.Invokes a GET request URI on the endpoint.Returns the endpoint stringInvokes a URI on a remote service, passing the supplied body as a POST request.Invokes a URI on a remote service, passing the supplied body as a POST request.Invokes a URI on a remote service, passing the supplied body as a PUT request.Invokes a URI on a remote service, passing the supplied body as a PUT request.
-
Constructor Details
-
ScriptRemoteConnector
public ScriptRemoteConnector(Connector connector, RemoteConfigElement.EndpointDescriptor descriptor) Constructor- Parameters:
connector- The Connector to wrapdescriptor- The description of the endpoint this connector is managing
-
-
Method Details
-
call
Invokes a URI on the endpoint via a GET request.- Parameters:
uri- the uri- Returns:
- Response object from the call
Response
-
get
Invokes a GET request URI on the endpoint.- Parameters:
uri- the uri- Returns:
- Response object from the call
Response
-
post
Invokes a URI on a remote service, passing the supplied body as a POST request.- Parameters:
uri- Uri to call on the endpointbody- Body of the POST request.- Returns:
- Response object from the call
Response
-
post
Invokes a URI on a remote service, passing the supplied body as a POST request.- Parameters:
uri- Uri to call on the endpointbody- Body of the POST request.contentType- Content mimetype of the request body- Returns:
- Response object from the call
Response
-
put
Invokes a URI on a remote service, passing the supplied body as a PUT request.- Parameters:
uri- Uri to call on the endpointbody- Body of the PUT request.- Returns:
- Response object from the call
Response
-
put
Invokes a URI on a remote service, passing the supplied body as a PUT request.- Parameters:
uri- Uri to call on the endpointbody- Body of the PUT request.contentType- Content mimetype of the request- Returns:
- Response object from the call
Response
-
del
Invokes a URI on a remote service as DELETE request. NOTE: the name of the method is 'del' not 'delete' so as to not interfere with JavaScript Object.delete() method.- Parameters:
uri- Uri to call on the endpoint- Returns:
- Response object from the call
Response
-
getEndpoint
Returns the endpoint string- Returns:
- endpoint
-
getDescriptor
- Returns:
- the endpoint descriptor object
-