wt.epm.structure
Class EPMNavigateUtility

java.lang.Object
  extended bywt.epm.structure.EPMNavigateUtility

class EPMNavigateUtility
extends Object

The EPMNavigateUtility is a class that navigates links for the EPMStandardStructureService class.

Supported API: false

Extendable: false


Nested Class Summary
protected static class EPMNavigateUtility.IdSet
          Represents a collection of one or more object identifiers.
protected static class EPMNavigateUtility.QueryResultProcessor
           
 
Constructor Summary
(package private) EPMNavigateUtility()
           
 
Method Summary
private static QueryResult filterIterations(QueryResult iterations, Relationship.Role role, QueryResult links)
          Given a list of iterations selected by a configuration spec, return those iterations that have at least one link to them.
private static QueryResult findIterationsOf(EPMNavigateUtility.IdSet masterIdSet, Class iteratedClass, ConfigSpec configSpec)
          Find all iterations of the given masters selected by the supplied configuration spec.
protected static EPMNavigateUtility.IdSet getBranchIds(QueryResult objects)
           
protected static EPMNavigateUtility.IdSet getId(Persistable object)
           
protected static EPMNavigateUtility.IdSet getIds(QueryResult objects)
           
private static QueryResult mergeResults(QueryResult objects, Relationship.Role role, QueryResult links)
          Merges a list of objects with a list of links.
protected static QueryResult navigate(EPMNavigateUtility.IdSet objectIdSet, Relationship assocation, QuerySpec querySpec, boolean returnLinks, boolean returnOtherSide)
          Navigate the given relationship to the other side objects.
protected static QueryResult navigate(EPMNavigateUtility.IdSet objectIdSet, Relationship assocation, QuerySpec querySpec, boolean returnLinks, boolean returnOtherSide, boolean bypassAccessControl)
          If bypassAccessControl is true, use low level API (query)
protected static QueryResult navigate(Persistable object, Relationship relationship, QuerySpec querySpec, boolean onlyOtherSide)
          Navigates the given relationship to the other side objects and returns a QueryResult of links or other-side objects depending upon the value of the onlyOtherSide flag.
protected static WTKeyedMap navigate(WTCollection objects, Relationship relationship, QuerySpec querySpec, boolean onlyOtherSide)
          Navigates the given relationship to the other side objects and returns a WTKeyedMap whose values are WTSets of links or other-side objects depending upon the value of the onlyOtherSide flag.
protected static WTKeyedMap navigate(WTCollection objects, Relationship relationship, QuerySpec querySpec, boolean onlyOtherSide, ConfigSpec configSpec)
          Navigates the given iteration-to-master relationship.
protected static Object navigate(WTCollection objects, Relationship relationship, QuerySpec querySpec, NavigateResultProcessor processor, boolean bypassAccessControl)
          Navigate the given relationship to the other side objects possibly bypassing access control.
private static QueryResult navigateIterationToMaster(EPMNavigateUtility.IdSet objectIdSet, Relationship relationship, QuerySpec querySpec)
          Navigate the given relationship to the other side Iterated objects.
protected static QueryResult navigateMasterToIteration(EPMNavigateUtility.IdSet objectIdSet, Relationship relationship, QuerySpec querySpec, boolean onlyOtherSide, ConfigSpec configSpec)
          Navigate the given relationship to the other side Mastered objects.
protected static QueryResult navigateToIteration(EPMNavigateUtility.IdSet objectIdSet, Relationship relationship, QuerySpec querySpec, boolean onlyOtherSide, ConfigSpec configSpec)
          Navigate the given relationship to the other side Iterated objects.
private static QueryResult recoverMissingMasters(EPMNavigateUtility.IdSet masterIdSet, QueryResult iterations)
          Given a set of masters and a set of iterations for those masters, return a list that contains the iterations plus all masters that do not have a corresponding iteration in the set of iterations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPMNavigateUtility

EPMNavigateUtility()
Method Detail

navigate

protected static WTKeyedMap navigate(WTCollection objects,
                                     Relationship relationship,
                                     QuerySpec querySpec,
                                     boolean onlyOtherSide)
                              throws WTException
Navigates the given relationship to the other side objects and returns a WTKeyedMap whose values are WTSets of links or other-side objects depending upon the value of the onlyOtherSide flag.

Throws:
WTException

navigate

protected static QueryResult navigate(Persistable object,
                                      Relationship relationship,
                                      QuerySpec querySpec,
                                      boolean onlyOtherSide)
                               throws WTException
Navigates the given relationship to the other side objects and returns a QueryResult of links or other-side objects depending upon the value of the onlyOtherSide flag. This method supports the legacy navigation methods. It should not be used for any other purpose.

Throws:
WTException

navigate

protected static WTKeyedMap navigate(WTCollection objects,
                                     Relationship relationship,
                                     QuerySpec querySpec,
                                     boolean onlyOtherSide,
                                     ConfigSpec configSpec)
                              throws WTException
Navigates the given iteration-to-master relationship. Using the supplied config spec, it finds the appropriate iteration of each other-side master. This method returns a WTKeyedMap. If onlyOtherSide is "true", the values are WTSets of iterations and possibly masters. If onlyOtherSide is "false", the values are Lists of two-element Persistable arrays where the first element is a link and the second element is either the selected iteration or possibly the master. A master is returned when none of its iterations match the config spec criteria.

