com.waveset.object
Class Account

java.lang.Object
  extended bycom.waveset.object.PersistentObject
      extended bycom.waveset.object.Account
All Implemented Interfaces:
java.lang.Comparable, javax.naming.Referenceable, XmlObject

public class Account
extends PersistentObject


Nested Class Summary
static class Account.Response
           
static class Account.Situation
           
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String code_id
           
static java.lang.String EL_CURRENT_ATTRIBUTES
           
static java.lang.String EL_EXPLANATION
           
static java.lang.String EL_POTENTIAL_OWNERS
           
static java.lang.String EL_PREVIOUS_ATTRIBUTES
           
static java.lang.String EL_TEMPLATE_PARAMETERS
           
static java.lang.String OWNER_UNKNOWN
          If Attribute.OWNER has this value, the resource account is not owned by any Lighthouse user.
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Account()
           
Account(org.w3c.dom.Element e)
           
Account(Resource r, java.lang.String accountId)
          Create an Account object representing the identified account on the given resource.
Account(Resource r, java.lang.String accountId, java.lang.String accountGUID)
          Create an Account object representing the identified account on the given resource.
Account(java.lang.String xml)
           
 
Method Summary
 boolean addPotentialOwner(java.lang.String id)
          Add the specified user to the list of potential owners (if not already among the list).
 boolean addPotentialOwner(WSUser user)
          Add the specified user to the list of potential owners (if not already among the list).
 boolean addPotentialOwners(java.util.List users)
          Add each specified user to the list of potential owners (if that user is not already in the list).
protected  void addSubclassAttributes(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).
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).
 boolean equals(java.lang.Object o)
          Compares two objects for equality of identity.
static AttributeCondition[] existsOnResource(Resource r)
           
static AttributeCondition[] forResource(Resource r)
           
 java.lang.Boolean getAccountDisabled()
           
 boolean getAccountExists()
           
 java.lang.String getAccountId()
           
 java.lang.String getAccountType()
           
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 java.util.Map getCurrentAttributes()
           
 java.lang.String getDisplayName()
          Return the display name of this object.
static java.lang.String getDisplayName(Resource r, java.lang.String accountId)
           
static java.lang.String getDisplayName(Resource r, java.lang.String accountId, WSUser account)
           
static java.lang.String getDisplayName(java.lang.String resoName, java.lang.String accountId)
           
 WavesetResult getExplanation()
           
 Account.Situation getInitialSituation()
           
static java.lang.String getName(Resource r, java.lang.String accountId)
           
static java.lang.String getName(java.lang.String resourceId, java.lang.String accountId)
           
 java.lang.String getNativeGUID()
           
 java.lang.String getNormalizedId()
           
 java.lang.String getOwner()
           
 java.lang.String getOwnerName()
           
 java.util.List getPotentialOwners()
           
 java.util.Map getPreviousAttributes()
          In order to perform attribute-level reconciliation (i.e., in order to detect changes in the values of change-controlled attributes of user resource accounts), we must keep the attribute values as of the last reconciliation.
 java.lang.String getResourceId()
           
 java.lang.String getResourceName()
           
 java.util.Map getResourceParameters()
           
 java.lang.String getResourceType()
           
 Account.Situation getSituation()
           
 java.util.Date getSituationChangeTime()
           
 Type getType()
          Return the type of this object.
 boolean getUnowned()
          Deprecated. As of 3.1sp2 use hasOwner().
 boolean hasOwner()
           
 java.util.List listQueryableAttributes()
           
 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 main(java.lang.String[] args)
           
protected  void parseSubclassAttributes(org.w3c.dom.Element e)
          Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).
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 refreshResourceData(Resource r)
           
 void setAccountDisabled(java.lang.Boolean b)
           
 void setAccountExists(boolean b)
           
 void setAccountType(java.lang.String accountType)
          Specify the account type of this account.
 void setCurrentAttributes(java.util.Map attributeMap)
           
 void setExplanation(WavesetResult explanation)
           
 void setInitialSituation(Account.Situation s)
           
 void setInitialSituation(java.lang.String s)
           
 void setNativeGUID(java.lang.String guid)
           
 void setNormalizedId(java.lang.String id)
           
 void setOwner(WSUser user)
          Specify the Lighthouse user who owns this account.
protected  void setOwnerId(java.lang.String ownerId)
           
protected  void setOwnerName(java.lang.String name)
           
 void setPotentialOwners(java.util.List list)
          Specify the repository id of a Lighthouse user who might own (or become the owner of) this resource account.
 void setPreviousAttributes(java.util.Map attributeMap)
           
 void setSituation(Account.Situation s)
           
 void setSituation(java.lang.String s)
           
 void setSituationChangeTime(java.util.Date time)
           
 void setUnowned(boolean b)
          Deprecated. As of 3.1sp2 use setOwner((WSUser)null) or setOwnerId((String)null).
 java.lang.String toString()
           
static AttributeCondition[] unownedOnResource(Resource r)
           
static AttributeCondition[] withGUID(java.lang.String guid)
           
static AttributeCondition[] withResourceAndAccountId(Resource r, java.lang.String accountId)
           
static AttributeCondition[] withResourceAndGUID(Resource r, java.lang.String guid)
           
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, fakeId, getAttribute, getAttributeValues, getAuthReferences, getAuthType, getBasicAttributes, getBasicAttributes, getBasicAttributes, getCache, getCounterValue, getCreateDate, getCreator, getDisplayableName, getElementName, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getReferences, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, listQueryableReferenceAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, 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, 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

OWNER_UNKNOWN

public static final java.lang.String OWNER_UNKNOWN
If Attribute.OWNER has this value, the resource account is not owned by any Lighthouse user.

See Also:
Constant Field Values

EL_POTENTIAL_OWNERS

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

EL_CURRENT_ATTRIBUTES

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

EL_PREVIOUS_ATTRIBUTES

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

EL_EXPLANATION

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

EL_TEMPLATE_PARAMETERS

public static final java.lang.String EL_TEMPLATE_PARAMETERS
See Also:
Constant Field Values
Constructor Detail

Account

public Account()

Account

public Account(Resource r,
               java.lang.String accountId)
Create an Account object representing the identified account on the given resource. If this account exists on a template instance, the resource must be the template instance (i.e. have the instance parameters set), not the template.


Account

public Account(Resource r,
               java.lang.String accountId,
               java.lang.String accountGUID)
Create an Account object representing the identified account on the given resource. If this account exists on a template instance, the resource must be the template instance (i.e. have the instance parameters set), not the template.


Account

public Account(java.lang.String xml)
        throws WavesetException

Account

public Account(org.w3c.dom.Element e)
        throws WavesetException
Method Detail

getAccountType

public java.lang.String getAccountType()
Returns:
the account type associated with this account.

setAccountType

public void setAccountType(java.lang.String accountType)
Specify the account type of this account.


getResourceName

public java.lang.String getResourceName()

getResourceType

public java.lang.String getResourceType()

getResourceParameters

public java.util.Map getResourceParameters()

getOwner

public java.lang.String getOwner()
Returns:
the repository id of the Lighthouse user who owns this account.

setOwner

public void setOwner(WSUser user)
              throws InvalidArgument
Specify the Lighthouse user who owns this account.

Throws:
InvalidArgument

setOwnerId

protected void setOwnerId(java.lang.String ownerId)

getOwnerName

public java.lang.String getOwnerName()

setOwnerName

protected void setOwnerName(java.lang.String name)

hasOwner

public boolean hasOwner()
Returns:
true if this resource account has an owner known to Lighthouse.

getUnowned

public boolean getUnowned()
Deprecated. As of 3.1sp2 use hasOwner().

Returns:
true if this resource account has no owner known to Lighthouse.

setUnowned

public void setUnowned(boolean b)
Deprecated. As of 3.1sp2 use setOwner((WSUser)null) or setOwnerId((String)null).

Mark this resource account as having no owner known to Lighthouse.


getPotentialOwners

public java.util.List getPotentialOwners()
Returns:
the repository id of each Lighthouse users who might own (or become the owner of) this resource account. Used by account reconciliation.

setPotentialOwners

public void setPotentialOwners(java.util.List list)
Specify the repository id of a Lighthouse user who might own (or become the owner of) this resource account. Used by account reconciliation.


addPotentialOwner

public boolean addPotentialOwner(java.lang.String id)
Add the specified user to the list of potential owners (if not already among the list).

Returns:
true if the user was actually added.

addPotentialOwner

public boolean addPotentialOwner(WSUser user)
Add the specified user to the list of potential owners (if not already among the list).

Returns:
true if the user was actually added.

addPotentialOwners

public boolean addPotentialOwners(java.util.List users)
Add each specified user to the list of potential owners (if that user is not already in the list).

Returns:
true if any user was actually added.

getExplanation

public WavesetResult getExplanation()

setExplanation

public void setExplanation(WavesetResult explanation)

getSituation

public Account.Situation getSituation()

setSituation

public void setSituation(Account.Situation s)

setSituation

public void setSituation(java.lang.String s)

getInitialSituation

public Account.Situation getInitialSituation()

setInitialSituation

public void setInitialSituation(Account.Situation s)

setInitialSituation

public void setInitialSituation(java.lang.String s)

getSituationChangeTime

public java.util.Date getSituationChangeTime()

setSituationChangeTime

public void setSituationChangeTime(java.util.Date time)

getCurrentAttributes

