Package io.dapr.client

# Interface DaprPreviewClient

All Superinterfaces:
  `AutoCloseable`

All Known Implementing Classes:
  `DaprClientImpl`

public interface DaprPreviewClient extends AutoCloseable
Generic client interface for preview or alpha APIs in Dapr, regardless of GRPC or HTTP.

See Also:
  - `for information on how to make instance for this interface.`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<ConversationResponse>`
`converse(ConversationRequest conversationRequest)`
`reactor.core.publisher.Mono<Void>`
`deleteJob(DeleteJobRequest deleteJobRequest)`
Deletes a job based on the given request.
`reactor.core.publisher.Mono<GetJobResponse>`
`getJob(GetJobRequest getJobRequest)`
Retrieves details of a specific job.
`<T> reactor.core.publisher.Mono<BulkPublishResponse<T>>`
`publishEvents(BulkPublishRequest<T> request)`
Publish multiple events to Dapr in a single request.
`<T> reactor.core.publisher.Mono<BulkPublishResponse<T>>`
`publishEvents(String pubsubName, String topicName, String contentType, List<T> events)`
Publish multiple events to Dapr in a single request.
`<T> reactor.core.publisher.Mono<BulkPublishResponse<T>>`
`publishEvents(String pubsubName, String topicName, String contentType, Map<String,String> requestMetadata, List<T> events)`
Publish multiple events to Dapr in a single request.
`<T> reactor.core.publisher.Mono<BulkPublishResponse<T>>`
`publishEvents(String pubsubName, String topicName, String contentType, Map<String,String> requestMetadata, T... events)`
Publish multiple events to Dapr in a single request.
`<T> reactor.core.publisher.Mono<BulkPublishResponse<T>>`
`publishEvents(String pubsubName, String topicName, String contentType, T... events)`
Publish multiple events to Dapr in a single request.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(QueryStateRequest request, TypeRef<T> type)`
Query for states using a query request.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(QueryStateRequest request, Class<T> clazz)`
Query for states using a query request.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, Query query, TypeRef<T> type)`
Query for states using a query domain object.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, Query query, Class<T> clazz)`
Query for states using a query domain object.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, Query query, Map<String,String> metadata, TypeRef<T> type)`
Query for states using a query domain object.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, Query query, Map<String,String> metadata, Class<T> clazz)`
Query for states using a query domain object.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, String query, TypeRef<T> type)`
Query for states using a query string.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, String query, Class<T> clazz)`
Query for states using a query string.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, String query, Map<String,String> metadata, TypeRef<T> type)`
Query for states using a query string.
`<T> reactor.core.publisher.Mono<QueryStateResponse<T>>`
`queryState(String storeName, String query, Map<String,String> metadata, Class<T> clazz)`
Query for states using a query string.
`reactor.core.publisher.Mono<Void>`
`scheduleJob(ScheduleJobRequest scheduleJobRequest)`
Schedules a job using the provided job request details.
`<T> Subscription`
`subscribeToEvents(String pubsubName, String topic, SubscriptionListener<T> listener, TypeRef<T> type)`
Subscribe to pubsub via streaming.
`reactor.core.publisher.Mono<Boolean>`
`tryLock(LockRequest request)`
Tries to get a lock with an expiry.
`reactor.core.publisher.Mono<Boolean>`
`tryLock(String storeName, String resourceId, String lockOwner, Integer expiryInSeconds)`
Tries to get a lock with an expiry.
`reactor.core.publisher.Mono<UnlockResponseStatus>`
`unlock(UnlockRequest request)`
Unlocks a lock.
`reactor.core.publisher.Mono<UnlockResponseStatus>`
`unlock(String storeName, String resourceId, String lockOwner)`
Unlocks a lock.

### Methods inherited from interface java.lang.AutoCloseable

`close`

## Method Details

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, String query, Map<String,String> metadata, Class<T> clazz)
Query for states using a query string.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - String value of the query.
  `metadata` - Optional metadata passed to the state store.
  `clazz` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, String query, Map<String,String> metadata, TypeRef<T> type)
Query for states using a query string.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - String value of the query.
  `metadata` - Optional metadata passed to the state store.
  `type` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, String query, Class<T> clazz)
Query for states using a query string.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - String value of the query.
  `clazz` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, String query, TypeRef<T> type)
Query for states using a query string.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - String value of the query.
  `type` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, Query query, Map<String,String> metadata, Class<T> clazz)
Query for states using a query domain object.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - Query value domain object.
  `metadata` - Optional metadata passed to the state store.
  `clazz` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, Query query, Map<String,String> metadata, TypeRef<T> type)
Query for states using a query domain object.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - Query value domain object.
  `metadata` - Optional metadata passed to the state store.
  `type` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, Query query, Class<T> clazz)
Query for states using a query domain object.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - Query value domain object.
  `clazz` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(String storeName, Query query, TypeRef<T> type)
Query for states using a query domain object.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `storeName` - Name of the state store to query.
  `query` - Query value domain object.
  `type` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(QueryStateRequest request, Class<T> clazz)
Query for states using a query request.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `request` - Query request object.
  `clazz` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### queryState

<T> reactor.core.publisher.Mono<QueryStateResponse<T>> queryState(QueryStateRequest request, TypeRef<T> type)
Query for states using a query request.

Type Parameters:
  `T` - The Type of the return, use byte[] to skip serialization.
Parameters:
  `request` - Query request object.
  `type` - The type needed as return for the call.
Returns:
  A Mono of QueryStateResponse of type T.

### publishEvents

<T> reactor.core.publisher.Mono<BulkPublishResponse<T>> publishEvents(BulkPublishRequest<T> request)
Publish multiple events to Dapr in a single request.

Type Parameters:
  `T` - The type of events to publish in the call.
Parameters:
  `request` - `BulkPublishRequest` object.
Returns:
  A Mono of `BulkPublishResponse` object.

### publishEvents

<T> reactor.core.publisher.Mono<BulkPublishResponse<T>> publishEvents(String pubsubName, String topicName, String contentType, List<T> events)
Publish multiple events to Dapr in a single request.

Type Parameters:
  `T` - The type of the events to publish in the call.
Parameters:
  `pubsubName` - the pubsub name we will publish the event to.
  `topicName` - the topicName where the event will be published.
  `events` - the `List` of events to be published.
  `contentType` - the content type of the event. Use Mime based types.
Returns:
  the `BulkPublishResponse` containing publish status of each event. The "entryID" field in `BulkPublishEntry` in `BulkPublishResponseFailedEntry` will be generated based on the order of events in the `List`.

### publishEvents

<T> reactor.core.publisher.Mono<BulkPublishResponse<T>> publishEvents(String pubsubName, String topicName, String contentType, T... events)
Publish multiple events to Dapr in a single request.

Type Parameters:
  `T` - The type of the events to publish in the call.
Parameters:
  `pubsubName` - the pubsub name we will publish the event to.
  `topicName` - the topicName where the event will be published.
  `events` - the varargs of events to be published.
  `contentType` - the content type of the event. Use Mime based types.
Returns:
  the `BulkPublishResponse` containing publish status of each event. The "entryID" field in `BulkPublishEntry` in `BulkPublishResponseFailedEntry` will be generated based on the order of events in the `List`.

### publishEvents

<T> reactor.core.publisher.Mono<BulkPublishResponse<T>> publishEvents(String pubsubName, String topicName, String contentType, Map<String,String> requestMetadata, List<T> events)
Publish multiple events to Dapr in a single request.

Type Parameters:
  `T` - The type of the events to publish in the call.
Parameters:
  `pubsubName` - the pubsub name we will publish the event to.
  `topicName` - the topicName where the event will be published.
  `events` - the `List` of events to be published.
  `contentType` - the content type of the event. Use Mime based types.
  `requestMetadata` - the metadata to be set at the request level for the `BulkPublishRequest`.
Returns:
  the `BulkPublishResponse` containing publish status of each event. The "entryID" field in `BulkPublishEntry` in `BulkPublishResponseFailedEntry` will be generated based on the order of events in the `List`.

### publishEvents

<T> reactor.core.publisher.Mono<BulkPublishResponse<T>> publishEvents(String pubsubName, String topicName, String contentType, Map<String,String> requestMetadata, T... events)
Publish multiple events to Dapr in a single request.

Type Parameters:
  `T` - The type of the events to publish in the call.
Parameters:
  `pubsubName` - the pubsub name we will publish the event to.
  `topicName` - the topicName where the event will be published.
  `events` - the varargs of events to be published.
  `contentType` - the content type of the event. Use Mime based types.
  `requestMetadata` - the metadata to be set at the request level for the `BulkPublishRequest`.
Returns:
  the `BulkPublishResponse` containing publish status of each event. The "entryID" field in `BulkPublishEntry` in `BulkPublishResponseFailedEntry` will be generated based on the order of events in the `List`.

### tryLock

reactor.core.publisher.Mono<Boolean> tryLock(String storeName, String resourceId, String lockOwner, Integer expiryInSeconds)
Tries to get a lock with an expiry.

Parameters:
  `storeName` - Name of the store
  `resourceId` - Lock key
  `lockOwner` - The identifier of lock owner
  `expiryInSeconds` - The time before expiry
Returns:
  Whether the lock is successful

### tryLock

reactor.core.publisher.Mono<Boolean> tryLock(LockRequest request)
Tries to get a lock with an expiry.

Parameters:
  `request` - The request to lock
Returns:
  Whether the lock is successful

### unlock

reactor.core.publisher.Mono<UnlockResponseStatus> unlock(String storeName, String resourceId, String lockOwner)
Unlocks a lock.

Parameters:
  `storeName` - Name of the store
  `resourceId` - Lock key
  `lockOwner` - The identifier of lock owner
Returns:
  Unlock result

### unlock

reactor.core.publisher.Mono<UnlockResponseStatus> unlock(UnlockRequest request)
Unlocks a lock.

Parameters:
  `request` - The request to unlock
Returns:
  Unlock result

### subscribeToEvents

<T> Subscription subscribeToEvents(String pubsubName, String topic, SubscriptionListener<T> listener, TypeRef<T> type)
Subscribe to pubsub via streaming.

Type Parameters:
  `T` - Type of object deserialization.
Parameters:
  `pubsubName` - Name of the pubsub component.
  `topic` - Name of the topic to subscribe to.
  `listener` - Callback methods to process events.
  `type` - Type for object deserialization.
Returns:
  An active subscription.

### scheduleJob

reactor.core.publisher.Mono<Void> scheduleJob(ScheduleJobRequest scheduleJobRequest)
Schedules a job using the provided job request details.

Parameters:
  `scheduleJobRequest` - The request containing the details of the job to schedule. Must include a name and optional schedule, data, and other related properties.
Returns:
  A `Mono` that completes when the job scheduling operation is successful or raises an error.
Throws:
  `IllegalArgumentException` - If the request or its required fields like name are null or empty.

### getJob

reactor.core.publisher.Mono<GetJobResponse> getJob(GetJobRequest getJobRequest)
Retrieves details of a specific job.

Parameters:
  `getJobRequest` - The request containing the job name for which the details are to be fetched. The name property is mandatory.
Returns:
  A `Mono` that emits the `GetJobResponse` containing job details or raises an error if the job is not found.
Throws:
  `IllegalArgumentException` - If the request or its required fields like name are null or empty.

### deleteJob

reactor.core.publisher.Mono<Void> deleteJob(DeleteJobRequest deleteJobRequest)
Deletes a job based on the given request.

Parameters:
  `deleteJobRequest` - The request containing the job name to be deleted. The name property is mandatory.
Returns:
  A `Mono` that completes when the job is successfully deleted or raises an error.
Throws:
  `IllegalArgumentException` - If the request or its required fields like name are null or empty.

### converse

reactor.core.publisher.Mono<ConversationResponse> converse(ConversationRequest conversationRequest)