Server builds

This commit is contained in:
Aidan Hahn 2019-05-17 01:35:55 -07:00
parent d6e73cf7ad
commit e476438c8c
No known key found for this signature in database
GPG key ID: 327711E983899316

View file

@ -16,12 +16,12 @@ public class JobServServer {
private void start() throws IOException {
// TODO: this should be passed in from a configuration manager
int port = 8448;
server = ServerBUilder.forPort(port)
.addService(new JobServImpl())
server = ServerBuilder.forPort(port)
.addService(new ShellServerImpl())
.build()
.start();
logger.info("Server initialized without tls");
Runtime.getRuntime().addShutdownHook(new thread() {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
// JVM shutdown might break logger functionality
@ -53,7 +53,7 @@ public class JobServServer {
}
// wrap around stub code generated by GRPC
static class JobServImpl extends JobServ.JobServImplBase {
static class ShellServerImpl extends ShellServerGrpc.ShellServerImplBase {
@Override
public void getStatusDetail(RequestMessage request,
@ -72,7 +72,6 @@ public class JobServServer {
StreamObserver<OutputMessage> responder) {
// TODO: Implement job controller, get output, do the thing
OutputMessage reply = OutputMessage.newBuilder()
.setPID(-1)
.build();
responder.onNext(reply);
responder.onCompleted();
@ -84,7 +83,7 @@ public class JobServServer {
// TODO: Implement job controller, Start Job, do the thing
JobStatusMessage reply = JobStatusMessage.newBuilder()
.setPID(-1)
.setJobStatus(-1)
.setProcessStatus(-1)
.build();
responder.onNext(reply);
responder.onCompleted();