/**
 * Part of the CCNx Java Library.
 *
 * Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 2.1
 * as published by the Free Software Foundation. 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details. You should have received
 * a copy of the GNU Lesser General Public License along with this library;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301 USA.
 */

package org.ccnx.ccn.impl.repo;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

import javax.xml.stream.XMLStreamException;

import org.ccnx.ccn.protocol.ContentName;
import org.ccnx.ccn.protocol.ContentObject;
import org.ccnx.ccn.protocol.MalformedContentNameStringException;


/**
 * Policy is the interface used by the RepositoryStore for interpreting and applying policy 
 * data to CCN repositories.
 * 
 * @author rasmusse
 *
 */

public interface Policy {
	
	/**
	 * Update the policy
	 * 
	 * @param stream	a stream of potential repository data
	 * @return			false if update is invalid or not for us
	 * @throws XMLStreamException	if the policy data is incorrect or inconsistent
	 * @throws IOException			on stream read errors
	 */
	boolean update(InputStream stream, boolean fromNet) throws XMLStreamException, IOException;

	/**
	 * Gets the current namespace covered by this repository. Any name not included within
	 * this namespace will not be stored in this repository.
	 * 
	 * @return			array of ContentNames specifying the namespace
	 */
	public ArrayList<ContentName> getNameSpace();
	
	/**
	 * Gets the current policy file as a CCN ContentObject
	 * 
	 * @return			the policy ContentObject
	 */
	public ContentObject getPolicyContent();
	
	/**
	 * Set the version of the policy protocol which is currently valid.  Depending on the
	 * implementation, any policy file containing a protocol with a different version ID may
	 * be rejected.
	 * 
	 * @param version the version to use
	 */
	public void setVersion(String version);
	
	/**
	 * The localName is used to identify an individual repository among several in an organization
	 * or other entity.
	 * 
	 * @param localName the name as a string in the form xxx/yyy/zzz
	 * @throws MalformedContentNameStringException	if the name is formatted incorrectly
	 */
	public void setLocalName(String localName) throws MalformedContentNameStringException;
	
	/**
	 * @return - the local name of this repository as a String in the form xxx/yyy/zzz
	 */
	public String getLocalName();
	
	/**
	 * The globalPrefix is used to identify a path to repositories within an organization
	 * or entity. Several local repositories could be contained with an organizations global
	 * repository namespace.
	 * 
	 * @param globalName the prefix as a string in the form xxx/yyy/zzz
	 * @throws MalformedContentNameStringException	if the name is formatted incorrectly
	 */
	public void setGlobalPrefix(String globalName) throws MalformedContentNameStringException;
	
	/**
	 * @return - the local name of this repository as a String in the form xxx/yyy/zzz
	 */
	public ContentName getGlobalPrefix();
}

@@ -1218,35 +1218,8 @@
 es.%0A
- * %0A * @author rasmusse%0A *%0A
  */%0A

Remove author tag