com.waveset.object
Class Service

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

public abstract class Service
extends PersistentObject

An abstract class used by the Role to reference resource and application objects.

Both the Resource and Application classes will extend this class, so they can be treated in a uniform way.

An appliication is simply a collection of resources.


Nested Class Summary
 
Nested classes inherited from class com.waveset.object.PersistentObject
PersistentObject.Comparator, PersistentObject.InitialInstance
 
Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.object.PersistentObject
_trace, trace
 
Constructor Summary
Service()
           
 
Method Summary
static void checkForReferenceCycles(Service service, java.util.Stack history)
          Recursively walk down a reference chain, watching for cycles.
 void dumpSummary(java.lang.String file)
           
 void findApplications(java.util.List list)
          see findResources.
 void findApplications(java.util.List list, boolean checkForCycles)
          The call that recurses - takes a boolean check flag so that only has to be done once.
protected  java.util.Collection findResourceAssignments(java.util.Collection assignments)
          Traverse the hierarchy of Services contained in this object, constructing a set of possibly qualified Resource references.
 void findResources(java.util.List list)
          Recursively walk a tree of Services building up a list of Resource references.
 void findRoleAttributes(java.util.List list)
          Return all of the role attributes associated with all of the applications associated with this service.
 void findRoleExclusions(java.util.Map map)
          Return all of the role exclusions associated with all of the roles associated with this service.
 void findRoles(java.util.List list)
          see findResources.
 void findRoles(java.util.List list, boolean checkForCycles)
          The call that recurses - takes a boolean check flag so that only has to be done once.
 void findServices(java.util.List list)
          see findResources.
 void findServices(java.util.List list, boolean checkForCycles)
          The call that recurses - takes a boolean check flag so that only has to be done once.
static java.util.Set getFlatResourceAssignments(java.util.List services, ObjectCache cache, java.util.Set assigns)
          Given a list of Services or service references, calculate a flat list of resolved ResourceAssignment objects.
 java.util.Set getFlatResourceAssignments(java.util.Set assigns)
          Calculate a flat collection of resolved Resource objects referenced directly or indirectly by this service.
 void getFlatResources(java.util.List resources)
          Calculate a flat list of resolved Resource objects referenced directly or indirectly by this service.
static void getFlatResources(java.util.List services, ObjectCache cache, java.util.List resources)
          Given a list of Services or service references, calculate a flat list of resolved Resource objects.
static java.util.Set getFlatResources(java.util.List services, ObjectCache cache, java.util.Set resources)
           
 java.util.Set getFlatResources(java.util.Set resources)
           
abstract  java.util.Set getResourceAssignmentRefs()
          Return the set of possibly qualified resource object references encapsulated by this Service and any Service it contains.
abstract  java.util.Set getResourceAssignments()
          Return the set of ResourceAssignments encapsulated by this Service and any Services it contains.
abstract  java.util.List getResourceRefs()
          Return a flattened list of resource object references encapsulated by this Service and any Service it contains.
abstract  Resource[] getResources()
          Return a flattened array of resolved resource objects encapsulated by this service and any Service it contains.
abstract  java.util.List getServiceRefs()
          Return a list of Service object references encapsulated by this service.
abstract  Service[] getServices()
          Return an array of resolved service objects, immediately referenced by this object.
 boolean isOrdered()
          Override this if this service is a container and order is important.
 java.lang.String toIdentityString()
           
 java.lang.String toVerboseString()
           
 java.lang.String toVerboseString(java.lang.String indent)
           
 
Methods inherited from class com.waveset.object.PersistentObject
addCommonElements, addEndTag, addMemberObjectGroup, addMemberObjectGroup, addPersistentAttributes, addStartTag, addSubclassAttributes, addSubclassElements, addSummaryAttributes, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, fakeId, getAttribute, getAttributeValues, 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, getReferences, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, getType, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isId, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, listQueryableAttributes, listQueryableReferenceAttributes, listSummaryAttributes, objectGroupMember, objectGroupMemberRef, parseCommonElement, parseCommonElements, parsePersistentAttributes, parseSubclassAttributes, parseSubclassElements, parseXml, parseXml, prepareForSerialization, prepareToSerialize, println, reEncrypt, reEncryptSubclassAttributes, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReference, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setCreateDate, setCreator, setDisplayName, setDisplayName, setHidden, setIsAlias, setLastMod, setLastMod, setLastModDate, setLastModifier, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setProtected, setProtectedFromDelete, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

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

Service

public Service()
Method Detail

getServiceRefs

public abstract java.util.List getServiceRefs()
Return a list of Service object references encapsulated by this service.


getServices

public abstract Service[] getServices()
                               throws WavesetException
Return an array of resolved service objects, immediately referenced by this object.

Throws:
WavesetException

getResourceRefs

public abstract java.util.List getResourceRefs()
                                        throws WavesetException
Return a flattened list of resource object references encapsulated by this Service and any Service it contains.

Throws:
WavesetException

getResourceAssignmentRefs

public abstract java.util.Set getResourceAssignmentRefs()
                                                 throws WavesetException
Return the set of possibly qualified resource object references encapsulated by this Service and any Service it contains.

Throws:
WavesetException

getResources

public abstract Resource[] getResources()
                                 throws WavesetException
Return a flattened array of resolved resource objects encapsulated by this service and any Service it contains.

Throws:
WavesetException

getResourceAssignments

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

Throws:
WavesetException

findResources

public void findResources(java.util.List list)
                   throws WavesetException
Recursively walk a tree of Services building up a list of Resource references. Since we have to resolve references to traverse, we must have a cache by now.

We don't really need to filter duplicates, the Provisioner will tolerate duplicates, but lets go ahead while we're here to cut down on resolution overhead.

Throws:
WavesetException

findResourceAssignments

protected java.util.Collection findResourceAssignments(java.util.Collection assignments)
                                                throws WavesetException
Traverse the hierarchy of Services contained in this object, constructing a set of possibly qualified Resource references.

Returns:
the Set of all Resource references contained in this Service hierarchy.
Throws:
WavesetException

findApplications

public void findApplications(java.util.List list)
                      throws WavesetException
see findResources. Return a flat list of ObjectRefs to Applications.

Throws:
WavesetException

findApplications

public void findApplications(java.util.List list,
                             boolean checkForCycles)
                      throws WavesetException
The call that recurses - takes a boolean check flag so that only has to be done once.

Throws:
WavesetException

findRoles

public void findRoles(java.util.List list)
               throws WavesetException
see findResources. Return a flat list of ObjectRefs to Roles.

Throws:
WavesetException

findRoles

public void findRoles(java.util.List list,
                      boolean checkForCycles)
               throws WavesetException
The call that recurses - takes a boolean check flag so that only has to be done once.

Throws:
WavesetException

findServices

public void findServices(java.util.List list)
                  throws WavesetException
see findResources. Return a flat list of ObjectRefs to Roles or Applications. Note that this does NOT return Resources. // jsl - the name of this method is incorrect since Resources // are also Services.

Throws:
WavesetException

findServices

public void findServices(java.util.List list,
                         boolean checkForCycles)
                  throws WavesetException
The call that recurses - takes a boolean check flag so that only has to be done once.

Throws:
WavesetException

findRoleAttributes

public void findRoleAttributes(java.util.List list)
                        throws WavesetException
Return all of the role attributes associated with all of the applications associated with this service. This will recurse down enclosed roles. Role attributes found will be have their container string set to this role's name.

Parameters:
list - an existing list to add found role attributes to
Throws:
WavesetException

findRoleExclusions

public void findRoleExclusions(java.util.Map map)
                        throws WavesetException
Return all of the role exclusions associated with all of the roles associated with this service.

Parameters:
map - an existing Map to add found role exclusions to. The map is keyed by excluded role name and the values are the roles that contain the exclusion
Throws:
WavesetException

checkForReferenceCycles

public static void checkForReferenceCycles(Service service,
                                           java.util.Stack history)
                                    throws WavesetException
Recursively walk down a reference chain, watching for cycles. Throw an exception with an informative (though maybe long) error message. Detect both the cycle a->b->c->a and a->b->c->b.

Parameters:
service - the service to check for cycles
history - a Stack of Services that contain service. Pass null to check a top level service.
Throws:
WavesetException

getFlatResources

public void getFlatResources(java.util.List resources)
                      throws WavesetException
Calculate a flat list of resolved Resource objects referenced directly or indirectly by this service.

Throws:
WavesetException

getFlatResources

public java.util.Set getFlatResources(java.util.Set resources)
                               throws WavesetException
Throws:
WavesetException

getFlatResourceAssignments

public java.util.Set getFlatResourceAssignments(java.util.Set assigns)
                                         throws WavesetException
Calculate a flat collection of resolved Resource objects referenced directly or indirectly by this service.

Throws:
WavesetException

getFlatResources

public static void getFlatResources(java.util.List services,
                                    ObjectCache cache,
                                    java.util.List resources)
                             throws WavesetException
Given a list of Services or service references, calculate a flat list of resolved Resource objects.

// This has become the core resource flattener, we don't really // need everything else above, but you have to be careful about // removing things.

Throws:
WavesetException

getFlatResources

public static java.util.Set getFlatResources(java.util.List services,
                                             ObjectCache cache,
                                             java.util.Set resources)
                                      throws WavesetException
Throws:
WavesetException

getFlatResourceAssignments

public static java.util.Set getFlatResourceAssignments(java.util.List services,
                                                       ObjectCache cache,
                                                       java.util.Set assigns)
                                                throws WavesetException
Given a list of Services or service references, calculate a flat list of resolved ResourceAssignment objects.

Throws:
WavesetException

isOrdered

public boolean isOrdered()
Override this if this service is a container and order is important.


dumpSummary

public void dumpSummary(java.lang.String file)

toIdentityString

public java.lang.String toIdentityString()

toVerboseString

public java.lang.String toVerboseString()

toVerboseString

public java.lang.String toVerboseString(java.lang.String indent)