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