ANTS v2.0 API

ants.core.security
Class ReferenceMonitor

java.lang.Object
  |
  +--ants.core.security.ReferenceMonitor

public final class ReferenceMonitor
extends java.lang.Object

This class serves as the interface to a basic reference monitor. Ants uses this class to check access to sensitive data and operations (i.e., the routing table; system shutdown; etc.) Note that this class supplies mechanism, not policy. The security policy is specified by loading a serialized instance of a Policy object. The policy object is specified by using -policy flag to the node argument in the ANTS configuration file: node 1.1.2.5 -updateRoutes -policy ~/ants/policy.ser If no policy object is specified, the ReferenceMonitor loads a default policy from the SecurityConstants class. If there is an error loading the policy file, the ReferenceMonitor will fail fast rather than passively loading the default policy.

Author:
Andrew Whitaker
See Also:
Policy, BasicPolicy, SecurityDefaults

Constructor Summary
ReferenceMonitor()
           
 
Method Summary
static void checkPermission(Principal who, Permission what)
          Check whether the given principal has a permission.
static void loadPolicy(java.lang.String file)
          Sets the access control policy at startup.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceMonitor

public ReferenceMonitor()
Method Detail

loadPolicy

public static void loadPolicy(java.lang.String file)
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException
Sets the access control policy at startup. The argument can be either a file containing a serialized policy object; or null which implies the default policy in SecurityDefaults. For security reasons, the policy can only be set once. If there is an error loading the policy file, this method will throw an exception rather than passively load the default policy.

checkPermission

public static void checkPermission(Principal who,
                                   Permission what)
                            throws ReferenceMonitorException
Check whether the given principal has a permission. If the policy hasn't been specifed, this method will fail.

ANTS v2.0 API

This documentation is Copyright (C) 1998-2001 The University of Utah and the University of Washington. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for ANTS v2.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/