// $Id: SipchatClient.java,v 1.12 2001/10/19 12:28:33 ramsdell Exp $
// Copyright (c) 2000. The MITRE Corporation (http://www.mitre.org/).
// All rights reserved.
// The SIMP Service comes with ABSOLUTELY NO WARRANTY.
// See the SIMP Service License Agreement for details.
package org.mitre.sipchat;
import org.mitre.sipchat.launcher.RegisterResult;
//import org.mitre.simp.security.SimpSigner;
import org.mitre.sipchat.model.ClientModel;
import org.mitre.sipchat.model.ClientStart;
import org.mitre.sipchat.model.ClientFactory;
/**
* SipchatClient for the Simple Instant Messaging and Presence client.
* All clients should start with a copy of this code.
* @author John D. Ramsdell
* @version February 2000
*/
public class SipchatClient
implements org.mitre.sipchat.launcher.Client
{
private String user;
private char[] password;
private String host;
// private SimpSigner signer;
private String font;
private RegisterResult result;
/**
* Initialize the login object.
*/
// public void init(String user, char[] password, String host,
// SimpSigner signer, String font, LoginResult result) {
public void init( String user, char[] password, String host,
String font, RegisterResult result ) {
this.user = user;
this.password = password;
this.host = host;
// this.signer = signer;
this.font = font;
this.result = result;
}
private Client client;
private void setClient(Client client) {
this.client = client;
}
/**
* Runs the client in this package.
* @see Client
*/
public void run() {
final String f = font;
ClientFactory cf = new ClientFactory() {
public void makeClient(ClientModel cm) {
setClient(new Client(cm, f));
}
};
// ClientStart.login(user, password, host, signer, result, cf);
ClientStart.start( user, password, host, result, cf );
}
/**
* Destroy client
*/
public void destroy() {
if (client != null)
client.destroy();
}
}