kaos.kpat.policyTemplates
Class HypertextPolicyTemplate

java.lang.Object
  extended by kaos.kpat.policyTemplates.PolicyTemplate
      extended by kaos.kpat.policyTemplates.HypertextPolicyTemplate
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
WizardPolicyTemplate

public class HypertextPolicyTemplate
extends PolicyTemplate


Nested Class Summary
protected  class HypertextPolicyTemplate.AbstractConditionContainer
           
 class HypertextPolicyTemplate.CompoundConditionContainer
           
static class HypertextPolicyTemplate.CONDITION_TYPE
           
protected  class HypertextPolicyTemplate.ConditionPanel
           
static class HypertextPolicyTemplate.CONNECTIVE_TYPE
           
protected  class HypertextPolicyTemplate.HistoryContainer
           
protected  class HypertextPolicyTemplate.ObligationContainer
           
protected  class HypertextPolicyTemplate.StateContainer
           
 
Field Summary
protected  HTComboBox _actionLink
           
protected  java.util.Hashtable _actionTable
           
protected  HypertextPolicyTemplate.ConditionPanel _conditionPanel
           
protected  HypertextContainerImpl _controlsAction
           
protected  HTActionClassPropertySet _controlsProps
           
protected  javax.swing.JTextArea _descriptionArea
           
protected  PolicyTemplateFactory _factory
           
protected  javax.swing.JLabel _idValueLbl
           
protected  boolean _isSubjectClass
           
protected  HTComboBox _modalityLink
           
protected  javax.swing.JTextField _nameFld
           
protected  HypertextPolicyTemplate.ObligationContainer _obligationContainer
           
protected  HTPeerRVMCoordinator _peerRVMCoordinator
           
protected  HTLabel _performLbl
           
protected  javax.swing.JPanel _policyPanel
           
protected  HypertextContainerImpl _policyStatementContainer
           
protected  javax.swing.JTextField _priorityFld
           
protected  boolean _stateSet
           
protected  ActorLink _subjectLink
           
protected  java.util.Vector _tcrs
           
protected  java.lang.String _templateName
           
protected  java.util.Hashtable _treeModels
           
protected  TunnelClient _tunnelClient
           
protected  java.lang.String BREAK
           
static java.lang.String CONDITION
           
static java.lang.String CONTROLS_ACTION
           
protected static java.lang.String CONTROLS_ACTION_BINDING
           
static java.lang.String CONTROLS_ACTOR
           
static java.lang.String CONTROLS_PROPS
           
protected static java.lang.String CONTROLS_SUBJECT_BINDING
           
protected static java.lang.String DESCRIPTION
           
static java.lang.String INSTANCE_ID
           
static java.lang.String MODALITY
           
static java.lang.String NAME
           
static java.lang.String OBLIGATION_TRIGGER
           
static java.lang.String PRIORITY
           
protected  java.lang.String TAB
           
 
Fields inherited from class kaos.kpat.policyTemplates.PolicyTemplate
_instanceId
 
Constructor Summary
HypertextPolicyTemplate()
           
 
Method Summary
 void addTemplateComponentReference(TemplateComponentReference tcr)
           
 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
protected  java.util.Hashtable getBindings()
           
 java.lang.String getDescription()
          Get the description of the PolicyTemplateEditor.
 java.awt.Component getDisplayComponent()
          Return the component to be displayed to the user
 HypertextContainer getHypertext()
           
 java.lang.String getName()
          Get the name of the PolicyTemplateEditor.
 java.lang.String getPolicyAsText(PolicyMsg policy)
           
 PolicyTemplateResult getResult()
          Return the resultant policy(s) and optional policy set
 PolicyTemplateResult getResult(boolean resolveBindings)
           
static HypertextPolicyTemplate getStaticInstance()
           
 java.lang.String getTemplateCreator()
          Get the creator of the PolicyTemplateEditor.
 java.lang.Object getTemplateState()
          This method is used if this template is a subtemplate
 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 initValuesForSubject(SubjectMsg subject)
           
 void removeTemplateComponentReference(TemplateComponentReference tcr)
           
 void setAddEmptyInstancesValue(boolean addEmptyInstancesValue)
           
protected  void setBindings(java.util.Hashtable bindings)
           
 void setName(java.lang.String name)
           
 void setNameAndDescVisible(boolean visible)
           
 void setPolicyName(java.lang.String policyName)
           
static void setStaticInstance(HypertextPolicyTemplate instance)
           
 void setTemplateComponentReferences(java.util.List refs)
           
 void setTemplateEditor(HypertextEditor editor)
           
 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 kaos.kpat.policyTemplates.PolicyTemplate
compareTo, getInstanceId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

DESCRIPTION

protected static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

CONTROLS_ACTION_BINDING

protected static final java.lang.String CONTROLS_ACTION_BINDING
See Also:
Constant Field Values

CONTROLS_SUBJECT_BINDING

protected static final java.lang.String CONTROLS_SUBJECT_BINDING
See Also:
Constant Field Values

_controlsAction

protected HypertextContainerImpl _controlsAction

_subjectLink

protected ActorLink _subjectLink

_modalityLink

protected HTComboBox _modalityLink

_actionLink

protected HTComboBox _actionLink

_controlsProps

protected HTActionClassPropertySet _controlsProps

_policyStatementContainer

protected HypertextContainerImpl _policyStatementContainer

_templateName

protected java.lang.String _templateName

_factory

protected PolicyTemplateFactory _factory

BREAK

protected final java.lang.String BREAK
See Also:
Constant Field Values

TAB

protected final java.lang.String TAB
See Also:
Constant Field Values

PRIORITY

public static final java.lang.String PRIORITY
See Also:
Constant Field Values

CONTROLS_ACTOR

public static final java.lang.String CONTROLS_ACTOR
See Also:
Constant Field Values

CONTROLS_ACTION

public static final java.lang.String CONTROLS_ACTION
See Also:
Constant Field Values

CONTROLS_PROPS

public static final java.lang.String CONTROLS_PROPS
See Also:
Constant Field Values

MODALITY

public static final java.lang.String MODALITY
See Also:
Constant Field Values

OBLIGATION_TRIGGER

public static final java.lang.String OBLIGATION_TRIGGER
See Also:
Constant Field Values

CONDITION

public static final java.lang.String CONDITION
See Also:
Constant Field Values

INSTANCE_ID

public static final java.lang.String INSTANCE_ID
See Also:
Constant Field Values

_actionTable

protected java.util.Hashtable _actionTable

_nameFld

protected javax.swing.JTextField _nameFld

_idValueLbl

protected javax.swing.JLabel _idValueLbl

_descriptionArea

protected javax.swing.JTextArea _descriptionArea

_priorityFld

protected javax.swing.JTextField _priorityFld

_isSubjectClass

protected boolean _isSubjectClass

_policyPanel

protected javax.swing.JPanel _policyPanel

_tunnelClient

protected TunnelClient _tunnelClient

_obligationContainer

protected HypertextPolicyTemplate.ObligationContainer _obligationContainer

_treeModels

protected java.util.Hashtable _treeModels

_tcrs

protected java.util.Vector _tcrs

_peerRVMCoordinator

protected HTPeerRVMCoordinator _peerRVMCoordinator

_stateSet

protected boolean _stateSet

_conditionPanel

protected HypertextPolicyTemplate.ConditionPanel _conditionPanel

_performLbl

protected HTLabel _performLbl
Constructor Detail

HypertextPolicyTemplate

public HypertextPolicyTemplate()
Method Detail

setStaticInstance

public static void setStaticInstance(HypertextPolicyTemplate instance)

getStaticInstance

public static HypertextPolicyTemplate getStaticInstance()

initialize

public void initialize(TunnelClient tunnelClient,
                       java.util.Hashtable subjectTreeModels,
                       PolicyTemplateFactory factory)
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

setNameAndDescVisible

public void setNameAndDescVisible(boolean visible)

setAddEmptyInstancesValue

public void setAddEmptyInstancesValue(boolean addEmptyInstancesValue)

getHypertext

public HypertextContainer getHypertext()

getPolicyAsText

public java.lang.String getPolicyAsText(PolicyMsg policy)

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.

setName

public void setName(java.lang.String 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.

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.

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

getResult

public PolicyTemplateResult getResult(boolean resolveBindings)
                               throws KAoSPolicyBuilder.PolicyBuildingNotCompleted
Throws:
KAoSPolicyBuilder.PolicyBuildingNotCompleted

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

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

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

initValuesForSubject

protected void initValuesForSubject(SubjectMsg subject)

addTemplateComponentReference

public void addTemplateComponentReference(TemplateComponentReference tcr)
Overrides:
addTemplateComponentReference in class PolicyTemplate

removeTemplateComponentReference

public void removeTemplateComponentReference(TemplateComponentReference tcr)
Overrides:
removeTemplateComponentReference in class PolicyTemplate

setTemplateComponentReferences

public void setTemplateComponentReferences(java.util.List refs)
Overrides:
setTemplateComponentReferences in class PolicyTemplate

setPolicyName

public void setPolicyName(java.lang.String policyName)

setTemplateEditor

public void setTemplateEditor(HypertextEditor editor)

setTemplateState

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

Overrides:
setTemplateState in class PolicyTemplate
Throws:
java.lang.Exception

getTemplateState

public java.lang.Object getTemplateState()
                                  throws KAoSPolicyBuilder.PolicyBuildingNotCompleted
Description copied from class: PolicyTemplate
This method is used if this template is a subtemplate

Overrides:
getTemplateState in class PolicyTemplate
Throws:
KAoSPolicyBuilder.PolicyBuildingNotCompleted

getBindings

protected java.util.Hashtable getBindings()

setBindings

protected void setBindings(java.util.Hashtable bindings)