Skip to content

Commit 5e35ab6

Browse files
committed
Move to core, all http stack is now from core
1 parent 9364f7b commit 5e35ab6

29 files changed

+101
-1273
lines changed

maven-wrapper/pom.xml

Lines changed: 8 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -46,156 +46,12 @@
4646
<dependency>
4747
<groupId>${project.groupId}</groupId>
4848
<artifactId>core</artifactId>
49-
<version>0.1.0-SNAPSHOT</version>
49+
<version>0.5.0-SNAPSHOT</version>
5050
</dependency>
5151
<dependency>
5252
<groupId>${project.groupId}</groupId>
5353
<artifactId>tmc-langs-abstraction</artifactId>
54-
<version>1.0.1-SNAPSHOT</version>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.apache.maven</groupId>
58-
<artifactId>apache-maven</artifactId>
59-
<version>${maven.version}</version>
60-
<type>pom</type>
61-
</dependency>
62-
<dependency>
63-
<artifactId>aether-api</artifactId>
64-
<groupId>org.sonatype.aether</groupId>
65-
<type>jar</type>
66-
<version>1.13.1</version>
67-
</dependency>
68-
<dependency>
69-
<artifactId>aether-connector-wagon</artifactId>
70-
<groupId>org.sonatype.aether</groupId>
71-
<type>jar</type>
72-
<version>1.13.1</version>
73-
</dependency>
74-
<dependency>
75-
<artifactId>aether-impl</artifactId>
76-
<groupId>org.sonatype.aether</groupId>
77-
<type>jar</type>
78-
<version>1.13.1</version>
79-
</dependency>
80-
<dependency>
81-
<artifactId>aether-spi</artifactId>
82-
<groupId>org.sonatype.aether</groupId>
83-
<type>jar</type>
84-
<version>1.13.1</version>
85-
</dependency>
86-
<dependency>
87-
<artifactId>aether-util</artifactId>
88-
<groupId>org.sonatype.aether</groupId>
89-
<type>jar</type>
90-
<version>1.13.1</version>
91-
</dependency>
92-
<dependency>
93-
<artifactId>commons-cli</artifactId>
94-
<groupId>commons-cli</groupId>
95-
<type>jar</type>
96-
<version>1.2</version>
97-
</dependency>
98-
<dependency>
99-
<artifactId>maven-aether-provider</artifactId>
100-
<groupId>org.apache.maven</groupId>
101-
<type>jar</type>
102-
<version>${maven.version}</version>
103-
</dependency>
104-
<dependency>
105-
<artifactId>maven-artifact</artifactId>
106-
<groupId>org.apache.maven</groupId>
107-
<type>jar</type>
108-
<version>${maven.version}</version>
109-
</dependency>
110-
<dependency>
111-
<artifactId>maven-compat</artifactId>
112-
<groupId>org.apache.maven</groupId>
113-
<type>jar</type>
114-
<version>${maven.version}</version>
115-
</dependency>
116-
<dependency>
117-
<artifactId>maven-core</artifactId>
118-
<groupId>org.apache.maven</groupId>
119-
<type>jar</type>
120-
<version>${maven.version}</version>
121-
</dependency>
122-
<dependency>
123-
<artifactId>maven-embedder</artifactId>
124-
<groupId>org.apache.maven</groupId>
125-
<type>jar</type>
126-
<version>${maven.version}</version>
127-
</dependency>
128-
<dependency>
129-
<artifactId>maven-model</artifactId>
130-
<groupId>org.apache.maven</groupId>
131-
<type>jar</type>
132-
<version>${maven.version}</version>
133-
</dependency>
134-
<dependency>
135-
<artifactId>maven-model-builder</artifactId>
136-
<groupId>org.apache.maven</groupId>
137-
<type>jar</type>
138-
<version>${maven.version}</version>
139-
</dependency>
140-
<dependency>
141-
<artifactId>maven-plugin-api</artifactId>
142-
<groupId>org.apache.maven</groupId>
143-
<type>jar</type>
144-
<version>${maven.version}</version>
145-
</dependency>
146-
<dependency>
147-
<artifactId>maven-repository-metadata</artifactId>
148-
<groupId>org.apache.maven</groupId>
149-
<type>jar</type>
150-
<version>${maven.version}</version>
151-
</dependency>
152-
<dependency>
153-
<artifactId>maven-settings</artifactId>
154-
<groupId>org.apache.maven</groupId>
155-
<type>jar</type>
156-
<version>${maven.version}</version>
157-
</dependency>
158-
<dependency>
159-
<artifactId>maven-settings-builder</artifactId>
160-
<groupId>org.apache.maven</groupId>
161-
<type>jar</type>
162-
<version>${maven.version}</version>
163-
</dependency>
164-
<dependency>
165-
<artifactId>plexus-cipher</artifactId>
166-
<groupId>org.sonatype.plexus</groupId>
167-
<type>jar</type>
168-
<version>1.7</version>
169-
</dependency>
170-
<dependency>
171-
<artifactId>plexus-classworlds</artifactId>
172-
<groupId>org.codehaus.plexus</groupId>
173-
<type>jar</type>
174-
<version>2.4</version>
175-
</dependency>
176-
<dependency>
177-
<artifactId>plexus-component-annotations</artifactId>
178-
<groupId>org.codehaus.plexus</groupId>
179-
<type>jar</type>
180-
<version>1.5.5</version>
181-
</dependency>
182-
<dependency>
183-
<artifactId>plexus-interpolation</artifactId>
184-
<groupId>org.codehaus.plexus</groupId>
185-
<type>jar</type>
186-
<version>1.14</version>
187-
</dependency>
188-
<dependency>
189-
<artifactId>plexus-sec-dispatcher</artifactId>
190-
<groupId>org.sonatype.plexus</groupId>
191-
<type>jar</type>
192-
<version>1.3</version>
193-
</dependency>
194-
<dependency>
195-
<artifactId>plexus-utils</artifactId>
196-
<groupId>org.codehaus.plexus</groupId>
197-
<type>jar</type>
198-
<version>2.0.6</version>
54+
<version>1.0.0</version>
19955
</dependency>
20056
<dependency>
20157
<artifactId>sisu-guava</artifactId>
@@ -222,51 +78,16 @@
22278
<type>jar</type>
22379
<version>2.3.0</version>
22480
</dependency>
225-
<dependency>
226-
<artifactId>wagon-file</artifactId>
227-
<groupId>org.apache.maven.wagon</groupId>
228-
<type>jar</type>
229-
<version>2.2</version>
230-
</dependency>
231-
<dependency>
232-
<artifactId>wagon-http</artifactId>
233-
<groupId>org.apache.maven.wagon</groupId>
234-
<type>jar</type>
235-
<version>2.2</version>
236-
<classifier>shaded</classifier>
237-
</dependency>
238-
<dependency>
239-
<artifactId>wagon-provider-api</artifactId>
240-
<groupId>org.apache.maven.wagon</groupId>
241-
<type>jar</type>
242-
<version>2.2</version>
243-
</dependency>
24481
<dependency>
24582
<groupId>com.google.code.gson</groupId>
24683
<artifactId>gson</artifactId>
24784
<version>2.2.2</version>
24885
</dependency>
249-
<dependency>
250-
<groupId>org.apache.httpcomponents</groupId>
251-
<artifactId>httpmime</artifactId>
252-
<version>4.3.1</version>
253-
</dependency>
25486
<dependency>
25587
<groupId>org.yaml</groupId>
25688
<artifactId>snakeyaml</artifactId>
25789
<version>1.10</version>
25890
</dependency>
259-
<dependency>
260-
<groupId>org.apache.httpcomponents</groupId>
261-
<artifactId>httpcore</artifactId>
262-
<version>4.3.2</version>
263-
</dependency>
264-
<dependency>
265-
<groupId>org.apache.httpcomponents</groupId>
266-
<artifactId>httpclient</artifactId>
267-
<type>jar</type>
268-
<version>4.3.4</version>
269-
</dependency>
27091
<dependency>
27192
<groupId>org.apache.commons</groupId>
27293
<artifactId>commons-lang3</artifactId>
@@ -277,15 +98,11 @@
27798
<artifactId>commons-io</artifactId>
27899
<version>2.4</version>
279100
</dependency>
280-
<dependency>
281-
<groupId>commons-codec</groupId>
282-
<artifactId>commons-codec</artifactId>
283-
<version>1.6</version>
284-
</dependency>
285101
<dependency>
286102
<groupId>org.mockito</groupId>
287103
<artifactId>mockito-all</artifactId>
288104
<version>1.9.0</version>
105+
<scope>test</scope>
289106
</dependency>
290107
<dependency>
291108
<groupId>org.cometd.java</groupId>
@@ -297,6 +114,11 @@
297114
<artifactId>cometd-java-websocket-javax-client</artifactId>
298115
<version>3.0.3</version>
299116
</dependency>
117+
<dependency>
118+
<groupId>org.slf4j</groupId>
119+
<artifactId>slf4j-jdk14</artifactId>
120+
<version>1.7.21</version>
121+
</dependency>
300122
<!-- required by cometd -->
301123
<dependency>
302124
<groupId>org.eclipse.jetty.websocket</groupId>

