package org.apache.maven.artifact.deployer;

/* ====================================================================
 *   Copyright 2001-2004 The Apache Software Foundation.
 *
 *   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.
 * ====================================================================
 */

import org.apache.maven.MavenException;
import org.apache.maven.project.Project;
import org.apache.maven.repository.ArtifactTypeHandler;

/**
 * 
 * The Bean which is used in Jelly Scripts 
 * and serves as a proxy to Artifact Deployer API
 * 
 * Note that all paths in repository are computed 
 * and source file name is igonred.
 * 
 * Other remark: To deploy an artifact means much 
 * more then to copy single file. In every case
 * also MD5 file created and copied  to remote repository.
 * In case of snapshots the process in even more complex. 
 * 
 * @author <a href="mailto:michal.maczka@dimatics.com">Michal Maczka</a> 
 * @version $Id$
 */
public interface ArtifactDeployer
{
    /**
     * Deploy given artifact to remote repository.
     * 
     * @param artifact Artifact filename
     * @param type  The type of the artifact 
     *     (like <code>war</code>, <code>jar</code>)
     * @param project The project which is a producer of the artifact
     * @param handler the type handler for the artifact
     *          
     * @throws MavenException 
     */
    void deploy(String artifact, String type, Project project, ArtifactTypeHandler handler)
        throws MavenException;

    /**
     * Deploy given artifact as a snapshot to remote repository.
     * @param artifact
     * @param type The type of the artifact 
     *     (like <code>war</code>, <code>jar</code>)
     * @param project The project which is a producer of the artifact
     * @param handler the type handler for the artifact
     *
     * @throws MavenException
     */
    void deploySnapshot(String artifact, String type, Project project, ArtifactTypeHandler handler)
        throws MavenException;

    /**
     * Install given artifact in local repository.
     * @param artifact file name of the artifact
     * @param type The type of the artifact 
     *     (like <code>war</code>, <code>jar</code>)
     * @param project The project which is a producer of the artifact
     * @param handler the type handler for the artifact
     * @throws MavenException
     */
    void install(String artifact, String type, Project project, ArtifactTypeHandler handler)
        throws MavenException;

    /**
     * Install given artifact as snapshot in local repository.
     * @param artifact
     * @param type The type of the artifact 
     *     (like <code>war</code>, <code>jar</code>)
     * @param project The project which is a producer of the artifact
     * @param handler the type handler for the artifact
     * @throws MavenException
     */
    void installSnapshot(String artifact, String type, Project project, ArtifactTypeHandler handler)
        throws MavenException;
}

