

package org.elasticsearch.action;

import org.elasticsearch.common.io.stream.Streamable;

/**
 *
 */
public interface ActionRequest extends Streamable {

    ActionRequestValidationException validate();

    /**
     * Should the response listener be executed on a thread or not.
     * <p/>
     * <p>When not executing on a thread, it will either be executed on the calling thread, or
     * on an expensive, IO based, thread.
     */
    boolean listenerThreaded();

    /**
     * Sets if the response listener be executed on a thread or not.
     */
    ActionRequest listenerThreaded(boolean listenerThreaded);
}
