adding all of botlist, initial add
[botlist.git] / botlistprojects / botspider / spider / lib / java / spider_remote / scala / model / AgentMessage.scala
blob60fa5f751b874ab82faad32e485db3dac7ad999a
1 //
2 // Berlin Brown
3 // 2/2/2008
4 // Model: Spider Remote
5 // Would you like some cake?
6 //
7 package org.spirit.spiderremote.model
9 abstract class TypePayload {
10 val typeName: String
11 val url: String
12 val title: String
13 val keywords: String
14 val descr: String
16 override def toString = title
18 def toXML =
19 <type>
20 <classtype>{typeName}</classtype>
21 <url>{url}</url>
22 <title>{title}</title>
23 <keywords>{keywords}</keywords>
24 <descr>{descr}</descr>
25 </type>
28 abstract class AgentMessage {
29 val message: String
30 val status: Int
31 val agentName: String
32 val messageReqId: String
33 val types: List[TypePayload]
35 override def toString = message
37 def toXML =
38 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
39 <agentmsg>
40 <botid>{agentName}</botid>
41 <message>{message}</message>
42 <status>{status}</status>
43 <typespayload>
44 { types map (_.toXML) }
45 </typespayload>
46 </agentmsg>
47 </rdf:RDF>