001package com.kodexa.client.steps;
002
003import com.kodexa.client.Document;
004import com.kodexa.client.pipeline.PipelineContext;
005
006/**
007 * An interface that describes the contract for a pipeline step.
008 * <p>
009 * Each step will recieve one document at a time, and also the pipeline context, it can then work with that document
010 * and return it, or create a new document to return.
011 */
012public interface PipelineStep {
013
014    /**
015     * The pipeline will call the process method, passing each document to the step.  The step will then perform
016     * and actions and can return either the same document or a new document representing its result.
017     * <p>
018     * It can also interact with the context if it wishes to work with the stores or other contextual information.
019     *
020     * @param document The document to process
021     * @param context  The pipeline's context
022     * @return The document after the steps actions
023     */
024    Document process(Document document, PipelineContext context);
025
026    /**
027     * The name of the pipeline step
028     *
029     * @return a string representing the name
030     */
031    String getName();
032}