Package io.grpc.alts.internal
Class AltsHandshakerStub
- java.lang.Object
-
- io.grpc.alts.internal.AltsHandshakerStub
-
class AltsHandshakerStub extends java.lang.ObjectAn interface to the ALTS handshaker service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAltsHandshakerStub.Readerprivate static classAltsHandshakerStub.ThrowableInfo
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<AltsHandshakerStub.ThrowableInfo>exceptionMessageprivate static longHANDSHAKE_RPC_DEADLINE_SECSprivate io.grpc.stub.StreamObserver<HandshakerResp>readerprivate java.util.concurrent.ArrayBlockingQueue<com.google.common.base.Optional<HandshakerResp>>responseQueueprivate HandshakerServiceGrpc.HandshakerServiceStubserviceStubprivate 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 voidclose()Close the connection.private voidcreateWriterIfNull()Create a new writer if the writer is null.(package private) io.grpc.stub.StreamObserver<HandshakerResp>getReaderForTest()private voidmaybeThrowIoException()Throw exception if there is an outstanding exception.HandshakerRespsend(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.InterruptedExceptionjava.io.IOException
-
createWriterIfNull
private void createWriterIfNull()
Create a new writer if the writer is null.
-
maybeThrowIoException
private void maybeThrowIoException() throws java.io.IOExceptionThrow exception if there is an outstanding exception.- Throws:
java.io.IOException
-
close
public void close()
Close the connection.
-
-