File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\os\windows\ManagedWindowsServiceConnector.java.html

1 package hudson.os.windows;
2
3 import hudson.Extension;
4 import hudson.model.TaskListener;
5 import hudson.slaves.ComputerConnector;
6 import hudson.slaves.ComputerConnectorDescriptor;
7 import hudson.util.Secret;
8 import org.kohsuke.stapler.DataBoundConstructor;
9
10 import java.io.IOException;
11
12 /**
13 * {@link ComputerConnector} that delegates to {@link ManagedWindowsServiceLauncher}.
14 * @author Kohsuke Kawaguchi
15 */
16 public class ManagedWindowsServiceConnector extends ComputerConnector {
17 /**
18 * "[DOMAIN\\]USERNAME" to follow the Windows convention.
19 */
20 public final String userName;
21
22 public final Secret password;
23
24 @DataBoundConstructor
25 public ManagedWindowsServiceConnector(String userName, String password) {
26 this.userName = userName;
27 this.password = Secret.fromString(password);
28 }
29
30 @Override
31 public ManagedWindowsServiceLauncher launch(final String hostName, TaskListener listener) throws IOException, InterruptedException {
32 return new ManagedWindowsServiceLauncher(userName,Secret.toString(password),hostName);
33 }
34
35 @Extension
36 public static class DescriptorImpl extends ComputerConnectorDescriptor {
37 public String getDisplayName() {
38 return Messages.ManagedWindowsServiceLauncher_DisplayName();
39 }
40
41 // used by Jelly
42 public static final Class<?> CONFIG_DELEGATE_TO = ManagedWindowsServiceLauncher.class;
43 }
44 }
45