Package com.hp.ucmdb.api.topology
Interface LiveQuery
public interface LiveQuery
Live query is a query whose result is always kept updated.
This interface allows retrieving the query result and tracking changes over the result.
After getting the result for the first time, one can track changes over this query result,
using the hasChanges and getChanges methods.
-
Method Summary
Modifier and TypeMethodDescriptiongetChanges
(QueryResultVersion queryResultVersion) returns the changes in the result of the query since the result had the given result version Notice that there may be cases where has changes returned true, but get changes will return empty changes since it accumulates changes, for example, if certain object was added and than was removedgetName()
The name of the query.Gets the result of the query.boolean
hasChanges
(QueryResultVersion queryResultVersion) Determines whether there are changes in the result of the query since the result had the given result version.Unregisters live query listener.void
setChunkKeepingPeriod
(int chunkKeepingPeriodInSeconds) Defines the time that a chunk is available.void
setMaxChunkSize
(int maxChunkSize) Defines a limit for maximum elements per chunk fromgetQueryResult
.void
Registers a listener to be called when the result of the query changes.withDataIntegrityRulesBundle
(String dataIntegrityRulesBundle)
-
Method Details
-
getName
String getName()The name of the query. -
getQueryResult
Gets the result of the query.- Returns:
- Topology with version that allows to track changes in the query result
- Throws:
UcmdbException
- Since:
- 9.0
- See Also:
-
hasChanges
Determines whether there are changes in the result of the query since the result had the given result version.- Parameters:
queryResultVersion
- the version of the result.- Returns:
- true if there were changes.
- Throws:
UcmdbException
-
getChanges
QueryResultChange getChanges(QueryResultVersion queryResultVersion) throws FullSyncRequiredException, UcmdbException returns the changes in the result of the query since the result had the given result version Notice that there may be cases where has changes returned true, but get changes will return empty changes since it accumulates changes, for example, if certain object was added and than was removed- Parameters:
queryResultVersion
-- Returns:
- the changes in the result of the query since the result had the given result version
- Throws:
FullSyncRequiredException
UcmdbException
-
setMaxChunkSize
void setMaxChunkSize(int maxChunkSize) Defines a limit for maximum elements per chunk fromgetQueryResult
. If the result is larger than this limit, query the LiveTopology as to whether there are more chunks, and retrieve these chunks usinggetNextChunk
. -
withDataIntegrityRulesBundle
-
setChunkKeepingPeriod
void setChunkKeepingPeriod(int chunkKeepingPeriodInSeconds) Defines the time that a chunk is available. After this time period, the chunk is disposed of.- Parameters:
chunkKeepingPeriodInSeconds
- time to keep the chunk in seconds
-
setQueryResultListener
Registers a listener to be called when the result of the query changes. There may be a delay of several minutes between the change in topology and the notification. The length of the delay depends on the query's priority and other factors.- Parameters:
listener
- client-side implementation of the listener interface- Since:
- 9.0
-
removeQueryResultListener
Unregisters live query listener.- Throws:
UcmdbException
- Since:
- 9.0
-