Package io.getstream.services.framework
Class StreamSDKClient
java.lang.Object
io.getstream.services.CommonImpl
io.getstream.services.framework.StreamSDKClient
- All Implemented Interfaces:
Common
-
Constructor Summary
ConstructorsConstructorDescriptionStreamSDKClient(StreamHTTPClient httpClient) StreamSDKClient(String apiKey, String apiSecret) StreamSDKClient(String apiKey, String apiSecret, StreamClientOptions options) StreamSDKClient(String apiKey, String apiSecret, okhttp3.OkHttpClient httpClient) StreamSDKClient(Properties properties) -
Method Summary
Modifier and TypeMethodDescriptionchat()feeds()Decode + parse a Stream-delivered SNS notification body.Decode + parse a Stream-delivered SQS message body.verifyAndParseWebhook(byte[] body, String signature) Verify and parse a webhook payload in one call, using this client's API secret.booleanverifySignature(byte[] body, String signature) Verify a webhook signature using this client's API secret.video()waitForTask(String taskId) PollsgetTask(taskId)until the task reaches a terminal status.waitForTask(String taskId, Duration pollInterval, Duration timeout) PollsgetTask(taskId)until the task reaches a terminal status.Methods inherited from class io.getstream.services.CommonImpl
addUserGroupMembers, blockUsers, cancelImportV2Task, cancelImportV2Task, checkExternalStorage, checkExternalStorage, checkPush, checkPush, checkSNS, checkSNS, checkSQS, checkSQS, createBlockList, createDevice, createExternalStorage, createGuest, createImport, createImportURL, createImportURL, createImportV2Task, createPermission, createPoll, createPollOption, createRole, createUserGroup, deactivateUser, deactivateUser, deactivateUsers, deleteBlockList, deleteBlockList, deleteDevice, deleteExternalStorage, deleteExternalStorage, deleteFile, deleteFile, deleteImage, deleteImage, deleteImporterExternalStorage, deleteImporterExternalStorage, deleteImportV2Task, deleteImportV2Task, deletePermission, deletePermission, deletePoll, deletePoll, deletePollOption, deletePollOption, deletePushProvider, deletePushProvider, deleteRole, deleteRole, deleteUserGroup, deleteUserGroup, deleteUsers, exportUser, exportUser, exportUsers, getApp, getApp, getBlockedUsers, getBlockedUsers, getBlockList, getBlockList, getImport, getImport, getImporterExternalStorage, getImporterExternalStorage, getImportV2Task, getImportV2Task, getOG, getPermission, getPermission, getPoll, getPoll, getPollOption, getPollOption, getPushTemplates, getRateLimits, getRateLimits, getTask, getTask, getUserGroup, getUserGroup, getUserLiveLocations, getUserLiveLocations, importBlockList, listBlockLists, listBlockLists, listDevices, listDevices, listExternalStorage, listExternalStorage, listImports, listImports, listImportV2Tasks, listImportV2Tasks, listPermissions, listPermissions, listPushProviders, listPushProviders, listRoles, listRoles, listUserGroups, listUserGroups, queryPolls, queryPolls, queryPollVotes, queryPollVotes, queryUsers, queryUsers, reactivateUser, reactivateUser, reactivateUsers, removeUserGroupMembers, restoreUsers, searchRoles, searchUserGroups, unblockUsers, updateApp, updateApp, updateBlockList, updateBlockList, updateExternalStorage, updateLiveLocation, updatePermission, updatePoll, updatePollOption, updatePollPartial, updatePollPartial, updatePushNotificationPreferences, updateUserGroup, updateUserGroup, updateUsers, updateUsersPartial, uploadFile, uploadFile, uploadImage, uploadImage, upsertImporterExternalStorage, upsertPushProvider, upsertPushProvider, upsertPushTemplate, validateImporterExternalStorage, validateImporterExternalStorageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.getstream.services.Common
addUserGroupMembers, blockUsers, cancelImportV2Task, cancelImportV2Task, checkExternalStorage, checkExternalStorage, checkPush, checkPush, checkSNS, checkSNS, checkSQS, checkSQS, createBlockList, createDevice, createExternalStorage, createGuest, createImport, createImportURL, createImportURL, createImportV2Task, createPermission, createPoll, createPollOption, createRole, createUserGroup, deactivateUser, deactivateUser, deactivateUsers, deleteBlockList, deleteBlockList, deleteDevice, deleteExternalStorage, deleteExternalStorage, deleteFile, deleteFile, deleteImage, deleteImage, deleteImporterExternalStorage, deleteImporterExternalStorage, deleteImportV2Task, deleteImportV2Task, deletePermission, deletePermission, deletePoll, deletePoll, deletePollOption, deletePollOption, deletePushProvider, deletePushProvider, deleteRole, deleteRole, deleteUserGroup, deleteUserGroup, deleteUsers, exportUser, exportUser, exportUsers, getApp, getApp, getBlockedUsers, getBlockedUsers, getBlockList, getBlockList, getImport, getImport, getImporterExternalStorage, getImporterExternalStorage, getImportV2Task, getImportV2Task, getOG, getPermission, getPermission, getPoll, getPoll, getPollOption, getPollOption, getPushTemplates, getRateLimits, getRateLimits, getTask, getTask, getUserGroup, getUserGroup, getUserLiveLocations, getUserLiveLocations, importBlockList, listBlockLists, listBlockLists, listDevices, listDevices, listExternalStorage, listExternalStorage, listImports, listImports, listImportV2Tasks, listImportV2Tasks, listPermissions, listPermissions, listPushProviders, listPushProviders, listRoles, listRoles, listUserGroups, listUserGroups, queryPolls, queryPolls, queryPollVotes, queryPollVotes, queryUsers, queryUsers, reactivateUser, reactivateUser, reactivateUsers, removeUserGroupMembers, restoreUsers, searchRoles, searchUserGroups, unblockUsers, updateApp, updateApp, updateBlockList, updateBlockList, updateExternalStorage, updateLiveLocation, updatePermission, updatePoll, updatePollOption, updatePollPartial, updatePollPartial, updatePushNotificationPreferences, updateUserGroup, updateUserGroup, updateUsers, updateUsersPartial, uploadFile, uploadFile, uploadImage, uploadImage, upsertImporterExternalStorage, upsertPushProvider, upsertPushProvider, upsertPushTemplate, validateImporterExternalStorage, validateImporterExternalStorage
-
Constructor Details
-
StreamSDKClient
-
StreamSDKClient
public StreamSDKClient(@NotNull String apiKey, @NotNull String apiSecret, @NotNull StreamClientOptions options) -
StreamSDKClient
public StreamSDKClient() -
StreamSDKClient
-
StreamSDKClient
-
StreamSDKClient
-
-
Method Details
-
video
-
getHttpClient
-
chat
-
feeds
-
moderation
-
tokenBuilder
-
getSDKClient
- Specified by:
getSDKClientin interfaceCommon
-
verifySignature
Verify a webhook signature using this client's API secret.Convenience wrapper around
Webhook.verifySignature(byte[], String, String).- Parameters:
body- the raw HTTP request body bytessignature- the value of the X-Signature header- Returns:
- true if the signature matches
-
verifyAndParseWebhook
public Object verifyAndParseWebhook(byte[] body, String signature) throws Webhook.InvalidWebhookError Verify and parse a webhook payload in one call, using this client's API secret.Handles gzip-compressed bodies transparently via magic-byte detection. Throws
Webhook.InvalidWebhookErroron signature mismatch or parse failures.- Parameters:
body- the raw HTTP request body bytes (possibly gzip-compressed)signature- the value of the X-Signature header- Returns:
- the parsed event (typed event or
Webhook.UnknownEvent) - Throws:
Webhook.InvalidWebhookError
-
parseSqs
Decode + parse a Stream-delivered SQS message body.Convenience wrapper around
Webhook.parseSqs(String). No signature is required; SQS deliveries are authenticated via AWS IAM.- Parameters:
messageBody- the SQS message body string- Returns:
- the parsed event (typed event or
Webhook.UnknownEvent) - Throws:
Webhook.InvalidWebhookError
-
parseSns
Decode + parse a Stream-delivered SNS notification body.Accepts either the raw SNS HTTP envelope JSON or the pre-extracted Message string. Convenience wrapper around
Webhook.parseSns(String). No signature is required; SNS deliveries are authenticated via AWS IAM.- Parameters:
notificationBody- the SNS notification body (envelope JSON or extracted Message)- Returns:
- the parsed event (typed event or
Webhook.UnknownEvent) - Throws:
Webhook.InvalidWebhookError
-
waitForTask
PollsgetTask(taskId)until the task reaches a terminal status. Uses a 1-second poll interval and a 60-second timeout.- Returns:
- the terminal
GetTaskResponsewhenstatus == "completed" - Throws:
StreamTaskException- if the task ends withstatus == "failed"StreamTransportException- witherrorType == "timeout"if the wait elapsesStreamException- for any other underlying transport / API failure
-
waitForTask
@NotNull public GetTaskResponse waitForTask(@NotNull String taskId, @NotNull Duration pollInterval, @NotNull Duration timeout) throws StreamException PollsgetTask(taskId)until the task reaches a terminal status.- Parameters:
taskId- the task identifier returned by the operation that enqueued the taskpollInterval- delay between polls; clamped to a non-negative valuetimeout- max total wait; the timeout window starts before the first poll- Throws:
StreamTaskException- if the task ends withstatus == "failed"StreamTransportException- witherrorType == "timeout"if the wait elapsesStreamException- for any other underlying transport / API failure
-