Class EventStreamRPCServiceModel
java.lang.Object
software.amazon.awssdk.eventstreamrpc.EventStreamRPCServiceModel
- Direct Known Subclasses:
GreengrassCoreIPCServiceModel
Implementers of this service model are expected to likely be singletons. There
should be little value to having more than one, though between different instances
properly constructed for a service, they can be used interchangeably
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanblobTypeEquals(Optional<byte[]> lhs, Optional<byte[]> rhs) Used to compare two members of a blob shape for equality.<T extends EventStreamJsonMessage>
TCreates a EventStreamJsonMessage of type T from the given application model class and payload.Creates a EventStreamJsonMessage from the given application model type string and payload.abstract Collection<String>Retreives all operations on the servicefinal Optional<Class<? extends EventStreamJsonMessage>>getApplicationModelClass(String applicationModelType) Returns the application model classabstract OperationModelContextgetOperationModelContext(String operationName) Retrieves the operation model context for a given operation name on the service This may not be a useful interface as generated code will typically pull a known operation model context Public visibility is useful for testingabstract StringFor getting the actual service namestatic com.google.gson.GsonIn situations where the framework needs to do some JSON processing without a specific service/operation in contextbyte[]toJson(EventStreamJsonMessage message) toJsonString(EventStreamJsonMessage message) Converts the given EventStreamJsonMessage to a JSON string
-
Field Details
-
CONTENT_TYPE_HEADER
Content type header string- See Also:
-
CONTENT_TYPE_APPLICATION_TEXT
Content type application text string- See Also:
-
CONTENT_TYPE_APPLICATION_JSON
Content type application json string- See Also:
-
SERVICE_MODEL_TYPE_HEADER
Service model type header- See Also:
-
-
Constructor Details
-
EventStreamRPCServiceModel
public EventStreamRPCServiceModel()
-
-
Method Details
-
blobTypeEquals
Used to compare two members of a blob shape for equality. Array equals nesting inside of an Optional doesn't work Note: Generated code for equals method of Smithy shapes relies on this- Parameters:
lhs- The first to comparerhs- The second to compare- Returns:
- True if both are equal, false otherwise
-
getServiceName
For getting the actual service name- Returns:
- The name of the service as a string
-
getApplicationModelClass
public final Optional<Class<? extends EventStreamJsonMessage>> getApplicationModelClass(String applicationModelType) Returns the application model class- Parameters:
applicationModelType- The application model- Returns:
- The class of the given application model
-
getAllOperations
Retreives all operations on the service- Returns:
- All operations on the service
-
getOperationModelContext
Retrieves the operation model context for a given operation name on the service This may not be a useful interface as generated code will typically pull a known operation model context Public visibility is useful for testing- Parameters:
operationName- The name of the operation- Returns:
- The operation context associated with the given operation name
-
toJson
-
toJsonString
Converts the given EventStreamJsonMessage to a JSON string- Parameters:
message- The message to convert- Returns:
- A JSON string
-
getStaticGson
public static com.google.gson.Gson getStaticGson()In situations where the framework needs to do some JSON processing without a specific service/operation in context- Returns:
- the static Gson instance capable of processing the basics of EventStreamableJsonMessage
-
fromJson
Creates a EventStreamJsonMessage from the given application model type string and payload. Uses this service's specific model class to create the EventStreamJsonMessage.- Parameters:
applicationModelType- The application model type stringpayload- The payload- Returns:
- A EventStreamMessage
-
fromJson
Creates a EventStreamJsonMessage of type T from the given application model class and payload.- Type Parameters:
T- The type to convert the result to- Parameters:
clazz- The classpayload- The payload- Returns:
- A EventStreamMessage of type T
-