|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.almende.eve.transport.xmpp.XmppService
public class XmppService
Constructor Summary | |
---|---|
protected |
XmppService()
|
|
XmppService(AgentFactory agentFactory,
Map<String,Object> params)
Construct an XmppService This constructor is called when the TransportService is constructed by the AgentFactory |
|
XmppService(AgentFactory agentFactory,
String host,
Integer port,
String service)
initialize the settings for the xmpp service |
|
XmppService(AgentFactory agentFactory,
String host,
Integer port,
String service,
String id)
initialize the settings for the xmpp service |
Method Summary | |
---|---|
void |
connect(String agentId,
String username,
String password)
Connect to the configured messaging service (such as XMPP). |
void |
connect(String agentId,
String username,
String password,
String resource)
Connect to the configured messaging service (such as XMPP). |
void |
disconnect(String agentId)
Disconnect the agent from the connected messaging service (if any) |
String |
getAgentId(String agentUrl)
Get the id of an agent from its url. |
String |
getAgentUrl(String agentId)
Get the url of an agent from its id. |
List<String> |
getProtocols()
Get the protocols supported by the XMPPService. |
JSONResponse |
send(String senderId,
String receiver,
JSONRequest request)
Send a message to an other agent |
void |
sendAsync(String senderId,
String receiver,
JSONRequest request,
AsyncCallback<JSONResponse> callback)
Asynchronously Send a message to an other agent |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected XmppService()
public XmppService(AgentFactory agentFactory, Map<String,Object> params)
params
- Available parameters:
{String} host
{Integer} port
{String} serviceName
{String} idpublic XmppService(AgentFactory agentFactory, String host, Integer port, String service, String id)
host
- port
- service
- service nameid
- state id, to persist the statepublic XmppService(AgentFactory agentFactory, String host, Integer port, String service)
agentFactory
- host
- port
- service
- service nameMethod Detail |
---|
public String getAgentUrl(String agentId)
getAgentUrl
in interface TransportService
agentId
- The id of the agent
public String getAgentId(String agentUrl)
getAgentId
in interface TransportService
agentUrl
-
public List<String> getProtocols()
getProtocols
in interface TransportService
public final void connect(String agentId, String username, String password) throws Exception
agentUrl
- username
- password
- resource
-
Exception
public final void connect(String agentId, String username, String password, String resource) throws Exception
agentUrl
- username
- password
- resource
- (optional)
Exception
public final void disconnect(String agentId)
agentId
- public JSONResponse send(String senderId, String receiver, JSONRequest request) throws Exception
send
in interface TransportService
url
- request
- response
-
Exception
public void sendAsync(String senderId, String receiver, JSONRequest request, AsyncCallback<JSONResponse> callback) throws Exception
sendAsync
in interface TransportService
url
- request
- callback
- with a JSONResponse
Exception
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |