Class HandlerDefinition<REQ,RES>
java.lang.Object
dev.restate.sdk.endpoint.definition.HandlerDefinition<REQ,RES>
This class represents a Restate handler.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionconfigure(Consumer<HandlerDefinition.Configurator> configurator) boolean@Nullable Duration@Nullable String@Nullable String@Nullable Boolean@Nullable Duration@Nullable Duration@Nullable Boolean@Nullable InvocationRetryPolicy@Nullable DurationgetName()@Nullable DurationinthashCode()static <REQ,RES> HandlerDefinition <REQ, RES> of(String handler, HandlerType handlerType, Serde<REQ> requestSerde, Serde<RES> responseSerde, HandlerRunner<REQ, RES> runner) withAcceptContentType(String acceptContentType) withDocumentation(@Nullable String documentation) withMetadata(Map<String, String> metadata)
-
Method Details
-
getName
- Returns:
- handler name.
-
getHandlerType
- Returns:
- handler type.
-
getAcceptContentType
- Returns:
- the acceptable content type when ingesting HTTP requests. Wildcards can be used, e.g.
application / *or* / *.
-
getRequestSerde
- Returns:
- request
Serde
-
getResponseSerde
- Returns:
- response
Serde
-
getDocumentation
- Returns:
- handler documentation. When using the annotation processor, this will contain the javadoc of the annotated methods.
-
getMetadata
- Returns:
- metadata, as shown in the Admin REST API.
-
getRunner
-
getInactivityTimeout
- Returns:
- the inactivity timeout applied to this handler.
- See Also:
-
getAbortTimeout
- Returns:
- the abort timeout applied to this handler.
- See Also:
-
getIdempotencyRetention
- Returns:
- the idempotency retention applied to this handler.
- See Also:
-
getWorkflowRetention
- Returns:
- the workflow retention applied to this handler.
- See Also:
-
getJournalRetention
- Returns:
- the journal retention applied to this handler.
- See Also:
-
getIngressPrivate
- Returns:
- true if this handler cannot be invoked from the restate-server HTTP and Kafka ingress, but only from other services.
- See Also:
-
getEnableLazyState
- Returns:
- true if this handler will use lazy state.
- See Also:
-
getInvocationRetryPolicy
- Returns:
- Retry policy for all requests to this handler
- See Also:
-
withAcceptContentType
-
withDocumentation
-
withMetadata
-
configure
- Returns:
- a copy of this
HandlerDefinition, configured with theHandlerDefinition.Configurator.
-
of
public static <REQ,RES> HandlerDefinition<REQ,RES> of(String handler, HandlerType handlerType, Serde<REQ> requestSerde, Serde<RES> responseSerde, HandlerRunner<REQ, RES> runner) -
equals
-
hashCode
public int hashCode()
-