-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactoring the transfer controller to support the new scheduling * intial scheduling work and refactoring of job submission apis * including spring profiles * refactored the public API to have UserTransferOptions Contain the scheduled time * backends fully up and running with the MetaData API now containing most recent influx information, and scheduler has been modified slightly * Date picker (#448) * visuals for calendar added * added time to date picker * added constraints for past dates and data will be sent to the backend * Fixed b to Mb and interval rendering * added credentialID textbox to stfp/http/ftp (#445) * added credentialID textbox to stfp/http/ftp * Credential ID working but some issues with spaced values --------- Co-authored-by: jacob goldverg <[email protected]> * removed all gridftp related functions (#443) * syntax error fix * request JSON changed * fixed transfer submission. 2 problems 1 the resourceList was an object, and then there were no default values for the two new paths * small change --------- Co-authored-by: Andrew <[email protected]> Co-authored-by: idkuri <[email protected]>
- Loading branch information
1 parent
de44a5b
commit 2b7a3a5
Showing
36 changed files
with
506 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
src/main/java/org/onedatashare/server/controller/TransferJobController.java
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
src/main/java/org/onedatashare/server/controller/TransferSchedulerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.onedatashare.server.controller; | ||
|
||
import org.onedatashare.server.model.ScheduledTransferJobRequest; | ||
import org.onedatashare.server.model.TransferJobRequestDTO; | ||
import org.onedatashare.server.model.request.StopRequest; | ||
import org.onedatashare.server.service.TransferSchedulerService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.server.ResponseStatusException; | ||
import reactor.core.publisher.Mono; | ||
|
||
import java.security.Principal; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@RestController | ||
@RequestMapping("/api/job") | ||
public class TransferSchedulerController { | ||
|
||
private final TransferSchedulerService transferSchedulerService; | ||
|
||
public TransferSchedulerController(TransferSchedulerService transferSchedulerService) { | ||
this.transferSchedulerService = transferSchedulerService; | ||
} | ||
|
||
|
||
Logger logger = LoggerFactory.getLogger(TransferSchedulerController.class); | ||
|
||
@PostMapping("/schedule") | ||
public ResponseEntity<Mono<UUID>> runJob(@RequestBody TransferJobRequestDTO request, | ||
Principal principal) { | ||
logger.debug("Recieved request: " + request.toString()); | ||
request.setOwnerId(principal.getName()); | ||
return ResponseEntity.ok(transferSchedulerService.scheduleJob(request)); | ||
} | ||
|
||
@PostMapping("/stop") | ||
public Mono<Void> stopJob(@RequestBody StopRequest stopRequest) { | ||
return transferSchedulerService.stopTransferJob(stopRequest) | ||
.onErrorResume(e -> Mono.error(new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, | ||
"Failed to stop job execution"))); | ||
} | ||
@GetMapping("/list") | ||
public ResponseEntity<Mono<List<ScheduledTransferJobRequest>>> listScheduledJobs(@RequestParam String userEmail) { | ||
return ResponseEntity.ok(this.transferSchedulerService.listScheduledJobs(userEmail)); | ||
} | ||
|
||
@GetMapping("/details") | ||
public ResponseEntity<Mono<TransferJobRequestDTO>> getScheduledJob(@RequestParam UUID jobUuid) { | ||
return ResponseEntity.ok(this.transferSchedulerService.getJobDetails(jobUuid)); | ||
} | ||
|
||
@DeleteMapping("/delete") | ||
public ResponseEntity<Void> deleteScheduledJob(@RequestParam UUID jobUuid) { | ||
this.transferSchedulerService.deleteScheduledJob(jobUuid); | ||
return ResponseEntity.accepted().build(); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/onedatashare/server/model/EntityInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.onedatashare.server.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class EntityInfo { | ||
protected String id; | ||
protected String path; | ||
protected long size; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/org/onedatashare/server/model/FileDestination.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.onedatashare.server.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import org.onedatashare.server.model.core.EndpointType; | ||
|
||
import java.io.Serializable; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class FileDestination implements Serializable { | ||
|
||
@NonNull | ||
private String credId; | ||
|
||
@NonNull | ||
private EndpointType type; | ||
|
||
|
||
String fileDestinationPath = ""; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/org/onedatashare/server/model/FileSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.onedatashare.server.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.NonNull; | ||
import org.onedatashare.server.model.core.EndpointType; | ||
|
||
import java.io.Serializable; | ||
import java.util.ArrayList; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class FileSource implements Serializable { | ||
@NonNull | ||
private String credId; | ||
@NonNull | ||
public EndpointType type; | ||
|
||
public String fileSourcePath = ""; //can also be the parent Id to the directory to find all data in the infoList | ||
|
||
@NonNull | ||
public ArrayList<EntityInfo> resourceList; //a list of files and folders. This will end up being a list of only files with paths fully expanded | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/org/onedatashare/server/model/ScheduledTransferJobRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.onedatashare.server.model; | ||
|
||
import lombok.Data; | ||
import org.onedatashare.server.model.request.UserTransferOptions; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
|
||
@Data | ||
public class ScheduledTransferJobRequest implements Serializable { | ||
|
||
LocalDateTime jobStartTime; | ||
UUID jobUuid; | ||
String ownerId; | ||
FileSource source; | ||
FileDestination destination; | ||
UserTransferOptions options; | ||
String transferNodeName; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/org/onedatashare/server/model/TransferJobRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.onedatashare.server.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import lombok.Data; | ||
import org.onedatashare.server.model.request.UserTransferOptions; | ||
|
||
import java.io.Serializable; | ||
|
||
@Data | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class TransferJobRequestDTO implements Serializable { | ||
private String ownerId; | ||
private FileSource source; | ||
private FileDestination destination; | ||
private UserTransferOptions options; | ||
private String transferNodeName; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.