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 referenceDefinitionType() method.

Since:
UCMDB 9.0

Method Summary
 MultipleReferencesWithFunctionDefinition asMultipleReferencesWithFunctionDefinition()
          Returns this interface as a MultipleReferencesWithFunctionDefinition .
 SingleQueryReferenceDefinition asSingleQueryReferenceDefinition()
          Returns this interface as a SingleQueryReferenceDefinition.
 java.lang.String description()
          A human-readable description of the query definition purpose.
 QueryDefinitionFirstLoadStrategy firstLoadStrategy()
          The values that determines when a saved query should first be loaded and calculated.
 java.lang.String name()
          The name of the query definition.
 QueryDefinitionRecalcPriority recalcPriority()
          The value that determines how soon a saved query is recalculated after data change.
 QueryType referenceDefinitionType()
          Returns the type of this reference definition.
 ExecutableQuery toExecutable()
          Converts this query definition into an executable query object for passing to TopologyQueryService.executeQuery(ExecutableQuery).
 T withDescription(java.lang.String description)
          Sets a human-readable description of the query definition purpose.
 T withFirstLoadStrategy(QueryDefinitionFirstLoadStrategy firstLoadStrategy)
          Sets when a saved query should first be loaded and calculated.
 T 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

name

java.lang.String name()
The name of the query definition.

Returns:
The name of the query definition.

description

java.lang.String description()
A human-readable description of the query definition purpose.

Returns:
A human-readable description of the query definition purpose.

withDescription

T withDescription(java.lang.String description)
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(QueryDefinitionRecalcPriority)

withRecalcPriority

T withRecalcPriority(QueryDefinitionRecalcPriority recalcPriority)
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(QueryDefinitionFirstLoadStrategy)

withFirstLoadStrategy

T withFirstLoadStrategy(QueryDefinitionFirstLoadStrategy firstLoadStrategy)
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 to TopologyQueryService.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

SingleQueryReferenceDefinition asSingleQueryReferenceDefinition()
                                                                throws java.lang.ClassCastException
Returns this interface as a SingleQueryReferenceDefinition. Throws ClassCastException if the type from referenceDefinitionType() is not QueryType.SINGLE_REFERENCE

Returns:
this interface, cast to SingleQueryReferenceDefinition.
Throws:
java.lang.ClassCastException - if referenceDefinitionType() is not QueryType.SINGLE_REFERENCE.

asMultipleReferencesWithFunctionDefinition

MultipleReferencesWithFunctionDefinition asMultipleReferencesWithFunctionDefinition()
                                                                                    throws java.lang.ClassCastException
Returns this interface as a MultipleReferencesWithFunctionDefinition . Throws ClassCastException if the type from referenceDefinitionType() is not QueryType.MULTIPLE_REFERENCES_WITH_FUNCTION

Returns:
this interface, cast to MultipleReferencesWithFunctionDefinition.
Throws:
java.lang.ClassCastException - if referenceDefinitionType() is not QueryType.MULTIPLE_REFERENCES_WITH_FUNCTION.


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