/** * Query for a document based on {@link ServiceDocument#documentSelfLink}. This is the same * operation of GET <code>documentSelfLink</code>. It is especially needed when a * {@link ServiceDocument} might not exist since using <code>GET</code> directly will timeout if * {@link ServiceDocument} doesn't exist. * * @param documentSelfLink * {@link ServiceDocument#documentSelfLink} of the document to be retrieved. * @param completionHandler * The completion handler to be called when the result is retrieved either with the * document or exception in case of error. The {@link ServiceDocument} might be null * if doesn't exists. */ public void queryDocument(String documentSelfLink, Consumer<ServiceDocumentQueryElementResult<T>> completionHandler) { queryUpdatedDocumentSince(-1, documentSelfLink, completionHandler); }
.queryUpdatedDocumentSince(0, state.documentSelfLink, (r) -> { if (r.hasException()) { logSevere("Can't query for system document: %s. Error: %s",
private List<ContainerDescription> queryDocumentUpdatedSince( long documentSinceUpdateTimeMicros, String documentSelfLink) throws Throwable { host.testStart(1); query.queryUpdatedDocumentSince(documentSinceUpdateTimeMicros, documentSelfLink, handler(true)); host.testWait(); return descs; }
private void poll(Consumer<SubscriptionNotification<T>> notificationHandler) { long currentDocumentUpdateTimeMicros = Utils.getNowMicrosUtc(); documentQuery .queryUpdatedDocumentSince( documentUpdateTimeMicros, subscribeForServiceLink,
host, ContainerState.class); queryHelper.queryUpdatedDocumentSince(0, missingContainer.documentSelfLink, (r) -> { if (r.hasException()) {