tmc-plugin/src/fi/helsinki/cs/tmc/actions/CheckForNewExercisesOrUpdates.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import fi.helsinki.cs.tmc.core.domain.Course;
55
import fi.helsinki.cs.tmc.core.domain.ProgressObserver;
66
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
7+
import fi.helsinki.cs.tmc.core.utilities.ServerErrorHelper;
78
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
89
import fi.helsinki.cs.tmc.data.CourseListUtils;
910
import fi.helsinki.cs.tmc.events.TmcEvent;
1011
import fi.helsinki.cs.tmc.events.TmcEventBus;
1112
import fi.helsinki.cs.tmc.model.CourseDb;
1213
import fi.helsinki.cs.tmc.model.LocalExerciseStatus;
1314
import fi.helsinki.cs.tmc.model.ObsoleteClientException;
14-
import fi.helsinki.cs.tmc.model.ServerAccess;
1515
import fi.helsinki.cs.tmc.ui.DownloadOrUpdateExercisesDialog;
1616
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
1717
import fi.helsinki.cs.tmc.ui.TmcNotificationDisplayer;
@@ -53,7 +53,6 @@ public static void startTimer() {
5353
private static final TmcNotificationDisplayer.SingletonToken notifierToken = TmcNotificationDisplayer.createSingletonToken();
5454

5555
private CourseDb courseDb;
56-
private ServerAccess serverAccess;
5756
private TmcNotificationDisplayer notifier;
5857
private ConvenientDialogDisplayer dialogs;
5958
private boolean beQuiet;
@@ -66,7 +65,6 @@ public CheckForNewExercisesOrUpdates() {
6665

6766
public CheckForNewExercisesOrUpdates(boolean beQuiet, boolean backgroundCheck) {
6867
this.courseDb = CourseDb.getInstance();
69-
this.serverAccess = new ServerAccess();
7068
this.notifier = TmcNotificationDisplayer.getDefault();
7169
this.dialogs = ConvenientDialogDisplayer.getDefault();
7270
this.beQuiet = beQuiet;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/CheckForNewReviews.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.communication.TmcServerCommunicationTaskFactory;
34
import fi.helsinki.cs.tmc.core.domain.Course;
45
import fi.helsinki.cs.tmc.core.domain.Review;
56
import fi.helsinki.cs.tmc.model.CourseDb;
67
import fi.helsinki.cs.tmc.model.ReviewDb;
7-
import fi.helsinki.cs.tmc.model.ServerAccess;
88
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
99
import fi.helsinki.cs.tmc.utilities.BgTask;
1010
import fi.helsinki.cs.tmc.utilities.BgTaskListener;
@@ -46,7 +46,6 @@ public static void startTimer() {
4646
}
4747
}
4848

49-
private ServerAccess serverAccess;
5049
private CourseDb courseDb;
5150
private ReviewDb reviewDb;
5251
private ConvenientDialogDisplayer dialogs;
@@ -59,7 +58,6 @@ public static void startTimer() {
5958
}
6059

6160
CheckForNewReviews(boolean beQuiet, boolean resetNotifications, boolean notifyAboutNoNewReviews) {
62-
this.serverAccess = new ServerAccess();
6361
this.courseDb = CourseDb.getInstance();
6462
this.reviewDb = ReviewDb.getInstance();
6563
this.dialogs = ConvenientDialogDisplayer.getDefault();
@@ -90,7 +88,8 @@ public void run() {
9088
return;
9189
}
9290

93-
BgTask.start("Checking for code reviews", serverAccess.getDownloadingReviewListTask(course), new BgTaskListener<List<Review>>() {
91+
// TODO via core
92+
BgTask.start("Checking for code reviews", new TmcServerCommunicationTaskFactory().getDownloadingReviewListTask(course), new BgTaskListener<List<Review>>() {
9493
@Override
9594
public void bgTaskReady(List<Review> result) {
9695
boolean newReviews = reviewDb.setReviews(result);

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadCompletedExercises.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import fi.helsinki.cs.tmc.core.domain.Course;
44
import fi.helsinki.cs.tmc.core.domain.Exercise;
5+
import fi.helsinki.cs.tmc.core.utilities.ServerErrorHelper;
56
import fi.helsinki.cs.tmc.events.TmcEvent;
67
import fi.helsinki.cs.tmc.events.TmcEventBus;
78
import fi.helsinki.cs.tmc.model.CourseDb;
89
import fi.helsinki.cs.tmc.model.LocalExerciseStatus;
9-
import fi.helsinki.cs.tmc.model.ServerAccess;
1010
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
1111
import fi.helsinki.cs.tmc.ui.DownloadOrUpdateExercisesDialog;
1212
import fi.helsinki.cs.tmc.utilities.BgTaskListener;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadExercisesAction.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import fi.helsinki.cs.tmc.core.TmcCore;
44
import fi.helsinki.cs.tmc.core.domain.Exercise;
55
import fi.helsinki.cs.tmc.core.domain.ProgressObserver;
6+
import fi.helsinki.cs.tmc.core.utilities.ServerErrorHelper;
67
import fi.helsinki.cs.tmc.events.TmcEvent;
78
import fi.helsinki.cs.tmc.events.TmcEventBus;
89
import fi.helsinki.cs.tmc.model.CourseDb;
@@ -62,8 +63,8 @@ private void startDownloading(final Exercise exercise, final BgTaskListener<TmcP
6263
BgTask.start("Downloading " + exercise.getName(), downloadExercisesTask, new BgTaskListener<List<Exercise>>() {
6364
@Override
6465
public void bgTaskReady(List<Exercise> result) {
65-
try {
66-
66+
// try {
67+
logger.warning("res: " + result);
6768
// There is only one exercise given as parameter.
6869
TmcProjectInfo proj = projectMediator.tryGetProjectForExercise(result.get(0));
6970

@@ -72,19 +73,19 @@ public void bgTaskReady(List<Exercise> result) {
7273
}
7374

7475
// Need to invoke courseDb in swing thread to avoid races
75-
SwingUtilities.invokeAndWait(new Runnable() {
76-
@Override
77-
public void run() {
76+
// SwingUtilities.invokeAndWait(new Runnable() {
77+
// @Override
78+
// public void run() {
7879
courseDb.exerciseDownloaded(exercise);
79-
}
80-
});
80+
// }
81+
// });
8182
listener.bgTaskReady(proj);
8283

83-
} catch (InterruptedException ex) {
84-
Exceptions.printStackTrace(ex);
85-
} catch (InvocationTargetException ex) {
86-
Exceptions.printStackTrace(ex);
87-
}
84+
// } catch (InterruptedException ex) {
85+
// Exceptions.printStackTrace(ex);
86+
// } catch (InvocationTargetException ex) {
87+
// Exceptions.printStackTrace(ex);
88+
// }
8889
}
8990

9091
@Override

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadSolutionAction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.communication.TmcServerCommunicationTaskFactory;
34
import fi.helsinki.cs.tmc.core.domain.Exercise;
45
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
6+
import fi.helsinki.cs.tmc.core.utilities.ServerErrorHelper;
57
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
68
import fi.helsinki.cs.tmc.events.TmcEvent;
79
import fi.helsinki.cs.tmc.events.TmcEventBus;
810
import fi.helsinki.cs.tmc.model.CourseDb;
911
import fi.helsinki.cs.tmc.model.ProjectMediator;
10-
import fi.helsinki.cs.tmc.model.ServerAccess;
1112
import fi.helsinki.cs.tmc.model.TmcProjectInfo;
1213
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
1314
import fi.helsinki.cs.tmc.utilities.BgTask;
@@ -132,9 +133,8 @@ public Void apply(Boolean yes) {
132133
}
133134

134135
private void downloadSolution(final Exercise ex, final TmcProjectInfo proj) {
135-
ServerAccess serverAccess = new ServerAccess(((TmcCoreSettingsImpl)TmcSettingsHolder.get()));
136-
CancellableCallable<byte[]> downloadTask =
137-
serverAccess.getDownloadingExerciseSolutionZipTask(ex);
136+
Callable<byte[]> downloadTask =
137+
new TmcServerCommunicationTaskFactory().getDownloadingExerciseSolutionZipTask(ex);
138138
BgTask.start(
139139
"Downloading solution for " + ex.getName(),
140140
downloadTask,

0 commit comments

Comments
 (0)