Package com.hp.ucmdb.api.topology
Interface QueryManagementService
-
Method Summary
Modifier and TypeMethodDescriptiondeleteQuery
(String queryName) Deletes a query, query reference, or perspective application from the server.boolean
deleteQueryByName
(String queryName) Deletes a query, query reference, or perspective application from the server.Collection<? extends Query>
Returns the entire queries list, including those not in the folders tree.Returns a map from defined query name to a collection of its bundles' names.getAllQueriesFromBundles
(Set<String> bundles) Returns the entire queries list, including those not in the folders tree.Returns a map from name of bundle to the collection of its bundled queries.getBundleNamesToQueries
(Collection<String> bundleNames) Returns a map from name of bundle to the collection of its bundled queries.getBundleNamesToQueriesWithoutPermission
(Collection<String> bundleNames) Returns a map from name of bundle to the collection of its bundled queries without permissions.getFolderNode
(List<String> folderPath, String resourceType) Returns the sub service for folder management.Returns the query folders tree.getQueryDefinition
(String queryName) getQueryType
(String queryName) getResourcesUnderFolder
(List<String> folderPath, String resourceType, int start, int limit, boolean showEmptyFolder, List<String> bundles) getSearchResult
(String queryString) modifyQuery
(QueryChangeCommand queryChangeCommand) Modifies an existing query according to the given command.registerQueryDependenciesChangeListener
(QueryDependenciesChangeListener listener, QueryManagementListenerFilter filter) Registers a listener to be called when the dependencies of the query have changed.registerQueryDependenciesChangeListener
(QueryDependenciesChangeListener listener, QueryManagementListenerFilter filter, int port) Registers a listener to be called when the dependencies of the query have changed.registerQueryManagementListener
(QueryManagementListener listener, QueryManagementListenerFilter filter) Registers a listener to be called when query management change occurs.registerQueryManagementListener
(QueryManagementListener listener, QueryManagementListenerFilter filter, int port) Registers a listener to be called when query management change occurs.saveMultipleReferencesWithFunctionDefinition
(MultipleReferencesWithFunctionDefinition queryReferenceDefinition) Deprecated.void
savePerspectiveApplication
(String topLevelName, List<Set<String>> perspectiveHierarhcy, String seedQueryName, QueryDefinitionRecalcPriority recalcPriority, QueryDefinitionFirstLoadStrategy firstLoadStrategy) Saves the perspective application of the perspective hierarchy over the seed query.saveQuery
(QueryDefinition queryDefinition) Saves the query definition to the server, updating an existing query by the same name if such exists.saveQuery
(QueryReferenceDefinition<?> queryReferenceDefinition) Saves the query reference definition to the server, updating an existing query by the same name if such exists.Saves the query definition from XML string to the server, updating an existing query by the same name if such exists.saveSingleQueryReferenceDefinition
(SingleQueryReferenceDefinition queryReferenceDefinition) Deprecated.void
unregisterQueryDependenciesChangeListener
(String listenerId) Unregisters the query dependencies change listener.void
unregisterQueryDependenciesChangeListener
(String listenerId, int port) Unregisters the query dependencies change listener.void
unregisterQueryManagementListener
(String listenerId) Unregisters the query management listener.void
unregisterQueryManagementListener
(String listenerId, int port) Unregisters the query management listener.void
whoDependsOn
(String queryName)
-
Method Details
-
getFactory
TopologyQueryFactory getFactory() -
saveQuery
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
Saves the query definition from XML string 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. It is better to use this method when saving a query from XML, rather than loading a query definition from XML and than saving it.- Parameters:
str
- the definition XML string to save.- Returns:
- the previous query (already fully loaded), if any exists, or null (same as
Map.put(K, V)
).
-
saveQuery
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. -
saveMultipleReferencesWithFunctionDefinition
@Deprecated @NotFinalAPI Query saveMultipleReferencesWithFunctionDefinition(MultipleReferencesWithFunctionDefinition queryReferenceDefinition) Deprecated. -
savePerspectiveApplication
@NotFinalAPI void savePerspectiveApplication(String topLevelName, List<Set<String>> perspectiveHierarhcy, 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
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)
).
-
deleteQueryByName
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 hierarchy is deleted. In that case, the return value is of the top level query.- Parameters:
queryName
- the query to delete.- Returns:
- true if a view was deleted, false if it was not found.
-
getQueriesTree
Returns the query folders tree. The returned folder represents the root of the tree. -
getBundleNamesToQueries
Returns a map from name of bundle to the collection of its bundled queries. -
getBundleNamesToQueries
Returns a map from name of bundle to the collection of its bundled queries. -
getBundleNamesToQueriesWithoutPermission
@NotFinalAPI Map<String,Collection<String>> getBundleNamesToQueriesWithoutPermission(Collection<String> bundleNames) Returns a map from name of bundle to the collection of its bundled queries without permissions. -
getAllQueriesBundleNames
Returns a map from defined query name to a collection of its bundles' names. -
getAllQueries
Returns the entire queries list, including those not in the folders tree. -
getAllQueriesFromBundles
Returns the entire queries list, including those not in the folders tree.- Parameters:
bundles
- the names of the bundles- Returns:
- the queries from the given bundles
-
getQueriesFoldersSubService
Returns the sub service for folder management.- Returns:
- the sub service for folder management.
-
registerQueryManagementListener
@NotFinalAPI 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
-
registerQueryManagementListener
@NotFinalAPI String registerQueryManagementListener(QueryManagementListener listener, QueryManagementListenerFilter filter, int port) 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.port
- port number- Returns:
- registration ID
-
unregisterQueryManagementListener
Unregisters the query management listener.- Parameters:
listenerId
- registration ID of the listener
-
unregisterQueryManagementListener
Unregisters the query management listener.- Parameters:
listenerId
- registration ID of the listenerport
- port number
-
registerQueryDependenciesChangeListener
@NotFinalAPI 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
-
registerQueryDependenciesChangeListener
@NotFinalAPI String registerQueryDependenciesChangeListener(QueryDependenciesChangeListener listener, QueryManagementListenerFilter filter, int port) 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).port
- port number- Returns:
- registration ID
-
unregisterQueryDependenciesChangeListener
Unregisters the query dependencies change listener.- Parameters:
listenerId
- registration ID of the listener
-
unregisterQueryDependenciesChangeListener
Unregisters the query dependencies change listener.- Parameters:
listenerId
- registration ID of the listenerport
- port number
-
modifyQuery
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 usingTopologyQueryFactory.createQueryChangeCommand(String)
.- Returns:
- the structure holding the changed queries, before and after the change.
- Throws:
ExecutionException
- if the change could not be made.
-
whoDependsOn
-
validateBulk
-
getQueryType
-
getQueryDefinition
-
getSearchResult
-
getResourcesUnderFolder
-
getFolderNode
-
saveQuery(QueryReferenceDefinition)