1 package org.apache.maven.settings.crypto;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.List;
25
26 import org.apache.maven.settings.Proxy;
27 import org.apache.maven.settings.Server;
28 import org.apache.maven.settings.Settings;
29
30
31
32
33
34
35 public class DefaultSettingsDecryptionRequest
36 implements SettingsDecryptionRequest
37 {
38
39 private List<Server> servers;
40
41 private List<Proxy> proxies;
42
43
44
45
46 public DefaultSettingsDecryptionRequest()
47 {
48
49 }
50
51
52
53
54
55
56 public DefaultSettingsDecryptionRequest( Settings settings )
57 {
58 setServers( settings.getServers() );
59 setProxies( settings.getProxies() );
60 }
61
62
63
64
65
66
67 public DefaultSettingsDecryptionRequest( Server server )
68 {
69 this.servers = new ArrayList<Server>( Arrays.asList( server ) );
70 }
71
72
73
74
75
76
77 public DefaultSettingsDecryptionRequest( Proxy proxy )
78 {
79 this.proxies = new ArrayList<Proxy>( Arrays.asList( proxy ) );
80 }
81
82 @Override
83 public List<Server> getServers()
84 {
85 if ( servers == null )
86 {
87 servers = new ArrayList<Server>();
88 }
89
90 return servers;
91 }
92
93 @Override
94 public DefaultSettingsDecryptionRequest setServers( List<Server> servers )
95 {
96 this.servers = servers;
97
98 return this;
99 }
100
101 @Override
102 public List<Proxy> getProxies()
103 {
104 if ( proxies == null )
105 {
106 proxies = new ArrayList<Proxy>();
107 }
108
109 return proxies;
110 }
111
112 @Override
113 public DefaultSettingsDecryptionRequest setProxies( List<Proxy> proxies )
114 {
115 this.proxies = proxies;
116
117 return this;
118 }
119
120 }