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

org.opensearch.migrations.transform.IAuthTransformer Maven / Gradle / Ivy

There is a newer version: 0.2.0.4
Show newest version
package org.opensearch.migrations.transform;

import java.nio.ByteBuffer;

import org.opensearch.migrations.replay.datahandlers.http.HttpJsonMessageWithFaultingPayload;

public interface IAuthTransformer {
    enum ContextForAuthHeader {
        HEADERS,
        HEADERS_AND_CONTENT_PAYLOAD
    }

    ContextForAuthHeader transformType();

    abstract class HeadersOnlyTransformer implements IAuthTransformer {
        @Override
        public ContextForAuthHeader transformType() {
            return ContextForAuthHeader.HEADERS;
        }

        public abstract void rewriteHeaders(HttpJsonMessageWithFaultingPayload msg);
    }

    abstract class StreamingFullMessageTransformer implements IAuthTransformer {
        @Override
        public ContextForAuthHeader transformType() {
            return ContextForAuthHeader.HEADERS_AND_CONTENT_PAYLOAD;
        }

        public abstract void consumeNextPayloadPart(ByteBuffer contentChunk);

        public abstract void finalizeSignature(HttpJsonMessageWithFaultingPayload msg);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy