All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.soffa.foundation.core.RequestContext Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package io.soffa.foundation.core;

import io.soffa.foundation.core.models.Authentication;
import io.soffa.foundation.core.models.SideEffects;

import java.util.Map;
import java.util.Optional;

public interface RequestContext {
    String TENANT_ID = "X-TenantId";
    String APPLICATION = "X-Application";
    String TRACE_ID = "X-TraceId";
    String SPAN_ID = "X-SpanId";
    String SERVICE_NAME = "X-ServiceName";
    String AUTHORIZATION = "Authorization";

    Map getHeaders();

    default void sync() {
        // TODO: Should we keep this ?
    }

    String getAuthorization();

    default SideEffects getSideEffects() {
        return null;
    }

    Map getContextMap();

    String getTenantId();

    void setApplicationName(String value);

    void setTenantId(String value);

    void setTraceId(String value);

    void setSpanId(String value);

    void setSender(String value);

    void setAuthorization(String value);

    boolean isAuthenticated();

    String getApplicationName();

    String getSender();

    Optional getUsername();

    boolean hasAuthorization();

    void setAuthentication(Authentication auth);

    Authentication getAuthentication();

    String getSpanId();

    String getTraceId();

    default RequestContext withAuthorization(String authorization) {
        setAuthorization(authorization);
        return this;
    }

    boolean hasTenant();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy