|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sr.client.JSONRRClient
public class JSONRRClient
This is java client class of simple remoting.
Class contains methods to access remote services.Class supports authentication
with BASIC,DIGEST & NTLM methods.
Usage:
JSONClient client = new JSONRRClient("http://localhost:8080/sr/JSONRR");
JSONResponse resp = client.callAService("echoBean","echo", null, "test");
TSAuthenticator
Constructor Summary | |
---|---|
JSONRRClient(java.lang.String jsonRRServletURL)
Client constructor for http connections to call service anonymously |
|
JSONRRClient(java.lang.String jsonRRServletURL,
java.lang.String userName,
java.lang.String password)
Client constructor for http connections to call services with the given security credentials |
|
JSONRRClient(java.lang.String jsonRRServletURL,
java.lang.String userName,
java.lang.String password,
java.lang.String proxyUserName,
java.lang.String proxyPassword)
Client constructor for http connections to call services with the given security credentials |
Method Summary | |
---|---|
JSONResponse |
callAService(java.lang.String service,
java.lang.String operation,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.lang.Object... parameters)
Calls the remote the servlet for the given service and the operation.This method generates and uses a UUID as message identifier. |
JSONResponse |
callAServiceWithMID(java.lang.String id,
java.lang.String service,
java.lang.String operation,
java.util.Map<java.lang.String,java.lang.Object> headers,
java.lang.Object... parameters)
Calls the remote the servlet for the given service and the operation. |
void |
setCredentials(java.lang.String userName,
java.lang.String password)
Sets user name & password for the server authentication |
void |
setProxyCredentials(java.lang.String userName,
java.lang.String password)
Sets username & password for the proxy authentication |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONRRClient(java.lang.String jsonRRServletURL) throws java.net.MalformedURLException
jsonRRServletURL
- JSON Request Response Servlet Url
java.net.MalformedURLException
public JSONRRClient(java.lang.String jsonRRServletURL, java.lang.String userName, java.lang.String password) throws java.net.MalformedURLException
jsonRRServletURL
- JSON Request Response Servlet UrluserName
- username for the authenticationpassword
- password credential for the authentication
java.net.MalformedURLException
public JSONRRClient(java.lang.String jsonRRServletURL, java.lang.String userName, java.lang.String password, java.lang.String proxyUserName, java.lang.String proxyPassword) throws java.net.MalformedURLException
jsonRRServletURL
- JSON Request Response Servlet UrluserName
- username for the authenticationpassword
- password credential for the authenticationproxyUserName
- proxy server usernameproxyPassword
- proxy server password credential for the authentications
java.net.MalformedURLException
Method Detail |
---|
public void setCredentials(java.lang.String userName, java.lang.String password)
userName
- password
- public void setProxyCredentials(java.lang.String userName, java.lang.String password)
userName
- password
- public JSONResponse callAService(java.lang.String service, java.lang.String operation, java.util.Map<java.lang.String,java.lang.Object> headers, java.lang.Object... parameters) throws java.io.IOException, JSONException, TransformationException, TransformationNotSupportedException
service
- service nameoperation
- operation nameheaders
- Header part of the message as given string,object mapparameters
- operation parameters, message payload
java.io.IOException
- throws when an exception happens when posting request to the given url
JSONException
- throws if an exception happens when preparing request
TransformationException
- throws if an exception happens during JSON-Java transformations or vice versa
TransformationNotSupportedException
public JSONResponse callAServiceWithMID(java.lang.String id, java.lang.String service, java.lang.String operation, java.util.Map<java.lang.String,java.lang.Object> headers, java.lang.Object... parameters) throws java.io.IOException, JSONException, TransformationException, TransformationNotSupportedException
service
- service nameoperation
- operation nameheaders
- Header part of the message as given string,object mapparameters
- operation parameters, message payload
java.io.IOException
- throws when an exception happens when posting request to the given url
JSONException
- throws if an exception happens when preparing request
TransformationException
- throws if an exception happens during JSON-Java transformations or vice versa
TransformationNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |