// Sample code file: ChatConnection.java

// Warning: This code has been marked up for HTML

/*
   Copyright (c) 2000 Novell, Inc.  All Rights Reserved.

   THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES. 
   USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE LICENSE AGREEMENT 
   ACCOMPANYING THE SOFTWARE DEVELOPMENT KIT (SDK) THAT CONTAINS THIS WORK. 
   PURSUANT TO THE SDK LICENSE AGREEMENT, NOVELL HEREBY GRANTS TO DEVELOPER A 
   ROYALTY-FREE, NON-EXCLUSIVE LICENSE TO INCLUDE NOVELL'S SAMPLE CODE IN ITS 
   PRODUCT. NOVELL GRANTS DEVELOPER WORLDWIDE DISTRIBUTION RIGHTS TO MARKET, 
   DISTRIBUTE, OR SELL NOVELL'S SAMPLE CODE AS A COMPONENT OF DEVELOPER'S 
   PRODUCTS. NOVELL SHALL HAVE NO OBLIGATIONS TO DEVELOPER OR DEVELOPER'S 
   CUSTOMERS WITH RESPECT TO THIS CODE. 
*/
 


package com.novell.Chat;

// ConsoleOne imports
import com.novell.application.console.snapin.*;

/**
 * This interface is used by the ChatClient and ChatServer classes.
 * It's purpose is to provide a means by which the ChatDialog can 
 * interface with these two classes.
 */
public interface ChatConnection
{
    /** 
     * Sends a propertly formated message.
     *
     * @param message The message to send.
     */
    public void sendMessage(String message);
        
    
    /**
     * Disconnects the client form the server.
     */
    public void disconnect();
        
    /**
     * Gets the key associated with this server.
     *
     * @return The key.
     */
    public String getKey();
    
    /**
     * Closes the connection.
     * This should be called on shut down.
     */
    public void close();
    
    /**
     * Gets the type of object this is, or is communication with.
     * User or Chat Room.
     *
     * @return The ObjectType name.
     */
    public String getType();
    
    /**
     * Gets the ObjectEntry this server is associated with. 
     *
     * @return The ObjectEntry.
     */
    public ObjectEntry getObjectEntry();
    
    /**
     * Gets the name of the person or chat room this session is with.
     * Used for the ChatDialog's title.
     *
     * @return The name to place in the title.
     */
    public String getConnectionName();

}