View Javadoc

1   /*
2   * The contents of this file are subject to the BT "ZEUS" Open Source 
3   * Licence (L77741), Version 1.0 (the "Licence"); you may not use this file 
4   * except in compliance with the Licence. You may obtain a copy of the Licence
5   * from $ZEUS_INSTALL/licence.html or alternatively from
6   * http://www.labs.bt.com/projects/agents/zeus/licence.htm
7   * 
8   * Except as stated in Clause 7 of the Licence, software distributed under the
9   * Licence is distributed WITHOUT WARRANTY OF ANY KIND, either express or 
10  * implied. See the Licence for the specific language governing rights and 
11  * limitations under the Licence.
12  * 
13  * The Original Code is within the package zeus.*.
14  * The Initial Developer of the Original Code is British Telecommunications
15  * public limited company, whose registered office is at 81 Newgate Street, 
16  * London, EC1A 7AJ, England. Portions created by British Telecommunications 
17  * public limited company are Copyright 1996-9. All Rights Reserved.
18  * 
19  * THIS NOTICE MUST BE INCLUDED ON ANY COPY OF THIS FILE
20  */
21  
22  
23  
24  package zeus.actors.event;
25  
26  import java.util.*;
27  import zeus.util.*;
28  import zeus.concepts.*;
29  
30  public class ConversationEvent extends Event {
31     public static final long INITIATE_MASK = 1;
32     public static final long CONTINUE_MASK = 2;
33  
34     public static final String GOAL = "goal";
35  
36     protected String comms_key = null;
37     protected String sender = null;
38     protected String receiver = null;
39     protected String msg_type = null;
40     protected String data_type = GOAL;
41     protected String data_key = null;
42     protected Vector data = null;
43  
44     public ConversationEvent(Object source, Object object,
45                              String comms_key, String sender,
46                              String receiver, String msg_type, String data_type,
47  			    String data_key, Vector data, long event_mask) {
48        super(source,object,CONVERSATION_FIRST,CONVERSATION_LAST,event_mask);
49        this.comms_key = comms_key;
50        this.sender = sender;
51        this.receiver = receiver;
52        this.msg_type = msg_type;
53        this.data_type = data_type;
54        this.data_key = data_key;
55        this.data = data;
56     }
57     public ConversationEvent(Object source, Object object, String comms_key,
58                              String sender, String receiver, String msg_type,
59  			    Vector data, long event_mask) {
60        super(source,object,CONVERSATION_FIRST,CONVERSATION_LAST,event_mask);
61        this.comms_key = comms_key;
62        this.sender = sender;
63        this.receiver = receiver;
64        this.msg_type = msg_type;
65        this.data = data;
66     }
67     public String  getConversationId() { return comms_key; }
68     public String  getSender()         { return sender; }
69     public String  getReceiver()       { return receiver; }
70     public String  getMessageType()    { return msg_type; }
71     public String  getDataType()       { return data_type; }
72     public String  getDataKey()        { return data_key; }
73     public Vector  getData()           { return data; }
74     public boolean isGoalEventType()   { return data_type.equals(GOAL); }
75     public boolean isFactEventType()   { return !data_type.equals(GOAL); }
76  }