/*
 * Copyright 2008-2026 Async-IO.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.atmosphere.cpr;

/**
 * This interface contains all Atmosphere headers shared between the client and the server.
 *
 * @author Jeanfrancois Arcand
 */
public interface HeaderConfig {
    /**
     * If long-polling is used during a POST, this header is added after the first successful response.
     */
    String X_ATMOSPHERE_FIRSTLONGPOLLING_DONE = "X-Atmosphere-first-long-polling-done";
    /**
     * The current transport used.
     */
    String X_ATMOSPHERE_TRANSPORT = "X-Atmosphere-Transport";

    String LONG_POLLING_TRANSPORT = "long-polling";

    String STREAMING_TRANSPORT = "streaming";

    String POLLING_TRANSPORT = "polling";

    String WEBSOCKET_TRANSPORT = "websocket";

    String SSE_TRANSPORT = "sse";

    String GRPC_TRANSPORT = "grpc";

    String WEBTRANSPORT_TRANSPORT = "webtransport";

    String DISCONNECT_TRANSPORT_MESSAGE = "close";

    String WEBSOCKET_X_ATMOSPHERE_TRANSPORT= X_ATMOSPHERE_TRANSPORT + "=" + WEBSOCKET_TRANSPORT;

    String X_FIRST_REQUEST= "X-Atmosphere-first-request";

    /**
     * When a unexpected error occurs.
     */
    String X_ATMOSPHERE_ERROR = "X-Atmosphere-error";
    /**
     * The unique tracking ID generated by the server.
     */
    String X_ATMOSPHERE_TRACKING_ID = "X-Atmosphere-tracking-id";

    /**
     * The current version of Atmosphere Framework.
     */
    String X_ATMOSPHERE_FRAMEWORK = "X-Atmosphere-Framework";

    /**
     * The desired heartbeat interval in seconds sent by the server and asked by the client.
     */
    String X_HEARTBEAT_SERVER = "X-Heartbeat-Server";

    String X_ATMOSPHERE = "X-Atmosphere";

    /**
     * The message size sent by Atmosphere.
     */
    String X_ATMOSPHERE_TRACKMESSAGESIZE = "X-Atmosphere-TrackMessageSize";

    String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin";

    String ACCESS_CONTROL_ALLOW_CREDENTIALS = "Access-Control-Allow-Credentials";

    String PRAGMA = "Pragma";

    String CACHE_CONTROL = "Cache-Control";

    String EXPIRES = "Expires";

    String WEBSOCKET_UPGRADE = "Upgrade";

    String ATMOSPHERE_POST_BODY = "X-Atmosphere-Post-Body";

    String X_ATMO_PROTOCOL = "X-atmo-protocol";

    String X_ATMO_BINARY = "X-Atmosphere-Binary";

    String X_ATMO_WEBSOCKET_PROXY = "X-Atmosphere-WebSocket-Proxy";

    String FORCE_BINARY = "application/octet-stream";

    /**
     * Header carrying the authentication token. Used by long-polling (fetch) requests
     * which can set custom headers. WebSocket and SSE use the query parameter instead.
     */
    String X_ATMOSPHERE_AUTH = "X-Atmosphere-Auth";
    /**
     * Header sent by the server when a refreshed token is available.
     * The client should store this and use it for subsequent requests.
     */
    String X_ATMOSPHERE_AUTH_REFRESH = "X-Atmosphere-Auth-Refresh";
    /**
     * Header sent by the server to indicate the token has expired and no refresh
     * was possible. The client should re-authenticate.
     */
    String X_ATMOSPHERE_AUTH_EXPIRED = "X-Atmosphere-Auth-Expired";

    /**
     * Client-assigned message ID for acknowledgment tracking.
     * Sent by the client; echoed back in {@link #X_ATMOSPHERE_ACK}.
     */
    String X_ATMOSPHERE_MESSAGE_ID = "X-Atmosphere-Message-Id";
    /**
     * Server acknowledgment of a received message. Contains the message ID.
     */
    String X_ATMOSPHERE_ACK = "X-Atmosphere-Ack";

}
