Package hudson.plugins.deploy
Class PasswordProtectedAdapterCargo
java.lang.Object
hudson.plugins.deploy.ContainerAdapter
hudson.plugins.deploy.CargoContainerAdapter
hudson.plugins.deploy.DefaultCargoContainerAdapterImpl
hudson.plugins.deploy.PasswordProtectedAdapterCargo
- All Implemented Interfaces:
ExtensionPoint,Describable<ContainerAdapter>,Serializable
- Direct Known Subclasses:
GlassFishAdapter,JBossAdapter,TomcatAdapter,WebLogicAdapter
Creates credentials for the previously stored password.
Historical precedent of the multiple password fields and why they should not be removed. Using
Tomcat7xAdapter as an example, but applies to all.
v1.0 Stored password as plain text
<Tomcat7xAdapter>
<userName>admin</userName>
<password>pw</password>
<url>http://example.com:8080</url>
</Tomcat7xAdapter>
v1.9 Used Scrambler to base64 encode password. readResolve converted plaintext password
to passwordScrambled.
<Tomcat7xAdapter>
<userName>admin</userName>
<passwordScrambled>cHcNCg==</passwordScrambled>
<url>http://example.com:8080</url>
</Tomcat7xAdapter>
v1.11 Full support of credentials. To be backwards compatible and not break builds converts old configurations
from password or passwordScrambled to credentials.
<Tomcat7xAdapter>
<credentialsId>aDjnKd4j-s66fnF53-2dmAS7PkqD4</credentialsId>
<url>http://example.com:8080</url>
</Tomcat7xAdapter>
- Author:
- Alex Johnson, Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.plugins.deploy.DefaultCargoContainerAdapterImpl
DefaultCargoContainerAdapterImpl.PropertyNested classes/interfaces inherited from class hudson.plugins.deploy.CargoContainerAdapter
CargoContainerAdapter.DeployCallableNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionPasswordProtectedAdapterCargo(String credentialsId) PasswordProtectedAdapterCargo(String userName, String password) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiongetUrl()voidloadCredentials(Job<?, ?> job) Loads the credentials for a job.booleanmigrateCredentials(List<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> generated) Migrates to credentials.voidredeployFile(FilePath war, String aContextPath, Run<?, ?> run, Launcher launcher, TaskListener listener) Perform redeployment.Methods inherited from class hudson.plugins.deploy.DefaultCargoContainerAdapterImpl
configureMethods inherited from class hudson.plugins.deploy.CargoContainerAdapter
createEAR, createWAR, deploy, expandVariable, getContainer, getContainerIdMethods inherited from class hudson.plugins.deploy.ContainerAdapter
all, getDescriptor, redeploy
-
Constructor Details
-
PasswordProtectedAdapterCargo
-
PasswordProtectedAdapterCargo
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @Deprecated public PasswordProtectedAdapterCargo(String userName, String password) Deprecated.
-
-
Method Details
-
redeployFile
public void redeployFile(FilePath war, String aContextPath, Run<?, ?> run, Launcher launcher, TaskListener listener) throws IOException, InterruptedExceptionDescription copied from class:CargoContainerAdapterPerform redeployment. If failed, return false. Implementations should override me and makeContainerAdapter.redeploy(FilePath, String, AbstractBuild, Launcher, BuildListener)delegate to that implementation to be usable within Pipeline projects- Overrides:
redeployFilein classCargoContainerAdapter- Parameters:
war- the path of the war/ear file to deployaContextPath- the context path for the war to be deployedrun- the build that is being deployedlauncher- the launcher of the buildlistener- the BuildListener of the build to deploy- Throws:
IOException- if there is an error locating the war fileInterruptedException- if there is an error deploying to the server
-
loadCredentials
Loads the credentials for a job.- Parameters:
job- the job to lookup the scope for
-
getCredentialsId
-
getUsername
-
getPassword
-
getUrl
-
migrateCredentials
public boolean migrateCredentials(List<com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> generated) Migrates to credentials. In case where migration fails, we retain the original username/password/passwordScrambled fields and should avoid saving to disk until the user can help resolve the situation.- Parameters:
generated- generated credentials which should be checked- Returns:
- True if migration succeeded, false if we tried to create credentials and failed.
-