com.waveset.object
Class Application

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

public class Application
extends Service
implements java.lang.Comparable

An object used to represent a named collection of Resource objects.

These provide an alternative way to specify resources for a role in environments that are more aware of specific web applications than resources. // *

// * Hmm, should Applications contain any Service objects rather than // * just Resources? That might be handy.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String ATT_OPAQUE
           
static java.lang.String ATT_ORDERED
           
static java.lang.String code_id
           
static java.lang.String EL_AUTHENTICATOR
           
static java.lang.String EL_RESOURCES
           
static java.lang.String EL_ROLEATTRIBUTES
           
static java.lang.String EL_ROLEEXCLUSIONREFS
           
static java.lang.String EL_SERVICES
          XML markup.
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Application()
          Construct a new empty application.
Application(org.w3c.dom.Element e)
          Deserialize an Application object from XML.
 
Method Summary
 void addResource(ObjectRef r)
          Adds a resource to the application.
 void addResource(Resource r)
          Add a new resource to the application.
 void addRoleAttribute(RoleAttribute ra)
           
 void addRoleExclusionRef(ObjectRef or)
           
 void addService(ObjectRef r)
          Adds a service reference to the application.
 void addService(Service s)
          Add a new service to the application.
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).
 void clearResources()
          Removes all resources from the application.
 void clearRoleAttributes()
           
 void clearRoleExclusionRefs(java.util.List list)
           
 void clearServices()
          Removes all services from the application.
 int compareTo(java.lang.Object o)
          Implement Comparable
 java.util.List getApplicationRefs()
          Gets the list of applications references in this application.
protected  WSAttribute getAttributeValues(java.lang.String attrName)
           
 ObjectRef getAuthenticatorRef()
           
 java.util.ArrayList getReferences()
          Return the list of references within this object.
 java.util.Set getResourceAssignmentRefs()
          Gets the list of resource references in this application.
 java.util.Set getResourceAssignments()
          Return the set of ResourceAssignments encapsulated by this Service and any Services it contains.
 java.util.List getResourceRefs()
          Gets the list of resource references in this application.
 Resource[] getResources()
          Gets an array of resolved Resource objects referenced by the application.
 java.util.List getRoleAttributes()
           
 java.util.List getRoleExclusionRefs()
           
 java.util.List getServiceRefs()
          Return the master list of Service object references.
 Service[] getServices()
          Return a resolved list of Service objects immediately referenced by this object.
 WSAttributes getSummaryAttributes()
           
 Type getType()
          Return the Type object associated with this class, which will always be Type.APPLICATION.
 boolean isOpaque()
          Test the opaque flag.
 boolean isOrdered()
          Override this if this service is a container and order is important.
 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 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 removeResource(ObjectRef ref)
          Removes a resource reference.
 void removeResource(Resource r)
          Removes a resource reference.
 void removeService(ObjectRef ref)
          Removes a service reference.
 void removeService(Service s)
          Removes a service reference.
static void resolveSummaryAttributes(ObjectCache cache, WSAttributes attrs)
          Walk the summary attributes, translating the embedded IDs to names.
 void setAuthenticator(ObjectRef ref)
           
 void setOpaque(boolean b)
           
 void setOrdered(boolean b)
           
 void setRoleAttributes(java.util.List list)
           
 void setRoleExclusionRefs(java.util.List list)
           
 void visit(Visitor v)
          Visitor interface.
 
Methods inherited from class com.waveset.object.Service
checkForReferenceCycles, dumpSummary, findApplications, findApplications, findResourceAssignments, findResources, findRoleAttributes, findRoleExclusions, findRoles, findRoles, findServices, findServices, getFlatResourceAssignments, getFlatResourceAssignments, getFlatResources, getFlatResources, getFlatResources, getFlatResources, toIdentityString, toVerboseString, toVerboseString
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, 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, getEncryptedValues, getId, getIdOrName, getInitialInstances, getLastMod, getLastModDate, getLastModifier, getLastModItemId, getLockInfo, getMemberObjectGroupRefs, getMemberObjectGroupRefsUpTo, getMemberObjectGroups, getName, getNameOrId, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryString, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, 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
 
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

EL_SERVICES

public static final java.lang.String EL_SERVICES
XML markup. is recognized for backward compatibility.

See Also:
Constant Field Values

EL_RESOURCES

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

EL_AUTHENTICATOR

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

EL_ROLEATTRIBUTES

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

EL_ROLEEXCLUSIONREFS

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

ATT_OPAQUE

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

ATT_ORDERED

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

Application

public Application()
Construct a new empty application.


Application

public Application(org.w3c.dom.Element e)
            throws WavesetException
Deserialize an Application object from XML.

