refactor API based on design document feedback
This commit is contained in:
parent
185b686ad1
commit
68eabf6510
3 changed files with 234 additions and 136 deletions
|
|
@ -56,34 +56,56 @@ public class JobServServer {
|
|||
static class ShellServerImpl extends ShellServerGrpc.ShellServerImplBase {
|
||||
|
||||
@Override
|
||||
public void getStatusDetail(RequestMessage request,
|
||||
StreamObserver<JobStatusMessage> responder) {
|
||||
public void getStatus(PIDMessage request,
|
||||
StreamObserver<StatusMessage> responder) {
|
||||
// TODO: Implement job controller, check request type, do the thing
|
||||
JobStatusMessage reply = JobStatusMessage.newBuilder()
|
||||
.setPID(-1)
|
||||
.setProcessStatus(-1)
|
||||
StatusMessage reply = StatusMessage.newBuilder()
|
||||
.setStatusCode(-1)
|
||||
.build();
|
||||
responder.onNext(reply);
|
||||
responder.onCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getJobOutput(RequestMessage request,
|
||||
StreamObserver<OutputMessage> responder) {
|
||||
public void getOutput(PIDMessage request,
|
||||
StreamObserver<OutputMessage> responder) {
|
||||
// TODO: Implement job controller, get output, do the thing
|
||||
OutputMessage reply = OutputMessage.newBuilder()
|
||||
.setOutput("test data")
|
||||
.build();
|
||||
responder.onNext(reply);
|
||||
responder.onCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void makeNewJob(NewJobMessage request,
|
||||
StreamObserver<JobStatusMessage> responder) {
|
||||
public void newJob(NewJobMessage request,
|
||||
StreamObserver<PIDMessage> responder) {
|
||||
// TODO: Implement job controller, Start Job, do the thing
|
||||
JobStatusMessage reply = JobStatusMessage.newBuilder()
|
||||
.setPID(-1)
|
||||
.setProcessStatus(-1)
|
||||
PIDMessage reply = PIDMessage.newBuilder()
|
||||
.setPid(-1)
|
||||
.build();
|
||||
responder.onNext(reply);
|
||||
responder.onCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getReturn(PIDMessage request,
|
||||
StreamObserver<ReturnMessage> responder) {
|
||||
// TODO: Implement job controller, get return code
|
||||
ReturnMessage reply = ReturnMessage.newBuilder()
|
||||
.setprocessReturnCode(277)
|
||||
.build();
|
||||
responder.onNext(reply);
|
||||
responder.onCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void killJob(PIDMessage request,
|
||||
StreamObserver<ReturnMessage> responder) {
|
||||
// TODO: implement job controller, do the thing
|
||||
// TODO: kill job here
|
||||
ReturnMessage reply = ReturnMessage.newBuilder()
|
||||
.setprocessReturnCode(-1)
|
||||
.build();
|
||||
responder.onNext(reply);
|
||||
responder.onCompleted();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue