status
This commit is contained in:
parent
afc9b1839d
commit
2ac4dd6c3f
8
grpc.iml
8
grpc.iml
|
@ -14,6 +14,8 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_mongo:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_java:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.grpc:grpc-netty:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.grpc:grpc-core:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.0.11" level="project" />
|
||||
|
@ -42,6 +44,9 @@
|
|||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_jmx:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_sql:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_snmp:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.snmp4j:snmp4j:2.5.0" level="project" />
|
||||
|
@ -49,10 +54,9 @@
|
|||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_redis:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_mongo:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_mongodb:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_wmi:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.loafle.overflow:crawler_java:1.0.0-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.hynnet:jacob:1.18" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.ObjectOutput;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.lang.Boolean;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -62,6 +63,7 @@ public class Server {
|
|||
server = ServerBuilder.forPort(port)
|
||||
.addService(new ConfigImpl())
|
||||
.addService(new DataImpl())
|
||||
.addService(new StatusImpl())
|
||||
.build()
|
||||
.start();
|
||||
logger.info("Server started, listening on " + port);
|
||||
|
@ -91,6 +93,25 @@ public class Server {
|
|||
}
|
||||
}
|
||||
|
||||
static class StatusImpl extends StatusGrpc.StatusImplBase {
|
||||
@Override
|
||||
public void status(Empty request, StreamObserver<com.loafle.overflow.rpc.Boolean> responseObserver) {
|
||||
com.loafle.overflow.rpc.Boolean reply = null;
|
||||
try {
|
||||
reply = com.loafle.overflow.rpc.Boolean.newBuilder()
|
||||
.setCheck(true)
|
||||
.build();
|
||||
responseObserver.onNext(reply);
|
||||
responseObserver.onCompleted();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static class DataImpl extends DataGrpc.DataImplBase {
|
||||
@Override
|
||||
public void get(Input req, StreamObserver<Output> responseObserver) {
|
||||
|
|
|
@ -48,6 +48,14 @@ service Data {
|
|||
rpc Get (Input) returns (Output) {}
|
||||
}
|
||||
|
||||
service Status {
|
||||
rpc Status(Empty) returns (Boolean) {}
|
||||
}
|
||||
|
||||
message Empty {}
|
||||
message Boolean {
|
||||
bool check = 1;
|
||||
}
|
||||
|
||||
// request models
|
||||
message InputArray {
|
||||
|
|
Loading…
Reference in New Issue
Block a user