wt.epm.retriever
Class EPMRetriever

java.lang.Object
  extended bywt.epm.retriever.EPMRetriever
All Implemented Interfaces:
EPMRetrieverConstants

public class EPMRetriever
extends Object
implements EPMRetrieverConstants


Nested Class Summary
private  class EPMRetriever.FamilyTableTriple
           
private  class EPMRetriever.Parameter
           
private  class EPMRetriever.Recursion
           
private  class EPMRetriever.Scope
           
private  class EPMRetriever.Select
           
private  class EPMRetriever.SimpleTriple
           
private  class EPMRetriever.Triple
           
private  class EPMRetriever.Where
           
 
Field Summary
(package private)  Set blocks
           
(package private)  boolean checkAccessRights
           
private static String CHECKPOINT_ALIAS
           
static int CHUNK_SIZE
           
(package private)  Map cs
           
(package private)  boolean descendantQuery
           
(package private)  Map executedTriples
           
(package private)  Map foundMasters
           
(package private)  List from
           
(package private)  Set incompatibleFTs
           
static boolean isInClauseUseBindOptimization
           
(package private)  Map lcmGenerics
           
private static Log log
           
(package private)  Set lwLinks
           
private static String NOT_PERSISTABLE
           
private static String NULL_PARAMETER
           
(package private)  Map params
           
(package private)  String query
           
(package private)  Map recursion_from
           
(package private)  InternalRetrieverCache result
           
(package private)  int saveLinks
           
(package private)  EPMRetriever.Scope scope
           
(package private)  Map seeds
           
(package private)  List select
           
(package private)  Map select_alias
           
(package private)  Set selected_params
           
(package private)  Set unresolvedMasters
           
(package private)  Map wftGenerics
           
(package private)  Map where
           
(package private)  Map wsFT
           
(package private)  Set wsFTVersions
           
(package private)  Map wsWrk
           
 
Fields inherited from interface wt.epm.retriever.EPMRetrieverConstants
ALL_ASSOCIATED, ALL_ATTRIBUTES, ALL_DEPENDENTS, ALL_DRAWINGS, ALL_FT_MEMBERS, ASSOCIATED_OF_SEEDS, BACKWARD_ORDER, DEFAULT_ALIAS, DEFAULT_BLOCK_ALIAS, DEFAULT_JOIN, DEFAULT_RESULT_SIZE, DRAWING_DEPENDENTS_AS_OTHER_DEPENDENTS, DRAWING_REQUIRED_DEPENDENTS, DRAWINGS_OF_SEEDS, FORWARD_ORDER, FT_MEMBERS_OF_SEEDS, LEFT_JOIN, NO_ASSOCIATED, NO_DEPENDENTS, NO_DRAWING_DEPENDENTS, NO_DRAWINGS, NO_FT_MEMBERS, NO_REPEAT_LIMIT, NO_SAVE_LINKS, NO_SCOPE, REQUIRED_DEPENDENTS, RIGHT_JOIN, SAVE_LIGHT_LINKS, SAVE_LINKS, SEED_SCOPE, STANDARD_SCOPE
 
Constructor Summary
EPMRetriever()
           
 
Method Summary
private  void addCondition(QuerySpec qs, SearchCondition sc, boolean appendAnd, int appendOpenParen, int appendCloseParen)
           
 void addConfigSpec(ConfigSpec spec)
           
 void addConfigSpec(String alias, ConfigSpec spec)
           
 void addFamilyTableTriple(String epmItersParamName, String epmDependentsParamName, String ftVersionParamName, String containedinLinkParamName, String variantLinkParamName, boolean includeAllMembers, EPMWorkspace ws, String recursionAlias)
           
 void addParameter(String paramName, Class cl)
           
 void addParameter(String paramName, Class cl, Object paramValue)
           
 void addRecursionFrom(String recursionAlias)
           
 void addRecursionFrom(String alias, int repeatLimit)
           
 void addSelect(String paramName)
           
 void addSelect(String paramName, String attrName)
           
 void addSelect(String paramName, String attrName, String alias)
           
 void addSelect(String paramName, String attrName, String alias, String block_alias)
           
 void addSimpleTriple(String[] aParamName, String alias)
           
private  void addTable(ClassInfo info, List tableList)
           
private  void addToMap(Map map, Collection c, boolean addMaster)
           
 void addTriple(String aParamName, String linkParamName, String bParamName)
           
 void addTriple(String aParamName, String linkParamName, String bParamName, String order)
           
 void addTriple(String aParamName, String linkParamName, String bParamName, String alias, String order)
           
 void addTriple(String aParamName, String linkParamName, String bParamName, String alias, String order, String block_alias)
           
 void addTripleToRecursion(String aParamName, String linkParamName, String bParamName, String recursionAlias)
           
 void addTripleToRecursion(String aParamName, String linkParamName, String bParamName, String alias, String recursionAlias)
           
 void addTripleToRecursion(String aParamName, String linkParamName, String bParamName, String alias, String order, String recursionAlias)
           
private  void addWhere(QuerySpec qs, String alias)
           
private  void addWhere(QuerySpec qs, String alias, String recursionAlias)
           
 void addWhere(SearchCondition sc)
           
 void addWhere(SearchCondition sc, String alias)
           
 void addWhere(SearchCondition sc, String alias, boolean appendAnd, int appendOpenParen, int appendCloseParen)
           
 void addWhere(String paramName, String attrName, String op, Object attrValue)
           
 void addWhere(String paramName, String attrName, String op, Object attrValue, String alias)
           
 void addWhere(String paramName, String attrName, String op, Object attrValue, String alias, boolean appendAnd, int appendOpenParen, int appendCloseParen, String recursionAlias)
           
 void addWhere(String paramName, String attrName, String op, Object attrValue, String alias, String recursionAlias)
           
private  void debugPrintOfFiltered(ObjectIdentifier masterId, Collection iters)
           
 EPMRetrieverCache execute()
           
private  Collection filterByParameterClass(EPMRetriever.Parameter param)
           
private  QueryResult find(String msg, StatementSpec spec)
           
private  QueryResult find(String msg, StatementSpec spec, boolean checkAccessRights)
           
private  List getConfigSpecList(String alias)
           
private  EPMRetriever.Parameter getParameter(String paramName)
           
private  String getParen(String s, int repeat)
           
private  Iterated getPreferedIteration(ObjectIdentifier masterID)
           
private  Object getTriple(Object obj)
           
private  List getWhereList(String alias)
           
private  boolean isConfigSpec(String alias)
           
private  boolean isOperatorValid(String op)
           
 void minusParameter(String paramName, String minusParamName)
           
private  void parseQuery()
           
 void plusParameter(String paramName, String plusParamName)
           
private  QueryResult processByConfigSpec(ObjectIdentifier masterId, ConfigSpec configSpec, QueryResult qr, int iterInd)
           
private  void run()
           
private  void runRecursion(EPMRetriever.Recursion r)
           
private  void runSelect(String[] paramName, String alias)
           
private  void save()
           
 void setCheckAccessRights(boolean checkAccessRights)
           
 void setDescendantQuery(boolean descendantQuery)
           
 void setParameter(String paramName, Object paramValue)
           
 void setQuery(String query)
           
 void setScope(WTContainer container)
           
 void setScope(WTContainer[] containers)
           
 void setSeeds(Collection c)
           
 void setSubstitutedSeeds(Collection substitutedSeeds)
           
 void setWorkspace(EPMWorkspace ws)
           
 String toString()
           
private  void validateFrom(Object obj, StringBuffer request)
           
private  void validateRequest()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

query

String query

result

InternalRetrieverCache result

checkAccessRights

boolean checkAccessRights

descendantQuery

boolean descendantQuery

params

Map params

select_alias

Map select_alias

recursion_from

Map recursion_from

where

Map where

cs

Map cs

foundMasters

Map foundMasters

executedTriples

Map executedTriples

wsWrk

Map wsWrk

wsFT

Map wsFT

seeds

Map seeds

lcmGenerics

Map lcmGenerics

wftGenerics

Map wftGenerics

select

List select

from

List from

selected_params

Set selected_params

blocks

Set blocks

unresolvedMasters

Set unresolvedMasters

incompatibleFTs

Set incompatibleFTs

lwLinks

Set lwLinks

wsFTVersions

Set wsFTVersions

scope

EPMRetriever.Scope scope

saveLinks

int saveLinks

CHUNK_SIZE

public static int CHUNK_SIZE

isInClauseUseBindOptimization

public static boolean isInClauseUseBindOptimization

NULL_PARAMETER

private static final String NULL_PARAMETER
See Also:
Constant Field Values

NOT_PERSISTABLE

private static final String NOT_PERSISTABLE
See Also:
Constant Field Values

CHECKPOINT_ALIAS

private static final String CHECKPOINT_ALIAS
See Also:
Constant Field Values

log

private static Log log
Constructor Detail

EPMRetriever

public EPMRetriever()
Method Detail

setQuery

public void setQuery(String query)

setCheckAccessRights

public void setCheckAccessRights(boolean checkAccessRights)

setDescendantQuery

public void setDescendantQuery(boolean descendantQuery)

setSubstitutedSeeds

public void setSubstitutedSeeds(Collection substitutedSeeds)

setWorkspace

public void setWorkspace(EPMWorkspace ws)
                  throws WTException,
                         WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

setSeeds

public void setSeeds(Collection c)

setParameter

public void setParameter(String paramName,
                         Object paramValue)
                  throws EPMRetrieverException
Throws:
EPMRetrieverException

toString

public String toString()

execute

public EPMRetrieverCache execute()
                          throws EPMRetrieverException,
                                 WTException,
                                 WTPropertyVetoException
Throws:
EPMRetrieverException
WTException
WTPropertyVetoException

addSelect

public void addSelect(String paramName)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addSelect

public void addSelect(String paramName,
                      String attrName)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addSelect

public void addSelect(String paramName,
                      String attrName,
                      String alias)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addSelect

public void addSelect(String paramName,
                      String attrName,
                      String alias,
                      String block_alias)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

setScope

public void setScope(WTContainer container)
              throws EPMRetrieverException,
                     WTException
Throws:
EPMRetrieverException
WTException

setScope

public void setScope(WTContainer[] containers)
              throws EPMRetrieverException,
                     WTException
Throws:
EPMRetrieverException
WTException

addRecursionFrom

public void addRecursionFrom(String recursionAlias)
                      throws EPMRetrieverException
Throws:
EPMRetrieverException

addRecursionFrom

public void addRecursionFrom(String alias,
                             int repeatLimit)
                      throws EPMRetrieverException
Throws:
EPMRetrieverException

addTriple

public void addTriple(String aParamName,
                      String linkParamName,
                      String bParamName)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addTriple

public void addTriple(String aParamName,
                      String linkParamName,
                      String bParamName,
                      String order)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addTriple

public void addTriple(String aParamName,
                      String linkParamName,
                      String bParamName,
                      String alias,
                      String order)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addTriple

public void addTriple(String aParamName,
                      String linkParamName,
                      String bParamName,
                      String alias,
                      String order,
                      String block_alias)
               throws EPMRetrieverException
Throws:
EPMRetrieverException

addTripleToRecursion

public void addTripleToRecursion(String aParamName,
                                 String linkParamName,
                                 String bParamName,
                                 String recursionAlias)
                          throws EPMRetrieverException
Throws:
EPMRetrieverException

addTripleToRecursion

public void addTripleToRecursion(String aParamName,
                                 String linkParamName,
                                 String bParamName,
                                 String alias,
                                 String recursionAlias)
                          throws EPMRetrieverException
Throws:
EPMRetrieverException

addTripleToRecursion

public void addTripleToRecursion(String aParamName,
                                 String linkParamName,
                                 String bParamName,
                                 String alias,
                                 String order,
                                 String recursionAlias)
                          throws EPMRetrieverException
Throws:
EPMRetrieverException

addFamilyTableTriple

public void addFamilyTableTriple(String epmItersParamName,
                                 String epmDependentsParamName,
                                 String ftVersionParamName,
                                 String containedinLinkParamName,
                                 String variantLinkParamName,
                                 boolean includeAllMembers,
                                 EPMWorkspace ws,
                                 String recursionAlias)
                          throws EPMRetrieverException
Throws:
EPMRetrieverException

addSimpleTriple

public void addSimpleTriple(String[] aParamName,
                            String alias)
                     throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(String paramName,
                     String attrName,
                     String op,
                     Object attrValue)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(String paramName,
                     String attrName,
                     String op,
                     Object attrValue,
                     String alias)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(String paramName,
                     String attrName,
                     String op,
                     Object attrValue,
                     String alias,
                     String recursionAlias)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(String paramName,
                     String attrName,
                     String op,
                     Object attrValue,
                     String alias,
                     boolean appendAnd,
                     int appendOpenParen,
                     int appendCloseParen,
                     String recursionAlias)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(SearchCondition sc)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(SearchCondition sc,
                     String alias)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addWhere

public void addWhere(SearchCondition sc,
                     String alias,
                     boolean appendAnd,
                     int appendOpenParen,
                     int appendCloseParen)
              throws EPMRetrieverException
Throws:
EPMRetrieverException

addConfigSpec

public void addConfigSpec(ConfigSpec spec)
                   throws EPMRetrieverException
Throws:
EPMRetrieverException

addConfigSpec

public void addConfigSpec(String alias,
                          ConfigSpec spec)
                   throws EPMRetrieverException
Throws:
EPMRetrieverException

addParameter

public void addParameter(String paramName,
                         Class cl)
                  throws EPMRetrieverException
Throws:
EPMRetrieverException

addParameter

public void addParameter(String paramName,
                         Class cl,
                         Object paramValue)
                  throws EPMRetrieverException
Throws:
EPMRetrieverException

plusParameter

public void plusParameter(String paramName,
                          String plusParamName)
                   throws EPMRetrieverException
Throws:
EPMRetrieverException

minusParameter

public void minusParameter(String paramName,
                           String minusParamName)
                    throws EPMRetrieverException
Throws:
EPMRetrieverException

isOperatorValid

private boolean isOperatorValid(String op)

validateRequest

private void validateRequest()
                      throws EPMRetrieverException,
                             WTException
Throws:
EPMRetrieverException
WTException

validateFrom

private void validateFrom(Object obj,
                          StringBuffer request)
                   throws EPMRetrieverException
Throws:
EPMRetrieverException

getParameter

private EPMRetriever.Parameter getParameter(String paramName)
                                     throws EPMRetrieverException
Throws:
EPMRetrieverException

run

private void run()
          throws EPMRetrieverException,
                 WTException,
                 WTPropertyVetoException
Throws:
EPMRetrieverException
WTException
WTPropertyVetoException

runRecursion

private void runRecursion(EPMRetriever.Recursion r)
                   throws EPMRetrieverException,
                          WTException,
                          WTPropertyVetoException
Throws:
EPMRetrieverException
WTException
WTPropertyVetoException

getTriple

private Object getTriple(Object obj)

runSelect

private void runSelect(String[] paramName,
                       String alias)
                throws WTException,
                       WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

save

private void save()
           throws WTException
Throws:
WTException

filterByParameterClass

private Collection filterByParameterClass(EPMRetriever.Parameter param)
                                   throws EPMRetrieverException
Throws:
EPMRetrieverException

addToMap

private void addToMap(Map map,
                      Collection c,
                      boolean addMaster)

parseQuery

private void parseQuery()
                 throws EPMRetrieverException
Throws:
EPMRetrieverException

getParen

private String getParen(String s,
                        int repeat)

addTable

private void addTable(ClassInfo info,
                      List tableList)
               throws WTException
Throws:
WTException

getWhereList

private List getWhereList(String alias)

addWhere

private void addWhere(QuerySpec qs,
                      String alias)
               throws WTException
Throws:
WTException

addWhere

private void addWhere(QuerySpec qs,
                      String alias,
                      String recursionAlias)
               throws WTException
Throws:
WTException

addCondition

private void addCondition(QuerySpec qs,
                          SearchCondition sc,
                          boolean appendAnd,
                          int appendOpenParen,
                          int appendCloseParen)
                   throws WTException
Throws:
WTException

getConfigSpecList

private List getConfigSpecList(String alias)

isConfigSpec

private boolean isConfigSpec(String alias)

processByConfigSpec

private QueryResult processByConfigSpec(ObjectIdentifier masterId,
                                        ConfigSpec configSpec,
                                        QueryResult qr,
                                        int iterInd)
                                 throws WTException
Throws:
WTException

debugPrintOfFiltered

private void debugPrintOfFiltered(ObjectIdentifier masterId,
                                  Collection iters)
                           throws WTException
Throws:
WTException

find

private QueryResult find(String msg,
                         StatementSpec spec)
                  throws WTException,
                         WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

find

private QueryResult find(String msg,
                         StatementSpec spec,
                         boolean checkAccessRights)
                  throws WTException,
                         WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

getPreferedIteration

private Iterated getPreferedIteration(ObjectIdentifier masterID)