/*
 * Created on 2004-6-7
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.huihoo.willow;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public interface Server {


		// ------------------------------------------------------------- Properties
	
		/**
		 * Return the port number we listen to for shutdown commands.
		 */
		public int getPort();


		/**
		 * Set the port number we listen to for shutdown commands.
		 *
		 * @param port The new port number
		 */
		public void setPort(int port);


		/**
		 * Return the shutdown command string we are waiting for.
		 */
		public String getShutdown();


		/**
		 * Set the shutdown command we are waiting for.
		 *
		 * @param shutdown The new shutdown command
		 */
		public void setShutdown(String shutdown);


		// --------------------------------------------------------- Public Methods


		/**
		 * Add a new Service to the set of defined Services.
		 *
		 * @param service The Service to be added
		 */
		public void addService(Service service);


		/**
		 * Wait until a proper shutdown command is received, then return.
		 */
		public void await();


		/**
		 * Return the specified Service (if it exists); otherwise return
		 * <code>null</code>.
		 *
		 * @param name Name of the Service to be returned
		 */
		public Service findService(String name);


		/**
		 * Return the set of Services defined within this NamingServer.
		 */
		public Service[] findServices();


		/**
		 * Remove the specified Service from the set associated from this
		 * NamingServer.
		 *
		 * @param service The Service to be removed
		 */
		public void removeService(Service service);

}
