import java.util.*;
import lotus.domino.*;

public class whoAmI{
	public static void main(String argv[]){
		try{
			// test and get args
			if (argv.length < 3){
				// no or too few arguments were entered. give user the variables
				System.out.println("You need to enter arguments for this application...");
				System.out.println("   server, user, password");
				System.exit(0);
			}			
			String server = argv[0];
			String user = argv[1];
			String pass = argv[2];

			// start bubblegum wrapper and start session
			NotesThread.sinitThread();
			Session s = NotesFactory.createSession(server, user, pass);
			System.out.println("User Name: " + s.getUserName());
			System.out.println("Server: " + s.getServerName());
			System.out.println("Notes Version: " + s.getNotesVersion());
			System.out.println("Platform: " + s.getPlatform());
		}
		catch (Exception e){
		if (e instanceof NotesException){
			NotesException ne=(NotesException)e;
			System.out.println("Domino-side error:\n" + ne.text + "\n");
		}
		e.printStackTrace();
		}
		finally {
		NotesThread.stermThread();
		}
	}
}	