Throws:
WTException

navigate

protected static Object navigate(WTCollection objects,
                                 Relationship relationship,
                                 QuerySpec querySpec,
                                 NavigateResultProcessor processor,
                                 boolean bypassAccessControl)
                          throws WTException
Navigate the given relationship to the other side objects possibly bypassing access control. This method performs the query. The NavigateResultProcessor that was passed in specifies, collects and optionally processes the results.

Throws:
WTException

navigate

protected static QueryResult navigate(EPMNavigateUtility.IdSet objectIdSet,
                                      Relationship assocation,
                                      QuerySpec querySpec,
                                      boolean returnLinks,
                                      boolean returnOtherSide)
                               throws WTException
Navigate the given relationship to the other side objects. If returnOtherSide is "true" and returnLinks is "false", return a query result that holds the other side objects. If returnLinks is "true" and returnOtherSide is "false", return a query result that holds the links. If both are "true", return a query result that holds Persistable[] where one element in each array is the the other side object and the other is its matching link.

Throws:
WTException

navigate

protected static QueryResult navigate(EPMNavigateUtility.IdSet objectIdSet,
                                      Relationship assocation,
                                      QuerySpec querySpec,
                                      boolean returnLinks,
                                      boolean returnOtherSide,
                                      boolean bypassAccessControl)
                               throws WTException
If bypassAccessControl is true, use low level API (query)

Throws:
WTException

navigateMasterToIteration

protected static QueryResult navigateMasterToIteration(EPMNavigateUtility.IdSet objectIdSet,
                                                       Relationship relationship,
                                                       QuerySpec querySpec,
                                                       boolean onlyOtherSide,
                                                       ConfigSpec configSpec)
                                                throws WTException
Navigate the given relationship to the other side Mastered objects. Find the appropriate iterations for those masters by applying the configSpec. If onlyOtherSide is "true", return a query result that holds the iterations and/or masters. A master is returned when none of its iterations match the configSpec criteria. If onlyOtherSide is "false", returns a query result that holds Persistable[] in which the first element in each array is the link and the second is its matching iteration or master.

Throws:
WTException

navigateToIteration

protected static QueryResult navigateToIteration(EPMNavigateUtility.IdSet objectIdSet,
                                                 Relationship relationship,
                                                 QuerySpec querySpec,
                                                 boolean onlyOtherSide,
                                                 ConfigSpec configSpec)
                                          throws WTException
Navigate the given relationship to the other side Iterated objects. Return those iterations selected by the supplied configuration spec. When onlyOtherSide is true, return a query result of those iterations selected by the supplied configuration spec that have at least one link to them. If a selected iteration does not have any links to it, return its master. Returning its master signifies that you can navigate to other iterations of the same master but not to the one selected by the supplied configuration spec. When onlyOtherSide is true, return a query result of Persistable[] where the first element in each array is the link and the second is the other side iteration selected by the configuration spec. If a selected iteration does not have any links to it, the first element in the Persistable[] will be null and the second will be the master of the iteration.

Throws:
WTException

getId

protected static EPMNavigateUtility.IdSet getId(Persistable object)

getIds

protected static EPMNavigateUtility.IdSet getIds(QueryResult objects)

getBranchIds

protected static EPMNavigateUtility.IdSet getBranchIds(QueryResult objects)
                                                throws WTException
Throws:
WTException

navigateIterationToMaster

private static QueryResult navigateIterationToMaster(EPMNavigateUtility.IdSet objectIdSet,
                                                     Relationship relationship,
                                                     QuerySpec querySpec)
                                              throws WTException
Navigate the given relationship to the other side Iterated objects. Return the links and the object identifiers of the Masters for those Iterated objects.

Throws:
WTException

findIterationsOf

private static QueryResult findIterationsOf(EPMNavigateUtility.IdSet masterIdSet,
                                            Class iteratedClass,
                                            ConfigSpec configSpec)
                                     throws WTException
Find all iterations of the given masters selected by the supplied configuration spec.

Throws:
WTException

mergeResults

private static QueryResult mergeResults(QueryResult objects,
                                        Relationship.Role role,
                                        QueryResult links)
Merges a list of objects with a list of links. This method returns a query result of Persistable[] where the first element in each array is the link and the second is the object that it is attached to. If more than one link is attached to the same object, this method returns a Persistable[] for each link. If an object does not have any links attached to it, this method returns a Persistable[] where the first element is null and the second is the object.


filterIterations

private static QueryResult filterIterations(QueryResult iterations,
                                            Relationship.Role role,
                                            QueryResult links)
Given a list of iterations selected by a configuration spec, return those iterations that have at least one link to them. If an iteration does not have any links to it, return its master. Returning its master signifies that you can navigate to other iterations of the same master but not to the one selected by the configuration spec.


recoverMissingMasters

private static QueryResult recoverMissingMasters(EPMNavigateUtility.IdSet masterIdSet,
                                                 QueryResult iterations)
                                          throws WTException
Given a set of masters and a set of iterations for those masters, return a list that contains the iterations plus all masters that do not have a corresponding iteration in the set of iterations. By adding a master to the list, we indicate that associations exist to some or all iterations of that master but the configuration spec did not select any of them.

Throws:
WTException