View Javadoc
1   // ////////////////////////////////////////////////////////////////////////////
2   // dexterIM - Instant Messaging Framework
3   // Copyright (C) 2003 Christoph Walcher
4   //
5   // This program is free software; you can redistribute it and/or modify
6   // it under the terms of the GNU General Public License as published by
7   // the Free Software Foundation; either version 2 of the License, or
8   // (at your option) any later version.
9   //
10  // This program is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  // GNU General Public License for more details.
14  //
15  // You should have received a copy of the GNU General Public License
16  // along with this program; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  //////////////////////////////////////////////////////////////////////////////
19  package net.sf.dexterim.oscar;
20  
21  import java.util.ArrayList;
22  import java.util.Iterator;
23  import java.util.List;
24  
25  import net.sf.dexterim.core.AbstractConversation;
26  import net.sf.dexterim.core.Contact;
27  
28  /***
29   * @author christoph
30   *
31   */
32  public class OscarConversation extends AbstractConversation {
33  
34  	private List contacts;
35  	private OscarConnection connection;
36  	
37  	public OscarConversation(OscarConnection connection) {
38  		super();
39  		
40  		this.connection = connection;
41  		this.contacts = new ArrayList();
42  	}
43  	
44  	/* (non-Javadoc)
45  	 * @see net.sf.dexterim.core.Conversation#join(net.sf.dexterim.core.Contact)
46  	 */
47  	public void join(Contact contact) {
48  		contacts.add(contact);
49  	}
50  
51  	/* (non-Javadoc)
52  	 * @see net.sf.dexterim.core.Conversation#open()
53  	 */
54  	public void open() {
55  		// TODO: Nothing to do for ICQ and AIM?
56  	}
57  
58  	/* (non-Javadoc)
59  	 * @see net.sf.dexterim.core.Conversation#sendMessage(java.lang.String)
60  	 */
61  	public void sendMessage(String message) {
62  		for (Iterator iter = contacts.iterator(); iter.hasNext();) {
63  			Contact contact = (Contact) iter.next();
64  		
65  			connection.sendMessage(contact, message);
66  		}
67  	}
68  
69  	/* (non-Javadoc)
70  	 * @see net.sf.dexterim.core.Conversation#close()
71  	 */
72  	public void close() {
73  		// TODO Auto-generated method stub
74  		
75  	}
76  
77  }