PDA

View Full Version : Suggesting modification to Agent api


jackhung
10-25-2004, 09:39 PM
Providing alias for agent identification.
The current agent identification is hardcoded at compile time. If the agent is deployed at a different location, the source have to be modified.

* I would suggest to change the agent tag to <agent alias="..." url="..."/>, with only one of either "alias" or "url" is required.
* The "to" parameter for the client sendAgentXML(to, xml) now should be either an alias or url.
* On the LPS server, there should be a configurable mapping table to map agent alias to agent url. getAgent(String url) in ConnectionAgent.java should change to getAgent(String agentId) should now handle both url or alias as parameter.
* setAgents(Set agents) in Application.java should:
1, if only "alias" is specified, lookup the url and register the agent.
2, if both "alias" and "url" are specified, then register the alias and the url as specified.
3, no change I guess

The modification should make it easilier to develop agent applications in that you can use mock backend to test the client code.