/***********************************************
* Columbia University CS Department
* Network Security Lab
*
* Open and Survivable Embedded Systems (OASES)
*
* Structured Policy Command Language (SPCL)
*
*
* This software is provided as is without any
* warranty or guarantee of merchantibility
* or fitness for a particular purpose. This
* software is released under the terms of the
* GNU General Public License (GPL).
*
* Last updated: April 10, 2003
*
***********************************************/

package spcl.data;

import java.util.Hashtable;


/**
 * maintains the current in focus policy, zone, object
 * for the policy engine.
 *
 * @author locasto@cs.columbia.edu
 *
*/
public class PolicyContext{

	//the current zone
	public Zone zone = null;

	//the currently connected system object (client)
	public SystemObject object = null;

	//the policy to search first. By default, the first policy in the zone.
	public Policy policy = null;

	public String toString(){
		StringBuffer sb = new StringBuffer( 256 );
		sb.append( "<context>" );
		sb.append( "\n\t<zone name=\"" );
		if( zone!=null ) sb.append( zone.getName() );
		sb.append( "\"/>" );
		sb.append( "\n\t<policy name=\"" );
		if( policy!=null ) sb.append( policy.getName() );
		sb.append( "\"/>" );
		sb.append( "\n\t<system name=\"" );
		if( object!=null ) sb.append( object.getName() );
		sb.append( "\"/>" );
		sb.append("\n</context>");
		return sb.toString();
	}
}
