Class VaultRpcChannel.Reply
java.lang.Object
lol.trq.alts.spi.VaultRpcChannel.Reply
- Enclosing interface:
VaultRpcChannel
The outcome of one call: the response message on
OK, else the status code, its message and the
trailers. A value: equal replies have equal parts, and toString() leaves the message bytes out.- Since:
- 1.1.0
-
Method Summary
Modifier and TypeMethodDescriptionintcode()The gRPC status code.booleanCompares every part, the message bytes included.inthashCode()Hashes every part.booleanisOk()Whether the call succeeded.byte[]message()The response message of a successful call.static VaultRpcChannel.Replyok(byte[] message) A successful call.static VaultRpcChannel.ReplyA call that ended with a status other thanOK.The status message.toString()Names the outcome and the message size, never the message bytes or the trailer values.trailers()The response headers and trailers, merged and normalized.
-
Method Details
-
ok
A successful call.- Parameters:
message- the response message, copied- Returns:
- the reply
- Since:
- 1.1.0
-
status
A call that ended with a status other thanOK.- Parameters:
code- the gRPC status code,1to16message- the status message, ornullfor none; under the AVP profile a refusal's message is its SPEC 10.4 codetrailers- the response headers and trailers, ornullfor none; keys are lower-cased, and a-binkey, a key that is not ASCII and a value that is not printable ASCII are dropped- Returns:
- the reply
- Throws:
IllegalArgumentException- ifcodeis0(useok(byte[])) or outside1to16- Since:
- 1.1.0
-
isOk
public boolean isOk()Whether the call succeeded.- Returns:
- whether the status is
OK - Since:
- 1.1.0
-
message
public byte[] message()The response message of a successful call.- Returns:
- a copy of the message; empty for a failed call
- Since:
- 1.1.0
-
code
public int code()The gRPC status code.- Returns:
0forOK, else1to16- Since:
- 1.1.0
-
statusMessage
The status message.- Returns:
- the message; empty for a successful call or a status without one
- Since:
- 1.1.0
-
trailers
-
equals
-
hashCode
-
toString
-