@Test public void socketSecurityOther() throws Exception { Message contents = GetChannelRequest.newBuilder().setChannelId(1).build(); Any packed = Any.pack(contents); socket.security = new InternalChannelz.Security( new InternalChannelz.OtherSecurity("other_security", packed)); assertEquals( Security.newBuilder().setOther( OtherSecurity.newBuilder().setName("other_security").setValue(packed)) .build(), ChannelzProtoUtil.toSocket(socket).getSecurity()); }
static Socket toSocket(InternalInstrumented<SocketStats> obj) { SocketStats socketStats = getFuture(obj.getStats()); Socket.Builder builder = Socket.newBuilder() .setRef(toSocketRef(obj)) .setLocal(toAddress(socketStats.local)); if (socketStats.security != null) { builder.setSecurity(toSecurity(socketStats.security)); } if (socketStats.remote != null) { builder.setRemote(toAddress(socketStats.remote)); } builder.setData(extractSocketData(socketStats)); return builder.build(); }
ChannelzProtoUtil { static Socket toSocket(InternalInstrumented<SocketStats> obj) { SocketStats socketStats = getFuture(obj.getStats()); Socket.Builder builder = Socket.newBuilder() .setRef(toSocketRef(obj)) .setLocal(toAddress(socketStats.local)); if (socketStats.security != null) { builder.setSecurity(toSecurity(socketStats.security)); } if (socketStats.remote != null) { builder.setRemote(toAddress(socketStats.remote)); } builder.setData(extractSocketData(socketStats)); return builder.build(); } }
ChannelzProtoUtil { static Socket toSocket(InternalInstrumented<SocketStats> obj) { SocketStats socketStats = getFuture(obj.getStats()); Socket.Builder builder = Socket.newBuilder() .setRef(toSocketRef(obj)) .setLocal(toAddress(socketStats.local)); if (socketStats.security != null) { builder.setSecurity(toSecurity(socketStats.security)); } if (socketStats.remote != null) { builder.setRemote(toAddress(socketStats.remote)); } builder.setData(extractSocketData(socketStats)); return builder.build(); } private  ChannelzProtoUtil(); }
ChannelzProtoUtil { static Socket toSocket(InternalInstrumented<SocketStats> obj) { SocketStats socketStats = getFuture(obj.getStats()); Socket.Builder builder = Socket.newBuilder() .setRef(toSocketRef(obj)) .setLocal(toAddress(socketStats.local)); if (socketStats.security != null) { builder.setSecurity(toSecurity(socketStats.security)); } if (socketStats.remote != null) { builder.setRemote(toAddress(socketStats.remote)); } builder.setData(extractSocketData(socketStats)); return builder.build(); } private  ChannelzProtoUtil();  }
ChannelzProtoUtil { static Socket toSocket(InternalInstrumented<SocketStats> obj) { SocketStats socketStats = getFuture(obj.getStats()); Socket.Builder builder = Socket.newBuilder() .setRef(toSocketRef(obj)) .setLocal(toAddress(socketStats.local)); if (socketStats.security != null) { builder.setSecurity(toSecurity(socketStats.security)); } if (socketStats.remote != null) { builder.setRemote(toAddress(socketStats.remote)); } builder.setData(extractSocketData(socketStats)); return builder.build(); } private  ChannelzProtoUtil();  static final String SO_LINGER; static final String SO_TIMEOUT; static final String TCP_INFO; }