Interface ScmImportPlugin


  • public interface ScmImportPlugin
    Plugin for importing job definitions from a Source control repository
    • Method Detail

      • scmImport

        ScmExportResult scmImport​(ScmOperationContext context,
                                  java.lang.String actionId,
                                  JobImporter importer,
                                  java.util.List<java.lang.String> selectedPaths,
                                  java.util.Map<java.lang.String,​java.lang.String> input)
                           throws ScmPluginException
        Perform import with the input
        Parameters:
        context - scm operation context
        actionId - action ID
        importer - can import files as jobs
        selectedPaths - selected scm paths to import
        input - result of GUI input
        Throws:
        ScmPluginException
      • scmImport

        default ScmExportResult scmImport​(ScmOperationContext context,
                                          java.lang.String actionId,
                                          JobImporter importer,
                                          java.util.List<java.lang.String> selectedPaths,
                                          java.util.List<java.lang.String> deletedJobs,
                                          java.util.Map<java.lang.String,​java.lang.String> input)
                                   throws ScmPluginException
        Perform import with the input
        Parameters:
        context - scm operation context
        actionId - action ID
        importer - can import files as jobs
        selectedPaths - selected scm paths to import
        deletedJobs - selected Job IDS to delete
        input - result of GUI input
        Throws:
        ScmPluginException
      • getJobStatus

        JobImportState getJobStatus​(JobScmReference job,
                                    java.lang.String originalPath)
        Return the state of the given job, with optional original repo path
        Parameters:
        job - job
        originalPath - path of original job, e.g. if the file was renamed
        Returns:
        state
      • initJobsStatus

        default void initJobsStatus​(java.util.List<JobScmReference> jobs)
        Set default job status
        Parameters:
        jobs -
      • cleanup

        void cleanup()
        perform any cleanup/teardown needed after disabling
      • totalClean

        default void totalClean()
        perform a total clean
      • getInputViewForAction

        BasicInputView getInputViewForAction​(ScmOperationContext context,
                                             java.lang.String actionId)
        Provide the input view for an action.
        Parameters:
        actionId - action ID
        Returns:
        input view for the specified action
      • getSetupAction

        Action getSetupAction​(ScmOperationContext context)
        Return any action that is needed for post-create setup. If not null, then the user will be forwarded to this action after plugin is configured, this should always return the setup action even if setup has already been performed, as the user may disable/reconfigure the plugin.
        Parameters:
        context - context map
        Returns:
        action used for post-create setup, if necessary
      • actionsAvailableForContext

        java.util.List<Action> actionsAvailableForContext​(ScmOperationContext context)
        Parameters:
        context - context map
        Returns:
        list of actions available for the context
      • actionsAvailableForContext

        default java.util.List<Action> actionsAvailableForContext​(ScmOperationContext context,
                                                                  ScmImportSynchState status)
        Parameters:
        context - context map
        Returns:
        list of actions available for the context
      • getTrackedItemsForAction

        java.util.List<ScmImportTrackedItem> getTrackedItemsForAction​(java.lang.String actionId)
        list any known items that can be tracked, such as: all files found in the selected source repository branch, can be an empty list (no items found to track) or null (item tracking is not used)
      • getRelativePathForJob

        java.lang.String getRelativePathForJob​(JobReference job)
        Return the relative path for the job in the repo
        Parameters:
        job - job
        Returns:
        state
      • getFileDiff

        ScmImportDiffResult getFileDiff​(JobScmReference job,
                                        java.lang.String originalPath)
        Get diff for the given job against another path, e.g. the original path before a rename
        Parameters:
        job - job
        originalPath - original path
      • clusterFixJobs

        default java.util.Map clusterFixJobs​(ScmOperationContext context,
                                             java.util.List<JobScmReference> jobs)
        Function to fix status of the jobs on cluster environment. To automatically match the job status on every node.
        Parameters:
        jobs - rundeck jobs
        Returns:
        map with information on the process
      • clusterFixJobs

        default java.util.Map clusterFixJobs​(ScmOperationContext context,
                                             java.util.List<JobScmReference> jobs,
                                             java.util.Map<java.lang.String,​java.lang.String> originalPaths)
        Function to fix status of the jobs on cluster environment. To automatically match the job status on every node.
        Parameters:
        jobs - rundeck jobs
        originalPaths - map of job ID to original path if the job has been renamed
        Returns:
        map with information on the process
      • refreshJobsStatus

        default void refreshJobsStatus​(java.util.List<JobScmReference> jobs)
        Function to refresh all job status . will upgrade the jobs cache status .
        Parameters:
        jobs - rundeck jobs
      • userHasAccessToKeyOrPassword

        default java.lang.Boolean userHasAccessToKeyOrPassword​(ScmOperationContext ctx)
        Returns true or false if the user has access to the key/password or not
        Parameters:
        ctx - : ScmOperationContext object from the controller.
        Returns:
        true or false