Package wt.vc.config
Class ConfigHelper
java.lang.Object
wt.vc.config.ConfigHelper
- All Implemented Interfaces:
Externalizable,Serializable
This helper for the
Supported API: true
Extendable: false
ConfigService provides convenience APIs useful
for converting lists of links into lists of masters or iterations and
for filtering lists.
Supported API: true
Extendable: false
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic QueryResultbuildConfigResultFromLinks(QueryResult linksToMasters, String role, QueryResult configResults) Given a QueryResult of links to masters and the iterations for those masters, this method returns a new QueryResult of Persistable[] in which each element is a Persistable[] containing the link in the 0th position and the iteration (or master, if no iteration was found) for the master specified in the link in the 1th position.static QueryResultiterationsOf(QueryResult arrayedElements, int index) Returns a QueryResult of iterations found at the index position of the Persistable[] elements in the provided QueryResult.static QueryResultiterationsOf(QueryResult links, String role) Returns a QueryResult of iterations by applying the role to the QueryResult of Links.static QueryResultmastersOf(QueryResult arrayedElements, int index) Returns a QueryResult of masters found at the index position of the Persistable[] elements in the provided QueryResult.static QueryResultmastersOf(QueryResult links, String role) Returns a QueryResult of masters by applying the role to the QueryResult of Links.static QueryResultrecoverMissingMasters(QueryResult masters, QueryResult iterations) Given a QueryResult of masters and a QueryResult of the iterations for those masters, this method returns a (new) QueryResult containing the iterations and any masters for which no corresponding iterations were found.static QueryResultremoveExtraLinks(QueryResult linksToIterations, String role, QueryResult configResults) Given a QueryResult of links to iterations and a QueryResult of filtered iterations, return a new QueryResult of only those links for which their iterations matched.
-
Field Details
-
service
Supported API: true
-
-
Method Details
-
mastersOf
Returns a QueryResult of masters by applying the role to the QueryResult of Links.
Supported API: true- Parameters:
links- A QueryResult of links.role- The role the masters play in the link.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
mastersOf
Returns a QueryResult of masters found at the index position of the Persistable[] elements in the provided QueryResult.
Supported API: true- Parameters:
arrayedElements- A QueryResult of elements of type Persistable[].index- The position in the Persistable[] the masters can be found in.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
iterationsOf
Returns a QueryResult of iterations by applying the role to the QueryResult of Links.
Supported API: true- Parameters:
links- A QueryResult of links.role- The role the iterations play in the link.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
iterationsOf
Returns a QueryResult of iterations found at the index position of the Persistable[] elements in the provided QueryResult.
Supported API: true- Parameters:
arrayedElements- A QueryResult of elements of type Persistable[].index- The position in the Persistable[] the iterations can be found in.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
recoverMissingMasters
public static QueryResult recoverMissingMasters(QueryResult masters, QueryResult iterations) throws WTException Given a QueryResult of masters and a QueryResult of the iterations for those masters, this method returns a (new) QueryResult containing the iterations and any masters for which no corresponding iterations were found. This method is useful to indicate that a master was found but no matching iteration was found for that master.
Supported API: true- Parameters:
masters- The masters the iterations belong to.iterations- The iterations for the masters.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
buildConfigResultFromLinks
public static QueryResult buildConfigResultFromLinks(QueryResult linksToMasters, String role, QueryResult configResults) throws WTException Given a QueryResult of links to masters and the iterations for those masters, this method returns a new QueryResult of Persistable[] in which each element is a Persistable[] containing the link in the 0th position and the iteration (or master, if no iteration was found) for the master specified in the link in the 1th position.
Supported API: true- Parameters:
linksToMasters- The links to masters.role- The role those masters play in the links.configResults- The iterations for those masters.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
removeExtraLinks
public static QueryResult removeExtraLinks(QueryResult linksToIterations, String role, QueryResult configResults) throws WTException Given a QueryResult of links to iterations and a QueryResult of filtered iterations, return a new QueryResult of only those links for which their iterations matched.
Supported API: true- Parameters:
linksToIterations- The links to iterations.role- The role those iterations play in the links.configResults- The iterations for those links. These are typically the iterations that matched given a ConfigSpec.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-