This project has retired. For details please refer to its
Attic page.
NetworkProxy xref
1 package org.apache.archiva.proxy.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.Serializable;
23 import java.util.Arrays;
24 import java.util.Objects;
25
26 public class NetworkProxy
27 implements Serializable
28 {
29 private String id;
30
31
32
33
34
35 private String protocol = "http";
36
37
38
39
40 private String host;
41
42
43
44
45 private int port = 8080;
46
47
48
49
50 private String username;
51
52
53
54
55 private char[] password;
56
57
58
59
60
61
62 private boolean useNtlm;
63
64 public NetworkProxy()
65 {
66
67 }
68
69 public NetworkProxy(String id, String protocol, String host, int port, String username, char[] password )
70 {
71 this.id = id;
72 this.protocol = protocol;
73 this.host = host;
74 this.port = port;
75 this.username = username;
76 setPassword(password);
77 }
78
79 public String getId()
80 {
81 return id;
82 }
83
84 public void setId( String id )
85 {
86 this.id = id;
87 }
88
89 public String getProtocol()
90 {
91 return protocol;
92 }
93
94 public void setProtocol( String protocol )
95 {
96 this.protocol = protocol;
97 }
98
99 public String getHost()
100 {
101 return host;
102 }
103
104 public void setHost( String host )
105 {
106 this.host = host;
107 }
108
109 public int getPort()
110 {
111 return port;
112 }
113
114 public void setPort( int port )
115 {
116 this.port = port;
117 }
118
119 public String getUsername()
120 {
121 return username;
122 }
123
124 public void setUsername( String username )
125 {
126 this.username = username;
127 }
128
129 public char[] getPassword()
130 {
131 return password;
132 }
133
134 public void setPassword(char[] password )
135 {
136 if (this.password!=null) {
137 Arrays.fill(this.password, '0');
138 }
139 this.password = Arrays.copyOf(password, password.length);
140 }
141
142 public boolean isUseNtlm()
143 {
144 return useNtlm;
145 }
146
147 public void setUseNtlm( boolean useNtlm )
148 {
149 this.useNtlm = useNtlm;
150 }
151
152 @Override
153 public boolean equals( Object o )
154 {
155 if ( this == o )
156 {
157 return true;
158 }
159 if ( o == null || getClass() != o.getClass() )
160 {
161 return false;
162 }
163
164 NetworkProxy./../../../org/apache/archiva/proxy/model/NetworkProxy.html#NetworkProxy">NetworkProxy that = (NetworkProxy) o;
165
166 return Objects.equals(id, that.id);
167 }
168
169 @Override
170 public int hashCode()
171 {
172 int result = 629 + ( id != null ? id.hashCode() : 0 );
173 return result;
174 }
175
176 @Override
177 public String toString()
178 {
179 final StringBuilder sb = new StringBuilder();
180 sb.append( "NetworkProxy" );
181 sb.append( "{id='" ).append( id ).append( '\'' );
182 sb.append( ", protocol='" ).append( protocol ).append( '\'' );
183 sb.append( ", host='" ).append( host ).append( '\'' );
184 sb.append( ", port=" ).append( port );
185 sb.append( ", username='" ).append( username ).append( '\'' );
186
187 sb.append( ", useNtlm=" ).append( useNtlm );
188 sb.append( '}' );
189 return sb.toString();
190 }
191 }
192