1 package org.eclipse.aether.deployment;
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.Collection;
24 import java.util.Collections;
25
26 import org.eclipse.aether.RepositorySystem;
27 import org.eclipse.aether.RepositorySystemSession;
28 import org.eclipse.aether.RequestTrace;
29 import org.eclipse.aether.artifact.Artifact;
30 import org.eclipse.aether.metadata.Metadata;
31 import org.eclipse.aether.repository.RemoteRepository;
32
33
34
35
36
37
38 public final class DeployRequest
39 {
40
41 private Collection<Artifact> artifacts = Collections.emptyList();
42
43 private Collection<Metadata> metadata = Collections.emptyList();
44
45 private RemoteRepository repository;
46
47 private RequestTrace trace;
48
49
50
51
52 public DeployRequest()
53 {
54 }
55
56
57
58
59
60
61 public Collection<Artifact> getArtifacts()
62 {
63 return artifacts;
64 }
65
66
67
68
69
70
71
72 public DeployRequest setArtifacts( Collection<Artifact> artifacts )
73 {
74 if ( artifacts == null )
75 {
76 this.artifacts = Collections.emptyList();
77 }
78 else
79 {
80 this.artifacts = artifacts;
81 }
82 return this;
83 }
84
85
86
87
88
89
90
91 public DeployRequest addArtifact( Artifact artifact )
92 {
93 if ( artifact != null )
94 {
95 if ( artifacts.isEmpty() )
96 {
97 artifacts = new ArrayList<Artifact>();
98 }
99 artifacts.add( artifact );
100 }
101 return this;
102 }
103
104
105
106
107
108
109 public Collection<Metadata> getMetadata()
110 {
111 return metadata;
112 }
113
114
115
116
117
118
119
120 public DeployRequest setMetadata( Collection<Metadata> metadata )
121 {
122 if ( metadata == null )
123 {
124 this.metadata = Collections.emptyList();
125 }
126 else
127 {
128 this.metadata = metadata;
129 }
130 return this;
131 }
132
133
134
135
136
137
138
139 public DeployRequest addMetadata( Metadata metadata )
140 {
141 if ( metadata != null )
142 {
143 if ( this.metadata.isEmpty() )
144 {
145 this.metadata = new ArrayList<Metadata>();
146 }
147 this.metadata.add( metadata );
148 }
149 return this;
150 }
151
152
153
154
155
156
157 public RemoteRepository getRepository()
158 {
159 return repository;
160 }
161
162
163
164
165
166
167
168 public DeployRequest setRepository( RemoteRepository repository )
169 {
170 this.repository = repository;
171 return this;
172 }
173
174
175
176
177
178
179 public RequestTrace getTrace()
180 {
181 return trace;
182 }
183
184
185
186
187
188
189
190 public DeployRequest setTrace( RequestTrace trace )
191 {
192 this.trace = trace;
193 return this;
194 }
195
196 @Override
197 public String toString()
198 {
199 return getArtifacts() + ", " + getMetadata() + " > " + getRepository();
200 }
201
202 }