/*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
 * 
 * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
 * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
 * language governing rights and limitations under the License.
 * 
 * The Original Code is the Venice Web Communities System.
 * 
 * The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
 * for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
 * Copyright (C) 2003 Eric J. Bowersox/Silverwrist Design Studios.  All Rights Reserved.
 * 
 * Contributor(s): 
 */
package com.silverwrist.dynamo.iface;

import java.util.Collection;

/**
 * A request service which provides access to "application attributes" managed by the servlet container
 * itself (through <CODE>ServletContext</CODE>) and not by Dynamo.  This will often be needed, for instance,
 * to interface with servlet-based APIs outside the scope of Dynamo.
 * <P><B>N.B.:</B> Dynamo itself requires several application-level attributes to manage its current state
 * (such as the {@link com.silverwrist.dynamo.app.ApplicationContainer ApplicationContainer} object).  This
 * service will not permit access to those reserved application-level attributes.
 *
 * @author Eric J. Bowersox &lt;erbo@silcom.com&gt;
 * @version X
 */
public interface ExternalAppAttributes
{
  /**
   * Returns a <CODE>java.util.Collection</CODE> containing all names of external application attributes.
   * Application attributes used internally by Dynamo itself will <EM>not</EM> be included in this list.
   *
   * @return The collection of attribute names.
   */
  public Collection getAttributeNames();

  /**
   * Returns the value of an external application attribute.  Attempts to get the value of an application
   * attribute used internally by Dynamo itself will return <CODE>null</CODE>.
   *
   * @param name The name of the attribute to retrieve.
   * @return The attribute's value, or <CODE>null</CODE> if the attribute did not exist.
   */
  public Object getAttribute(String name);

  /**
   * Deletes the value of an external application attribute.  Attempts to delete the value of an application
   * attribute used internally by Dynamo itself will be silently ignored.
   *
   * @param name The name of the attribute to remove.
   */
  public void removeAttribute(String name);

  /**
   * Sets the value of an external application attribute.  Attempts to set the value of an application
   * attribute used internally by Dynamo will be silently ignored.
   *
   * @param name The name of the attribute to set.
   * @param value The new value of the attribute.
   */
  public void setAttribute(String name, Object value);

} // end interface ExternalAppAttributes

