com.hp.ucmdb.api.topology
Interface QueryManagementService


@NotFinalAPI
public interface QueryManagementService


Method Summary
 Query deleteQuery(java.lang.String queryName)
          Deletes a query, query reference, or perspective application from the server.
 java.util.Collection<? extends Query> getAllQueries()
          Returns the entire queries list, including those not in the folders tree.
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getAllQueriesBundleNames()
          Returns a map from defined query name to a collection of its bundles' names.
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getBundleNamesToQueries()
          Returns a map from name of bundle to the collection of its bundled queries.
 TopologyQueryFactory getFactory()
           
 FoldersManagementSubService<QueryFolder,Query> getQueriesFoldersSubService()
          Returns the sub service for folder management.
 QueryFolder getQueriesTree()
          Returns the query folders tree.
 QueryChangeResult modifyQuery(QueryChangeCommand queryChangeCommand)
          Modifies an existing query according to the given command.
 java.lang.String registerQueryDependenciesChangeListener(QueryDependenciesChangeListener listener, QueryManagementListenerFilter filter)
          Registers a listener to be called when the dependencies of the query have changed.
 java.lang.String registerQueryManagementListener(QueryManagementListener listener, QueryManagementListenerFilter filter)
          Registers a listener to be called when query management change occurs.
 Query saveMultipleReferencesWithFunctionDefinition(MultipleReferencesWithFunctionDefinition queryReferenceDefinition)
          Deprecated. use saveQuery(QueryReferenceDefinition)
 void savePerspectiveApplication(java.lang.String topLevelName, java.util.List<java.util.Set<java.lang.String>> perspectiveHierarhcy, java.lang.String seedQueryName, QueryDefinitionRecalcPriority recalcPriority, QueryDefinitionFirstLoadStrategy firstLoadStrategy)
          Saves the perspective application of the perspective hierarchy over the seed query.
 Query saveQuery(QueryDefinition queryDefinition)
          Saves the query definition to the server, updating an existing query by the same name if such exists.
 Query saveQuery(QueryReferenceDefinition<?> queryReferenceDefinition)
          Saves the query reference definition to the server, updating an existing query by the same name if such exists.
 Query saveSingleQueryReferenceDefinition(SingleQueryReferenceDefinition queryReferenceDefinition)
          Deprecated. use saveQuery(QueryReferenceDefinition)
 void unregisterQueryDependenciesChangeListener(java.lang.String listenerId)
          Unregisters the query dependencies change listener.
 void unregisterQueryManagementListener(java.lang.String listenerId)
          Unregisters the query management listener.
 void validateBulk(QueryValidationBulk bulk)
           
 DependsOnQuery whoDependsOn(java.lang.String queryName)
           
 

Method Detail

getFactory

TopologyQueryFactory getFactory()

saveQuery

Query saveQuery(QueryDefinition queryDefinition)
Saves the query definition to the server, updating an existing query by the same name if such exists.

If a query by the same name exists, it is overwritten. If that query is attached to a folder, its position will remain the same. Otherwise, the query is created in the root folder.

Parameters:
queryDefinition - the definition to save.
Returns:
the previous query (already fully loaded), if any exists, or null (same as Map.put(K, V)).

saveQuery

Query saveQuery(QueryReferenceDefinition<?> queryReferenceDefinition)
Saves the query reference definition to the server, updating an existing query by the same name if such exists.

If a query by the same name exists, it is overwritten. If that query is attached to a folder, its position will remain the same. Otherwise, the query is created in the root folder.

Parameters:
queryReferenceDefinition - the definition to save.
Returns:
the previous query (already fully loaded), if any exists, or null (same as Map.put(K, V)).

saveSingleQueryReferenceDefinition

@Deprecated
@NotFinalAPI
Query saveSingleQueryReferenceDefinition(SingleQueryReferenceDefinition queryReferenceDefinition)
Deprecated. use saveQuery(QueryReferenceDefinition)


saveMultipleReferencesWithFunctionDefinition

@Deprecated
@NotFinalAPI
Query saveMultipleReferencesWithFunctionDefinition(MultipleReferencesWithFunctionDefinition queryReferenceDefinition)
Deprecated. use saveQuery(QueryReferenceDefinition)


savePerspectiveApplication

@NotFinalAPI
void savePerspectiveApplication(java.lang.String topLevelName,
                                            java.util.List<java.util.Set<java.lang.String>> perspectiveHierarhcy,
                                            java.lang.String seedQueryName,
                                            QueryDefinitionRecalcPriority recalcPriority,
                                            QueryDefinitionFirstLoadStrategy firstLoadStrategy)
Saves the perspective application of the perspective hierarchy over the seed query.

Perspectives are queries with at least one node defined as "perspective contact" node (PerspectiveContactable.setAsPerspectiveContact()). A perspective contact node is restricted by the "previous result" (see below) while the rest of the perspective is not restricted. This can allow perspectives to enrich the "previous result" with more information.

Perspectives are executed in partial order, defined by a List of Set. Each perspective from a specific "level" in the list (N) is restricted by the results of the unioned previous level (N-1). The results of all perspectives from the level are then unioned with the results of the previous level. The "zero-th" perspective "level" is the seed query.

The end result can be fetched by executing the query with the "top level name", which is the union of the top-most perspective level.

All of the perspectives and the seed query name must be saved before this operation.

While it is possible to define recalculation priority and first load strategy, the actual recaculation priority and first load strategy is the minimum of those given and those from the seed query.

You cannot parameterize a saved perspective application using ExecutableQuery.

Parameters:
topLevelName - the name of the top level union query. This name should be used to execute the perspective application.
perspectiveHierarhcy - the partial order of perspective query names.
seedQueryName - the seed query name.
recalcPriority - the recalculation prioirty of the entire perspective structure.
firstLoadStrategy - the first load strategy of the entire perspective structure.

deleteQuery

Query deleteQuery(java.lang.String queryName)
Deletes a query, query reference, or perspective application from the server.

If the query represents the top level query of a perspective application, the entire perspective application hierarhcy is deleted. In that case, the return value is of the top level query.

Parameters:
queryName - the query to delete.
Returns:
the previous query (already fully loaded) if the delete was successful, or null on failure (same as Map.remove(java.lang.Object)).

getQueriesTree

@NotFinalAPI
QueryFolder getQueriesTree()
Returns the query folders tree. The returned folder represents the root of the tree.


getBundleNamesToQueries

@NotFinalAPI
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getBundleNamesToQueries()
Returns a map from name of bundle to the collection of its bundled queries.


getAllQueriesBundleNames

@NotFinalAPI
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getAllQueriesBundleNames()
Returns a map from defined query name to a collection of its bundles' names.


getAllQueries

@NotFinalAPI
java.util.Collection<? extends Query> getAllQueries()
Returns the entire queries list, including those not in the folders tree.


getQueriesFoldersSubService

@NotFinalAPI
FoldersManagementSubService<QueryFolder,Query> getQueriesFoldersSubService()
Returns the sub service for folder management.

Returns:
the sub service for folder management.

registerQueryManagementListener

@NotFinalAPI
java.lang.String registerQueryManagementListener(QueryManagementListener listener,
                                                             QueryManagementListenerFilter filter)
Registers a listener to be called when query management change occurs.

Parameters:
listener - a listener to be called when a query management change occurs.
filter - filters query management changes.
Returns:
registration ID

unregisterQueryManagementListener

@NotFinalAPI
void unregisterQueryManagementListener(java.lang.String listenerId)
Unregisters the query management listener.

Parameters:
listenerId - registration ID of the listener

registerQueryDependenciesChangeListener

@NotFinalAPI
java.lang.String registerQueryDependenciesChangeListener(QueryDependenciesChangeListener listener,
                                                                     QueryManagementListenerFilter filter)
Registers a listener to be called when the dependencies of the query have changed.

Parameters:
listener - a listener to be called when the dependencies of the query have changed.
filter - filters the changes by name and/or bundles of a root resource (dependent).
Returns:
registration ID

unregisterQueryDependenciesChangeListener

@NotFinalAPI
void unregisterQueryDependenciesChangeListener(java.lang.String listenerId)
Unregisters the query dependencies change listener.

Parameters:
listenerId - registration ID of the listener

modifyQuery

@NotFinalAPI
QueryChangeResult modifyQuery(QueryChangeCommand queryChangeCommand)
Modifies an existing query according to the given command.

This API is different from the normal "get definition, modify, save" since it does not require the client to have any knowledge of the query internals or of its dependencies. This is the preferred way of changing a query that is not owned by the client.

Depending on the changes requested and the query type, more than one query may be modified. The return value holds the modified queries (before and after the change) with data already fetched from the server.

Parameters:
queryChangeCommand - the command. Can be created using TopologyQueryFactory.createQueryChangeCommand(String).
Returns:
the structure holding the changed queries, before and after the change.
Throws:
ExecutionException - if the change could not be made.

whoDependsOn

@NotFinalAPI
DependsOnQuery whoDependsOn(java.lang.String queryName)

validateBulk

@NotFinalAPI
void validateBulk(QueryValidationBulk bulk)


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