Package com.hp.ucmdb.api.topology
Interface QueryReferenceDefinition<T extends QueryReferenceDefinition>
- All Superinterfaces:
BundledResource<QueryReferenceDefinition>
- All Known Subinterfaces:
MultipleReferencesWithFunctionDefinition
,SingleQueryReferenceDefinition
@NotFinalAPI
public interface QueryReferenceDefinition<T extends QueryReferenceDefinition>
extends BundledResource<QueryReferenceDefinition>
Parent interface for reference definitions.
Reference definitions rely on other queries which may be reference or "regular".
References act recursively, but not in a cycle.
If the original query changes, the reference definition is updated.
The query or queries the reference definition relies on are called "base queries".
The reference definition is sometimes called "QueryRef". The actual details of the relation between the reference query and the base query depend on the definition used, which can be learned using the
The reference definition is sometimes called "QueryRef". The actual details of the relation between the reference query and the base query depend on the definition used, which can be learned using the
referenceDefinitionType()
method.- Since:
- UCMDB 9.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns this interface as a MultipleReferencesWithFunctionDefinition .Returns this interface as a SingleQueryReferenceDefinition.A human-readable description of the query definition purpose.The values that determines when a saved query should first be loaded and calculated.name()
The name of the query definition.The value that determines how soon a saved query is recalculated after data change.Returns the type of this reference definition.Converts this query definition into an executable query object for passing toTopologyQueryService.executeQuery(ExecutableQuery)
.withDescription
(String description) Sets a human-readable description of the query definition purpose.withFirstLoadStrategy
(QueryDefinitionFirstLoadStrategy firstLoadStrategy) Sets when a saved query should first be loaded and calculated.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 Details
-
name
String name()The name of the query definition.- Returns:
- The name of the query definition.
-
description
String description()A human-readable description of the query definition purpose.- Returns:
- A human-readable description of the query definition purpose.
-
withDescription
Sets a human-readable description of the query definition purpose.- Parameters:
description
- the description.- Returns:
- this object for method chaining.
-
recalcPriority
QueryDefinitionRecalcPriority recalcPriority()The value that determines how soon a saved query is recalculated after data change.- Returns:
- the value that determines how soon a saved query is recalculated after data change.
- See Also:
-
withRecalcPriority
Sets how soon a saved query is recalculated after data change. This applies only to saved queries. Query definitions that are executed 'ad-hoc' ignore this parameter. The default is QueryDefinitionRecalcPriority.LOW. The recalcPriority value cannot be higher than the referenced query or queries. -
firstLoadStrategy
QueryDefinitionFirstLoadStrategy firstLoadStrategy()The values that determines when a saved query should first be loaded and calculated.- Returns:
- The values that determines when a saved query should first be loaded and calculated.
- See Also:
-
withFirstLoadStrategy
Sets when a saved query should first be loaded and calculated. This applies only to saved queries. Query definitions that are executed 'ad-hoc' ignore this parameter. The default is QueryDefinitionFirstLoadStrategy.LOAD_ON_FIRST_REQUEST. The firstLoadStrategy value used cannot be higher than the referenced query or queries. -
toExecutable
ExecutableQuery toExecutable()Converts this query definition into an executable query object for passing toTopologyQueryService.executeQuery(ExecutableQuery)
. -
referenceDefinitionType
QueryType referenceDefinitionType()Returns the type of this reference definition. This method never returns QueryType.DEFINITION_BASED.- Returns:
- the reference definition type.
-
asSingleQueryReferenceDefinition
Returns this interface as a SingleQueryReferenceDefinition. Throws ClassCastException if the type fromreferenceDefinitionType()
is not QueryType.SINGLE_REFERENCE- Returns:
- this interface, cast to SingleQueryReferenceDefinition.
- Throws:
ClassCastException
- ifreferenceDefinitionType()
is not QueryType.SINGLE_REFERENCE.
-
asMultipleReferencesWithFunctionDefinition
MultipleReferencesWithFunctionDefinition asMultipleReferencesWithFunctionDefinition() throws ClassCastExceptionReturns this interface as a MultipleReferencesWithFunctionDefinition . Throws ClassCastException if the type fromreferenceDefinitionType()
is not QueryType.MULTIPLE_REFERENCES_WITH_FUNCTION- Returns:
- this interface, cast to MultipleReferencesWithFunctionDefinition.
- Throws:
ClassCastException
- ifreferenceDefinitionType()
is not QueryType.MULTIPLE_REFERENCES_WITH_FUNCTION.
-