import java.util.Vector;

/**
 * An interface for representing the dependencies between Java Objects.
 * @author  Fabio Kon
 * @version 0.1
 * @see     HookSpecification
*/
public interface ComponentConfigurator {

/////////////////////////////////////////////////////////////////
// METHODS    
/////////////////////////////////////////////////////////////////

/**
 * Deletes the references to all internal data structures.
 */
    public void destroyComponentConfigurator ();
        
/**
 * Adds a hook to the configurator.
 * @param   hookName  the name of the hook to be added.
 * @exception ElementExists if the hook already exists.
 */
    public void addHook (String hookName) throws ElementExists;
    
/**
 * Deletes a hook from the configurator.
 * @param   hookName  the name of the hook to be deleted.
 * @exception NotFound if the hook is not found.
 */
    public void deleteHook (String hookName) throws NotFound;
        
/**
 * Attaches a ComponentConfigurator to the given hook.
 * @param  hookName  the name of the hook.
 * @param  cc        the ComponentConfigurator to be attached to the hook.
 * @exception HookBusy if there is already a component attached to the hook.
 * @exception NotFound if the hook does not exist.
 */
    public void hook (String hookName, ComponentConfigurator cc) 
        throws HookBusy, NotFound;

/**
 * Detaches a ComponentConfigurator from the given hook.
 * @param hookName  the name of the hook.
 * @param cc        the ComponentConfigurator to be detached.
 * @exception HookVacant if there are no components attached to the hook.
 * @exception NotFound if the hook does not exist.
 */
    public void unhook (String hookName)
        throws HookVacant, NotFound;
    
/**
 * Adds a new component to the list of clients.
 * @param  client  the ComponentConfigurator representing the new client.
 * @param  hookNameInClient the name of the hook to which this component is attached.
 * @exception ElementExists if the given pair (client, hookNameInClient) is 
 *                          already present in the client list.
 * 
 */
    public void registerClient (ComponentConfigurator client, 
                               String hookNameInClient)
        throws ElementExists;
    
/**
 * Removes a pair (client, hook) from the list of clients.
 * @param  client  the ComponentConfigurator representing the new client.
 * @param  hookNameInClient the name of the hook to which this component is attached.
 * @exception NotFound if the given pair (client, hookNameInClient) is not 
 *                     present in the client list.
 * 
 */
    public void unregisterClient (ComponentConfigurator client, 
                                 String hookNameInClient)
        throws NotFound;
    
/**
 * This implementation simply prints the event to the standard output.
 * @param  hookedComponent the ComponentConfigurator that generated the event.
 * @param  e               the event that was generated. 
 */
    public void eventOnHookedComponent (ComponentConfigurator hookedComponent,
                                        ComponentEvent e);

    
/**
 * This implementation simply prints the event to the standard output.
 * @param  client  the ComponentConfigurator that generated the event.
 * @param  e       the event that was generated. 
 */
    public void eventOnClient (ComponentConfigurator client,
                               ComponentEvent e);
    
/**
 * Accessor for the component name.
 * @return a string containing the component name. 
 */
    public String name ();
    
/**
 * Accessor for the component information string.
 * @return a string containing component information.
 */
    public String info ();
    
/**
 * Provides a list of the hooks in this component.
 * @return a vector of HookSpecifications. (MAYBE SHOULD RETURN JUST AN ITERATOR)
 * @see HookSpecification
 * @see java.util.Vector 
 */
    public Vector listHooks (); // 

/**
 * Provides a list of the clients of this component.
 * @return a vector of HookSpecifications. (MAYBE SHOULD RETURN JUST AN ITERATOR)
 * @see HookSpecification
 * @see java.util.Vector 
 */
    public Vector listClients ();
    
/**
 * Sets the name of this component.
 */
    public void name (String s);
    
/**
 * Sets the information string for this component.
 */
    public void info (String s);
        
};

