|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QueryNode
A node in the query definition.
A node in the query definition may add CIs to the result, be used to constraint the result or both.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.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
Method Summary | |
---|---|
java.util.Collection<QueryLink<?>> |
getQueryLinks()
Returns the all the links (incoming and outgoing) that relate to this node. |
com.hp.ucmdb.api.topology.indirectlink.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. |
com.hp.ucmdb.api.topology.indirectlink.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. |
java.lang.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). |
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. |
com.hp.ucmdb.api.topology.reachableset.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. |
com.hp.ucmdb.api.topology.reachableset.EmptyReachableSetStep |
withReachableSetStep()
Creates an incomplete reachable set step, which is completed using a from condition, a to condition and a link condition. |
Methods inherited from interface com.hp.ucmdb.api.topology.TypeConditionable |
---|
isTypeStrict, noDerivedTypes, ofConfigurationItemType, ofITWorldType, ofType, strictlyOfType, type |
Methods inherited from interface com.hp.ucmdb.api.topology.IdConditionable |
---|
ids, withIds, withIds, withIdsFromStrings, withIdsFromStrings, withIdsOf, withIdsOf |
Methods inherited from interface com.hp.ucmdb.api.topology.PropertiesConditionable |
---|
propertiesCondition, propertiesConditionBuilder, property, property, property, withPropertiesConditions |
Methods inherited from interface com.hp.ucmdb.api.topology.DataStoresConditionable |
---|
dataStores, isAllDataStores, isInternalDataStoreOnly, withAllDataStores, withDataStores, withDataStores, withInternalDataStoreOnly |
Methods inherited from interface com.hp.ucmdb.api.topology.PropertiesCarrier |
---|
getDefaultPropertiesToQuery, getPropertiesToQueryPerType, propertiesToQuery, queryKeyProperties, queryProperties, queryPropertiesWithQualifier, queryProperty |
Methods inherited from interface com.hp.ucmdb.api.topology.SupportsInvisibility |
---|
invisible, isInvisible |
Methods inherited from interface com.hp.ucmdb.api.topology.InterQueryRestrictableElement |
---|
addInterQueryElementRestrictions, addInterQueryElementRestrictions, interQueryElementRestrictions |
Methods inherited from interface com.hp.ucmdb.api.topology.QualifierConditionable |
---|
qualifierMatchingStrategy, qualifiersRestrictiedTo, restrictToQualifiers, restrictToQualifiers, withQualifierMatchingStrategy |
Methods inherited from interface com.hp.ucmdb.api.topology.PerspectiveContactable |
---|
isPerspectiveContact, setAsPerspectiveContact |
Method Detail |
---|
java.lang.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
).
linkedFrom(com.hp.ucmdb.api.topology.QueryNode)
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);
linkedTo(com.hp.ucmdb.api.topology.QueryNode)
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
).
linkedTo(com.hp.ucmdb.api.topology.QueryNode)
DirectLink linkedFrom(QueryNode otherNode)
otherNode
.
nodeA.linkedFrom(nodeB);
is equivalent to nodeB.linkedTo(nodeA);
linkedTo(com.hp.ucmdb.api.topology.QueryNode)
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);
linkedFrom(com.hp.ucmdb.api.topology.QueryNode)
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);
.
linkedFrom(com.hp.ucmdb.api.topology.QueryNode)
DirectLink notLinkedTo(QueryNode otherNode)
otherNode
.
Equivalent to: thisNode.linkedTo(otherNode).withSourceCardinality(0,0).withTargetCardinality(0,0);
linkedTo(com.hp.ucmdb.api.topology.QueryNode)
DirectLink notLinkedFrom(QueryNode otherNode)
otherNode
.
Equivalent to:thisNode.linkedFrom(otherNode).withSourceCardinality(0,0).withTargetCardinality(0,0);
linkedFrom(com.hp.ucmdb.api.topology.QueryNode)
com.hp.ucmdb.api.topology.indirectlink.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
).
com.hp.ucmdb.api.topology.indirectlink.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)...
- Returns:
- the indirect link.
- See Also:
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)
java.util.Collection<QueryLink<?>> getQueryLinks()
ConditionExpression<LinkConditionElement,LinkConditionOperand> queryLinkConditions()
withQueryLinkConditions(com.hp.ucmdb.api.topology.ConditionExpression)
QueryNode withQueryLinkConditions(ConditionExpression<LinkConditionElement,LinkConditionOperand> conditionExpression)
queryLinkConditions()
,
getQueryLinks()
,
linksConditionsBuilder().
LinkConditionBuilder linksConditionsBuilder()
withQueryLinkConditions(com.hp.ucmdb.api.topology.ConditionExpression)
com.hp.ucmdb.api.topology.reachableset.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
com.hp.ucmdb.api.topology.reachableset.ReachableSetDefinition reachableSetDefinition()
withReachableSetStep()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |