public final class ProtoMessage extends Object
Constructor and Description |
---|
ProtoMessage(Protocol.AsyncCacheRequest request) |
ProtoMessage(Protocol.Heartbeat heartbeat) |
ProtoMessage(Protocol.LocalBlockCloseRequest request) |
ProtoMessage(Protocol.LocalBlockCompleteRequest request) |
ProtoMessage(Protocol.LocalBlockCreateRequest request) |
ProtoMessage(Protocol.LocalBlockCreateResponse response) |
ProtoMessage(Protocol.LocalBlockOpenRequest request) |
ProtoMessage(Protocol.LocalBlockOpenResponse response) |
ProtoMessage(Protocol.ReadRequest readRequest) |
ProtoMessage(Protocol.ReadResponse response) |
ProtoMessage(Protocol.Response response) |
ProtoMessage(Protocol.WriteRequest writeRequest) |
Modifier and Type | Method and Description |
---|---|
Protocol.AsyncCacheRequest |
asAsyncCacheRequest() |
Protocol.LocalBlockCloseRequest |
asLocalBlockCloseRequest()
Gets the local block close request or throws runtime exception if mMessage is not of type
Protocol.LocalBlockCloseRequest . |
Protocol.LocalBlockCompleteRequest |
asLocalBlockCompleteRequest() |
Protocol.LocalBlockCreateRequest |
asLocalBlockCreateRequest() |
Protocol.LocalBlockCreateResponse |
asLocalBlockCreateResponse() |
Protocol.LocalBlockOpenRequest |
asLocalBlockOpenRequest()
Gets the local block open request or throws runtime exception if mMessage is not of type
Protocol.LocalBlockOpenRequest . |
Protocol.LocalBlockOpenResponse |
asLocalBlockOpenResponse()
Gets the local block open response or throws runtime exception if mMessage is not of type
Protocol.LocalBlockOpenResponse . |
Protocol.ReadRequest |
asReadRequest()
Gets the read request or throws runtime exception if mMessage is not of type
Protocol.ReadRequest . |
Protocol.ReadResponse |
asReadResponse()
Gets the read response or throws runtime exception if mMessage is not of type
Protocol.ReadResponse . |
Protocol.Response |
asResponse()
Gets the response or throws runtime exception if mMessage is not of type
Protocol.Response . |
Protocol.WriteRequest |
asWriteRequest()
Gets the write request or throws runtime exception if mMessage is not of type
Protocol.WriteRequest . |
boolean |
isAsyncCacheRequest() |
boolean |
isHeartbeat() |
boolean |
isLocalBlockCloseRequest() |
boolean |
isLocalBlockCompleteRequest() |
boolean |
isLocalBlockCreateRequest() |
boolean |
isLocalBlockCreateResponse() |
boolean |
isLocalBlockOpenRequest() |
boolean |
isLocalBlockOpenResponse() |
boolean |
isReadRequest() |
boolean |
isReadResponse() |
boolean |
isResponse() |
boolean |
isWriteRequest() |
static ProtoMessage |
parseFrom(byte[] serialized,
ProtoMessage prototype)
Parses proto message from bytes given a prototype.
|
byte[] |
toByteArray() |
String |
toString() |
public ProtoMessage(Protocol.ReadRequest readRequest)
readRequest
- the read requestpublic ProtoMessage(Protocol.WriteRequest writeRequest)
writeRequest
- the write requestpublic ProtoMessage(Protocol.Response response)
response
- the responsepublic ProtoMessage(Protocol.ReadResponse response)
response
- the read responsepublic ProtoMessage(Protocol.LocalBlockOpenRequest request)
request
- the local block open requestpublic ProtoMessage(Protocol.LocalBlockOpenResponse response)
response
- the local block open responsepublic ProtoMessage(Protocol.LocalBlockCloseRequest request)
request
- the local block close requestpublic ProtoMessage(Protocol.LocalBlockCreateRequest request)
request
- the local block create requestpublic ProtoMessage(Protocol.LocalBlockCreateResponse response)
response
- the local block create responsepublic ProtoMessage(Protocol.LocalBlockCompleteRequest request)
request
- the local block complete requestpublic ProtoMessage(Protocol.AsyncCacheRequest request)
request
- the async cache requestpublic ProtoMessage(Protocol.Heartbeat heartbeat)
heartbeat
- the heartbeatpublic Protocol.ReadRequest asReadRequest()
Protocol.ReadRequest
.public boolean isReadRequest()
Protocol.ReadRequest
public Protocol.WriteRequest asWriteRequest()
Protocol.WriteRequest
.public boolean isWriteRequest()
Protocol.WriteRequest
public Protocol.Response asResponse()
Protocol.Response
.public boolean isResponse()
Protocol.Response
public Protocol.ReadResponse asReadResponse()
Protocol.ReadResponse
.public boolean isReadResponse()
Protocol.ReadResponse
public Protocol.LocalBlockOpenRequest asLocalBlockOpenRequest()
Protocol.LocalBlockOpenRequest
.public boolean isLocalBlockOpenRequest()
Protocol.LocalBlockOpenRequest
public Protocol.LocalBlockOpenResponse asLocalBlockOpenResponse()
Protocol.LocalBlockOpenResponse
.public boolean isLocalBlockOpenResponse()
Protocol.LocalBlockOpenResponse
public Protocol.LocalBlockCloseRequest asLocalBlockCloseRequest()
Protocol.LocalBlockCloseRequest
.public boolean isLocalBlockCloseRequest()
Protocol.LocalBlockCloseRequest
public Protocol.LocalBlockCreateRequest asLocalBlockCreateRequest()
public boolean isLocalBlockCreateRequest()
Protocol.LocalBlockCreateRequest
public Protocol.LocalBlockCreateResponse asLocalBlockCreateResponse()
public boolean isLocalBlockCreateResponse()
Protocol.LocalBlockCreateResponse
public Protocol.LocalBlockCompleteRequest asLocalBlockCompleteRequest()
public boolean isLocalBlockCompleteRequest()
Protocol.LocalBlockCompleteRequest
public Protocol.AsyncCacheRequest asAsyncCacheRequest()
public boolean isAsyncCacheRequest()
public boolean isHeartbeat()
Protocol.Heartbeat
public byte[] toByteArray()
public static ProtoMessage parseFrom(byte[] serialized, ProtoMessage prototype)
serialized
- the serialized messageprototype
- the prototype of the message to return which is usually constructed via
new ProtoMessage(SomeProtoType.getDefaultInstance())Copyright © 2023. All Rights Reserved.