/** * @return {@link ManagementContext#getManagementNodeUri()}, located in this utility class for convenience. */ public static Maybe<URI> getBrooklynWebUri(ManagementContext mgmt) { return mgmt.getManagementNodeUri(); }
protected void connectSensors() { URI webConsoleUri = getManagementContext().getManagementNodeUri().orNull(); sensors().set(WEB_CONSOLE_URI, webConsoleUri); if (webConsoleUri != null) { httpFeed = HttpFeed.builder() .entity(this) .period(200) .baseUri(webConsoleUri) .credentialsIfNotNull(getConfig(MANAGEMENT_USER), getConfig(MANAGEMENT_PASSWORD)) .poll(new HttpPollConfig<Boolean>(SERVICE_UP) .onSuccess(HttpValueFunctions.responseCodeEquals(200)) .setOnFailureOrException(false)) .build(); } else { sensors().set(SERVICE_UP, true); } }