Skip to content

Commit 303f001

Browse files
Merge pull request #34 from ufcg-lsd/feature/current-common
Feature/current common
2 parents f046cc7 + 0b9145c commit 303f001

39 files changed

+296
-2644
lines changed

Diff for: .idea/workspace.xml

+74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
# SAPS COMMON
2-
3-
This repository maintains legacy code among the other SAPS repositories.
4-
5-
See the initial SAPS documentation at [saps-engine repository](https://github.com/ufcg-lsd/saps-engine)
1+
#newCommon

Diff for: pom.xml

+1-153
Original file line numberDiff line numberDiff line change
@@ -143,146 +143,7 @@
143143
</repositories>
144144

145145
<dependencies>
146-
<dependency>
147-
<groupId>org.mockito</groupId>
148-
<artifactId>mockito-core</artifactId>
149-
<version>1.10.19</version>
150-
<scope>test</scope>
151-
</dependency>
152-
<dependency>
153-
<groupId>commons-lang</groupId>
154-
<artifactId>commons-lang</artifactId>
155-
<version>2.3</version>
156-
</dependency>
157-
158-
<dependency>
159-
<groupId>org.apache.httpcomponents</groupId>
160-
<artifactId>httpclient</artifactId>
161-
<version>4.5.13</version>
162-
</dependency>
163-
164-
<dependency>
165-
<groupId>org.mockito</groupId>
166-
<artifactId>mockito-all</artifactId>
167-
<version>1.10.19</version>
168-
<scope>test</scope>
169-
</dependency>
170-
171-
<dependency>
172-
<groupId>org.powermock</groupId>
173-
<artifactId>powermock-mockito-release-full</artifactId>
174-
<version>1.6.4</version>
175-
<type>pom</type>
176-
<scope>test</scope>
177-
</dependency>
178-
179-
<dependency>
180-
<groupId>log4j</groupId>
181-
<artifactId>log4j</artifactId>
182-
<version>1.2.17</version>
183-
</dependency>
184-
185-
<dependency>
186-
<groupId>org.javaswift</groupId>
187-
<artifactId>joss</artifactId>
188-
<version>0.9.7</version>
189-
</dependency>
190-
191-
<dependency>
192-
<groupId>org.json</groupId>
193-
<artifactId>json</artifactId>
194-
<version>20090211</version>
195-
</dependency>
196-
197-
<dependency>
198-
<groupId>com.googlecode.json-simple</groupId>
199-
<artifactId>json-simple</artifactId>
200-
<version>1.1.1</version>
201-
</dependency>
202-
203-
<dependency>
204-
<groupId>com.google.code.gson</groupId>
205-
<artifactId>gson</artifactId>
206-
<version>2.2.4</version>
207-
</dependency>
208-
<dependency>
209-
<groupId>org.apache.httpcomponents</groupId>
210-
<artifactId>httpmime</artifactId>
211-
<version>4.5</version>
212-
</dependency>
213-
214-
<dependency>
215-
<groupId>org.restlet.jse</groupId>
216-
<artifactId>org.restlet</artifactId>
217-
<version>2.4.3</version>
218-
</dependency>
219-
220-
<dependency>
221-
<groupId>org.restlet.jse</groupId>
222-
<artifactId>org.restlet.ext.jackson</artifactId>
223-
<version>2.4.3</version>
224-
</dependency>
225-
226-
<dependency>
227-
<groupId>org.restlet.jse</groupId>
228-
<artifactId>org.restlet.ext.freemarker</artifactId>
229-
<version>2.3.0</version>
230-
</dependency>
231-
232-
<dependency>
233-
<groupId>org.restlet.jee</groupId>
234-
<artifactId>org.restlet.ext.slf4j</artifactId>
235-
<version>2.3.0</version>
236-
</dependency>
237-
238-
<dependency>
239-
<groupId>org.restlet.jee</groupId>
240-
<artifactId>org.restlet.ext.jsslutils</artifactId>
241-
<version>2.3.0</version>
242-
</dependency>
243-
244-
<dependency>
245-
<groupId>org.restlet.jse</groupId>
246-
<artifactId>org.restlet.ext.jetty</artifactId>
247-
<version>2.3.0</version>
248-
</dependency>
249-
250-
<dependency>
251-
<groupId>org.apache.commons</groupId>
252-
<artifactId>commons-dbcp2</artifactId>
253-
<version>2.0.1</version>
254-
</dependency>
255-
256-
<dependency>
257-
<groupId>org.postgresql</groupId>
258-
<artifactId>postgresql</artifactId>
259-
<version>9.3-1102-jdbc41</version>
260-
</dependency>
261-
262-
<dependency>
263-
<groupId>org.jsoup</groupId>
264-
<artifactId>jsoup</artifactId>
265-
<version>1.8.2</version>
266-
</dependency>
267-
<dependency>
268-
<groupId>condor</groupId>
269-
<artifactId>classad</artifactId>
270-
<version>2.4</version>
271-
</dependency>
272-
273-
<dependency>
274-
<groupId>org.mapdb</groupId>
275-
<artifactId>mapdb</artifactId>
276-
<version>1.0.9</version>
277-
</dependency>
278-
279-
280-
<dependency>
281-
<groupId>org.openprovenance.prov</groupId>
282-
<artifactId>prov-model</artifactId>
283-
<version>0.7.0</version>
284-
</dependency>
285-
<dependency>
146+
<dependency>
286147
<groupId>org.openprovenance.prov</groupId>
287148
<artifactId>prov-interop</artifactId>
288149
<version>0.7.0</version>
@@ -294,23 +155,10 @@
294155
<version>20090211</version>
295156
</dependency>
296157

297-
<dependency>
298-
<groupId>javax.mail</groupId>
299-
<artifactId>mail</artifactId>
300-
<version>1.4</version>
301-
</dependency>
302-
303158
<dependency>
304159
<groupId>junit</groupId>
305160
<artifactId>junit</artifactId>
306161
<version>4.13.1</version>
307162
</dependency>
308-
309-
<dependency>
310-
<groupId>com.diffplug.spotless</groupId>
311-
<artifactId>spotless-maven-plugin</artifactId>
312-
<version>2.6.1</version>
313-
</dependency>
314-
315163
</dependencies>
316164
</project>

Diff for: src/main/java/saps/common/core/dto/JobRequestDTO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import saps.common.core.model.SapsTask;
1010

1111
public class JobRequestDTO implements Serializable {
12-
/** */
12+
1313
private static final long serialVersionUID = 1L;
1414

1515
private String label;

Diff for: src/main/java/saps/common/core/dto/JobResponseDTO.java

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
public class JobResponseDTO implements Serializable {
99

10-
/** */
1110
private static final long serialVersionUID = 1L;
1211

1312
private String id;

Diff for: src/main/java/saps/common/core/dto/TaskRequestDTO.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.util.Map;
77

88
public class TaskRequestDTO implements Serializable {
9-
/** */
9+
1010
private static final long serialVersionUID = 1L;
1111

1212
private String label;
@@ -25,7 +25,6 @@ public TaskRequestDTO(
2525
this.metadata = metadata;
2626
}
2727

28-
// empty constructor required for Gson.
2928
public TaskRequestDTO() {}
3029

3130
public List<String> getCommands() {

Diff for: src/main/java/saps/common/core/dto/TaskResponseDTO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.io.Serializable;
66

77
public class TaskResponseDTO implements Serializable {
8-
/** */
8+
99
private static final long serialVersionUID = 1L;
1010

1111
public static final String STATE_FAILED = "FAILED";

Diff for: src/main/java/saps/common/core/dto/TaskSpecResponseDTO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.util.Map;
77

88
public class TaskSpecResponseDTO implements Serializable {
9-
/** */
9+
1010
private static final long serialVersionUID = 1L;
1111

1212
private String id;

Diff for: src/main/java/saps/common/core/model/SapsImage.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import java.io.Serializable;
55
import java.sql.Timestamp;
6+
import java.text.SimpleDateFormat;
67
import java.time.Instant;
78
import java.time.ZoneId;
89
import java.time.ZonedDateTime;
@@ -238,18 +239,14 @@ public void setError(String error) {
238239
this.error = error;
239240
}
240241

241-
// TODO change to the correct format
242242
public String getName() {
243-
Calendar cal = Calendar.getInstance();
244-
cal.setTime(imageDate);
245-
return dataset + cal.get(Calendar.DAY_OF_YEAR) + cal.get(Calendar.YEAR);
243+
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
244+
return dataset + format.format(imageDate);
246245
}
247246

248-
// TODO change to the correct format
249247
public String getCollectionTierName() {
250-
Calendar cal = Calendar.getInstance();
251-
cal.setTime(imageDate);
252-
return dataset + "_" + cal.get(Calendar.DAY_OF_YEAR) + "_" + cal.get(Calendar.YEAR);
248+
SimpleDateFormat format = new SimpleDateFormat("yyyyDDD");
249+
return dataset + "_" + format.format(imageDate);
253250
}
254251

255252
private ZonedDateTime getZonedImageDate() {

Diff for: src/main/java/saps/common/core/model/SapsLandsatImage.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package saps.common.core.model;
22

33
import java.io.Serializable;
4-
import java.sql.Date;
54

65
public class SapsLandsatImage implements Serializable {
76

Diff for: src/main/java/saps/common/core/model/SapsTask.java

-5
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,19 @@ public SapsTask(String id) {
4848
}
4949

5050
public static List<String> buildCommandList(SapsImage task, String phase) {
51-
// info shared dir between host (with NFS) and container
52-
// ...
5351

5452
DateFormat dateFormater = new SimpleDateFormat(DATE_FORMAT);
5553
String taskDir = task.getTaskId();
5654
String rootPath = "/nfs/" + taskDir;
5755
String phaseDirPath = "/nfs/" + taskDir + File.separator + phase;
5856
List<String> commands = new LinkedList<String>();
5957

60-
// Remove dirs
6158
String removeThings = String.format("rm -rf %s", phaseDirPath);
6259
commands.add(removeThings);
6360

64-
// Create dirs
6561
String createDirectory = String.format("mkdir -p %s", phaseDirPath);
6662
commands.add(createDirectory);
6763

68-
// Run command
6964
String runCommand =
7065
String.format(
7166
"bash /home/saps/run.sh %s %s %s %s",

0 commit comments

Comments
 (0)