Package io.grpc.alts.internal
Class AltsHandshakerStub
- java.lang.Object
-
- io.grpc.alts.internal.AltsHandshakerStub
-
class AltsHandshakerStub extends java.lang.Object
An interface to the ALTS handshaker service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AltsHandshakerStub.Reader
private static class
AltsHandshakerStub.ThrowableInfo
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<AltsHandshakerStub.ThrowableInfo>
exceptionMessage
private static long
HANDSHAKE_RPC_DEADLINE_SECS
private io.grpc.stub.StreamObserver<HandshakerResp>
reader
private java.util.concurrent.ArrayBlockingQueue<com.google.common.base.Optional<HandshakerResp>>
responseQueue
private HandshakerServiceGrpc.HandshakerServiceStub
serviceStub
private io.grpc.stub.StreamObserver<HandshakerReq>
writer
-
Constructor Summary
Constructors Constructor Description AltsHandshakerStub()
AltsHandshakerStub(HandshakerServiceGrpc.HandshakerServiceStub serviceStub)
AltsHandshakerStub(io.grpc.stub.StreamObserver<HandshakerReq> writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the connection.private void
createWriterIfNull()
Create a new writer if the writer is null.(package private) io.grpc.stub.StreamObserver<HandshakerResp>
getReaderForTest()
private void
maybeThrowIoException()
Throw exception if there is an outstanding exception.HandshakerResp
send(HandshakerReq req)
Send a handshaker request and return the handshaker response.
-
-
-
Field Detail
-
reader
private final io.grpc.stub.StreamObserver<HandshakerResp> reader
-
writer
private io.grpc.stub.StreamObserver<HandshakerReq> writer
-
serviceStub
private final HandshakerServiceGrpc.HandshakerServiceStub serviceStub
-
responseQueue
private final java.util.concurrent.ArrayBlockingQueue<com.google.common.base.Optional<HandshakerResp>> responseQueue
-
exceptionMessage
private final java.util.concurrent.atomic.AtomicReference<AltsHandshakerStub.ThrowableInfo> exceptionMessage
-
HANDSHAKE_RPC_DEADLINE_SECS
private static final long HANDSHAKE_RPC_DEADLINE_SECS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AltsHandshakerStub
AltsHandshakerStub(HandshakerServiceGrpc.HandshakerServiceStub serviceStub)
-
AltsHandshakerStub
AltsHandshakerStub()
-
AltsHandshakerStub
AltsHandshakerStub(io.grpc.stub.StreamObserver<HandshakerReq> writer)
-
-
Method Detail
-
getReaderForTest
io.grpc.stub.StreamObserver<HandshakerResp> getReaderForTest()
-
send
public HandshakerResp send(HandshakerReq req) throws java.lang.InterruptedException, java.io.IOException
Send a handshaker request and return the handshaker response.- Throws:
java.lang.InterruptedException
java.io.IOException
-
createWriterIfNull
private void createWriterIfNull()
Create a new writer if the writer is null.
-
maybeThrowIoException
private void maybeThrowIoException() throws java.io.IOException
Throw exception if there is an outstanding exception.- Throws:
java.io.IOException
-
close
public void close()
Close the connection.
-
-