net.ponder2.policy
Class Policy

java.lang.Object
  extended by net.ponder2.policy.Policy
All Implemented Interfaces:
ManagedObject
Direct Known Subclasses:
AuthorisationPolicy, ObligationPolicy

public abstract class Policy
extends java.lang.Object
implements ManagedObject

This class implements policies within the SMC. It is the base class for more specialised policy classes and manages all the common work.

Version:
$Id:$
Author:
Kevin Twidle

Field Summary
static java.lang.String defaultDomain
           
 
Constructor Summary
protected Policy()
          initialises the base class for the underlying specific policy class
 
Method Summary
protected abstract  void attach(P2Object aManagedObject)
          attaches this policy to aManagedObject.
static java.lang.String getDefaultDomain()
           
 boolean isActive()
          checks to see if this policy is active
protected  boolean isAttached()
           
protected  P2Object operation_active(boolean aBoolean)
          makes the policy active if aBoolean is true else makes the policy inactive.
 void setActive(boolean active)
          makes the policy active if aBoolean is true, else makes it inactive.
protected  void setAttached(boolean attached)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultDomain

public static java.lang.String defaultDomain
Constructor Detail

Policy

protected Policy()
initialises the base class for the underlying specific policy class

Method Detail

setActive

public void setActive(boolean active)
makes the policy active if aBoolean is true, else makes it inactive. Once active it can receive events of the correct type. If the policy has not been attached anywhere (see attach: it will be attached to the root domain.

Parameters:
active - true if the policy should be activated

isActive

public boolean isActive()
checks to see if this policy is active

Returns:
true if this policy is active

getDefaultDomain

public static java.lang.String getDefaultDomain()

operation_active

protected P2Object operation_active(boolean aBoolean)
makes the policy active if aBoolean is true else makes the policy inactive. Returns aBoolean.

Parameters:
aBoolean - true to make the policy active
Returns:
true if this policy is now active

attach

protected abstract void attach(P2Object aManagedObject)
attaches this policy to aManagedObject. This policy may be attached to more than one managed object. This command forms part of the proximity event bus.

Parameters:
aManagedObject - the managed object that the policy should be attached to

isAttached

protected boolean isAttached()
Returns:
the attached

setAttached

protected void setAttached(boolean attached)
Parameters:
attached - the attached to set


Copyright © 2008 Imperial College. All Rights Reserved.