Package com.dtolabs.rundeck.plugins.scm
Interface ScmImportPlugin
-
public interface ScmImportPlugin
Plugin for importing job definitions from a Source control repository
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<Action>
actionsAvailableForContext(ScmOperationContext context)
default java.util.List<Action>
actionsAvailableForContext(ScmOperationContext context, ScmImportSynchState status)
void
cleanup()
perform any cleanup/teardown needed after disablingdefault java.util.Map
clusterFixJobs(ScmOperationContext context, java.util.List<JobScmReference> jobs)
Function to fix status of the jobs on cluster environment.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.ScmImportDiffResult
getFileDiff(JobScmReference job)
Get diff for the given jobScmImportDiffResult
getFileDiff(JobScmReference job, java.lang.String originalPath)
Get diff for the given job against another path, e.g.BasicInputView
getInputViewForAction(ScmOperationContext context, java.lang.String actionId)
Provide the input view for an action.JobImportState
getJobStatus(JobScmReference job)
Return the state of the given jobJobImportState
getJobStatus(JobScmReference job, java.lang.String originalPath)
Return the state of the given job, with optional original repo pathjava.lang.String
getRelativePathForJob(JobReference job)
Return the relative path for the job in the repoAction
getSetupAction(ScmOperationContext context)
Return any action that is needed for post-create setup.ScmImportSynchState
getStatus(ScmOperationContext context)
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)default void
initJobsStatus(java.util.List<JobScmReference> jobs)
Set default job statusJobImportState
jobChanged(JobChangeEvent event, JobScmReference reference)
Return the state of the given jobdefault void
refreshJobsStatus(java.util.List<JobScmReference> jobs)
Function to refresh all job status .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)
Perform import with the inputScmExportResult
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)
Perform import with the inputdefault void
totalClean()
perform a total cleandefault java.lang.Boolean
userHasAccessToKeyOrPassword(ScmOperationContext ctx)
Returns true or false if the user has access to the key/password or not
-
-
-
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 contextactionId
- action IDimporter
- can import files as jobsselectedPaths
- selected scm paths to importinput
- 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 contextactionId
- action IDimporter
- can import files as jobsselectedPaths
- selected scm paths to importdeletedJobs
- selected Job IDS to deleteinput
- result of GUI input- Throws:
ScmPluginException
-
getStatus
ScmImportSynchState getStatus(ScmOperationContext context) throws ScmPluginException
- Returns:
- overall status
- Throws:
ScmPluginException
-
getJobStatus
JobImportState getJobStatus(JobScmReference job)
Return the state of the given job- Parameters:
job
- job- Returns:
- state
-
getJobStatus
JobImportState getJobStatus(JobScmReference job, java.lang.String originalPath)
Return the state of the given job, with optional original repo path- Parameters:
job
- joboriginalPath
- 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
-
-
jobChanged
JobImportState jobChanged(JobChangeEvent event, JobScmReference reference)
Return the state of the given job- Parameters:
event
- change eventreference
- job- Returns:
- state
-
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)
Get diff for the given job- Parameters:
job
- job
-
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
- joboriginalPath
- 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 jobsoriginalPaths
- 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
-
-