diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2018-12-24 23:20:35 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2018-12-24 23:20:35 +0900 |
commit | 48fa25d06c96262779253b0b051e8d1a34604764 (patch) | |
tree | fabaad0ea3022bc15c526e6757793ce62d2b67b3 /tools/grpc/java | |
parent | bb1bbdd197a971917ae24946a4c4d2da539e5d55 (diff) |
docs: delete outdated java/nodejs/ruby gRPC API examples
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'tools/grpc/java')
-rw-r--r-- | tools/grpc/java/src/gobgp/example/GobgpSampleClient.java | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/tools/grpc/java/src/gobgp/example/GobgpSampleClient.java b/tools/grpc/java/src/gobgp/example/GobgpSampleClient.java deleted file mode 100644 index 287b46b6..00000000 --- a/tools/grpc/java/src/gobgp/example/GobgpSampleClient.java +++ /dev/null @@ -1,44 +0,0 @@ -package gobgp.example; - -import gobgpapi.Gobgp; -import gobgpapi.GobgpApiGrpc; -import io.grpc.ManagedChannel; -import io.grpc.ManagedChannelBuilder; - -import java.util.List; - -public class GobgpSampleClient { - - private final GobgpApiGrpc.GobgpApiBlockingStub blockingStub; - - public GobgpSampleClient(String host, int port) { - ManagedChannel channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build(); - this.blockingStub = GobgpApiGrpc.newBlockingStub(channel); - } - - public void getNeighbors(){ - - Gobgp.GetNeighborRequest request = Gobgp.GetNeighborRequest.newBuilder().build(); - - for(Gobgp.Peer peer: this.blockingStub.getNeighbor(request).getPeersList()) { - Gobgp.PeerConf conf = peer.getConf(); - Gobgp.PeerState state = peer.getInfo(); - Gobgp.Timers timer = peer.getTimers(); - - System.out.printf("BGP neighbor is %s, remote AS %d\n", conf.getNeighborAddress(), conf.getPeerAs()); - System.out.printf("\tBGP version 4, remote router ID %s\n", conf.getId()); - System.out.printf("\tBGP state = %s, up for %d\n", state.getBgpState(), timer.getState().getUptime()); - System.out.printf("\tBGP OutQ = %d, Flops = %d\n", state.getOutQ(), state.getFlops()); - System.out.printf("\tHold time is %d, keepalive interval is %d seconds\n", - timer.getState().getHoldTime(), timer.getState().getKeepaliveInterval()); - System.out.printf("\tConfigured hold time is %d\n", timer.getConfig().getHoldTime()); - - } - } - - public static void main(String args[]){ - new GobgpSampleClient(args[0], 50051).getNeighbors(); - } - -} - |