public interface QueryNode extends TypeConditionable<QueryNode>, IdConditionable<QueryNode,CI>, PropertiesConditionable<QueryNode>, DataStoresConditionable<QueryNode>, PropertiesCarrier<QueryNode>, SupportsInvisibility<QueryNode>, InterQueryRestrictableElement<QueryNode>, QualifierConditionable<QueryNode>, PerspectiveContactable<QueryNode>, ComplexTypeConditionHandler<QueryNode>, SupportsClientProperties<QueryNode>
name()
).type
, with all of its derived types or with the specific type only
.
The type places a class constraint on the CIs that may match this node.property
method. More complex properties condition tree
can be built using the properties condition builder
.IDs condition
, which limits the CIs matching to a specific set.Invisibility status
- an invisible query node acts only as a condition on its connected
query nodes, while a visible node both acts as a condition and possibly enriches the result with (one or more)
CI
s.explicitely
or by
grouping qualifier
. By default, CIs in the result do not have properties.reachable set definition
, which may add more CIs and relations to the result
topology, based on valid steps.complex type conditions
which specifies a complex conditions
on the type of the query element. Each complex condition
can add or remove class
types to be matched in the result. NOTE: The type of the node can be ignored for the results if needed. Just
create a complex condition
and declare this type
to be ignored
in the result.
In this case, the results will only be matched to the complex type conditions
and
not to the type of the node.query links
attached to it,
specifying topological conditions between CIs (for example, "show all Nodes with at least one IP address").
These links can either be defined by the query node itself, or linked from another query node.
These links act either as:
link conditions expression tree
which specifies the induced
conditions from the links that are connected to it.linkedTo()
and similar methods are added with
an "and" condition to the existing tree, and with "cardinality" conditions that say "A CI matching this query node
will appear only if there is at least one link attached to it in the correct direction that matches all
other conditions (those from QueryLink and those from the QueryNode "other side").rewrite
the entire links expression tree. This
enables
Modifier and Type | Method and Description |
---|---|
Collection<QueryLink<?>> |
getQueryLinks()
Returns the all the links (incoming and outgoing) that relate to this node.
|
IndirectLink |
indirectlyLinkedFrom(QueryNode otherNode)
Creates a query link specifying that there is are one ore more paths of defined steps
(source CI, link, target CI) between results (CIs) of
otherNode> and the results of this node. |
IndirectLink |
indirectlyLinkedTo(QueryNode otherNode)
Creates a query link specifying that there are a one ore more paths of defined steps
(source CI, link, target CI) between results (CIs) of this node and results of the
otherNode . |
DirectLink |
linkedFrom(QueryNode otherNode)
Creates a query link specifying that results (CIs) from this node are the end2 of some real-world relationship
to results from node
otherNode . |
IncompleteLinkOnPropertyP1 |
linkedOnPropertyFrom(QueryNode otherNode)
Creates a query link specifying that a link (Relation) be created in the result such that a specific property
in a CI from the given node's results has has either an "equal" or "not equal" relation to a specific property
of a CI from the this node's results.
|
IncompleteLinkOnPropertyP1 |
linkedOnPropertyTo(QueryNode otherNode)
Creates a query link specifying that a link (Relation) be created in the result such that a specific property
in a CI from this node's results has either an "equal" or "not equal" relation to a specific property
of a CI from the target node's results.
|
DirectLink |
linkedTo(QueryNode otherNode)
Creates a query link that specifies that the results (CIs) from this QueryNode have some real-world
relationship (existance or absence of Relations) to the results from another QueryNode.
|
LinkConditionBuilder |
linksConditionsBuilder()
Returns a builder that can be used to build query links expression trees.
|
String |
name()
The name of this element in the query definition it belongs to.
|
DirectLink |
notLinkedFrom(QueryNode otherNode)
Creates a condition specifying that CIs matching this node are not linked from any CIs matching
otherNode . |
DirectLink |
notLinkedTo(QueryNode otherNode)
Creates a condition specifying that CIs matching this node are not linked to any CIs matching
otherNode . |
DirectLink |
optionallyLinkedFrom(QueryNode otherNode)
Similar to
linkedFrom , except this method adds the link with an "and at least zero
links" ("and" with cardinality 0..UNBOUNDED) condition to the target of the link (this node). |
DirectLink |
optionallyLinkedTo(QueryNode otherNode)
Similar to
linkedTo , except this method adds the link with an "and at least zero links"
("and" with cardinality 0..UNBOUNDED) condition to the source of the link (this node). |
DirectLink |
orLinkedFrom(QueryNode otherNode)
Similar to
linkedFrom , except this method adds the link with an "or at least one
link" ("or" with cardinality 1..UNBOUNDED) condition to the target of the link (this node). |
DirectLink |
orLinkedTo(QueryNode otherNode)
Similar to
linkedTo , except this method adds the link with an "or at least one link"
("or" with cardinality 1..UNBOUNDED) condition to the source of the link (this node). |
QueryNode |
queryConcreteProperties()
Adds all the concrete properties of the CI to the list of properties to query.
|
ConditionExpression<LinkConditionElement,LinkConditionOperand> |
queryLinkConditions()
Returns the current links expression conditions tree for this node, or null if there are no links attached to
this node.
|
QueryNode |
queryPathToConcreteProperties()
Adds all the concrete properties of the CI to the list of properties to query, in addition to the concrete
properties of all CI types along the path in the class model hierarchy between the CI-type in the TQL query
(defined by ofType(String) method) and the CI-type of the CI instance.
|
ReachableSetDefinition |
reachableSetDefinition()
Returns the previously defined reachable set, or a new one if none exists.
If a reachable set has no steps, it has no effect on the result. |
QueryNode |
withQueryLinkConditions(ConditionExpression<LinkConditionElement,LinkConditionOperand> conditionExpression)
Sets a new links expression condition tree for this node.
A validation error will occur if the new expression tree does not have at least one instance of every query link (incoming and outgoing) that relates to this node. |
EmptyReachableSetStep |
withReachableSetStep()
Creates an incomplete reachable set step, which is completed using a from condition, a to condition and a link
condition.
|
isTypeStrict, noDerivedTypes, ofConfigurationItemType, ofITWorldType, ofType, strictlyOfType, type
ids, withIds, withIds, withIdsFromStrings, withIdsFromStrings, withIdsOf, withIdsOf
propertiesCondition, propertiesConditionBuilder, property, property, property, withPropertiesConditions
dataStores, isAllDataStores, isInternalDataStoreOnly, withAllDataStores, withDataStores, withDataStores, withInternalDataStoreOnly
excludedProperties, excludeProperties, excludeProperty, getDefaultPropertiesToQuery, getPropertiesToQueryPerType, isPropertiesCarrierEmpty, propertiesCarrierBehavior, propertiesToQuery, queryKeyProperties, queryProperties, queryPropertiesWithQualifier, queryProperty, withPropertiesCarrierBehavior
invisible, isInvisible
addInterQueryElementRestrictions, addInterQueryElementRestrictions, interQueryElementRestrictions
qualifierMatchingStrategy, qualifiersRestrictiedTo, restrictToQualifiers, restrictToQualifiers, withQualifierMatchingStrategy
isPerspectiveContact, setAsPerspectiveContact
complexTypeConditionsSet, withComplexTypeCondition
clientProperties, clientProperty, usedNamespaces, withClientProperty
String name()
DirectLink linkedTo(QueryNode otherNode)
QueryLink
object)
and as a setter method (setting the new condition to be the link condition of this node).
thisNode.linkedTo(myNode).withLinkOfType("link type").atLeast(2)
sets:
thisNode
. CIs will be matched to thisNode
if
they have a relation of type "link type"
to at least two CIs matching myNode
and satisfying all other conditions set on thisNode
.myNode
. CIs match myNode
if they have a relation of "link type"
to at least least one CI matching thisNode
and satisfying all other conditions set on myNode
). This can be changed using
target cardinality
methods.
DirectLink
(as described above)
to appear in the result topology. This can be changed using the invisible
method.ofType
,
strictlyOfType
or ofConfigurationItemType
.
If the type is not specified, the query is invalid.
This link is added as an "and at least one link" condition ("and" with cardinality 1..UNBOUNDED) to both
source and target ends of the link (this node and the otherNode
).DirectLink optionallyLinkedTo(QueryNode otherNode)
linkedTo
, except this method adds the link with an "and at least zero links"
("and" with cardinality 0..UNBOUNDED) condition to the source of the link (this node). The link is
added as an "and at least one link" ("and" with cardinality 1..UNBOUNDED) to its target (the otherNode
).
nodeA.optionallyLinkedTo(nodeB);
is equivalent to
nodeA.linkedTo(nodeA).withSourceCardinality(0, QueryLink.UNBOUNDED);
DirectLink orLinkedTo(QueryNode otherNode)
linkedTo
, except this method adds the link with an "or at least one link"
("or" with cardinality 1..UNBOUNDED) condition to the source of the link (this node). The link is
added as an "and at least one link" ("and" with cardinality 1..UNBOUNDED) to its target (the otherNode
).DirectLink linkedFrom(QueryNode otherNode)
otherNode
.
nodeA.linkedFrom(nodeB);
is equivalent to nodeB.linkedTo(nodeA);
DirectLink optionallyLinkedFrom(QueryNode otherNode)
linkedFrom
, except this method adds the link with an "and at least zero
links" ("and" with cardinality 0..UNBOUNDED) condition to the target of the link (this node). The link is
added as an "and at least one link" ("and" with cardinality 1..UNBOUNDED) to its source (the otherNode
).
nodeA.optionallyLinkedFrom(nodeB);
is equivalent to
nodeA.linkedFrom(nodeB).withTargetCardinality(0, QueryLink.UNBOUNDED);
which is also equivalent to
nodeB.linkedTo(nodeA).withTargetCardinality(0, QueryLink.UNBOUNDED);
DirectLink orLinkedFrom(QueryNode otherNode)
linkedFrom
, except this method adds the link with an "or at least one
link" ("or" with cardinality 1..UNBOUNDED) condition to the target of the link (this node). The link is
added as an "and at least one link" ("and" with cardinality 1..UNBOUNDED) to its source (the otherNode
).
Note: nodeA.orLinkedFrom(nodeB);
is NOT equivalent to nodeB.orLinkedTo(nodeA);
.DirectLink notLinkedTo(QueryNode otherNode)
otherNode
.
Equivalent to: thisNode.linkedTo(otherNode).withSourceCardinality(0,0).withTargetCardinality(0,0);
DirectLink notLinkedFrom(QueryNode otherNode)
otherNode
.
Equivalent to:thisNode.linkedFrom(otherNode).withSourceCardinality(0,0).withTargetCardinality(0,0);
IndirectLink indirectlyLinkedTo(QueryNode otherNode)
otherNode
.
Calling:app.indirectlyLinkedTo(host). withStep().from("app").to("service").alongITWorldLink(). andStep().from("service").to("host").alongITWorldLink(). andStep().from("service").to("service").alongITWorldLink(). andStep().from("app").to("host").alongITWorldLink();causes a relation to be created in the result if a result app is directly connected to host or if there is a path app->service(->service->service...)->host. An indirect link with no steps is invalid. This link is added as an "and at least one link" condition ("and" with cardinality 1..UNBOUNDED) to both source and target of the link (this node and the
otherNode
).IndirectLink indirectlyLinkedFrom(QueryNode otherNode)
otherNode> and the results of this node.
This link is added as an "and at least one link" condition ("and" with cardinality 1..UNBOUNDED) to both
source and target of the link (this node and the otherNode
).
nodeA.indirectlyLinkedFrom(nodeB)...
is equivalent to nodeB.indirectlyLinkedTo(nodeA)...
indirectlyLinkedTo(com.hp.ucmdb.api.topology.QueryNode)
IncompleteLinkOnPropertyP1 linkedOnPropertyTo(QueryNode otherNode)
network.linkedOnPropertyTo(ip).whenSourceProperty("network_netaddr").isEqualToTargetProperty("ip_netaddr");causes a relation to be created between CI1 (network) and CI2 (ip) if CI1.network_netaddr = CI2.ip_netaddr. This link is added as an "and at least one link" condition ("and" with cardinality 1..UNBOUNDED) to both source and target of the link (this node and the
otherNode
).IncompleteLinkOnPropertyP1 linkedOnPropertyFrom(QueryNode otherNode)
otherNode
).
nodeA.linkedOnPropertyFrom(nodeB)...
is equivalent to nodeB.linkedOnPropertyTo(nodeA)...
linkedOnPropertyFrom(QueryNode)
Collection<QueryLink<?>> getQueryLinks()
ConditionExpression<LinkConditionElement,LinkConditionOperand> queryLinkConditions()
QueryNode withQueryLinkConditions(ConditionExpression<LinkConditionElement,LinkConditionOperand> conditionExpression)
LinkConditionBuilder linksConditionsBuilder()
EmptyReachableSetStep withReachableSetStep()
//service is a QueryNode. service.ofType("logical_service"). withReachableSetStep().from("logical_service").to("business").alongAnyLink(). andStep().from("business").to("software_element").alongAnyLink(). andStep().from("host").to("software_element").againstAnyLink(). andReachableSetDefinition().withMaxNumberOfStepsMatched(4);In the above example, the steps are searched, combining up to four steps back-to-back. The initial sources are the CIs matching this QueryNode. Afterwards, each step "to" can be a source for another step.
Service1 | -------------------------------------------- | | | depends on | depends on | | Application1 Server5 | --------------------- | | | contains | depends on | | Application2 Server5 | | contains | Server4Where "Service1" is a CI that was matched by this QueryNode, and every other CI was matched by a step from the previous source CI, up to 4 steps. In addition, the
.containingQueryNode()
at the end returns this
QueryNode
object, allowing for more conditions to be specified.
Calling this method a second time results in adding another step to the already defined reachable set.
Any properties to query
EmptyReachableSetStep
,
ReachableSetStepFromPart
,
ReachableSetStepToPart
,
ReachableSetStepLinkPart
,
ReachableSetDefinition
ReachableSetDefinition reachableSetDefinition()
withReachableSetStep()
QueryNode queryConcreteProperties()
ClassDefinition.getDeclaredAttributes()
QueryNode queryPathToConcreteProperties()
Documentation Feedback
Copyright 2011 - 2018 Micro Focus or one of its affiliates.