com.waveset.object
Class Principal

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.Principal
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, java.io.Serializable, XmlObject
Direct Known Subclasses:
AdminGroup, Administrator, AdminRole, WSUser

public abstract class Principal
extends PersistentObject
implements java.io.Serializable

A Principal represents a Subject identity. Principals are associated with a Subject.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
protected  java.util.List _adminGroupRefs
           
protected  AdminGroup[] _adminGroups
           
protected  ObjectRef _adminGroupsRuleRef
           
protected  java.util.List _adminRoleRefs
          The list of Admin Role Object Refs assigned to this principal.
protected  java.util.List _controlledObjectGroupRefs
           
protected  ObjectGroup[] _controlledObjectGroups
           
protected  ObjectRef _controlledObjectGroupsRuleRef
           
protected  Permission[] _permissions
           
protected  ObjectRef _userFormRef
          the ObjectRef of a user form that will be used for creating/editing users in this principal's authorization scope.
protected  ObjectRef _viewUserFormRef
           
static java.lang.String code_id
           
static java.lang.String LAST_LOGIN_LOCALE_PROP
          The name of the property used to store the locale where the user last logged in.
static java.lang.String LOCALE_PROP
          The name of the property used to store the locale of the user.
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Principal()
           
Principal(Principal src)
           
Principal(java.lang.String name)
           
 
Method Summary
 void addAdminGroup(AdminGroup ag)
           
 void addAdminGroupRef(ObjectRef ref)
          Add one approver to our approver list.
protected  void addCommonPrincipalElements(java.lang.StringBuffer b)
          Add any elements common to all principal objects.
 void addControlledObjectGroup(ObjectGroup og)
           
 void addPermission(Permission perm)
           
 void clearAdminGroups()
           
 java.util.ArrayList getAdminGroupRefs()
           
 AdminGroup[] getAdminGroups()
           
 ObjectRef getAdminGroupsRuleRef()
           
 java.util.List getAdminRoleRefs()
           
 java.util.List getAdminRoles()
          Resolve and return the list of admin role objects.
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 java.util.ArrayList getControlledObjectGroupRefs()
           
 ObjectGroup[] getControlledObjectGroups()
           
 ObjectRef getControlledObjectGroupsRuleRef()
           
 java.util.List getEncryptedValues()
           
 Permission[] getPermissions()
           
 java.util.ArrayList getReferences()
          Return the list of references within this object.
 Configuration getUserForm()
           
 java.lang.String getUserFormId()
           
 ObjectRef getUserFormRef()
           
 Configuration getViewUserForm()
           
 java.lang.String getViewUserFormId()
           
 ObjectRef getViewUserFormRef()
           
 boolean hasCapabilities()
           
 java.util.List listQueryableAttributes()
           
 java.util.List listQueryableReferenceAttributes()
           
 java.util.List listSummaryAttributes()
          Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).
protected  void parseCommonPrincipalElements(org.w3c.dom.Element e)
           
static Permission[] parsePermissions(org.w3c.dom.Element e)
           
 void removeAdminGroup(AdminGroup ag)
           
 void removeControlledObjectGroup(ObjectGroup og)
           
 void removePermission(Permission perm)
           
 void setAdminGroupRefs(java.util.List refs)
           
 void setAdminGroups(AdminGroup[] agarray)
           
 void setAdminGroupsRuleRef(ObjectRef adminGroupsRuleRef)
           
 void setAdminRoleRefs(java.util.List adminRoles)
           
 void setAdminRoles(java.util.List adminRoles)
          set the list of admin roles.
 void setControlledObjectGroupRefs(java.util.List refs)
          Has to be public, its called by AccessPolicy.
 void setControlledObjectGroups(ObjectGroup[] ogarray)
           
 void setControlledObjectGroupsRuleRef(ObjectRef controlledObjectGroupsRuleRef)
           
 void setPermissions(Permission[] permissions)
           
 void setUserForm(Configuration userForm)
           
 void setUserFormRef(ObjectRef userFormRef)
           
 void setViewUserForm(Configuration viewUserForm)
           
 void setViewUserFormRef(ObjectRef viewUserFormRef)
           
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSubclassAttributes, addSubclassElements, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getDisplayName, getElementName, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, getType, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseSubclassAttributes, parseSubclassElements, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

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

LOCALE_PROP

public static final java.lang.String LOCALE_PROP
The name of the property used to store the locale of the user. This was originally added to enable localized email messages. The value is determined by Locale.toString(), e.g. "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC". This allows us to store the language, country, and variant. See bug 9597 for more information.

See Also:
Constant Field Values

LAST_LOGIN_LOCALE_PROP

public static final java.lang.String LAST_LOGIN_LOCALE_PROP
The name of the property used to store the locale where the user last logged in. If the user has not explicitly set their locale, this is used as a hint of the user's locale. It's set each time the user logs in. See LOCALE_PROP for more information including the format of the stored value.

See Also:
Constant Field Values

_permissions

protected Permission[] _permissions

_controlledObjectGroupRefs

protected java.util.List _controlledObjectGroupRefs

_controlledObjectGroups

protected ObjectGroup[] _controlledObjectGroups

_controlledObjectGroupsRuleRef

protected ObjectRef _controlledObjectGroupsRuleRef

_adminGroupRefs

protected java.util.List _adminGroupRefs

_adminGroups

protected AdminGroup[] _adminGroups

_adminGroupsRuleRef

protected ObjectRef _adminGroupsRuleRef

_adminRoleRefs

protected java.util.List _adminRoleRefs
The list of Admin Role Object Refs assigned to this principal. Admin Roles enable unique capabilities / controlled object group pairing.


_userFormRef

protected ObjectRef _userFormRef
the ObjectRef of a user form that will be used for creating/editing users in this principal's authorization scope. If a user form is assigned directly to a user type principal, that user form will be used for editing all users in the principal's scope. If the user form is assigned to an admin role type principal which is, in turn, assigned to a user, that user form will be used for editing all users in the scope of the admin role. As for precedence, a user form assigned directly to a user will take precedense over a user form assigned to an admin role assigned to the same user or a user form assigned to an object group of which the user is a member.


_viewUserFormRef

protected ObjectRef _viewUserFormRef
Constructor Detail

Principal

public Principal()

Principal

public Principal(java.lang.String name)

Principal

public Principal(Principal src)
          throws WavesetException
Method Detail

getReferences

public java.util.ArrayList getReferences()
Return the list of references within this object.

Overrides:
getReferences in class PersistentObject

listSummaryAttributes

public java.util.List listSummaryAttributes()
Description copied from class: PersistentObject
Returns the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.

Overrides:
listSummaryAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as summary attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listSummaryAttributes() to ensure that the subclass includes summary attributes that are common to all PersistentObjects.

See Also:
Constants.MAX_SUMMARY_STRING_LENGTH, PersistentObject.getSummaryString()

listQueryableAttributes

public java.util.List listQueryableAttributes()
Overrides:
listQueryableAttributes in class PersistentObject
Returns:
the complete list of defined attributes that this type of persistent object exposes as queryable attributes (regardless of whether this particular object has a value for each).

Any subclass of PersistentObject that overrides this method should first invoke super.listQueryableAttributes() to ensure that the subclass includes queryable attributes that are common to all PersistentObjects.


listQueryableReferenceAttributes

public java.util.List listQueryableReferenceAttributes()
Overrides:
listQueryableReferenceAttributes in class PersistentObject
Returns:
the list of defined attributes that this type of persistent object supports as queryable attributes and for which each value is a reference to another persistent object.

Any subclass of Principal that overrides this method must first invoke super.listQueryableReferenceAttributes() to ensure that the following attributes are returned as queryable reference attributes for all Principals.

  • MemberAdminGroups
  • ControlledObjectGroups
  • AdminRoles

getAttributeValues

protected WSAttribute getAttributeValues(java.lang.String attrName)
Overrides:
getAttributeValues in class PersistentObject
Parameters:
attrName - - the name of the attribute for which to return values.
Returns:
a WSAttribute that represents the value (or values) that this object contains for the specified attribute.


getEncryptedValues

