|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.PersistentObject
com.waveset.object.ObjectGroup
An ObjectGroup is a collection of PersistentObjects. ObjectGroups can be nested to form a hierarchy.
Lighthouse predefines two instances of ObjectGroup:
Top
is the most exclusive.
ObjectGroup:Top is the root of the object group hierarchy.
Access to Top implies access to every object group.
All
is the most inclusive.
ObjectGroup:All lies outside the object group hierarchy.
Any administrator has access to objects in All.
Nested Class Summary | |
static class |
ObjectGroup.ResourceContainerInfo
Used for values of the _resetCheck field. |
Nested classes inherited from class com.waveset.object.PersistentObject |
PersistentObject.Comparator, PersistentObject.InitialInstance |
Field Summary | |
protected java.util.List |
_auditPolicies
A list of ObjectRefs to audit policies. |
protected java.lang.String[] |
_path
cache the path if we have generated it before (it is used a lot in the gui). |
protected java.lang.String[] |
_pathAsIDs
cache the IDs of the path members If an object group changes, the cache will get reloaded so this should not go stale. |
protected ObjectGroup.ResourceContainerInfo |
_resourceContainerInfo
if this object group is a "virtual" object group which represent a directory resource container, this object will describe the resource and the id of the container. |
protected boolean |
_useOrgDisplayNames
|
protected ObjectRef |
_userFormRef
the ObjectRef of a user form that will be used for creating/editing users by all principals (admins, users, etc.) that are members of this object group |
protected java.lang.String |
_userMembersRuleCacheTimeout
If resource objects queries are to be cached, this option specifies the number of milliseconds before the cache times out. |
protected ObjectRef |
_userMembersRuleRef
object ref to a rule that evaluates to a list of 0 or more users that are members of this object group. |
protected ObjectRef |
_viewUserFormRef
the ObjectRef of a user form that will be used by a view only admin that are members of this object group |
static ObjectGroup |
All
|
static java.lang.String |
code_id
|
static ObjectGroup |
Top
|
Fields inherited from class com.waveset.object.PersistentObject |
_trace, trace |
Constructor Summary | |
ObjectGroup()
|
|
ObjectGroup(org.w3c.dom.Element e)
|
|
ObjectGroup(ObjectGroup src)
Clone the object, cloning the object refs to remove any resolved refs that might not belong to the new object's cache. |
|
ObjectGroup(java.lang.String name)
|
Method Summary | |
void |
addApprover(ObjectRef ref)
Add one approver to our approver list. |
void |
addApprover(WSUser admin)
Add one approver to our approver list. |
void |
addAuditPolicyRef(ObjectRef ref)
|
void |
addPolicyRef(ObjectRef ref)
|
protected void |
addSubclassElements(java.lang.StringBuffer b)
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). |
void |
clearApprovers()
Clear the approvers list. |
PersistentObject |
cloneObject()
Clones an object. |
boolean |
dupOrgInParent()
|
java.util.ArrayList |
getApproverRefs()
Get the list of approver object references for this role. |
WSUser[] |
getApprovers()
Get an array of resolved approver objects for this group. |
protected WSAttribute |
getAttributeValues(java.lang.String attrName)
|
java.util.List |
getAuditPolicies()
|
java.util.List |
getAuditPolicyRefs()
|
void |
getChildObjectGroupIds(java.util.List childogidlist)
Similar to getChildObjectGroupNames, but builds a list of ids instead. |
void |
getChildObjectGroupNames(java.util.List childognamelist)
For this ObjectGroup, the method will find all child object groups (e.g. |
void |
getChildObjectGroupPathNames(java.util.List childogpathnamelist)
Similar to getChildObjectGroupNames, but builds a list of pathnames instead. |
void |
getChildObjectGroups(java.util.List childoglist)
Similar to getChildObjectGroupNames, but builds a list of objects instead. |
void |
getDirectChildObjectGroupIds(java.util.List childogidlist)
Similar to getChildObjectGroupIds, but returns only child object group ids whose parent is this object group |
java.lang.String |
getDisplayableName()
Override this to return the path which is what we really want to display for orgs. |
static PersistentObject.InitialInstance[] |
getInitialInstances()
Returns the set of initial instances that should be created for this object type when a repository is created. |
static java.util.List |
getMemberObjectGroupDisplayNames(ObjectSource objSrc,
PersistentObject po)
Return a list of displayNames of the member object groups of the PersistentObject parameter. |
static java.util.List |
getMemberObjectGroupNames(ObjectSource objSrc,
PersistentObject po)
Return a List of String where the Strings are names of the member object groups of the PersistentObject parameter. |
static java.util.List |
getMemberObjectGroupPaths(ObjectSource objSrc,
PersistentObject po)
Return a list of paths of the member object groups of the PersistentObject parameter. |
java.lang.String |
getName()
Return the name of this object. |
static java.lang.String |
getObjectGroupHandle(ObjectSource objSrc,
ObjectRef ref)
Return the org path or displayName for the given object reference. |
static java.util.List |
getObjectGroupHandles(ObjectSource objSrc,
java.util.List objectRefs)
Return a list of org paths or displayNames for the given list of object references. |
static ObjectRef |
getObjectGroupRef(ObjectSource objSrc,
java.lang.String orgHandle)
Takes an orgHandles (either name, path, or displayname) and returns a formal object reference . |
static java.util.List |
getObjectGroupRefs(ObjectSource objSrc,
java.util.List orgList)
Takes a list of orgHandles (either names, paths, or displaynames) and returns a list of formal object references . |
static java.lang.String |
getOrganizationPath(ObjectSource objSrc,
ObjectGroup group)
|
static java.util.List |
getOrganizationPathList(ObjectSource objSrc,
ObjectGroup group,
boolean returnIDs)
Build a list of names or IDs from the given organization back to the top containing the names of each intermediate object groups. |
java.lang.String[] |
getPath()
|
java.lang.String[] |
getPath(boolean returnIDs)
|
java.lang.String[] |
getPathAsIDs()
|
java.lang.String |
getPathString()
Return the organization path as a string of path elements seperated by colons. |
java.util.List |
getPolicies()
|
java.util.List |
getPolicyRefs()
|
java.util.ArrayList |
getReferences()
Return the list of references within this object. |
ObjectGroup.ResourceContainerInfo |
getResourceContainerInfo()
|
static java.util.List |
getTopControlledObjectGroups(LighthouseContext lc,
Subject subject)
Returns the set of 0 or more object groups controlled by the given Subject, each of which has no object group parent that is also controlled by the principal. |
Type |
getType()
Return the type of this object. |
Configuration |
getUserForm()
|
java.lang.String |
getUserFormId()
|
ObjectRef |
getUserFormRef()
|
java.lang.String |
getUserMembersRuleCacheTimeout()
If resource objects queries are to be cached, this option specifies the number of milliseconds before the cache times out. |
ObjectRef |
getUserMembersRuleRef()
|
Configuration |
getViewUserForm()
|
java.lang.String |
getViewUserFormId()
|
ObjectRef |
getViewUserFormRef()
|
boolean |
isJunction()
|
boolean |
isVirtual()
|
java.util.List |
listQueryableAttributes()
|
protected void |
listQueryableSummaryAttributes(java.util.List attrs)
|
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). |
static void |
normalizeObjectGroup(ObjectSource objSrc,
ObjectGroup org)
Update the path (from the top of the organization hierarchy) for the specified object group. |
protected void |
parseSubclassElements(org.w3c.dom.Element e)
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer). |
void |
prepareForSerialization()
Overrides PersistentObject to ensure that our
"pathname" within the organization hierarchy is up-to-date
before this object is serialized (i.e., stored persistently). |
void |
setAuditPolicyRef(ObjectRef ref)
|
void |
setAuditPolicyRefs(java.util.List policies)
|
void |
setCache(ObjectCache c)
Overridden from PersistentObject to invalidate our path string cache - if the cache is changing, the path to top may change. |
void |
setPath(java.lang.String[] path)
|
void |
setPathAsIDs(java.lang.String[] IDPath)
|
void |
setPolicyRef(ObjectRef ref)
|
void |
setPolicyRefs(java.util.List policies)
|
void |
setResourceContainerInfo(ObjectGroup.ResourceContainerInfo resourceContainerInfo)
|
void |
setUseOrgDisplayNames(boolean val)
|
void |
setUserForm(Configuration userForm)
|
void |
setUserFormRef(ObjectRef userFormRef)
|
void |
setUserMembersRuleCacheTimeout(java.lang.String userMembersRuleCacheTimeout)
|
void |
setUserMembersRuleRef(ObjectRef userMembersRuleRef)
|
void |
setViewUserForm(Configuration viewUserForm)
|
void |
setViewUserFormRef(ObjectRef viewUserFormRef)
|
static java.lang.String |
stripPath(java.lang.String path)
Given an organization name in "path" form, remove the path prefix. |
static boolean |
useOrgDisplayNames(ObjectSource objSrc)
|
void |
visit(Visitor v)
Visitor interface. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static ObjectGroup Top
public static ObjectGroup All
protected ObjectRef _userFormRef
protected ObjectRef _viewUserFormRef
protected java.lang.String[] _path
protected java.lang.String[] _pathAsIDs
protected boolean _useOrgDisplayNames
protected ObjectGroup.ResourceContainerInfo _resourceContainerInfo
protected ObjectRef _userMembersRuleRef
protected java.lang.String _userMembersRuleCacheTimeout
protected java.util.List _auditPolicies
Constructor Detail |
public ObjectGroup()
public ObjectGroup(org.w3c.dom.Element e) throws WavesetException
public ObjectGroup(java.lang.String name)
public ObjectGroup(ObjectGroup src) throws WavesetException
Method Detail |
public java.lang.String getName()
PersistentObject
getName
in class PersistentObject
public java.lang.String getDisplayableName()
getDisplayableName
in class PersistentObject
public void setUseOrgDisplayNames(boolean val)
public static final PersistentObject.InitialInstance[] getInitialInstances()
PersistentObject
ServerRepository initialization will call this method on the Java class associated with each Type to get a list of the items it should "seed" into the repository.
Each initial instance contains a PersistentObject to be added, as well as boolean methods that describe any special handling.
public Type getType()
PersistentObject
getType
in class PersistentObject
public java.util.ArrayList getReferences()
getReferences
in class PersistentObject
public void setCache(ObjectCache c)
setCache
in class PersistentObject
c
- - an object cachepublic void setPath(java.lang.String[] path)
public void setPathAsIDs(java.lang.String[] IDPath)
public java.lang.String[] getPathAsIDs()
public java.lang.String[] getPath() throws WavesetException
WavesetException
public java.lang.String[] getPath(boolean returnIDs) throws WavesetException
WavesetException
public java.lang.String getPathString()
TODO: Support an option to filter out organization names that the user is not authorized to see. This probably can't be done at this level? - jsl
public static java.lang.String stripPath(java.lang.String path)
public void getChildObjectGroupNames(java.util.List childognamelist) throws WavesetException
Inputs: - childognamelist - non-null list to be populated with child object group names
WavesetException
public void getChildObjectGroupPathNames(java.util.List childogpathnamelist) throws WavesetException
WavesetException
public void getChildObjectGroupIds(java.util.List childogidlist) throws WavesetException
WavesetException
public void getChildObjectGroups(java.util.List childoglist) throws WavesetException
WavesetException
public void getDirectChildObjectGroupIds(java.util.List childogidlist) throws WavesetException
WavesetException
public void prepareForSerialization() throws WavesetException
PersistentObject
to ensure that our
"pathname" within the organization hierarchy is up-to-date
before this object is serialized (i.e., stored persistently).
Otherwise, PersistentObject.getQueryableAttributes()
may expose
an incorrect value for CONTAINED_BY_OBJECT_GROUP
.
Since we must resolve object references in order to do this, we have to do it in this method (while we have an ObjectCache).
prepareForSerialization
in class PersistentObject
WavesetException
public java.util.List listQueryableAttributes()
listQueryableAttributes
in class PersistentObject
defined attributes
that this type of persistent object exposes as queryable
(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.
public java.util.List listSummaryAttributes()
PersistentObject
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.
listSummaryAttributes
in class PersistentObject
defined attributes
that this this type 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.getSummaryAttributes()
to ensure that the subclass includes summary attributes
that are common to all PersistentObjects.
Constants.MAX_SUMMARY_STRING_LENGTH
,
PersistentObject.getSummaryString()
protected void listQueryableSummaryAttributes(java.util.List attrs)
protected WSAttribute getAttributeValues(java.lang.String attrName)
getAttributeValues
in class PersistentObject
attrName
- - the name of the attribute for which to return values.
WSAttribute
that represents the value (or values)
that this object contains for the specified attribute.
public java.util.ArrayList getApproverRefs()
These are references to Administrators that are considered approvers for provisioning requests using this group.
public WSUser[] getApprovers() throws WavesetException
WavesetException
public void clearApprovers()
public void addApprover(ObjectRef ref)
These should be administrators with APPROVAL rights. Can't check that here, it will have to be done as part of the Checkin validator. The GUI currently tries to prevent selection of bad values.
public void addApprover(WSUser admin)
These should be administrators with APPROVAL rights. Can't check that here, it will have to be done as part of the Checkin validator. The GUI currently tries to prevent selection of bad values.
If you want to specify a completely new list, call
clearApprovers
first.
clearApprovers()
public void visit(Visitor v) throws WavesetException
visit
in class PersistentObject
WavesetException
public ObjectRef getViewUserFormRef()
public Configuration getViewUserForm() throws WavesetException
WavesetException
public java.lang.String getViewUserFormId()
public void setViewUserFormRef(ObjectRef viewUserFormRef)
public void setViewUserForm(Configuration viewUserForm)
public ObjectRef getUserFormRef()
public Configuration getUserForm() throws WavesetException
WavesetException
public java.lang.String getUserFormId()
public void setUserFormRef(ObjectRef userFormRef)
public void setUserForm(Configuration userForm)
public boolean dupOrgInParent() throws WavesetException
WavesetException
public void setPolicyRefs(java.util.List policies)
public void setPolicyRef(ObjectRef ref)
public void addPolicyRef(ObjectRef ref)
public java.util.List getPolicyRefs()
public java.util.List getPolicies() throws WavesetException
WavesetException
public ObjectGroup.ResourceContainerInfo getResourceContainerInfo()
public void setResourceContainerInfo(ObjectGroup.ResourceContainerInfo resourceContainerInfo)
public boolean isVirtual()
public boolean isJunction()
public ObjectRef getUserMembersRuleRef()
public void setUserMembersRuleRef(ObjectRef userMembersRuleRef)
public void setAuditPolicyRefs(java.util.List policies)
public void setAuditPolicyRef(ObjectRef ref)
public void addAuditPolicyRef(ObjectRef ref)
public java.util.List getAuditPolicyRefs()
public java.util.List getAuditPolicies() throws WavesetException
WavesetException
public java.lang.String getUserMembersRuleCacheTimeout()
public void setUserMembersRuleCacheTimeout(java.lang.String userMembersRuleCacheTimeout)
protected void addSubclassElements(java.lang.StringBuffer b)
PersistentObject
NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.
addSubclassElements
in class PersistentObject
protected void parseSubclassElements(org.w3c.dom.Element e) throws WavesetException
PersistentObject
parseSubclassElements
in class PersistentObject
WavesetException
PersistentObject's default implementation is a no-op.
,
PersistentObject.parseXml(Element)
public PersistentObject cloneObject() throws WavesetException
PersistentObject
We don't overload the java.lang.Object.clone
method
because it can't throw any exceptions, and there is the potential
for deserialization errors here (though I suppose we could
throw an unchecked exceptions).
The clone is done using the XML serialization that all PersistentObjects must support. It would probably be more efficient to implement java.lang.Serializable, but that's another serialization format that would have to be debugged. Since we have to support XML transforms anyway, just use that.
cloneObject
in class PersistentObject
Overridden for speed because object groups are moved between caches a lot.
WavesetException
- if there were problems duplicating the objectpublic static boolean useOrgDisplayNames(ObjectSource objSrc) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
true
if SystemConfiguration
specifies that object groups should use display names.
Otherwise, if object groups should use organization paths,
return false
.
WavesetException
public static void normalizeObjectGroup(ObjectSource objSrc, ObjectGroup org) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.util.List getOrganizationPathList(ObjectSource objSrc, ObjectGroup group, boolean returnIDs) throws WavesetException
Assumes that object groups can have only a single parent object group and therefore every object group will have a single unique fully qualified path from Top or All.
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.lang.String getOrganizationPath(ObjectSource objSrc, ObjectGroup group) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.util.List getTopControlledObjectGroups(LighthouseContext lc, Subject subject) throws WavesetException
WavesetException
public static java.util.List getMemberObjectGroupNames(ObjectSource objSrc, PersistentObject po) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.util.List getMemberObjectGroupDisplayNames(ObjectSource objSrc, PersistentObject po) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.util.List getMemberObjectGroupPaths(ObjectSource objSrc, PersistentObject po) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.lang.String getObjectGroupHandle(ObjectSource objSrc, ObjectRef ref) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static java.util.List getObjectGroupHandles(ObjectSource objSrc, java.util.List objectRefs) throws WavesetException
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.
WavesetException
public static ObjectRef getObjectGroupRef(ObjectSource objSrc, java.lang.String orgHandle) throws WavesetException
object reference
.
objSrc
- - an ObjectSource
such as a ViewMaster
or LighthouseContext
.orgHandle
- - an object group identifier (e.g., name, path or displayName).
object reference
to the object group.
WavesetException
public static java.util.List getObjectGroupRefs(ObjectSource objSrc, java.util.List orgList) throws WavesetException
object references
.
objSrc
- - an ObjectSource
used to resolve object references.orgList
- - a list of org handles (names, paths or displayNames).
object references
to organizations.
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |