Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-10363] Override defaults in manage jenkins
- Loading branch information
Showing
30 changed files
with
1,262 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/jenkins/plugins/publish_over_ftp/options/FtpDefaults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (C) 2010-2011 by Anthony Robinson | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jenkins.plugins.publish_over_ftp.options; | ||
|
||
import hudson.DescriptorExtensionList; | ||
import hudson.ExtensionPoint; | ||
import hudson.model.Describable; | ||
import hudson.model.Descriptor; | ||
import hudson.model.Hudson; | ||
|
||
public abstract class FtpDefaults implements Describable<FtpDefaults>, ExtensionPoint, FtpOptions { | ||
|
||
public static DescriptorExtensionList<FtpDefaults, FtpDefaultsDescriptor> all() { | ||
return Hudson.getInstance().<FtpDefaults, FtpDefaultsDescriptor>getDescriptorList(FtpDefaults.class); | ||
} | ||
|
||
public FtpDefaultsDescriptor getDescriptor() { | ||
return (FtpDefaultsDescriptor) Hudson.getInstance().getDescriptor(getClass()); | ||
} | ||
|
||
public static abstract class FtpDefaultsDescriptor extends Descriptor<FtpDefaults> { | ||
|
||
protected FtpDefaultsDescriptor() { } | ||
|
||
protected FtpDefaultsDescriptor(Class<? extends FtpDefaults> clazz) { | ||
super(clazz); | ||
} | ||
|
||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/jenkins/plugins/publish_over_ftp/options/FtpOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (C) 2010-2011 by Anthony Robinson | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jenkins.plugins.publish_over_ftp.options; | ||
|
||
import jenkins.plugins.publish_over.options.InstanceConfigOptions; | ||
import jenkins.plugins.publish_over.options.ParamPublishOptions; | ||
import jenkins.plugins.publish_over.options.PublisherLabelOptions; | ||
import jenkins.plugins.publish_over.options.PublisherOptions; | ||
import jenkins.plugins.publish_over.options.RetryOptions; | ||
|
||
public interface FtpOptions { | ||
|
||
InstanceConfigOptions getInstanceConfig(); | ||
ParamPublishOptions getParamPublish(); | ||
PublisherOptions getPublisher(); | ||
PublisherLabelOptions getPublisherLabel(); | ||
RetryOptions getRetry(); | ||
FtpTransferOptions getTransfer(); | ||
|
||
} |
125 changes: 125 additions & 0 deletions
125
src/main/java/jenkins/plugins/publish_over_ftp/options/FtpOverrideDefaults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (C) 2010-2011 by Anthony Robinson | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jenkins.plugins.publish_over_ftp.options; | ||
|
||
import hudson.Extension; | ||
import jenkins.plugins.publish_over.options.InstanceConfigOptions; | ||
import jenkins.plugins.publish_over.options.ParamPublishOptions; | ||
import jenkins.plugins.publish_over.options.PublisherLabelOptions; | ||
import jenkins.plugins.publish_over.options.PublisherOptions; | ||
import jenkins.plugins.publish_over.options.RetryOptions; | ||
import jenkins.plugins.publish_over.view_defaults.manage_jenkins.Messages; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
public class FtpOverrideDefaults extends FtpDefaults { | ||
|
||
private final FtpOverrideInstanceConfigDefaults overrideInstanceConfig; | ||
private final FtpOverrideParamPublishDefaults overrideParamPublish; | ||
private final FtpOverridePublisherDefaults overridePublisher; | ||
private final FtpOverridePublisherLabelDefaults overridePublisherLabel; | ||
private final FtpOverrideRetryDefaults overrideRetry; | ||
private final FtpOverrideTransferDefaults overrideTransfer; | ||
|
||
@DataBoundConstructor | ||
public FtpOverrideDefaults(final FtpOverrideInstanceConfigDefaults overrideInstanceConfig, | ||
final FtpOverrideParamPublishDefaults overrideParamPublish, | ||
final FtpOverridePublisherDefaults overridePublisher, | ||
final FtpOverridePublisherLabelDefaults overridePublisherLabel, | ||
final FtpOverrideRetryDefaults overrideRetry, | ||
final FtpOverrideTransferDefaults overrideTransfer) { | ||
this.overrideInstanceConfig = overrideInstanceConfig; | ||
this.overrideParamPublish = overrideParamPublish; | ||
this.overridePublisher = overridePublisher; | ||
this.overridePublisherLabel = overridePublisherLabel; | ||
this.overrideRetry = overrideRetry; | ||
this.overrideTransfer = overrideTransfer; | ||
} | ||
|
||
// prevent the property type being clobbered in the descriptor map by using different names from the IF | ||
public FtpOverrideInstanceConfigDefaults getOverrideInstanceConfig() { | ||
return overrideInstanceConfig; | ||
} | ||
|
||
public FtpOverrideParamPublishDefaults getOverrideParamPublish() { | ||
return overrideParamPublish; | ||
} | ||
|
||
public FtpOverridePublisherDefaults getOverridePublisher() { | ||
return overridePublisher; | ||
} | ||
|
||
public FtpOverridePublisherLabelDefaults getOverridePublisherLabel() { | ||
return overridePublisherLabel; | ||
} | ||
|
||
public FtpOverrideRetryDefaults getOverrideRetry() { | ||
return overrideRetry; | ||
} | ||
|
||
public FtpOverrideTransferDefaults getOverrideTransfer() { | ||
return overrideTransfer; | ||
} | ||
|
||
public InstanceConfigOptions getInstanceConfig() { | ||
return overrideInstanceConfig; | ||
} | ||
|
||
public ParamPublishOptions getParamPublish() { | ||
return overrideParamPublish; | ||
} | ||
|
||
public PublisherOptions getPublisher() { | ||
return overridePublisher; | ||
} | ||
|
||
public PublisherLabelOptions getPublisherLabel() { | ||
return overridePublisherLabel; | ||
} | ||
|
||
public RetryOptions getRetry() { | ||
return overrideRetry; | ||
} | ||
|
||
public FtpTransferOptions getTransfer() { | ||
return overrideTransfer; | ||
} | ||
|
||
@Extension | ||
public static class FtpOverrideDefaultsDescriptor extends FtpDefaultsDescriptor { | ||
|
||
private static final FtpPluginDefaults PLUGIN_DEFAULTS = new FtpPluginDefaults(); | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return Messages.defaults_overrideDefaults(); | ||
} | ||
|
||
public FtpPluginDefaults getPluginDefaults() { | ||
return PLUGIN_DEFAULTS; | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.