@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
protected void doLogging(Level level, Supplier<String> messageSupplier) { Logger lg = Logger.getLogger(this.getClass().getName()); if (!lg.isLoggable(level)) { return; } URI uri; String classOrUri = this.host != null && this.selfLink != null && (uri = getUri()) != null ? uri.toString() : this.getClass().getSimpleName(); Utils.log(lg, 3, classOrUri, level, messageSupplier); }
s.documentExpirationTimeMicros = Utils.getNowMicrosUtc(); o.setBody(s); }, factoryService.getUri()); this.host.getServiceState(null, ServiceDocumentQueryResult.class, factoryService.getUri()); Set<String> deletedServiceStats = new HashSet<>(); ServiceStats factoryStats = this.host.getServiceState(null, ServiceStats.class, UriUtils.buildStatsUri(factoryService.getUri())); for (String statName : factoryStats.entries.keySet()) { if (statName.startsWith(factoryLink)) {
s.documentExpirationTimeMicros = Utils.getNowMicrosUtc(); o.setBody(s); }, factoryService.getUri()); this.host.getServiceState(null, ServiceDocumentQueryResult.class, factoryService.getUri()); Set<String> deletedServiceStats = new HashSet<>(); ServiceStats factoryStats = this.host.getServiceState(null, ServiceStats.class, UriUtils.buildStatsUri(factoryService.getUri())); for (String statName : factoryStats.entries.keySet()) { if (statName.startsWith(factoryLink)) {
this.uri = super.getUri();
private ServiceSubscriber createAndStartNotificationTarget( String link, Function<Operation, Boolean> h) throws Throwable { StatelessService notificationTarget = createNotificationTargetService(h); // Start notification target (shared between subscriptions) Operation startOp = Operation .createPost(UriUtils.buildUri(this.host, link)) .setCompletion(this.host.getCompletion()) .setReferer(this.host.getReferer()); this.host.testStart(1); this.host.startService(startOp, notificationTarget); this.host.testWait(); ServiceSubscriber sr = new ServiceSubscriber(); sr.reference = notificationTarget.getUri(); return sr; }
private ServiceSubscriber createAndStartNotificationTarget( String link, Function<Operation, Boolean> h) throws Throwable { StatelessService notificationTarget = createNotificationTargetService(h); // Start notification target (shared between subscriptions) Operation startOp = Operation .createPost(UriUtils.buildUri(this.host, link)) .setCompletion(this.host.getCompletion()) .setReferer(this.host.getReferer()); this.host.testStart(1); this.host.startService(startOp, notificationTarget); this.host.testWait(); ServiceSubscriber sr = new ServiceSubscriber(); sr.reference = notificationTarget.getUri(); return sr; }
.setAction(Action.DELETE); serviceHost.stopSubscriptionService(unSubscribe, notificationTarget.getUri()); this.host.testWait(unSubscribeCtx); this.verifySubscriberCount(new URI[] { uri }, 0);
.setAction(Action.DELETE); serviceHost.stopSubscriptionService(unSubscribe, notificationTarget.getUri()); this.host.testWait(unSubscribeCtx); this.verifySubscriberCount(new URI[] { uri }, 0);