@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(); }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(); }
/** * Returns a map of mapper functions associated with appropriate target type ({@code GenericType<?>}. * <p> * Mappers will by automatically registered by {@link Config.Builder} during * bootstrapping of {@link Config} unless * {@link Config.Builder#disableMapperServices() disableld}. * * @return a map of config mapper functions, never {@code null}, though this may return an empty map if * {@link #mapper(Class)} is used instead */ default Map<GenericType<?>, BiFunction<Config, ConfigMapper, ?>> genericTypeMappers() { return CollectionsHelper.mapOf(); }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(); }
@Override public Map<GenericType<?>, BiFunction<Config, ConfigMapper, ?>> genericTypeMappers() { return CollectionsHelper.mapOf(type, (config, aMapper) -> mappingFunction.apply(config)); } });
private Map<String, List<String>> findInboundHeaders(Optional<TracingContext> tracingContext) { return tracingContext.map(TracingContext::inboundHeaders) .orElse(CollectionsHelper.mapOf()); }
@Override public <T> Config.Builder addMapper(Class<T> type, Function<Config, T> mapper) { Objects.requireNonNull(type); Objects.requireNonNull(mapper); addMapper(() -> CollectionsHelper.mapOf(type, mapper)); return this; }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(Logger.class, new LoggerConfigMapper()); }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(Locale.class, new LocaleConfigMapper()); }
private boolean atnFinishFailure(ServerResponse res, CompletableFuture<AtxResult> future, AuthenticationResponse response) { if (authenticationOptional.orElse(false)) { LOGGER.finest("Authentication failed, but was optional, so assuming anonymous"); return false; } else { int defaultStatusCode = Http.Status.UNAUTHORIZED_401.code(); abortRequest(res, response, defaultStatusCode, CollectionsHelper.mapOf()); future.complete(AtxResult.STOP); return true; } }
private void atnFinish(ServerResponse res, CompletableFuture<AtxResult> future, AuthenticationResponse response) { int defaultStatusCode = Http.Status.OK_200.code(); abortRequest(res, response, defaultStatusCode, CollectionsHelper.mapOf()); future.complete(AtxResult.STOP); }
private static OutboundSecurityResponse toBasicAuthOutbound(UserStore.User user) { String b64 = Base64.getEncoder() .encodeToString((user.login() + ":" + new String(user.password())).getBytes(StandardCharsets.UTF_8)); String basicAuthB64 = "basic " + b64; return OutboundSecurityResponse .withHeaders(CollectionsHelper.mapOf("Authorization", CollectionsHelper.listOf(basicAuthB64))); }
@Override protected MergeableNode member(String name) { return members.computeIfAbsent(name, (k) -> new ObjectNodeImpl(CollectionsHelper.mapOf(), tokenResolver())); }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(Logger.class, new LoggerConfigMapper(), Locale.class, new LocaleConfigMapper()); } }
private void finishSpanWithError(Span readSpan, Throwable t) { Tags.ERROR.set(readSpan, Boolean.TRUE); readSpan.log(CollectionsHelper.mapOf("event", "error", "error.kind", "Exception", "error.object", t, "message", t.toString())); readSpan.finish(); }
private boolean atnAbstainFailure(ServerResponse res, CompletableFuture<AtxResult> future, AuthenticationResponse response) { if (authenticationOptional.orElse(false)) { LOGGER.finest("Authentication failed, but was optional, so assuming anonymous"); return false; } abortRequest(res, response, Http.Status.UNAUTHORIZED_401.code(), CollectionsHelper.mapOf(Http.Header.WWW_AUTHENTICATE, CollectionsHelper.listOf("Basic realm=\"Security Realm\""))); future.complete(AtxResult.STOP); return true; }
@Override public Map<Class<?>, Function<Config, ?>> mappers() { return CollectionsHelper.mapOf(OptionalInt.class, new OptionalIntConfigMapper(), Integer.class, new IntegerConfigMapper(), BigInteger.class, new BigIntegerConfigMapper()); }
static void traceError(Span span, Throwable throwable) { // failed Tags.ERROR.set(span, true); span.log(CollectionsHelper.mapOf("event", "error", "error.object", throwable)); span.finish(); }
protected Span startSecuritySpan(SecurityContext securityContext) { Span securitySpan = startNewSpan(securityContext.tracingSpan(), "security"); securitySpan.log(CollectionsHelper.mapOf("securityId", securityContext.id())); return securitySpan; }
private void mergeValueMember(ValueNode member, MergingKey key, MergeableNode node, ID id) { ObjectNode on = ObjectNodeBuilderImpl.create(CollectionsHelper.mapOf(), tokenResolver).value(member.get()).build(); ConfigNode merged = ObjectNodeBuilderImpl .create(on, tokenResolver) // make copy of member .value(on.get()) .deepMerge(key.rest(), node) // merge it with specified node .build(); update(id, wrap(merged, tokenResolver)); }