public java.util.Map getCurrentAttributes()

setCurrentAttributes

public void setCurrentAttributes(java.util.Map attributeMap)

getPreviousAttributes

public java.util.Map getPreviousAttributes()
In order to perform attribute-level reconciliation (i.e., in order to detect changes in the values of change-controlled attributes of user resource accounts), we must keep the attribute values as of the last reconciliation.


setPreviousAttributes

public void setPreviousAttributes(java.util.Map attributeMap)

getAccountExists

public boolean getAccountExists()

setAccountExists

public void setAccountExists(boolean b)

getAccountDisabled

public java.lang.Boolean getAccountDisabled()

setAccountDisabled

public void setAccountDisabled(java.lang.Boolean b)

getNormalizedId

public java.lang.String getNormalizedId()
Returns:
the accountId in a form suitable for comparison so as to preserve equivalency classes.

setNormalizedId

public void setNormalizedId(java.lang.String id)

getNativeGUID

public java.lang.String getNativeGUID()

setNativeGUID

public void setNativeGUID(java.lang.String guid)

getName

public static java.lang.String getName(Resource r,
                                       java.lang.String accountId)
Returns:
a generated name for the stored Account object.

getName

public static java.lang.String getName(java.lang.String resourceId,
                                       java.lang.String accountId)
Returns:
an generated internalname (e.g., "testuser@#ID#Resource:recon01") for a Account object.

getDisplayName

public java.lang.String getDisplayName()
Description copied from class: PersistentObject
Return the display name of this object.

Overrides:
getDisplayName in class PersistentObject
Returns:
a generated external name (e.g., "testuser@recon01") for this Account object.

getDisplayName

public static java.lang.String getDisplayName(Resource r,
                                              java.lang.String accountId)
Returns:
a generated external name (e.g., "testuser@recon01") for the stored Account object.

getDisplayName

public static java.lang.String getDisplayName(java.lang.String resoName,
                                              java.lang.String accountId)
Returns:
a generated external name (e.g., "testuser@recon01") for the specified resource name and account id.

getDisplayName

public static java.lang.String getDisplayName(Resource r,
                                              java.lang.String accountId,
                                              WSUser account)
Parameters:
accountId - a name that is unique within the specified resource.
account - if specified along with accountGUID, may supply a recognizable short name.
Returns:
a generated external name (e.g., "testuser@recon01") for the specified resource name and account id.


forResource

public static AttributeCondition[] forResource(Resource r)

unownedOnResource

public static AttributeCondition[] unownedOnResource(Resource r)

existsOnResource

public static AttributeCondition[] existsOnResource(Resource r)

withGUID

public static AttributeCondition[] withGUID(java.lang.String guid)

withResourceAndGUID

public static AttributeCondition[] withResourceAndGUID(Resource r,
                                                       java.lang.String guid)

withResourceAndAccountId

public static AttributeCondition[] withResourceAndAccountId(Resource r,
                                                            java.lang.String accountId)

getType

public Type getType()
Description copied from class: PersistentObject
Return the type of this object. This must be implemented by each subclass.

Specified by:
getType in class PersistentObject
Returns:
the associated Type object.

getResourceId

public java.lang.String getResourceId()
Returns:
the resource account id.

refreshResourceData

public void refreshResourceData(Resource r)

getAccountId

public java.lang.String getAccountId()
Returns:
the resource account id.

toString

public java.lang.String toString()
Overrides:
toString in class PersistentObject

equals

public boolean equals(java.lang.Object o)
Description copied from class: PersistentObject
Compares two objects for equality of identity.

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:

  1. The object argument is either an instance of a PersistentObject or an ObjectRef
  2. The types must match
  3. If both ids are not null, they must be the same
  4. If either or both ids are null, then the names must be the same

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.

Overrides:
equals in class PersistentObject
Parameters:
o - - a PersistentObject or an ObjectRef

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.


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 common to all PersistentObjects.

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

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.


addSubclassAttributes

protected void addSubclassAttributes(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.

Overrides:
addSubclassAttributes in class PersistentObject
See Also:


addSubclassElements

protected void addSubclassElements(java.lang.StringBuffer b)
Description copied from class: PersistentObject
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). PersistentObject's default implementation is a no-op.

NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.

Overrides:
addSubclassElements in class PersistentObject
See Also:


parseSubclassAttributes

protected void parseSubclassAttributes(org.w3c.dom.Element e)
                                throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassAttributes in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

parseSubclassElements

protected void parseSubclassElements(org.w3c.dom.Element e)
                              throws WavesetException
Description copied from class: PersistentObject
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer).

Overrides:
parseSubclassElements in class PersistentObject
Throws:
WavesetException
See Also:

PersistentObject's default implementation is a no-op.

, PersistentObject.parseXml(Element)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception