|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.PersistentObject
public abstract class PersistentObject
The base class of all objects that can be stored in the repository.
We define a number of common fields such as type, id and name.
We also define behavior that all persistent objects share.
Once such behavior is the interaction with an ObjectCache
that provides automated resolution of references between objects.
Implements JNDI's Referenceable
interface.
This allows us to store a PersistentObject
in any JNDI service provider.
Nested Class Summary | |
---|---|
static class |
PersistentObject.Comparator
Implement the Comparator interface to sort PersistentObject instances by type and name. |
static class |
PersistentObject.InitialInstance
An inner class describing an "initial instance" of a persistent object that is to be automatically added to a repository when it is created. |
Field Summary | |
---|---|
static java.lang.String |
code_id
|
static long |
INITIAL_OBJECT_VERSION
|
Constructor Summary | |
---|---|
PersistentObject(com.sun.idm.object.IDMObjectClass objectClass)
Base constructor for persistent objects. |
Method Summary | |
---|---|
void |
addMemberObjectGroup(ObjectGroup og)
Add a new object group, declaring this object as a member of that group. |
void |
addMemberObjectGroup(com.waveset.object.ObjectRef og)
Add a new object group, declaring this object as a member of that group. |
static void |
addXmlHeader(java.lang.StringBuffer b,
java.lang.String element)
Adds a standard XML header, DOCTYPE statement and element start tag. |
boolean |
attributesMatch(AttributeCondition[] attrConds)
Return true if the attributes exposed by this object meet the supplied list of attribute conditions. |
boolean |
attributesMatch(com.waveset.object.LogicalExpression filter)
Return true if the attributes exposed by this object satisfy the specified logical expression. |
boolean |
attributesMatch(WSAttributes extatts)
Return true if the supplied list of attributes match attributes exposed by this object. |
void |
checkReference(com.waveset.object.ObjectRef ref)
Checks a reference owned by an object to make sure that the referenced object is in the same cache as the referencing object. |
void |
checkReferences(java.util.List refs)
Check a list of references. |
void |
clearId()
Removes the ID from an object. |
PersistentObject |
cloneAs(java.lang.String newName)
Clones an object, changing the name in the process. |
PersistentObject |
cloneObject()
Clones an object. |
int |
compareTo(java.lang.Object o)
Implement the Comparable interface so that lists of these will have a reasonable contains() implementation |
static PersistentObject |
create(org.w3c.dom.Element element)
|
static PersistentObject |
create(java.lang.String xml)
Build a persistent object from an XML string. |
static PersistentObject |
create(java.lang.String xml,
boolean validate)
Build a persistent object from an XML string. |
static PersistentObject |
create(com.waveset.object.Type type)
Creates an empty object of the given type. |
static PersistentObject.InitialInstance |
createLastModItem(PersistentObject obj)
Build an InitialInstance for a special object used to hold the last modification time of all objects of a particular type. |
static PersistentObject.InitialInstance |
createLastModItem(com.waveset.object.Type type)
|
static PersistentObject.InitialInstance[] |
createLastModItemList(PersistentObject obj)
Build an InitialInstance array containing a single instance for the special "last mode time" marker. |
boolean |
directObjectGroupMember(ObjectGroup og)
Test to see if this object is a direct member of the given object group. |
void |
dump()
for consistency with XmlObjectFactory & AbstractXmlObject |
void |
dumpFile(java.lang.String file)
|
boolean |
equals(java.lang.Object obj)
Compares two objects for equality of identity. |
java.lang.String |
getAttribute(java.lang.String name)
Return the value of an abstract attribute if the class supports it. |
WSAttribute |
getAttributeValues(com.sun.idm.object.IDMObjectClassAttribute attrDef)
|
java.util.ArrayList |
getAuthReferences()
Returns the list of all references in this object that are subject to CONNECT/DISCONNECT Right authorization checks. |
java.lang.String |
getAuthType()
Return the authorization type of this object. |
javax.naming.directory.BasicAttributes |
getBasicAttributes()
|
static javax.naming.directory.BasicAttributes |
getBasicAttributes(PersistentObject po,
java.lang.String[] attrIds)
|
javax.naming.directory.BasicAttributes |
getBasicAttributes(java.lang.String[] attrIds)
|
com.waveset.object.ObjectCache |
getCache()
Gets the cache this object is referencing. |
long |
getCounterValue()
|
java.util.Date |
getCreateDate()
|
java.lang.String |
getCreator()
|
java.lang.String |
getDisplayableName()
Return the displayable name of this object. |
java.lang.String |
getDisplayName()
Return the display name of this object. |
java.lang.String |
getElementName()
Return the XML element name of this object. |
java.util.List |
getEncryptedValues()
|
java.lang.String |
getId()
Get the internally generated unique id for this object. |
java.lang.String |
getIdOrName()
Get the id if one has been assigned, otherwise the name. |
static PersistentObject.InitialInstance[] |
getInitialInstances()
Returns the set of initial instances that should be created for this object type when a repository is created. |
long |
getLastMod()
Return the modification count for this object at the time this object was last modified. |
java.util.Date |
getLastModDate()
Return the date/time this object was created |
java.lang.String |
getLastModifier()
|
static java.lang.String |
getLastModItemId(com.waveset.object.Type type)
|
com.waveset.object.LockInfo |
getLockInfo()
Return information about any lock held on this object. |
java.util.List |
getMemberObjectGroupRefs()
Return the list of references to object groups this object is a member of. |
java.util.List |
getMemberObjectGroupRefsUpTo(ObjectGroup og)
Returns the list of references to object groups this object is a member of up the hierarchy to the specified object group (e.g. |
ObjectGroup[] |
getMemberObjectGroups()
Get an array of resolved object groups to which this object is a member. |
java.lang.String |
getName()
Return the name of this object. |
java.lang.String |
getNameOrId()
Get the name if it has been assigned, otherwise the id. |
com.sun.idm.object.IDMObjectClass |
getPrimaryObjectClass()
|
java.util.Properties |
getProperties()
|
java.lang.Object |
getProperty(java.lang.String name)
|
java.lang.String |
getPropertyAsString(java.lang.String name)
|
com.waveset.object.PropertyList |
getPropertyList()
|
WSAttributes |
getQueryableAttributes()
|
javax.naming.Reference |
getReference()
|
java.util.ArrayList |
getReferences()
Returns the list of all references in this object. |
long |
getRepositoryMod()
Returns the SQL timestamp time of the last update of the record in the repository. |
java.util.List |
getRuleDrivenMemberObjectGroupRefs()
Return the list of references to object groups this object is a member of based on the evaluation of user members rules associated with the object groups controlled by the current subject. |
java.util.List |
getRuleDrivenMemberObjectGroupRefsUpTo(ObjectGroup og,
ObjectGroup[] mogs)
Returns the list of references to object groups this object is a member of up the hierarchy to the specified object group (e.g. |
ObjectGroup[] |
getRuleDrivenMemberObjectGroups()
Get an array of resolved object groups to which this object is a member. |
java.lang.String |
getSubtype()
Return the subtype of this object. |
WSAttributes |
getSummaryAttributes()
|
java.lang.String |
getSummaryString()
Get the summary string for this object. |
abstract com.waveset.object.Type |
getType()
Return the type of this object. |
long |
getXMLSize()
|
static boolean |
hasEncryptedData()
|
int |
hashCode()
Implement the hashCode for efficient map insertion |
boolean |
identityEquals(PersistentObject pobj)
Helper for the equals method, compares the identity of this object with another persistent object. |
boolean |
isAlias()
|
boolean |
isHidden()
|
boolean |
isProtected()
|
boolean |
isProtectedFromDelete()
|
boolean |
isReferencedIn(java.util.Collection coll)
Returns true if an ObjectRef reference to this object is contained within the collection. |
void |
listOperationalAttributes(java.util.List attrs)
Add to the specified list the "built-in" attributes that are queryable just because the IDM Repository needs them in order to operate. |
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). |
boolean |
objectGroupMember(ObjectGroup og)
Test to see if this object is a member of the given object group. |
com.waveset.object.ObjectRef |
objectGroupMemberRef(ObjectGroup og)
Test to see if this object is a member of the given object group. |
void |
prepareForSerialization()
Prepare for serialization by doing anything that involves resolving references, leaving behind in the object anything that will be needed for toXml, getSummaryAttributes, getQueryableAttributes. |
void |
prepareToSerialize()
Update the structure of the object prior to serialization. |
void |
reEncrypt()
|
void |
removeMemberObjectGroup(ObjectGroup og)
Remove an object group from this object. |
void |
removeProperty(java.lang.String name)
|
int |
resolve(java.util.List refs)
Resolve a list of references, filtering out elements that no longer resolve. |
boolean |
resolve(java.util.List refs,
java.lang.Object[] array)
Resolve a list of references, storing pointers to the resolved objects in an array as a side effect. |
PersistentObject |
resolve(com.waveset.object.ObjectRef ref)
Resolve a single reference. |
java.lang.Object |
resolveArray(java.util.List refs,
java.lang.Object[] array,
java.lang.Class elClass)
Resolve a list of references, creating a typed array of PersistentObject pointers. |
java.lang.Object |
resolveArrayByFetching(java.util.List refs,
java.lang.Object[] array,
java.lang.Class elClass)
Now that users can also be administrators that can be approvers or be notified, together with the fact that users are a supressed type meaning they never get cached, we need a way to ensure that we alway resolve these list of refs by hitting the repo. |
void |
resolveObjectReferences(com.waveset.object.ObjectCache cache)
Walk over an object looking for ObjectRefs without ids and resolve them. |
PersistentObject |
resolveReference(com.waveset.object.ObjectRef ref)
DEPRECATED: like resolve above but throws an exception if it can't find it, try to weed these out. |
static void |
resolveSummaryAttributes(com.waveset.object.ObjectCache cache,
WSAttributes attrs)
Walk the summary attributes, translating the embedded IDs to names. |
static void |
resolveSummaryAttributes(com.waveset.object.Type type,
com.waveset.object.ObjectCache cache,
WSAttributes attrs)
Map the type to an implementation class, then call its resolveSummaryAttributes method. |
com.waveset.object.ObjectRef |
ruleDrivenObjectGroupMemberRef(ObjectGroup og,
java.util.List memberObjectGroupRefs)
Test to see if this object is a member of the given object group. |
void |
setAuthType(com.waveset.object.AuthType t)
Set the authorization type of this object. |
void |
setAuthType(java.lang.String s)
Set the authorization type of this object. |
void |
setCache(com.waveset.object.ObjectCache c)
Sets the object cache. |
void |
setDisplayName(com.waveset.msgcat.Message m)
Set the display name to an unresolved message. |
void |
setDisplayName(java.lang.String s)
Replaces the value of the displayName attribute. |
void |
setHidden(boolean b)
|
void |
setIsAlias(boolean isAlias)
|
void |
setMemberObjectGroupRef(com.waveset.object.ObjectRef og)
Set a single member object group ref |
void |
setMemberObjectGroupRefs(java.util.List refs)
Set the list of references to object groups to which this object is a member (say that 10 times fast). |
void |
setMemberObjectGroups(ObjectGroup[] ogarray)
Set the object groups to which this object is a member. |
void |
setName(java.lang.String s)
Replaces the value of the name attribute. |
void |
setProperties(java.util.Properties p)
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
|
void |
setPropertyList(com.waveset.object.PropertyList p)
|
void |
setRuleDrivenMembersCache(com.waveset.object.RuleDrivenMembersCache cache)
|
void |
setSubtype(java.lang.String subtype)
Set the subtype of this object (e.g., Messages.ACCOUNT_CORRELATION_RULE within Type.RULE). |
void |
setTrace(boolean b)
|
java.lang.String |
toString()
|
java.lang.String |
toXml()
Serialize the object to an XML string. |
void |
toXml(java.lang.StringBuffer b)
Serialize the object as XML into a string buffer. |
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize the object as XML with an optional indentation. |
void |
toXmlFile(java.lang.String file)
Serialize the object to a file. |
void |
visit(com.waveset.object.Visitor v)
All persistent objects support a visitor interface. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String code_id
public static final long INITIAL_OBJECT_VERSION
Constructor Detail |
---|
public PersistentObject(com.sun.idm.object.IDMObjectClass objectClass)
Set default ObjectGroup to "Top" for all Persistent Objects the one exception is for the ObjectGroup "Top" whose member object group will be set to null (see ObjectGroup constructor).
objectClass
- for the persistent object.Method Detail |
---|
public void addMemberObjectGroup(ObjectGroup og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void addMemberObjectGroup(com.waveset.object.ObjectRef og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public static void addXmlHeader(java.lang.StringBuffer b, java.lang.String element)
toXml
method above prior to calling
the toXml method of a subclass. Subclasses may also call it
if they want to overload the generation of the header
or DOCTYPE for some reason, though there should be no
reason to do so.
public final boolean attributesMatch(AttributeCondition[] attrConds)
The default implementation here calls getQueryableAttributes to obtain the object's attribute list. This can be overloaded if desired if for some reason you want to support matching, without exposing queryable attributes.
AttributeCondition
public final boolean attributesMatch(com.waveset.object.LogicalExpression filter)
The default implementation here calls getQueryableAttributes to obtain the object's attribute list. This can be overloaded if desired if for some reason you want to support matching, without exposing queryable attributes.
LogicalExpression
public final boolean attributesMatch(WSAttributes extatts)
The default implementation here calls getQueryableAttributes to obtain the object's attribute list. This can be overloaded if desired if for some reason you want to support matching, without exposing queryable attributes.
WSAttributes
public void checkReference(com.waveset.object.ObjectRef ref)
public void checkReferences(java.util.List refs)
public void clearId()
Useful when creating an object that is derived from another, clone the object, then clear the ID.
public PersistentObject cloneAs(java.lang.String newName) throws com.waveset.util.WavesetException
This is a convenience method for a common set of operations when attempting to create a new object that is a derivative of another.
We'll clone the object, clear the old object ID, and assign a differeent name.
com.waveset.util.WavesetException
- if there were problems duplicating the objectpublic PersistentObject cloneObject() throws com.waveset.util.WavesetException
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.
com.waveset.util.WavesetException
- if there were problems duplicating the objectpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public static PersistentObject create(org.w3c.dom.Element element) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public static PersistentObject create(java.lang.String xml) throws com.waveset.util.WavesetException
DTD Validation is not performed.
com.waveset.util.WavesetException
public static PersistentObject create(java.lang.String xml, boolean validate) throws com.waveset.util.WavesetException
Validation against the DTD can be controlled with the validate argument. Normally this is off for performance, but in some contexts you may want it on.
com.waveset.util.WavesetException
public static PersistentObject create(com.waveset.object.Type type) throws com.waveset.util.WavesetException
This was added for the generic object editor GUI, which needs to create a default object for a type. The only types that can be instantiated here are the ones which have no-argument constructors and for which the class is known from the Type object.
com.waveset.util.WavesetException
public static PersistentObject.InitialInstance createLastModItem(PersistentObject obj)
public static PersistentObject.InitialInstance createLastModItem(com.waveset.object.Type type)
public static PersistentObject.InitialInstance[] createLastModItemList(PersistentObject obj)
A helper method that may be used by persistent object classes that want to have their mod times tracked, but have no other initial instances.
public boolean directObjectGroupMember(ObjectGroup og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void dump()
public void dumpFile(java.lang.String file)
public boolean equals(java.lang.Object obj)
This method overrides the java.lang.Object equals method. It determines equality based on whether the two identities of the current object and the object argument are equal, where equal is defined as:
Note that this will makes it impossible to use the equals() method to do content comparison of two object copies. I'm not sure I really like this, its an unusual way to have equals() behave, but it is convenient for searching collections for references.
equals
in class java.lang.Object
obj
- - a PersistentObject or an ObjectRefpublic java.lang.String getAttribute(java.lang.String name) throws com.waveset.util.WavesetException
Abstract attributes are not currently used, this interface was
originally developed to support a concept that evolved
into queryable attributes
and summary attributes
.
com.waveset.util.WavesetException
public final WSAttribute getAttributeValues(com.sun.idm.object.IDMObjectClassAttribute attrDef)
getAttributeValues
in interface com.waveset.object.AttributeBag
public java.util.ArrayList getAuthReferences()
public java.lang.String getAuthType()
public javax.naming.directory.BasicAttributes getBasicAttributes()
public static javax.naming.directory.BasicAttributes getBasicAttributes(PersistentObject po, java.lang.String[] attrIds)
public javax.naming.directory.BasicAttributes getBasicAttributes(java.lang.String[] attrIds)
public com.waveset.object.ObjectCache getCache()
public long getCounterValue()
public java.util.Date getCreateDate()
public java.lang.String getCreator()
public java.lang.String getDisplayableName()
public java.lang.String getDisplayName()
public java.lang.String getElementName()
getElementName
in interface XmlObject
public java.util.List getEncryptedValues()
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.
public java.lang.String getId()
public java.lang.String getIdOrName()
public static PersistentObject.InitialInstance[] getInitialInstances()
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 long getLastMod()
public java.util.Date getLastModDate()
public java.lang.String getLastModifier()
public static java.lang.String getLastModItemId(com.waveset.object.Type type)
public com.waveset.object.LockInfo getLockInfo()
NOTE: To obtain up-to-date lock information,
use the Session.getLockInfo
method.
Session.getLockInfo(com.waveset.object.Type, java.lang.String)
public java.util.List getMemberObjectGroupRefs()
public java.util.List getMemberObjectGroupRefsUpTo(ObjectGroup og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public ObjectGroup[] getMemberObjectGroups() throws com.waveset.util.WavesetException
This list is derived on demand from the list of group references.
com.waveset.util.WavesetException
public java.lang.String getName()
public java.lang.String getNameOrId()
public com.sun.idm.object.IDMObjectClass getPrimaryObjectClass()
public java.util.Properties getProperties()
public java.lang.Object getProperty(java.lang.String name)
public java.lang.String getPropertyAsString(java.lang.String name)
public com.waveset.object.PropertyList getPropertyList()
public final WSAttributes getQueryableAttributes()
attribute values
to be used as search keys for this object.
The WSAttributes
contains a
WSAttribute
for each queryable attribute.
Each WSAttribute
may contain multiple values.
This is normally not used by applications, but called by storage managers like the Repository. This allows us to define type-specific search keys without requiring the Repository to know the details of each type. <> This default implementation adds values for a number of attributes commonly queryable for PersistentObjects.
If a subclass wants to expose a different set of queryable attributes,
that subclass should override {@link #listQueryableAttributes()}.
In order to supply values for queryable attributes
that may not be available in PersistentObject
(e.g., from a field specified to that subclass),
such a subclass may also override {@link #getAttributeValues(String)}.
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public java.util.ArrayList getReferences()
public long getRepositoryMod()
public java.util.List getRuleDrivenMemberObjectGroupRefs() throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public java.util.List getRuleDrivenMemberObjectGroupRefsUpTo(ObjectGroup og, ObjectGroup[] mogs) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public ObjectGroup[] getRuleDrivenMemberObjectGroups() throws com.waveset.util.WavesetException
This list is derived on demand from the list of group references.
com.waveset.util.WavesetException
public final java.lang.String getSubtype()
NOTE: By convention, the subtype value is a message key. This allows persistent objects to be filtered or queried by subtype within type using well-defined constants (i.e., message keys), but allows each subtype to be localized for display.
public WSAttributes getSummaryAttributes()
attribute values
to expose when this object appears in a list.
The WSAttributes
contains a
WSAttribute
for each attribute.
Each WSAttribute
may contain multiple values.
This default implementation adds values for attributes that are common to most (if not all) PersistentObjects.
If a subclass wants to expose a different set of summary attributes,
that subclass should override {@link #listSummaryAttributes}.
In order to supply values for summary attributes
that may not be available in PersistentObject
(e.g., from a field specified to that subclass),
such a subclass may also override {@link #getAttributeValues(String)}.
A subclass should not need to override this method
(except to limit the number of values for a summary attribute).
public java.lang.String getSummaryString()
Any subclass that overrides this implementation must limit the length of the summary string.
Constants.MAX_SUMMARY_STRING_LENGTH
public abstract com.waveset.object.Type getType()
public long getXMLSize()
public static boolean hasEncryptedData()
public int hashCode()
hashCode
in class java.lang.Object
public boolean identityEquals(PersistentObject pobj)
public boolean isAlias()
public boolean isHidden()
public boolean isProtected()
public boolean isProtectedFromDelete()
public boolean isReferencedIn(java.util.Collection coll)
This is typically used by classes that maintain a collection of ObjectRefs, and wish to detect attempts to add the same reference more than once.
This could also be a static on ObjectRef, but it felt ok to handle this here too. At the moment you could accomplish a similar function using the Collection.contains method since our equals() method is overloaded to handle ObjectRef comparison. Defining equality for two completely different objects feels strange though, so this interface is also provided.
coll
- - a collection (usually an ArrayList) that we will searchpublic void listOperationalAttributes(java.util.List attrs)
public java.util.List listQueryableAttributes()
defined attributes
that this type of PersistentObject exposes as queryable attributes
(regardless of whether this object has a value for each).
Any subclass of PersistentObject that overrides this method must first invoke super.getQueryableAttributes() to ensure that the list of queryable attribute for PersistentObjects are included in the subclasses list.
NOTE: UPDATING THIS METHOD also affects
getQueryableAttributes()
.
public java.util.List listQueryableReferenceAttributes()
defined attributes
that this type of persistent object exposes as queryable
and for which each value is a reference
to another persistent object.
This is intended to be overloaded each subclass to add queryable reference attributes that are specific to that subclass.
public java.util.List listSummaryAttributes()
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.
Constants.MAX_SUMMARY_STRING_LENGTH
,
getSummaryString()
public boolean objectGroupMember(ObjectGroup og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public com.waveset.object.ObjectRef objectGroupMemberRef(ObjectGroup og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void prepareForSerialization() throws com.waveset.util.WavesetException
This is called by the session before checking in the object. Later the repository will ask for the xml and summary string.
com.waveset.util.WavesetException
public void prepareToSerialize() throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void reEncrypt() throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void removeMemberObjectGroup(ObjectGroup og)
public void removeProperty(java.lang.String name)
public int resolve(java.util.List refs) throws com.waveset.util.WavesetException
Returns the size of the reference list.
com.waveset.util.WavesetException
public boolean resolve(java.util.List refs, java.lang.Object[] array) throws com.waveset.util.WavesetException
We return true if the provided array matched the number of resolved references, this is the usual case. If the array size doesn't match, we'll still try to resolve all the elements in the list, but the caller will have to reallocate a suitable array. It would be nice if we could do this automatically, but we'd have to know the type of array to allocate, and I'm not sure how to do that with reflection.
com.waveset.util.WavesetException
public PersistentObject resolve(com.waveset.object.ObjectRef ref) throws com.waveset.util.WavesetException
If the object does not exist, the reference will be marked
as being deleted, so that the ObjectRef.isDeleted
method will return true.
com.waveset.util.WavesetException
ObjectRef.isDeleted()
public java.lang.Object resolveArray(java.util.List refs, java.lang.Object[] array, java.lang.Class elClass) throws com.waveset.util.WavesetException
We allow an existing array to be passed in, and will try to reuse the array if it hasn't changed in size. !! Note that since this modifies the list, it is not thread safe if you are in the server thread. But its overly restrictive to synchronize here, the caller must be synchronized.
com.waveset.util.WavesetException
public java.lang.Object resolveArrayByFetching(java.util.List refs, java.lang.Object[] array, java.lang.Class elClass) throws com.waveset.util.WavesetException
Resolve a list of references, creating a typed array of PersistentObject pointers. Used by suppressed objects to provide a more convenient array interface for collections of references.
Note that in order to assure that we are always resolving the objects from the repo, we will null out the ref handles before calling resolveArray. !! Note that since this modifies the list, it is not thread safe if you happen to be operating within the server cache. The caller must be synchronized.
com.waveset.util.WavesetException
public void resolveObjectReferences(com.waveset.object.ObjectCache cache) throws com.waveset.util.WavesetException
We originally used the generic resolveReferences for this, but this operates off of the DOM tree and requires an expensive user/dom/user conversion. Since we're called from bulk load have to be more careful about garabge.
Formerly picked specific attributes out of the user object but that wasn't robust. Assume PersistentObject.getReferences is correct.
com.waveset.util.WavesetException
public PersistentObject resolveReference(com.waveset.object.ObjectRef ref) throws com.waveset.util.WavesetException
Resolve a reference, throwing an exception if the object didn't exist. We're moving toward being tolerant of deleted objects, so you should call resolve instead. This will shortly become the default behavior.
ref
- - an object reference
com.waveset.util.WavesetException
public static void resolveSummaryAttributes(com.waveset.object.ObjectCache cache, WSAttributes attrs) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public static void resolveSummaryAttributes(com.waveset.object.Type type, com.waveset.object.ObjectCache cache, WSAttributes attrs) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public com.waveset.object.ObjectRef ruleDrivenObjectGroupMemberRef(ObjectGroup og, java.util.List memberObjectGroupRefs) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void setAuthType(com.waveset.object.AuthType t)
public void setAuthType(java.lang.String s)
public void setCache(com.waveset.object.ObjectCache c)
There are two situations where this may be used. First, an
ObjectCache
may set this when an object is added
to the cache. Second, an application may wish to assign a cache
to this object for automatic reference resolution, without having
the object actually be "in" the cache.
For example Type.USER objects will never be in a cache, but they need to point to a cache in order to automatically resolve roles and other things.
c
- - an object cachepublic void setDisplayName(com.waveset.msgcat.Message m)
public void setDisplayName(java.lang.String s)
public void setHidden(boolean b)
public void setIsAlias(boolean isAlias)
public void setMemberObjectGroupRef(com.waveset.object.ObjectRef og) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public void setMemberObjectGroupRefs(java.util.List refs) throws com.waveset.util.WavesetException
// * jsl - is this necessary?
com.waveset.util.WavesetException
public void setMemberObjectGroups(ObjectGroup[] ogarray) throws com.waveset.util.WavesetException
The list is specified as an array of group objects, it will be converted internally to a list of object reference objects.
com.waveset.util.WavesetException
public void setName(java.lang.String s)
Note that if you change the name of an object, and check the object into the repository using the Session.checkinObject method, this will have the effect of renaming the object in the repository.
public void setProperties(java.util.Properties p)
public void setProperty(java.lang.String name, java.lang.Object value)
public void setPropertyList(com.waveset.object.PropertyList p)
public void setRuleDrivenMembersCache(com.waveset.object.RuleDrivenMembersCache cache)
public void setSubtype(java.lang.String subtype)
NOTE: By convention, the subtype value is a message key.
public void setTrace(boolean b)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toXml()
The default implementation is to create a string buffer, add an XML header and call the toXml(StringBuffer) method. This may be overloaded by the subclasses, though there is usually no need to.
toXml
in interface XmlObject
public void toXml(java.lang.StringBuffer b)
NOTE: Each subclass should serialize any necessary fields specific to that subclass. // * @see #addSubclassAttributes // * @see #addSubclassElements
public void toXml(java.lang.StringBuffer b, int indent)
toXml
in interface XmlObject
b
- target bufferindent
- amount of indentationpublic void toXmlFile(java.lang.String file)
public void visit(com.waveset.object.Visitor v) throws com.waveset.util.WavesetException
v
- Visitor for this persistent object.
com.waveset.util.WavesetException
- if there's a problem from visitPersistentObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |