|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QueryDefinition
Definition of a UCMDB TQL query.
Examples of simple queries:QueryDefinition queryDefinition = topologyQueryFactory.createQueryDefinition("Get Hosts by IDs"); QueryNode queryNode = queryDefinition.addNode("Hosts").ofType("host").withIds(ids); queryNode.queryPropertiesWithQualifier("COMPARABLE").queryProperties("host_key", "host_iscomplete");Full description: Retrieve all CIs of type "host" or a descendant type, using "ids". ids is assumed as a parameter for the code. Also retrieves all properties marked "comparable" and the properties "host_key" and "host_iscomplete" for all CIs in the result topology.
QueryDefinition queryDefinition = topologyQueryFactory.createQueryDefinition("Get Hosts"); QueryNode queryNode = queryDefinition.addNode("Hosts").ofType("host"); queryNode.property("host_key").like("T%").caseInsensitive(); queryNode.property("host_iscomplete").isNull(); queryNode.queryKeyProperties();Full description: Retrieve all CIs of type "host" or a descendant where:
QueryDefinition queryDefinition = topologyQueryFactory.createQueryDefinition("Get hosts' neighbors"); QueryNode cisNode = queryDefinition.addNode("CIs").ofType("host").withIdsOf(hosts_ids).invisible(); QueryNode neighborsNode = queryDefinition.addNode("Neighbors").ofType("configuration_item"); neighborsNode.queryKeyProperties(); cisNode.linkedTo(neighborsNode).ofITWorldType().invisible();Full description: Retreive all CIs that are neighbours if hosts with the given ids. host_ids assumed as a parameter the code. Both the host CIs and the link between the hosts and their neighbours are invisible - they do not return in the result topology. Also retrieves the key property for these neighbours CIs.
Method Summary | |
---|---|
QueryNode |
addNode(java.lang.String nodeName)
Adds a new node to the query. |
java.lang.String |
baseQueryName()
|
java.lang.String |
debugDescription()
Returns a human-readable full description of this query definition to be used debugging the query definition. |
java.lang.String |
description()
|
QueryDefinitionFirstLoadStrategy |
firstLoadStrategy()
Returns the setting for when a saved query should first be loaded and calculated. |
QueryLink |
getLink(java.lang.String linkName)
Returns the query link with the specified name or null if node does not exist. |
QueryNode |
getNode(java.lang.String nodeName)
Returns the node with the specified name or null if node does not exist. |
java.util.Map<java.lang.String,? extends QueryLink> |
links()
Returns the links defined in this query as a map of names to links. |
java.lang.String |
name()
|
java.util.Map<java.lang.String,? extends QueryNode> |
nodes()
Returns the nodes defined in this query as a map of names to nodes. |
QueryDefinitionRecalcPriority |
recalcPriority()
Returns the setting for how soon a saved query is recalculated after data change. |
boolean |
removeLink(java.lang.String linkName)
Removes the named link from this query definition. |
boolean |
removeNode(java.lang.String nodeName)
Removes the named node from this query definition. |
ExecutableQuery |
toExecutable()
Converts this query definition into an executable query object for passing to TopologyQueryService.executeQuery(ExecutableQuery) . |
QueryDefinition |
withBaseQueryName(java.lang.String baseQueryName)
Sets this query to run over the result of another query. |
QueryDefinition |
withDescription(java.lang.String description)
Sets a human-readable description of the query definition purpose. |
QueryDefinition |
withFirstLoadStrategy(QueryDefinitionFirstLoadStrategy firstLoadStrategy)
Sets when a saved query should first be loaded and calculated. |
QueryDefinition |
withRecalcPriority(QueryDefinitionRecalcPriority recalcPriority)
Sets how soon a saved query is recalculated after data change. |
Methods inherited from interface com.hp.ucmdb.api.bundles.BundledResource |
---|
bundleNames, withBundles |
Method Detail |
---|
java.lang.String name()
java.lang.String description()
QueryDefinition withDescription(java.lang.String description)
description
- the description.
QueryNode addNode(java.lang.String nodeName)
ofType
or the strictlyOfType
method.
nodeName
- name of this node. The name must be unique in this query.QueryNode getNode(java.lang.String nodeName)
QueryLink getLink(java.lang.String linkName)
java.util.Map<java.lang.String,? extends QueryNode> nodes()
java.util.Map<java.lang.String,? extends QueryLink> links()
ExecutableQuery toExecutable()
TopologyQueryService.executeQuery(ExecutableQuery)
.
QueryDefinitionRecalcPriority recalcPriority()
QueryDefinition withRecalcPriority(QueryDefinitionRecalcPriority recalcPriority)
QueryDefinitionFirstLoadStrategy firstLoadStrategy()
QueryDefinition withFirstLoadStrategy(QueryDefinitionFirstLoadStrategy firstLoadStrategy)
java.lang.String debugDescription()
@NotFinalAPI QueryDefinition withBaseQueryName(java.lang.String baseQueryName)
baseQueryName
- name of the query that specifies the "universe" for this query to run on, or null to disable
this feature. May not be empty string.
ExecutableQuery.onTopOfQuery(java.lang.String)
@NotFinalAPI java.lang.String baseQueryName()
withBaseQueryName(String)
@NotFinalAPI boolean removeLink(java.lang.String linkName)
linkName
- the name of the link to remove.
@NotFinalAPI boolean removeNode(java.lang.String nodeName)
nodeName
- the name of the node to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |