kaos.kpat.policyTemplates
Class DefinedPolicyWizardTemplate

java.lang.Object
  extended by kaos.kpat.policyTemplates.PolicyTemplate
      extended by kaos.kpat.policyTemplates.DefinedPolicyWizardTemplate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class DefinedPolicyWizardTemplate
extends PolicyTemplate
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
 java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> _stateVector
           
 java.lang.String _templateCreator
           
 java.lang.String _templateDescr
           
 java.lang.String _templateName
           
 int _templatePriority
           
 
Fields inherited from class kaos.kpat.policyTemplates.PolicyTemplate
_instanceId
 
Constructor Summary
DefinedPolicyWizardTemplate()
          Creates an instance of DefinedPolicyWizardTemplate
DefinedPolicyWizardTemplate(SerializableOntModelImpl templateModel)
           
DefinedPolicyWizardTemplate(java.lang.String templateName, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> stateVector, java.lang.String description, int priority, java.lang.String templateCreator)
           
 
Method Summary
 java.lang.Object clone()
           
 void createPolicy(SubjectMsg optionalSubject)
          Update the display component to create a new policy.
 void editPolicy(PolicyTemplateResult existingPolicy)
          Update the display component to edit an existing policy
 SerializableOntModelImpl getDefinedPolicyWizardTemplateOntModel()
          Method returning ontology representation of the given policy template
 java.lang.String getDescription()
          Get the description of the PolicyTemplateEditor.
 java.awt.Component getDisplayComponent()
          Return the component to be displayed to the user
 java.lang.String getName()
          Get the name of the PolicyTemplateEditor.
 int getPriority()
           
 PolicyTemplateResult getResult()
          Return the resultant policy(s) and optional policy set
 java.lang.String getTemplateCreator()
          Get the creator of the PolicyTemplateEditor.
 java.lang.String getTemplateGroup()
           
 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
protected  void printDebugString(java.lang.String msg, int loggerDisplayLevel)
          Utility method to print debug messages.
 void setTemplateGroup(java.lang.String group)
           
 
Methods inherited from class kaos.kpat.policyTemplates.PolicyTemplate
addTemplateComponentReference, compareTo, getInstanceId, getTemplateState, removeTemplateComponentReference, setTemplateComponentReferences, setTemplateState
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_templateDescr

public java.lang.String _templateDescr

_templateName

public java.lang.String _templateName

_templatePriority

public int _templatePriority

_stateVector

public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> _stateVector

_templateCreator

public java.lang.String _templateCreator
Constructor Detail

DefinedPolicyWizardTemplate

public DefinedPolicyWizardTemplate()
Creates an instance of DefinedPolicyWizardTemplate


DefinedPolicyWizardTemplate

public DefinedPolicyWizardTemplate(java.lang.String templateName,
                                   java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> stateVector,
                                   java.lang.String description,
                                   int priority,
                                   java.lang.String templateCreator)

DefinedPolicyWizardTemplate

public DefinedPolicyWizardTemplate(SerializableOntModelImpl templateModel)
Method Detail

getDefinedPolicyWizardTemplateOntModel

public SerializableOntModelImpl getDefinedPolicyWizardTemplateOntModel()
Method returning ontology representation of the given policy template

Returns:
ontology model with policy template representation

createPolicy

public void createPolicy(SubjectMsg optionalSubject)
                  throws java.lang.Exception
Description copied from class: PolicyTemplate
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;

Specified by:
createPolicy in class PolicyTemplate
Parameters:
optionalSubject - The subject if the editor was invoked for it
Throws:
java.lang.Exception

getName

public java.lang.String getName()
Description copied from class: PolicyTemplate
Get the name of the PolicyTemplateEditor.

Specified by:
getName in class PolicyTemplate
Returns:
String Represents the policy template editor name.

getDescription

public java.lang.String getDescription()
Description copied from class: PolicyTemplate
Get the description of the PolicyTemplateEditor.

Specified by:
getDescription in class PolicyTemplate
Returns:
String Represents the policy template editor name.

getPriority

public int getPriority()

getTemplateCreator

public java.lang.String getTemplateCreator()
Description copied from class: PolicyTemplate
Get the creator of the PolicyTemplateEditor.

Specified by:
getTemplateCreator in class PolicyTemplate
Returns:
String Represents the policy template editor creator.

initialize

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

Specified by:
initialize in class PolicyTemplate
Throws:
java.lang.Exception

getResult

public PolicyTemplateResult getResult()
                               throws KAoSPolicyBuilder.PolicyBuildingNotCompleted
Description copied from class: PolicyTemplate
Return the resultant policy(s) and optional policy set

Specified by:
getResult in class PolicyTemplate
Returns:
PolicyTemplateEditorResult the resultant policy(s)
Throws:
KAoSPolicyBuilder.PolicyBuildingNotCompleted

getDisplayComponent

public java.awt.Component getDisplayComponent()
Description copied from class: PolicyTemplate
Return the component to be displayed to the user

Specified by:
getDisplayComponent in class PolicyTemplate

editPolicy

public void editPolicy(PolicyTemplateResult existingPolicy)
                throws java.lang.Exception
Description copied from class: PolicyTemplate
Update the display component to edit an existing policy

Specified by:
editPolicy in class PolicyTemplate
Parameters:
existingPolicy - Contains information about the existing policy(s) (and optionally policy set)
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

printDebugString

protected void printDebugString(java.lang.String msg,
                                int loggerDisplayLevel)
Utility method to print debug messages.


setTemplateGroup

public void setTemplateGroup(java.lang.String group)

getTemplateGroup

public java.lang.String getTemplateGroup()