1 package com.atlassian.maven.plugins.amps;
2
3 public class PdkParams
4 {
5 private final String pluginKey;
6 private final String server;
7 private final int port;
8 private final String contextPath;
9 private final String username;
10 private final String password;
11 private final String pluginFile;
12
13 private PdkParams(String pluginKey, String server, int port, String contextPath, String username, String password, String pluginFile)
14 {
15 this.pluginKey = pluginKey;
16 this.server = server;
17 this.port = port;
18 this.contextPath = contextPath;
19 this.username = username;
20 this.password = password;
21 this.pluginFile = pluginFile;
22 }
23
24 public String getPluginKey()
25 {
26 return pluginKey;
27 }
28
29 public String getServer()
30 {
31 return server;
32 }
33
34 public int getPort()
35 {
36 return port;
37 }
38
39 public String getContextPath()
40 {
41 return contextPath;
42 }
43
44 public String getUsername()
45 {
46 return username;
47 }
48
49 public String getPassword()
50 {
51 return password;
52 }
53
54 public String getPluginFile()
55 {
56 return pluginFile;
57 }
58
59 public static class Builder
60 {
61 private String pluginKey;
62 private String server;
63 private int port;
64 private String contextPath;
65 private String username;
66 private String password;
67 private boolean testPlugin;
68
69 public Builder pluginKey(String pluginKey)
70 {
71 this.pluginKey = pluginKey;
72 return this;
73 }
74
75 public Builder server(String server)
76 {
77 this.server = server;
78 return this;
79 }
80
81 public Builder port(int port)
82 {
83 this.port = port;
84 return this;
85 }
86
87 public Builder contextPath(String contextPath)
88 {
89 this.contextPath = contextPath;
90 return this;
91 }
92
93 public Builder username(String username)
94 {
95 this.username = username;
96 return this;
97 }
98
99 public Builder password(String password)
100 {
101 this.password = password;
102 return this;
103 }
104
105 public Builder testPlugin(boolean value)
106 {
107 this.testPlugin = value;
108 return this;
109 }
110
111
112 public PdkParams build()
113 {
114 String pluginFile = "${project.build.directory}/${project.build.finalName}.jar";
115 if (testPlugin)
116 {
117 pluginFile = "${project.build.directory}/${project.build.finalName}-tests.jar";
118 }
119 return new PdkParams(pluginKey, server, port, contextPath, username, password, pluginFile);
120 }
121 }
122 }