com.waveset.object
Class Service

java.lang.Object
  extended by com.waveset.object.PersistentObject
      extended by com.waveset.object.Service
All Implemented Interfaces:
com.waveset.object.AttributeBag, XmlObject, java.lang.Comparable, javax.naming.Referenceable
Direct Known Subclasses:
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/interfaces 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
INITIAL_OBJECT_VERSION
 
Constructor Summary
Service(com.sun.idm.object.IDMObjectClass objectClass)
           
 
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.
 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, com.waveset.object.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.
static java.util.Set getFlatResourceAssignmentsNoRoles(java.util.List services, com.waveset.object.ObjectCache cache, java.util.Set assigns)
          Given a list of service references, calculate a flat list of resolved ResourceAssignment objects.
 java.util.Set getFlatResourceAssignmentsNoRoles(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, com.waveset.object.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, com.waveset.object.ObjectCache cache, java.util.Set resources)
           
 java.util.Set getFlatResources(java.util.Set resources)
           
static java.util.Set getFlatResourcesNoRoles(java.util.List services, com.waveset.object.ObjectCache cache, java.util.Set assigns)
          Given a list of service references, calculate a flat list of resolved Resource objects.
 java.util.Set getFlatResourcesNoRoles(java.util.Set assigns)
          Calculate a flat collection of resolved Resource objects referenced directly or indirectly by this service.
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  com.waveset.object.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
addMemberObjectGroup, addMemberObjectGroup, addXmlHeader, attributesMatch, attributesMatch, attributesMatch, checkReference, checkReferences, clearId, cloneAs, cloneObject, compareTo, create, create, create, create, createLastModItem, createLastModItem, createLastModItemList, directObjectGroupMember, dump, dumpFile, equals, 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, getPrimaryObjectClass, getProperties, getProperty, getPropertyAsString, getPropertyList, getQueryableAttributes, getReference, getReferences, getRepositoryMod, getRuleDrivenMemberObjectGroupRefs, getRuleDrivenMemberObjectGroupRefsUpTo, getRuleDrivenMemberObjectGroups, getSubtype, getSummaryAttributes, getSummaryString, getType, getXMLSize, hasEncryptedData, hashCode, identityEquals, isAlias, isHidden, isProtected, isProtectedFromDelete, isReferencedIn, listOperationalAttributes, listQueryableAttributes, listQueryableReferenceAttributes, listSummaryAttributes, objectGroupMember, objectGroupMemberRef, prepareForSerialization, prepareToSerialize, reEncrypt, removeMemberObjectGroup, removeProperty, resolve, resolve, resolve, resolveArray, resolveArrayByFetching, resolveObjectReferences, resolveReference, resolveSummaryAttributes, resolveSummaryAttributes, ruleDrivenObjectGroupMemberRef, setAuthType, setAuthType, setCache, setDisplayName, setDisplayName, setHidden, setIsAlias, setMemberObjectGroupRef, setMemberObjectGroupRefs, setMemberObjectGroups, setName, setProperties, setProperty, setPropertyList, setRuleDrivenMembersCache, setSubtype, setTrace, toString, toXml, toXml, toXml, toXmlFile, visit
 
Methods inherited from class java.lang.Object
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(com.sun.idm.object.IDMObjectClass objectClass)
Method Detail

checkForReferenceCycles

public static void checkForReferenceCycles(Service service,
                                           java.util.Stack history)
                                    throws com.waveset.util.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:
com.waveset.util.WavesetException

dumpSummary

public void dumpSummary(java.lang.String file)

findApplications

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

Throws:
com.waveset.util.WavesetException

findApplications

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

Throws:
com.waveset.util.WavesetException

findResources

public void findResources(java.util.List list)
                   throws com.waveset.util.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:
com.waveset.util.WavesetException

findRoleAttributes

public void findRoleAttributes(java.util.List list)
                        throws com.waveset.util.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:
com.waveset.util.WavesetException

findRoleExclusions

public void findRoleExclusions(java.util.Map map)
                        throws com.waveset.util.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:
com.waveset.util.WavesetException

findRoles

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

Throws:
com.waveset.util.WavesetException

findRoles

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

Throws:
com.waveset.util.WavesetException

findServices

public void findServices(java.util.List list)
                  throws com.waveset.util.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:
com.waveset.util.WavesetException

findServices

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

Throws:
com.waveset.util.WavesetException

getFlatResourceAssignments

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

Throws:
com.waveset.util.WavesetException

getFlatResourceAssignments

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

Throws:
com.waveset.util.WavesetException

getFlatResourceAssignmentsNoRoles

public static java.util.Set getFlatResourceAssignmentsNoRoles(java.util.List services,
                                                              com.waveset.object.ObjectCache cache,
                                                              java.util.Set assigns)
                                                       throws com.waveset.util.WavesetException
Given a list of service references, calculate a flat list of resolved ResourceAssignment objects. However, ignore any Role references

Parameters:
services -
cache -
assigns -
Returns:
a flat list of resolved ResourceAssignment objects.
Throws:
com.waveset.util.WavesetException

getFlatResourceAssignmentsNoRoles

public java.util.Set getFlatResourceAssignmentsNoRoles(java.util.Set assigns)
                                                throws com.waveset.util.WavesetException
Calculate a flat collection of resolved Resource objects referenced directly or indirectly by this service. However, ignore any Role references

Throws:
com.waveset.util.WavesetException

getFlatResources

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

Throws:
com.waveset.util.WavesetException

getFlatResources

public static void getFlatResources(java.util.List services,
                                    com.waveset.object.ObjectCache cache,
                                    java.util.List resources)
                             throws com.waveset.util.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:
com.waveset.util.WavesetException

getFlatResources

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

getFlatResources

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

getFlatResourcesNoRoles

public static java.util.Set getFlatResourcesNoRoles(java.util.List services,
                                                    com.waveset.object.ObjectCache cache,
                                                    java.util.Set assigns)
                                             throws com.waveset.util.WavesetException
Given a list of service references, calculate a flat list of resolved Resource objects. However, ignore any Role references

Parameters:
services -
cache -
assigns -
Returns:
a flat list of resolved Resource objects.
Throws:
com.waveset.util.WavesetException

getFlatResourcesNoRoles

public java.util.Set getFlatResourcesNoRoles(java.util.Set assigns)
                                      throws com.waveset.util.WavesetException
Calculate a flat collection of resolved Resource objects referenced directly or indirectly by this service. However, ignore any Role references

Throws:
com.waveset.util.WavesetException

getResourceAssignmentRefs

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

Throws:
com.waveset.util.WavesetException

getResourceAssignments

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

Throws:
com.waveset.util.WavesetException

getResourceRefs

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

Throws:
com.waveset.util.WavesetException

getResources

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

Throws:
com.waveset.util.WavesetException

getServiceRefs

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


getServices

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

Throws:
com.waveset.util.WavesetException

isOrdered

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


toIdentityString

public java.lang.String toIdentityString()

toVerboseString

public java.lang.String toVerboseString()

toVerboseString

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