com.hp.ucmdb.api.topology
Interface SingleQueryReferenceDefinition

All Superinterfaces:
BundledResource<QueryReferenceDefinition>, ContactNodeRestrictions<SingleQueryReferenceDefinition>, DataStoresConditionable<SingleQueryReferenceDefinition>, QueryReferenceDefinition<SingleQueryReferenceDefinition>

@NotFinalAPI
public interface SingleQueryReferenceDefinition
extends QueryReferenceDefinition<SingleQueryReferenceDefinition>, DataStoresConditionable<SingleQueryReferenceDefinition>, ContactNodeRestrictions<SingleQueryReferenceDefinition>

A single query reference definition holds a single base query name and, possibly, parameters and restrictions that should be used on that query.

There are two ways to define changes over a query:

  1. Parameters - if the original query defined named conditions, the queryParameters() can then be used to insert values into those conditions, or even replace a named condition completely.
  2. Restrictions - the restrictions() map allows defining restrictions per node name. A QueryNodeRestrictions object can be used to restrict a node to certain Ids, types or add additional property conditions.
A Query object with this definition returns the "flatten" QueryDefinition - with all restrictions and parameters already applied.

Note: While it is possible to define a query reference that does not add restrictions or parameters, it is useless to do so. Methods from the following interfaces refer to restrictions on the entire query:

Since:
UCMDB 9.0

Method Summary
 java.lang.String baseQueryName()
          The query this definition is referencing.
 QueryNodeRestrictions nodeRestrictions(java.lang.String nodeName)
          Creates or returns the node restrictions for the given node name.
 com.hp.ucmdb.api.topology.queryparameter.QueryParameters queryParameters()
          The query parameters this definition should use.
 java.util.Map<java.lang.String,QueryNodeRestrictions> restrictions()
          The map of restrictions.
 
Methods inherited from interface com.hp.ucmdb.api.topology.QueryReferenceDefinition
asMultipleReferencesWithFunctionDefinition, asSingleQueryReferenceDefinition, description, firstLoadStrategy, name, recalcPriority, referenceDefinitionType, toExecutable, withDescription, withFirstLoadStrategy, withRecalcPriority
 
Methods inherited from interface com.hp.ucmdb.api.bundles.BundledResource
bundleNames, withBundles
 
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.ContactNodeRestrictions
queriesRestrictingContactNodes, restrictAllContactNodesByQueries, restrictAllContactNodesByQueries
 

Method Detail

baseQueryName

java.lang.String baseQueryName()
The query this definition is referencing.

Returns:
The query this definition is referencing.

queryParameters

com.hp.ucmdb.api.topology.queryparameter.QueryParameters queryParameters()
The query parameters this definition should use.

Returns:
The query parameters this definition should use.

restrictions

java.util.Map<java.lang.String,QueryNodeRestrictions> restrictions()
The map of restrictions.

Returns:
the map of restrictions.

nodeRestrictions

QueryNodeRestrictions nodeRestrictions(java.lang.String nodeName)
Creates or returns the node restrictions for the given node name.

Parameters:
nodeName - the node name. A node with that name should exist in the base query.
Returns:
the restrictions structure.


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.