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

com.paypal.butterfly.api.TransformationResult Maven / Gradle / Ivy

package com.paypal.butterfly.api;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * Transformation result
 *
 * @author facarvalho
 */
public interface TransformationResult {

    /**
     * Returns an identifier for this transformation result
     *
     * @return an identifier for this transformation result
     */
    String getId();

    /**
     * Returns the {@link TransformationRequest} that originated this transformation
     *
     * @return the {@link TransformationRequest} that originated this transformation
     */
    TransformationRequest getTransformationRequest();

    /**
     * Returns the OS id of the user who performed the transformation
     *
     * @return the OS id of the user who performed the transformation
     */
    String getUserId();

    /**
     * Returns the transformation conclusion date in "yyyyy-mm-dd hh:mm:ss"
     *
     * @return the transformation conclusion date in "yyyyy-mm-dd hh:mm:ss"
     */
    String getDateTime();

    /**
     * Returns the transformation conclusion date in milliseconds
     *
     * @return the transformation conclusion date in milliseconds
     */
    long getTimestamp();

    /**
     * Returns the type of the transformed application
     *
     * @return the type of the transformed application
     */
    String getApplicationType();

    /**
     * Returns the name of the transformed application
     *
     * @return the name of the transformed application
     */
    String getApplicationName();

    /**
     * Returns true only if this transformation has completed successfully.
     * Notice that even a successful transformation might have post-transformation
     * manual instructions, warnings or errors.
     * Check {@link #getMetrics()} to find out more about the transformation result.
     *
     * @return true if the transformation was successful, or false, if it aborted.
     */
    boolean isSuccessful();

    /**
     * Returns the folder where the transformed application is.
     * Even if the transformation didn't complete successfully
     * this method will return the transformed application directory.
     *
     * @return the folder where the transformed application is
     */
    File getTransformedApplicationDir();

    /**
     * Return how many upgrade steps were executed during this transformation.
     * It returns 0 if the transformation was actually not an upgrade.
     *
     * @return how many upgrade steps were executed during this transformation,
     * or 0, if the transformation was actually not an upgrade
     */
    int getUpgradeStepsCount();

    /**
     * Returns true if this transformation requires
     * manual instructions to be completed. It returns
     * false otherwise, or if the transformation aborted.
     *
     * @return true if this transformation requires
     * manual instructions to be completed
     */
    boolean hasManualInstructions();

    /**
     * Return how many manual instructions are
     * necessary to complete the transformation.
     * Notice that, in case of upgrades, this number
     * will be the total of all upgrade steps
     * manual instructions.
     *
     * @return how many manual instructions are
     * necessary to complete the transformation
     */
    int getManualInstructionsTotal();

    /**
     * Returns the directory where all post-transformation
     * manual instruction documents are placed. It returns
     * null if the transformation didn't result in any
     * post-transformation manual instruction,
     * or if the transformation aborted.
     *
     * @return the directory where all post-transformation
     * manual instruction documents are placed
     */
    File getManualInstructionsDir();

    /**
     * Returns the document file that contains
     * the manual instructions, or null, if there is none,
     * or if the transformation aborted.
     *
     * @return the document file that contains
     * the manual instructions, or null, if there is none
     */
    File getManualInstructionsFile();

    /**
     * Returns an unmodifiable list with the metrics generated by the transformation.
     * If the transformation is an upgrade, then the list will have one metrics object per
     * upgrade step. If it is not, then it will have just one item.
     *
     * @return a list of metrics generated by this transformation
     */
    List getMetrics();

    /**
     * Returns an unmodifiable map with the metrics generated by the transformation.
     * The key is the transformation template class name, while the value is the metrics object.
     * If the transformation is an upgrade, then the map will have one metrics object per
     * upgrade step. If it is not, then it will have just one item.
     *
     * @return a map of metrics generated by this transformation
     */
    Map getMetricsMap();

    /**
     * Returns details about the reason why the transformation
     * associated with this metric record aborted. If it actually
     * succeeded, then it returns null.
     *
     * @return details about the reason why the transformation
     * associated with this metric record aborted
     */
    AbortDetails getAbortDetails();

    /**
     * Returns a String representing this transformation result object in JSON format
     *
     * @return a String representing this transformation result object in JSON format
     */
    String toJson();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy