/** * Gets the options for configuring the server side trust anchor. * <p> * This implementation returns the options returned by {@link AbstractConfig#getTrustOptions()} if not {@code null}. * Otherwise, it returns trust options for verifying a client certificate's validity period. * * @return The trust options. */ @Override protected TrustOptions getServerTrustOptions() { return Optional.ofNullable(getConfig().getTrustOptions()) .orElseGet(() -> { if (getConfig().isAuthenticationRequired()) { return new ValidityBasedTrustOptions(); } else { return null; } }); }
/** * Gets the options for configuring the server side trust anchor. * <p> * This implementation returns the options returned by {@link AbstractConfig#getTrustOptions()} if not {@code null}. * Otherwise, it returns trust options for verifying a client certificate's validity period. * * @return The trust options. */ @Override protected TrustOptions getServerTrustOptions() { return Optional.ofNullable(getConfig().getTrustOptions()) .orElseGet(() -> { if (getConfig().isAuthenticationRequired()) { return new ValidityBasedTrustOptions(); } else { return null; } }); }
/** * Registers a health check procedure which tries to run an action on the protocol adapter context. * If the protocol adapter vert.x event loop is blocked, the health check procedure will not complete * with OK status within the defined timeout. * * @param handler The health check handler to register the checks with. */ protected void registerEventLoopBlockedCheck(final HealthCheckHandler handler) { handler.register("event-loop-blocked-check", getConfig().getEventLoopBlockedCheckTimeout(), procedure -> { final Context currentContext = Vertx.currentContext(); if (currentContext != context) { context.runOnContext(action -> { procedure.complete(Status.OK()); }); } else { LOG.info("Protocol Adapter - HealthCheck Server context match. Assume protocol adapter is alive."); procedure.complete(Status.OK()); } }); }
/** * Registers a health check procedure which tries to run an action on the protocol adapter context. * If the protocol adapter vert.x event loop is blocked, the health check procedure will not complete * with OK status within the defined timeout. * * @param handler The health check handler to register the checks with. */ protected void registerEventLoopBlockedCheck(final HealthCheckHandler handler) { handler.register("event-loop-blocked-check", getConfig().getEventLoopBlockedCheckTimeout(), procedure -> { final Context currentContext = Vertx.currentContext(); if (currentContext != context) { context.runOnContext(action -> { procedure.complete(Status.OK()); }); } else { LOG.info("Protocol Adapter - HealthCheck Server context match. Assume protocol adapter is alive."); procedure.complete(Status.OK()); } }); }