public java.util.List getEncryptedValues()
Overrides:
getEncryptedValues in class PersistentObject
Returns:
the complete set of object values whose type is encrypted data (regardless of whether this object has a value for each).

Any subclass of PersistentObject that overrides this method must first invoke super.getEncryptedValues() to ensure that the list of encrypted values for PersistentObjects are included in the subclasses list.


addPermission

public void addPermission(Permission perm)

removePermission

public void removePermission(Permission perm)

getPermissions

public Permission[] getPermissions()

setPermissions

public void setPermissions(Permission[] permissions)

getControlledObjectGroupRefs

public java.util.ArrayList getControlledObjectGroupRefs()

setControlledObjectGroupRefs

public void setControlledObjectGroupRefs(java.util.List refs)
Has to be public, its called by AccessPolicy.


getControlledObjectGroups

public ObjectGroup[] getControlledObjectGroups()
                                        throws WavesetException
Throws:
WavesetException

setControlledObjectGroups

public void setControlledObjectGroups(ObjectGroup[] ogarray)

addControlledObjectGroup

public void addControlledObjectGroup(ObjectGroup og)

removeControlledObjectGroup

public void removeControlledObjectGroup(ObjectGroup og)

getControlledObjectGroupsRuleRef

public ObjectRef getControlledObjectGroupsRuleRef()

setControlledObjectGroupsRuleRef

public void setControlledObjectGroupsRuleRef(ObjectRef controlledObjectGroupsRuleRef)

clearAdminGroups

public void clearAdminGroups()

getAdminGroupRefs

public java.util.ArrayList getAdminGroupRefs()

setAdminGroupRefs

public void setAdminGroupRefs(java.util.List refs)

getAdminGroups

public AdminGroup[] getAdminGroups()
                            throws WavesetException
Throws:
WavesetException

setAdminGroups

public void setAdminGroups(AdminGroup[] agarray)
                    throws WavesetException
Throws:
WavesetException

addAdminGroup

public void addAdminGroup(AdminGroup ag)
                   throws WavesetException
Throws:
WavesetException

addAdminGroupRef

public void addAdminGroupRef(ObjectRef ref)
Add one approver to our approver list.


removeAdminGroup

public void removeAdminGroup(AdminGroup ag)

getAdminGroupsRuleRef

public ObjectRef getAdminGroupsRuleRef()

setAdminGroupsRuleRef

public void setAdminGroupsRuleRef(ObjectRef adminGroupsRuleRef)

getAdminRoleRefs

public java.util.List getAdminRoleRefs()

getAdminRoles

public java.util.List getAdminRoles()
                             throws WavesetException
Resolve and return the list of admin role objects.

Throws:
WavesetException

setAdminRoles

public void setAdminRoles(java.util.List adminRoles)
set the list of admin roles.

Parameters:
adminRoles - - List of ObjectRefs or Admin Role objects

setAdminRoleRefs

public void setAdminRoleRefs(java.util.List adminRoles)

getUserFormRef

public ObjectRef getUserFormRef()

getUserForm

public Configuration getUserForm()
                          throws WavesetException
Throws:
WavesetException

getUserFormId

public java.lang.String getUserFormId()

setUserFormRef

public void setUserFormRef(ObjectRef userFormRef)

setUserForm

public void setUserForm(Configuration userForm)

hasCapabilities

public boolean hasCapabilities()

getViewUserFormRef

public ObjectRef getViewUserFormRef()

getViewUserForm

public Configuration getViewUserForm()
                              throws WavesetException
Throws:
WavesetException

getViewUserFormId

public java.lang.String getViewUserFormId()

setViewUserFormRef

public void setViewUserFormRef(ObjectRef viewUserFormRef)

setViewUserForm

public void setViewUserForm(Configuration viewUserForm)

addCommonPrincipalElements

protected void addCommonPrincipalElements(java.lang.StringBuffer b)
Add any elements common to all principal objects.


parseCommonPrincipalElements

protected void parseCommonPrincipalElements(org.w3c.dom.Element e)
                                     throws WavesetException
Throws:
WavesetException

parsePermissions

public static Permission[] parsePermissions(org.w3c.dom.Element e)
                                     throws WavesetException
Throws:
WavesetException