kaos.core.util
Class PolicyMsg

java.lang.Object
  extended by kaos.core.util.Msg
      extended by 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

Field Summary
static java.lang.String ADMINISTRATOR
           
static java.lang.String ATTRIBUTES
           
static java.lang.String DESCRIPTION
           
static java.lang.String HARMONIZED_POLICIES
           
static java.lang.String ID
           
static java.lang.String INCLUDED_IN_POLICY_SETS
           
static java.lang.String INFORCE
           
static java.lang.String MODALITY
           
static java.lang.String NAME
           
static java.lang.String ORIGINAL_POLICY
           
static java.lang.String POLICY_MSG_TYPE
           
static java.lang.String PRIORITY
           
static java.lang.String SITE_OF_ENFORCEMENT
           
static java.lang.String SUBJECTS
           
static java.lang.String TEMPLATE_INSTANCE_ID
           
static java.lang.String TIME_STAMP
           
static java.lang.String TYPE
           
static java.lang.String USED_POLICY_TEMPLATE
           
 
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.
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getAdministrator()
           
 java.util.Vector getAttributes()
           
 java.lang.String getDescription()
           
 java.util.Vector getHarmonizedPolicies()
           
 java.lang.String getId()
           
 java.util.Vector getIncludedInPolicySets()
           
 java.lang.String getModality()
           
 java.lang.String getName()
           
 java.lang.String getOriginalPolicy()
           
 java.lang.String getPriority()
           
 java.lang.String getSiteOfEnforcement()
           
 java.util.Vector getSubjects()
          Get the subjects of a policy (the entities to which the policy applies
 java.lang.String getTemplateInstanceId()
           
 java.lang.String getTimeStamp()
           
 java.lang.String getType()
           
 java.lang.String getUsedPolicyTemplate()
           
 boolean isHarmonized()
           
 boolean isInForce()
           
 boolean setAttribute(AttributeMsg attribMsg)
          Set the attribute.
 void setDescription(java.lang.String desc)
           
 void setHarmonizedPolicies(java.util.Vector ids)
           
 void setIncludedInPolicySets(java.util.Vector ids)
           
 void setIsInForce(boolean _isInForce)
           
 void setModality(java.lang.String modality)
           
 void setName(java.lang.String name)
           
 void setOriginalPolicy(java.lang.String id)
           
 void setPriority(java.lang.String priority)
           
 void setSiteOfEnforcement(java.lang.String siteOfEnforcement)
           
 void setTemplateInstanceId(java.lang.String instanceId)
           
 void setTimeStamp(java.lang.String timeStamp)
           
 void setUsedPolicyTemplate(java.lang.String usedPolicyTemplate)
           
 
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
 

Field Detail

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
Constructor Detail

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 policy
name - name of the policy
description - description of the policy
type - type of the policy (should match the type of a policy enforcer)
administrator - the administrator of the policy
subjects - 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

Method Detail

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()