Normally, this will only be called by PersistentObject.create().

Method Detail

getType

public Type getType()
Return the Type object associated with this class, which will always be Type.APPLICATION.

Specified by:
getType in class PersistentObject

getReferences

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

Overrides:
getReferences in class PersistentObject

visit

public void visit(Visitor v)
           throws WavesetException
Visitor interface.

Overrides:
visit in class PersistentObject
Throws:
WavesetException

getServiceRefs

public java.util.List getServiceRefs()
Return the master list of Service object references.

Specified by:
getServiceRefs in class Service

getServices

public Service[] getServices()
                      throws WavesetException
Return a resolved list of Service objects immediately referenced by this object.

Specified by:
getServices in class Service
Throws:
WavesetException

addService

public void addService(Service s)
Add a new service to the application.


addService

public void addService(ObjectRef r)
Adds a service reference to the application.


removeService

public void removeService(Service s)
Removes a service reference.

The reference is specified as a Service object.


removeService

public void removeService(ObjectRef ref)
Removes a service reference.


clearServices

public void clearServices()
Removes all services from the application.


addResource

public void addResource(Resource r)
Add a new resource to the application.


addResource

public void addResource(ObjectRef r)
Adds a resource to the application.


removeResource

public void removeResource(Resource r)
Removes a resource reference.


removeResource

public void removeResource(ObjectRef ref)
Removes a resource reference.


clearResources

public void clearResources()
Removes all resources from the application.


isOpaque

public boolean isOpaque()
Test the opaque flag.


setOpaque

public void setOpaque(boolean b)

isOrdered

public boolean isOrdered()
Description copied from class: Service
Override this if this service is a container and order is important.

Overrides:
isOrdered in class Service

setOrdered

public void setOrdered(boolean b)

getAuthenticatorRef

public ObjectRef getAuthenticatorRef()

setAuthenticator

public void setAuthenticator(ObjectRef ref)

getRoleAttributes

public java.util.List getRoleAttributes()
Returns:
a List of RoleAttribute objects

setRoleAttributes

public void setRoleAttributes(java.util.List list)

clearRoleAttributes

public void clearRoleAttributes()

addRoleAttribute

public void addRoleAttribute(RoleAttribute ra)

getRoleExclusionRefs

public java.util.List getRoleExclusionRefs()

setRoleExclusionRefs

public void setRoleExclusionRefs(java.util.List list)

clearRoleExclusionRefs

public void clearRoleExclusionRefs(java.util.List list)

addRoleExclusionRef

public void addRoleExclusionRef(ObjectRef or)

getResourceRefs

public java.util.List getResourceRefs()
                               throws WavesetException
Gets the list of resource references in this application. Now that we can contain other Services as well as resources, we have to calcuate this.

Specified by:
getResourceRefs in class Service
Throws:
WavesetException

getResourceAssignmentRefs

public java.util.Set getResourceAssignmentRefs()
                                        throws WavesetException
Gets the list of resource references in this application. Now that we can contain other Services as well as resources, we have to calcuate this.

Specified by:
getResourceAssignmentRefs in class Service
Throws:
WavesetException

getApplicationRefs

public java.util.List getApplicationRefs()
                                  throws WavesetException
Gets the list of applications references in this application.

Throws:
WavesetException

getResources

public Resource[] getResources()
                        throws WavesetException
Gets an array of resolved Resource objects referenced by the application.

Specified by:
getResources in class Service
Throws:
WavesetException

getResourceAssignments

public java.util.Set getResourceAssignments()
                                     throws WavesetException
Description copied from class: Service
Return the set of ResourceAssignments encapsulated by this Service and any Services it contains.

Specified by:
getResourceAssignments in class Service
Throws:
WavesetException

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)

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

getSummaryAttributes

public WSAttributes getSummaryAttributes()
Overrides:
getSummaryAttributes in class PersistentObject
Returns:
attribute values to be displayed when this object appears in a list. The WSAttributes contains a WSAttribute for each summary attribute. Each WSAttribute may contain multiple values.

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.

See Also:

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(Attribute)}.

A subclass should not need to override this method (except to limit the number of values for a summary attribute).


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.


resolveSummaryAttributes

public static void resolveSummaryAttributes(ObjectCache cache,
                                            WSAttributes attrs)
                                     throws WavesetException
Walk the summary attributes, translating the embedded IDs to names. For this object, they are just name and ID, which need no translation. IF YOU ADD A TYPE HERE, add it to the referenced types list

Throws:
WavesetException

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 exposes as queryable and for which each value is a reference to another persistent object.

compareTo

public int compareTo(java.lang.Object o)
Implement Comparable

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class PersistentObject