|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.almende.eve.transport.http.HttpService
public class HttpService
Field Summary | |
---|---|
protected Config |
config
|
protected List<String> |
protocols
|
protected String |
servletUrl
|
Constructor Summary | |
---|---|
HttpService()
|
|
HttpService(AgentFactory agentFactory,
Map<String,Object> params)
Construct an HttpService This constructor is called when the TransportService is constructed by the AgentFactory |
|
HttpService(Config config)
Construct an HttpService from a config The config can contain parameters: environment.Production.servlet_url environment.Development.servlet_url servlet_url The HttpService will select the parameter based on the current environment |
|
HttpService(String servletUrl)
Construct an HttpService |
Method Summary | |
---|---|
String |
getAgentId(String agentUrl)
Get the id of an agent from its url. |
String |
getAgentResource(String agentUrl)
Get the resource from the end of an agentUrl, for example "http://myserver.com/agents/agentid/index.html" will return "index.html" The method will return null when the provided url does not match the configured url |
String |
getAgentUrl(String agentId)
Get the url of an agent from its id. |
String |
getDomain(String url)
Get the domain part of given url. |
List<String> |
getProtocols()
Retrieve the protocols supported by the transport service. |
String |
getServletUrl()
Return the configured servlet url corresponding to this transport service. |
JSONResponse |
send(String senderId,
String receiverUrl,
JSONRequest request)
Send a JSON-RPC request to an agent via HTTP |
void |
sendAsync(String senderId,
String receiverUrl,
JSONRequest request,
AsyncCallback<JSONResponse> callback)
Send an asynchronous JSON-RPC request to an agent via HTTP |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Config config
protected String servletUrl
protected List<String> protocols
Constructor Detail |
---|
public HttpService()
public HttpService(AgentFactory agentFactory, Map<String,Object> params)
agentFactory
- params
- Available parameters:
{String} servlet_urlpublic HttpService(Config config)
agentFactory
- params
- Available parameters:
{String} servlet_urlpublic HttpService(String servletUrl)
servletUrl
- Method Detail |
---|
public String getServletUrl()
public List<String> getProtocols()
getProtocols
in interface TransportService
public JSONResponse send(String senderId, String receiverUrl, JSONRequest request) throws Exception
send
in interface TransportService
senderId
- Unused in the case of a HttpTransportreceiverUrl
- request
-
Exception
public void sendAsync(String senderId, String receiverUrl, JSONRequest request, AsyncCallback<JSONResponse> callback)
sendAsync
in interface TransportService
senderId
- receiver
- receiverUrl
-
IOException
public String getAgentUrl(String agentId)
getAgentUrl
in interface TransportService
agentId
-
public String getAgentId(String agentUrl)
getAgentId
in interface TransportService
agentUrl
-
public String getAgentResource(String agentUrl)
agentUrl
-
public String getDomain(String url)
url
-
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |