kaos.core.util
Class PolicyMsg
java.lang.Object
kaos.core.util.Msg
kaos.core.util.PolicyMsg
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, org.xml.sax.ErrorHandler
public class PolicyMsg
- extends Msg
- implements java.lang.Cloneable
Convenience class for constructing and accessing fields of a Msg representation of a policy.
$Revision: 1.17 $
- See Also:
- Serialized Form
Constructor Summary |
PolicyMsg(Msg msg)
Create PolicyMsg from existing Msg
note that the existing Msg will be modified as the PolicyMsg is modified
and vice versa |
PolicyMsg(java.lang.String id,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String administrator,
java.util.Vector subjects,
boolean isInForce)
Constructor
Creates an empty PolicyMsg containing information necessary
for policy distribution. |
Methods inherited from class kaos.core.util.Msg |
addSubMsg, addSubMsg, addSymbol, addSymbol, addSymbol, addSymbol, addSymbol, addSymbol, createFromFile, error, fatalError, getElementsNamed, getFirstChildSkip, getNamedString, getNamedString, getNamedVector, getNextSkip, getNodeAttributes, getParentSkip, getPreviousSkip, getRootNode, getSubMsg, getSubMsg, getSymbol, getSymbol, getVerbosity, main, removeSymbol, setLogger, setVerbosity, showMsgInfo, showMsgInfo, toString, traverseDOMBranch, traverseRoot, warning |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
POLICY_MSG_TYPE
public static final java.lang.String POLICY_MSG_TYPE
- See Also:
- Constant Field Values
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
ADMINISTRATOR
public static final java.lang.String ADMINISTRATOR
- See Also:
- Constant Field Values
SUBJECTS
public static final java.lang.String SUBJECTS
- See Also:
- Constant Field Values
INFORCE
public static final java.lang.String INFORCE
- See Also:
- Constant Field Values
ATTRIBUTES
public static final java.lang.String ATTRIBUTES
- See Also:
- Constant Field Values
HARMONIZED_POLICIES
public static final java.lang.String HARMONIZED_POLICIES
- See Also:
- Constant Field Values
ORIGINAL_POLICY
public static final java.lang.String ORIGINAL_POLICY
- See Also:
- Constant Field Values
MODALITY
public static final java.lang.String MODALITY
- See Also:
- Constant Field Values
PRIORITY
public static final java.lang.String PRIORITY
- See Also:
- Constant Field Values
TIME_STAMP
public static final java.lang.String TIME_STAMP
- See Also:
- Constant Field Values
SITE_OF_ENFORCEMENT
public static final java.lang.String SITE_OF_ENFORCEMENT
- See Also:
- Constant Field Values
USED_POLICY_TEMPLATE
public static final java.lang.String USED_POLICY_TEMPLATE
- See Also:
- Constant Field Values
INCLUDED_IN_POLICY_SETS
public static final java.lang.String INCLUDED_IN_POLICY_SETS
- See Also:
- Constant Field Values
TEMPLATE_INSTANCE_ID
public static final java.lang.String TEMPLATE_INSTANCE_ID
- See Also:
- Constant Field Values
PolicyMsg
public PolicyMsg(java.lang.String id,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String administrator,
java.util.Vector subjects,
boolean isInForce)
- Constructor
Creates an empty PolicyMsg containing information necessary
for policy distribution.
The actual policy content is arbitrary and should be added
by calling setAttribute().
- Parameters:
id
- unique identifier for the policyname
- name of the policydescription
- description of the policytype
- type of the policy (should match the type of a
policy enforcer)administrator
- the administrator of the policysubjects
- Vector of SubjectMsgs representing the subjects of
the policy (the entities to which the policy
applies)isInForce
- true to distribute and enforce the policy, false
to only store the policy in the directory
PolicyMsg
public PolicyMsg(Msg msg)
- Create PolicyMsg from existing Msg
note that the existing Msg will be modified as the PolicyMsg is modified
and vice versa
clone
public java.lang.Object clone()
- Overrides:
clone
in class Msg
setAttribute
public boolean setAttribute(AttributeMsg attribMsg)
- Set the attribute.
If the attribute already exists, replace it. If it doesn't, add it.
- Returns:
- boolean indicating if the attribute was set successfully
setIsInForce
public void setIsInForce(boolean _isInForce)
setModality
public void setModality(java.lang.String modality)
setPriority
public void setPriority(java.lang.String priority)
setTimeStamp
public void setTimeStamp(java.lang.String timeStamp)
setSiteOfEnforcement
public void setSiteOfEnforcement(java.lang.String siteOfEnforcement)
setUsedPolicyTemplate
public void setUsedPolicyTemplate(java.lang.String usedPolicyTemplate)
setTemplateInstanceId
public void setTemplateInstanceId(java.lang.String instanceId)
setIncludedInPolicySets
public void setIncludedInPolicySets(java.util.Vector ids)
- Parameters:
ids
- The Vector of ids of sets of policies, to which this policy belongs.
setHarmonizedPolicies
public void setHarmonizedPolicies(java.util.Vector ids)
setOriginalPolicy
public void setOriginalPolicy(java.lang.String id)
getAttributes
public java.util.Vector getAttributes()
- Returns:
- a vector of AttributeMsg
getId
public java.lang.String getId()
getName
public java.lang.String getName()
getDescription
public java.lang.String getDescription()
setName
public void setName(java.lang.String name)
setDescription
public void setDescription(java.lang.String desc)
getType
public java.lang.String getType()
getAdministrator
public java.lang.String getAdministrator()
getModality
public java.lang.String getModality()
getPriority
public java.lang.String getPriority()
getTimeStamp
public java.lang.String getTimeStamp()
getSiteOfEnforcement
public java.lang.String getSiteOfEnforcement()
getUsedPolicyTemplate
public java.lang.String getUsedPolicyTemplate()
getTemplateInstanceId
public java.lang.String getTemplateInstanceId()
getHarmonizedPolicies
public java.util.Vector getHarmonizedPolicies()
- Returns:
- Vector of Strings indicating ids of the policies created
as a result of the harmonization of this policy
(or null if the policy has not been harmonized)
getOriginalPolicy
public java.lang.String getOriginalPolicy()
- Returns:
- the id of the original policy if this policy is the result of
a harmonization (null otherwise)
getIncludedInPolicySets
public java.util.Vector getIncludedInPolicySets()
- Returns:
- Vector of Strings representing ids of the policy sets,
to which this policy belongs.
getSubjects
public java.util.Vector getSubjects()
- Get the subjects of a policy (the entities to which the policy applies
- Returns:
- Vector of SubjectMsg
isInForce
public boolean isInForce()
isHarmonized
public boolean isHarmonized()