kaos.kpat.models
Class ModelPolicy

java.lang.Object
  extended by kaos.kpat.models.ModelPolicy
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, iModelPolicy

public class ModelPolicy
extends java.lang.Object
implements iModelPolicy, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.awt.datatransfer.Transferable

This class models a policy in KPAT

See Also:
Serialized Form

Field Summary
 javax.swing.tree.TreeModel _analysisTreeModel
           
 PolicyMsg _originalPolicyMsg
           
static java.awt.datatransfer.DataFlavor INFO_FLAVOR
           
 
Constructor Summary
ModelPolicy(ModelPolicy po)
          The 'copy' contructor for cloning the policy list.
ModelPolicy(PolicyMsg policyMsg)
          Constructor for modeling an existing policy Note that if you use this constructor the set* methods will not have any affect on the policy returned by toPolicyMsg()
ModelPolicy(java.lang.String id, java.lang.String name, java.lang.String description, java.lang.String scope, java.lang.String subjectID, java.lang.String subjectName, java.lang.String targetID, java.lang.String targetName, java.lang.String type, boolean inForce, boolean isSingleValued, boolean isFixedSet, ModelAttributeList attributeList)
          OLD CONSTRUCTOR ONLY FOR CREATING XML POLICIES Constructor.
 
Method Summary
 java.lang.Object clone()
          'Deep' clone.
 int compareTo(java.lang.Object o)
           
 javax.swing.tree.TreeModel getAnalysisTreeModel()
           
 ModelAttributeList getAttributeList()
           
 java.lang.String getDescription()
           
 int getDomainItemCount()
           
 java.lang.String getID()
           
 java.lang.String getName()
           
 java.lang.String getNameJTP()
           
 java.lang.String getPolicyTemplate()
           
 java.lang.String getPriority()
           
 java.lang.String getScope()
           
 java.lang.String getSubjectID()
           
 java.lang.String getSubjectName()
           
 java.lang.String getTargetID()
           
 java.lang.String getTargetName()
           
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
          implements Transferable interface
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
          implements Transferable interface
 java.lang.String getType()
           
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
           
 boolean isFixedSet()
           
 boolean isHarmonized()
           
 boolean isInForce()
           
 boolean isSingleValued()
           
 java.lang.String selectedAttributesString()
          Return a pretty string containing all the currently *selected* attributes.
 void setAnalysisTreeModel(javax.swing.tree.TreeModel analysisTreeModel)
           
 void setAttributeList(ModelAttributeList newList)
           
 void setDescription(java.lang.String newDescription)
           
 void setFixedSet(boolean isFixedSet)
           
 void setHarmonized(boolean harmon)
           
 void setID(java.lang.String newID)
           
 void setInForce(boolean inf)
           
 void setName(java.lang.String newName)
           
 void setNameJTP(java.lang.String newName)
           
 void setPolicyTemplate(java.lang.String policyTemplate)
           
 void setScope(java.lang.String newScope)
           
 void setSingleValued(boolean isSingleValued)
           
 void setSubjectID(java.lang.String newID)
           
 void setSubjectName(java.lang.String newName)
           
 void setTargetID(java.lang.String newID)
           
 void setTargetName(java.lang.String newName)
           
 void setType(java.lang.String newType)
           
 PolicyMsg toPolicyMsg()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_originalPolicyMsg

public PolicyMsg _originalPolicyMsg

_analysisTreeModel

public javax.swing.tree.TreeModel _analysisTreeModel

INFO_FLAVOR

public static final java.awt.datatransfer.DataFlavor INFO_FLAVOR
Constructor Detail

ModelPolicy

public ModelPolicy(java.lang.String id,
                   java.lang.String name,
                   java.lang.String description,
                   java.lang.String scope,
                   java.lang.String subjectID,
                   java.lang.String subjectName,
                   java.lang.String targetID,
                   java.lang.String targetName,
                   java.lang.String type,
                   boolean inForce,
                   boolean isSingleValued,
                   boolean isFixedSet,
                   ModelAttributeList attributeList)
OLD CONSTRUCTOR ONLY FOR CREATING XML POLICIES Constructor. Note that attributeList isn't copied, so you'd better be passing in a new one, just for this object (or not, if that's what you want).


ModelPolicy

public ModelPolicy(PolicyMsg policyMsg)
Constructor for modeling an existing policy Note that if you use this constructor the set* methods will not have any affect on the policy returned by toPolicyMsg()


ModelPolicy

public ModelPolicy(ModelPolicy po)
The 'copy' contructor for cloning the policy list. This constructor DOES copy the attribute list.

Method Detail

setAnalysisTreeModel

public void setAnalysisTreeModel(javax.swing.tree.TreeModel analysisTreeModel)

getAnalysisTreeModel

public javax.swing.tree.TreeModel getAnalysisTreeModel()

clone

public java.lang.Object clone()
'Deep' clone.

Overrides:
clone in class java.lang.Object

toPolicyMsg

public PolicyMsg toPolicyMsg()

selectedAttributesString

public java.lang.String selectedAttributesString()
Return a pretty string containing all the currently *selected* attributes.


getDomainItemCount

public int getDomainItemCount()
Specified by:
getDomainItemCount in interface iModelPolicy

getAttributeList

public ModelAttributeList getAttributeList()
Specified by:
getAttributeList in interface iModelPolicy

setAttributeList

public void setAttributeList(ModelAttributeList newList)

getID

public java.lang.String getID()

setID

public void setID(java.lang.String newID)

getName

public java.lang.String getName()
Specified by:
getName in interface iModelPolicy

setName

public void setName(java.lang.String newName)

getNameJTP

public java.lang.String getNameJTP()

setNameJTP

public void setNameJTP(java.lang.String newName)

getScope

public java.lang.String getScope()

setScope

public void setScope(java.lang.String newScope)

getSubjectID

public java.lang.String getSubjectID()

setSubjectID

public void setSubjectID(java.lang.String newID)

getSubjectName

public java.lang.String getSubjectName()

setSubjectName

public void setSubjectName(java.lang.String newName)

getTargetID

public java.lang.String getTargetID()

setTargetID

public void setTargetID(java.lang.String newID)

getTargetName

public java.lang.String getTargetName()

setTargetName

public void setTargetName(java.lang.String newName)

getType

public java.lang.String getType()

setType

public void setType(java.lang.String newType)

setInForce

public void setInForce(boolean inf)
Specified by:
setInForce in interface iModelPolicy

isInForce

public boolean isInForce()
Specified by:
isInForce in interface iModelPolicy

setHarmonized

public void setHarmonized(boolean harmon)

isHarmonized

public boolean isHarmonized()

getPriority

public java.lang.String getPriority()

setSingleValued

public void setSingleValued(boolean isSingleValued)
Specified by:
setSingleValued in interface iModelPolicy

isSingleValued

public boolean isSingleValued()
Specified by:
isSingleValued in interface iModelPolicy

setFixedSet

public void setFixedSet(boolean isFixedSet)
Specified by:
setFixedSet in interface iModelPolicy

isFixedSet

public boolean isFixedSet()
Specified by:
isFixedSet in interface iModelPolicy

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String newDescription)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setPolicyTemplate

public void setPolicyTemplate(java.lang.String policyTemplate)

getPolicyTemplate

public java.lang.String getPolicyTemplate()

compareTo

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

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor df)
Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor df)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
implements Transferable interface

Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
implements Transferable interface

Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable