Class ServiceDefinition
java.lang.Object
dev.restate.sdk.endpoint.definition.ServiceDefinition
This class represents a Restate service.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionconfigure
(Consumer<ServiceDefinition.Configurator> configurator) boolean
@Nullable Duration
@Nullable String
@Nullable Boolean
@Nullable HandlerDefinition
<?, ?> getHandler
(String name) Collection
<HandlerDefinition<?, ?>> @Nullable Duration
@Nullable Duration
@Nullable Boolean
@Nullable Duration
int
hashCode()
static ServiceDefinition
of
(String name, ServiceType ty, Collection<HandlerDefinition<?, ?>> handlers) withDocumentation
(@Nullable String documentation) withMetadata
(Map<String, String> metadata)
-
Method Details
-
getServiceName
- Returns:
- service name.
-
getServiceType
- Returns:
- service type.
-
getHandlers
- Returns:
- handlers.
-
getHandler
- Returns:
- a specific handler.
-
getDocumentation
- Returns:
- service documentation. When using the annotation processor, this will contain the javadoc of the annotated service class or interface.
-
getMetadata
- Returns:
- metadata, as shown in the Admin REST API.
-
getInactivityTimeout
- Returns:
- the inactivity timeout applied to all handlers of this service.
- See Also:
-
getAbortTimeout
- Returns:
- the abort timeout applied to all handlers of this service.
- See Also:
-
getIdempotencyRetention
- Returns:
- the idempotency retention applied to all handlers of this service.
- See Also:
-
getJournalRetention
- Returns:
- the journal retention applied to all handlers of this service.
- See Also:
-
getIngressPrivate
- Returns:
- true if the service, with all its handlers, cannot be invoked from the restate-server HTTP and Kafka ingress, but only from other services.
- See Also:
-
getEnableLazyState
- Returns:
- true if the service, with all its handlers, will use lazy state.
- See Also:
-
withDocumentation
-
withMetadata
-
configure
- Returns:
- a copy of this
ServiceDefinition
, configured with theServiceDefinition.Configurator
.
-
equals
-
hashCode
public int hashCode() -
of
public static ServiceDefinition of(String name, ServiceType ty, Collection<HandlerDefinition<?, ?>> handlers)
-