@@ -96,36 +96,6 @@ default void showHTML(BrowseParameter content) {
9696 throw new UnsupportedOperationException ();
9797 }
9898
99- @ JsonRequest ("rascal/jobStart" )
100- default CompletableFuture <Void > jobStart (JobStartParameter param ) {
101- throw new UnsupportedOperationException ();
102- }
103-
104- @ JsonRequest ("rascal/jobStep" )
105- default CompletableFuture <Void > jobStep (JobStepParameter param ) {
106- throw new UnsupportedOperationException ();
107- }
108-
109- @ JsonRequest ("rascal/jobEnd" )
110- default CompletableFuture <AmountOfWork > jobEnd (JobEndParameter param ) {
111- throw new UnsupportedOperationException ();
112- }
113-
114- @ JsonRequest ("rascal/jobIsCanceled" )
115- default CompletableFuture <BooleanParameter > jobIsCanceled () {
116- throw new UnsupportedOperationException ();
117- }
118-
119- @ JsonRequest ("rascal/jobTodo" )
120- default CompletableFuture <Void > jobTodo (AmountOfWork param ) {
121- throw new UnsupportedOperationException ();
122- }
123-
124- @ JsonNotification ("rascal/warning" )
125- default void warning (WarningMessage param ) {
126- throw new UnsupportedOperationException ();
127- }
128-
12999 @ JsonNotification ("rascal/registerLocations" )
130100 default void registerLocations (RegisterLocationsParameters param ) {
131101 throw new UnsupportedOperationException ();
@@ -206,121 +176,6 @@ public String getRawAuthority() {
206176
207177 }
208178
209- public static class WarningMessage {
210- private final String location ;
211- private final String message ;
212-
213- public WarningMessage (String message , ISourceLocation src ) {
214- this .message = message ;
215- this .location = src .toString ();
216- }
217-
218- public String getMessage () {
219- return message ;
220- }
221-
222- public ISourceLocation getLocation () {
223- return buildLocation (location );
224- }
225-
226- }
227-
228- private static ISourceLocation buildLocation (String location ) throws FactTypeUseException {
229- try {
230- return (ISourceLocation ) new StandardTextReader ().read (IRascalValueFactory .getInstance (), TypeFactory .getInstance ().sourceLocationType (), new StringReader (location ));
231- } catch (IOException e ) {
232- throw new RuntimeException ("this should never happen:" , e );
233- }
234- }
235- public static class AmountOfWork {
236- private final int amount ;
237-
238- public AmountOfWork (int amount ) {
239- this .amount = amount ;
240- }
241-
242- public int getAmount () {
243- return amount ;
244- }
245- }
246-
247- public static class BooleanParameter {
248- private final boolean truth ;
249-
250- public BooleanParameter (boolean s ) {
251- this .truth = s ;
252- }
253-
254- public boolean isTrue () {
255- return truth ;
256- }
257- }
258- public static class JobStartParameter {
259- private final String name ;
260- private final int workShare ;
261- private final int totalWork ;
262-
263- public JobStartParameter (String name , int workShare , int totalWork ) {
264- this .name = name ;
265- this .workShare = workShare ;
266- this .totalWork = totalWork ;
267- }
268-
269- public String getName () {
270- return name ;
271- }
272-
273- public int getTotalWork () {
274- return totalWork ;
275- }
276-
277- public int getWorkShare () {
278- return workShare ;
279- }
280- }
281-
282- public static class JobStepParameter {
283- private final String name ;
284- private final String message ;
285- private final int inc ;
286-
287- public JobStepParameter (String name , String message , int inc ) {
288- this .name = name ;
289- this .message = message ;
290- this .inc = inc ;
291- }
292-
293- public String getName () {
294- return name ;
295- }
296-
297- public String getMessage () {
298- return message ;
299- }
300-
301- public int getInc () {
302- return inc ;
303- }
304- }
305-
306- public static class JobEndParameter {
307- private final String name ;
308- private final boolean success ;
309-
310- public JobEndParameter (String name , boolean total ) {
311- this .name = name ;
312- this .success = total ;
313- }
314-
315- public String getName () {
316- return name ;
317- }
318-
319- public boolean getSuccess () {
320- return success ;
321- }
322- }
323-
324179 public static String value2string (IValue value ) {
325180 final Encoder encoder = Base64 .getEncoder ();
326181 ByteArrayOutputStream stream = new ByteArrayOutputStream (512 );
@@ -378,18 +233,6 @@ public String toString() {
378233 }
379234 }
380235
381- public static class JobCanceledParameter {
382- private String jobName ;
383-
384- public JobCanceledParameter (String jobName ) {
385- this .jobName = jobName ;
386- }
387-
388- public String getModule () {
389- return jobName ;
390- }
391- }
392-
393236 public static class BrowseParameter {
394237 private String uri ;
395238 private String title ;
@@ -599,5 +442,13 @@ public String toString() {
599442 + ", nonTerminalIsStart=" + nonTerminalIsStart + ", allowAmbiguity=" + allowAmbiguity + "]" ;
600443 }
601444
445+ private static ISourceLocation buildLocation (String location ) throws FactTypeUseException {
446+ try {
447+ return (ISourceLocation ) new StandardTextReader ().read (IRascalValueFactory .getInstance (), TypeFactory .getInstance ().sourceLocationType (), new StringReader (location ));
448+ } catch (IOException e ) {
449+ throw new RuntimeException ("this should never happen:" , e );
450+ }
451+ }
452+
602453 }
603454}
0 commit comments