kaos.kpat.policyTemplates
Class PolicyTemplate

java.lang.Object
  extended by kaos.kpat.policyTemplates.PolicyTemplate
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
BlackboardAccessPolicyTemplate, EditablePolicyTemplate, GenericDAMLPolicyTemplate, MessageContentPolicyTemplate, MessageProtectionPolicyTemplate, ServletAccessPolicyTemplate, ServletAuditPolicyTemplate, ServletAuthenticationPolicyTemplate, VideoFeedTemplate

public abstract class PolicyTemplate
extends java.lang.Object
implements java.lang.Comparable

This is the interface implemented by the end-system programmer with functionalities specific for graphical creation and edition of policies according to a specific policy template. $Revision: 1.10 $


Field Summary
protected  java.lang.String _instanceId
           
 
Constructor Summary
PolicyTemplate()
           
 
Method Summary
 void addTemplateComponentReference(TemplateComponentReference tcr)
           
 int compareTo(java.lang.Object o)
           
abstract  void createPolicy(SubjectMsg optionalSubject)
          Update the display component to create a new policy.
abstract  void editPolicy(PolicyTemplateResult existingPolicy)
          Update the display component to edit an existing policy
abstract  java.lang.String getDescription()
          Get the description of the PolicyTemplateEditor.
abstract  java.awt.Component getDisplayComponent()
          Return the component to be displayed to the user
 java.lang.String getInstanceId()
           
abstract  java.lang.String getName()
          Get the name of the PolicyTemplateEditor.
abstract  PolicyTemplateResult getResult()
          Return the resultant policy(s) and optional policy set
 java.lang.Object getTemplateState()
          This method is used if this template is a subtemplate
abstract  void initialize(TunnelClient tunnelClient, java.util.Hashtable subjectTreeModels, PolicyTemplateFactory factory)
          Initialize the template In most instances, the GUI components should be built at this time
 void removeTemplateComponentReference(TemplateComponentReference tcr)
           
 void setTemplateComponentReferences(java.util.List refs)
           
 void setTemplateState(java.lang.Object state)
          This method is used if this template is a subtemplate It should restore it's state from the state object returned above
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_instanceId

protected java.lang.String _instanceId
Constructor Detail

PolicyTemplate

public PolicyTemplate()
Method Detail

initialize

public abstract void initialize(TunnelClient tunnelClient,
                                java.util.Hashtable subjectTreeModels,
                                PolicyTemplateFactory factory)
                         throws java.lang.Exception
Initialize the template In most instances, the GUI components should be built at this time

Throws:
java.lang.Exception

getName

public abstract java.lang.String getName()
Get the name of the PolicyTemplateEditor.

Returns:
String Represents the policy template editor name.

getDescription

public abstract java.lang.String getDescription()
Get the description of the PolicyTemplateEditor.

Returns:
String Represents the policy template editor name.

getResult

public abstract PolicyTemplateResult getResult()
                                        throws PolicyBuildingNotCompleted
Return the resultant policy(s) and optional policy set

Returns:
PolicyTemplateEditorResult the resultant policy(s)
Throws:
PolicyBuildingNotCompleted

getDisplayComponent

public abstract java.awt.Component getDisplayComponent()
Return the component to be displayed to the user


createPolicy

public abstract void createPolicy(SubjectMsg optionalSubject)
                           throws java.lang.Exception
Update the display component to create a new policy. Also called when a template is edited or created. This second usage exists to ensure that the selections of template components in the template is reset to their default values. If your template requires a subject, you should override the requiresSubject() method to return true;

Parameters:
optionalSubject - The subject if the editor was invoked for it
Throws:
java.lang.Exception

editPolicy

public abstract void editPolicy(PolicyTemplateResult existingPolicy)
                         throws java.lang.Exception
Update the display component to edit an existing policy

Parameters:
PolicyTemplateEditorResult - Contains information about the existing policy(s) (and optionally policy set)
Throws:
java.lang.Exception

addTemplateComponentReference

public void addTemplateComponentReference(TemplateComponentReference tcr)

removeTemplateComponentReference

public void removeTemplateComponentReference(TemplateComponentReference tcr)

setTemplateComponentReferences

public void setTemplateComponentReferences(java.util.List refs)

getTemplateState

public java.lang.Object getTemplateState()
                                  throws TemplateBuildingNotCompleted,
                                         PolicyBuildingNotCompleted
This method is used if this template is a subtemplate

Throws:
TemplateBuildingNotCompleted
PolicyBuildingNotCompleted

setTemplateState

public void setTemplateState(java.lang.Object state)
                      throws java.lang.Exception
This method is used if this template is a subtemplate It should restore it's state from the state object returned above

Throws:
java.lang.Exception

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getInstanceId

public java.lang.String getInstanceId()