Class BrokerEventsSseClient
The generated EventsApi exposes SSE endpoints as ordinary blocking REST calls, which
can hang indefinitely for live streams. This wrapper reuses the generated request builders for
path, query parameters, and authentication, then opens them through the SDK's incremental OkHttp
transport.
-
Constructor Summary
ConstructorsConstructorDescriptionBrokerEventsSseClient(EventsApi eventsApi) Creates an SSE wrapper around a generated BrokerEventsApi.BrokerEventsSseClient(EventsApi eventsApi, Executor callbackExecutor) Creates an SSE wrapper around a generated BrokerEventsApi.BrokerEventsSseClient(EventsApi eventsApi, AlpacaSseOptions sseOptions) Creates an SSE wrapper with explicit transport options and direct callbacks.BrokerEventsSseClient(EventsApi eventsApi, AlpacaSseOptions sseOptions, Executor callbackExecutor) Creates an SSE wrapper with explicit transport options and callback executor.BrokerEventsSseClient(ApiClient apiClient) Creates an SSE wrapper from a generated BrokerApiClient.BrokerEventsSseClient(ApiClient apiClient, Executor callbackExecutor) Creates an SSE wrapper from a generated BrokerApiClient.BrokerEventsSseClient(ApiClient apiClient, AlpacaSseOptions sseOptions) Creates an SSE wrapper from a generated Broker client with explicit transport options.BrokerEventsSseClient(ApiClient apiClient, AlpacaSseOptions sseOptions, Executor callbackExecutor) Creates an SSE wrapper from a generated Broker client with explicit transport settings. -
Method Summary
Modifier and TypeMethodDescriptiongetAccountActivityEventAsync(UUID accountId, String eventId) Fetches one previously observed Broker activity event through its single-event SSE endpoint.getAccountActivityEventAsync(UUID accountId, String eventId, Duration timeout) Fetches one Broker activity event, failing if no event arrives beforetimeout.subscribeToAccountStatus(LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, String id, BrokerSseEventListener<AccountStatusEvent> listener) Opens the Broker account status SSE stream with explicit legacy cursor filters.subscribeToAccountStatus(BrokerSseIdentifiedLegacyDateOptions options, BrokerSseEventListener<AccountStatusEvent> listener) Opens the Broker account status SSE stream.subscribeToActivities(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<ActivityEventV2> listener) Opens the Broker activities SSE stream with explicit date/time cursor filters.subscribeToActivities(BrokerSseDateTimeOptions options, BrokerSseEventListener<ActivityEventV2> listener) Opens the Broker activities SSE stream.subscribeToAdminActions(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<SubscribeToAdminActionSSE200ResponseInner> listener) Opens the Broker admin actions SSE stream with explicit date/time cursor filters.subscribeToAdminActions(BrokerSseDateTimeOptions options, BrokerSseEventListener<SubscribeToAdminActionSSE200ResponseInner> listener) Opens the Broker admin actions SSE stream.subscribeToFundingStatus(LocalDate since, LocalDate until, String sinceId, String untilId, BrokerSseEventListener<StatusFundingEvent> listener) Opens the Broker funding status SSE stream with explicit date cursor filters.subscribeToFundingStatus(BrokerSseDateOptions options, BrokerSseEventListener<StatusFundingEvent> listener) Opens the Broker funding status SSE stream.subscribeToIpoEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<IPOEvent> listener) Opens the Broker IPO events SSE stream with explicit date/time cursor filters.subscribeToIpoEvents(BrokerSseDateTimeOptions options, BrokerSseEventListener<IPOEvent> listener) Opens the Broker IPO events SSE stream.subscribeToJournalStatus(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, String id, BrokerSseEventListener<JournalStatusEventV2> listener) Opens the current Broker journal status SSE stream with explicit date/time cursor filters.subscribeToJournalStatus(BrokerSseIdentifiedDateTimeOptions options, BrokerSseEventListener<JournalStatusEventV2> listener) Opens the current Broker journal status SSE stream.subscribeToJournalStatusLegacy(LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, String id, BrokerSseEventListener<JournalStatusEvent> listener) Opens the legacy Broker journal status SSE stream with explicit legacy cursor filters.subscribeToJournalStatusLegacy(BrokerSseIdentifiedLegacyDateOptions options, BrokerSseEventListener<JournalStatusEvent> listener) Opens the legacy Broker journal status SSE stream.subscribeToNonTradingActivities(String id, LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, Boolean includePreprocessing, UUID groupId, BrokerSseEventListener<NonTradeActivityEvent> listener) Opens the Broker non-trading activities SSE stream with explicit filter parameters.subscribeToNonTradingActivities(BrokerSseNonTradingActivitiesOptions options, BrokerSseEventListener<NonTradeActivityEvent> listener) Opens the Broker non-trading activities SSE stream.subscribeToRebalancerEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, String lastEventId, BrokerSseEventListener<RebalancerEvent> listener) Opens the Broker rebalancer events SSE stream with explicit cursor filters.subscribeToRebalancerEvents(BrokerSseRebalancerOptions options, BrokerSseEventListener<RebalancerEvent> listener) Opens the Broker rebalancer events SSE stream.subscribeToSystemEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<SystemEventV2> listener) Opens the Broker system events SSE stream with explicit date/time cursor filters.subscribeToSystemEvents(BrokerSseDateTimeOptions options, BrokerSseEventListener<SystemEventV2> listener) Opens the Broker system events SSE stream.subscribeToTradeEvents(LocalDate since, LocalDate until, String sinceId, String untilId, BrokerSseEventListener<TradeUpdateEventV2> listener) Opens the Broker trade events SSE stream with explicit date cursor filters.subscribeToTradeEvents(BrokerSseDateOptions options, BrokerSseEventListener<TradeUpdateEventV2> listener) Opens the Broker trade events SSE stream.
-
Constructor Details
-
BrokerEventsSseClient
Creates an SSE wrapper around a generated BrokerEventsApi. -
BrokerEventsSseClient
Creates an SSE wrapper with explicit transport options and direct callbacks. -
BrokerEventsSseClient
Creates an SSE wrapper around a generated BrokerEventsApi. -
BrokerEventsSseClient
public BrokerEventsSseClient(EventsApi eventsApi, AlpacaSseOptions sseOptions, Executor callbackExecutor) Creates an SSE wrapper with explicit transport options and callback executor. -
BrokerEventsSseClient
Creates an SSE wrapper from a generated BrokerApiClient. -
BrokerEventsSseClient
Creates an SSE wrapper from a generated Broker client with explicit transport options. -
BrokerEventsSseClient
Creates an SSE wrapper from a generated BrokerApiClient. -
BrokerEventsSseClient
public BrokerEventsSseClient(ApiClient apiClient, AlpacaSseOptions sseOptions, Executor callbackExecutor) Creates an SSE wrapper from a generated Broker client with explicit transport settings.
-
-
Method Details
-
subscribeToNonTradingActivities
public BrokerSseSubscription subscribeToNonTradingActivities(BrokerSseNonTradingActivitiesOptions options, BrokerSseEventListener<NonTradeActivityEvent> listener) throws ApiException Opens the Broker non-trading activities SSE stream.The generated OpenAPI operation is
getV1EventsNta. Use the options object for the date/id cursor filters documented in the Broker OpenAPI spec.- Throws:
ApiException
-
subscribeToNonTradingActivities
public BrokerSseSubscription subscribeToNonTradingActivities(String id, LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, Boolean includePreprocessing, UUID groupId, BrokerSseEventListener<NonTradeActivityEvent> listener) throws ApiException Opens the Broker non-trading activities SSE stream with explicit filter parameters.- Throws:
ApiException
-
subscribeToActivities
public BrokerSseSubscription subscribeToActivities(BrokerSseDateTimeOptions options, BrokerSseEventListener<ActivityEventV2> listener) throws ApiException Opens the Broker activities SSE stream.- Throws:
ApiException
-
subscribeToActivities
public BrokerSseSubscription subscribeToActivities(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<ActivityEventV2> listener) throws ApiException Opens the Broker activities SSE stream with explicit date/time cursor filters.- Throws:
ApiException
-
subscribeToAdminActions
public BrokerSseSubscription subscribeToAdminActions(BrokerSseDateTimeOptions options, BrokerSseEventListener<SubscribeToAdminActionSSE200ResponseInner> listener) throws ApiException Opens the Broker admin actions SSE stream.- Throws:
ApiException
-
subscribeToAdminActions
public BrokerSseSubscription subscribeToAdminActions(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<SubscribeToAdminActionSSE200ResponseInner> listener) throws ApiException Opens the Broker admin actions SSE stream with explicit date/time cursor filters.- Throws:
ApiException
-
subscribeToFundingStatus
public BrokerSseSubscription subscribeToFundingStatus(BrokerSseDateOptions options, BrokerSseEventListener<StatusFundingEvent> listener) throws ApiException Opens the Broker funding status SSE stream.- Throws:
ApiException
-
subscribeToFundingStatus
public BrokerSseSubscription subscribeToFundingStatus(LocalDate since, LocalDate until, String sinceId, String untilId, BrokerSseEventListener<StatusFundingEvent> listener) throws ApiException Opens the Broker funding status SSE stream with explicit date cursor filters.- Throws:
ApiException
-
subscribeToIpoEvents
public BrokerSseSubscription subscribeToIpoEvents(BrokerSseDateTimeOptions options, BrokerSseEventListener<IPOEvent> listener) throws ApiException Opens the Broker IPO events SSE stream.- Throws:
ApiException
-
subscribeToIpoEvents
public BrokerSseSubscription subscribeToIpoEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<IPOEvent> listener) throws ApiException Opens the Broker IPO events SSE stream with explicit date/time cursor filters.- Throws:
ApiException
-
subscribeToJournalStatusLegacy
public BrokerSseSubscription subscribeToJournalStatusLegacy(BrokerSseIdentifiedLegacyDateOptions options, BrokerSseEventListener<JournalStatusEvent> listener) throws ApiException Opens the legacy Broker journal status SSE stream.- Throws:
ApiException
-
subscribeToJournalStatusLegacy
public BrokerSseSubscription subscribeToJournalStatusLegacy(LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, String id, BrokerSseEventListener<JournalStatusEvent> listener) throws ApiException Opens the legacy Broker journal status SSE stream with explicit legacy cursor filters.- Throws:
ApiException
-
subscribeToJournalStatus
public BrokerSseSubscription subscribeToJournalStatus(BrokerSseIdentifiedDateTimeOptions options, BrokerSseEventListener<JournalStatusEventV2> listener) throws ApiException Opens the current Broker journal status SSE stream.- Throws:
ApiException
-
subscribeToJournalStatus
public BrokerSseSubscription subscribeToJournalStatus(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, String id, BrokerSseEventListener<JournalStatusEventV2> listener) throws ApiException Opens the current Broker journal status SSE stream with explicit date/time cursor filters.- Throws:
ApiException
-
subscribeToRebalancerEvents
public BrokerSseSubscription subscribeToRebalancerEvents(BrokerSseRebalancerOptions options, BrokerSseEventListener<RebalancerEvent> listener) throws ApiException Opens the Broker rebalancer events SSE stream.lastEventIdis sent as theLast-Event-Idheader. The Broker API uses that header assince_idand rejects it together withsince.- Throws:
ApiException
-
subscribeToRebalancerEvents
public BrokerSseSubscription subscribeToRebalancerEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, String lastEventId, BrokerSseEventListener<RebalancerEvent> listener) throws ApiException Opens the Broker rebalancer events SSE stream with explicit cursor filters.- Throws:
ApiException
-
subscribeToSystemEvents
public BrokerSseSubscription subscribeToSystemEvents(BrokerSseDateTimeOptions options, BrokerSseEventListener<SystemEventV2> listener) throws ApiException Opens the Broker system events SSE stream.- Throws:
ApiException
-
subscribeToSystemEvents
public BrokerSseSubscription subscribeToSystemEvents(OffsetDateTime since, OffsetDateTime until, String sinceId, String untilId, BrokerSseEventListener<SystemEventV2> listener) throws ApiException Opens the Broker system events SSE stream with explicit date/time cursor filters.- Throws:
ApiException
-
subscribeToTradeEvents
public BrokerSseSubscription subscribeToTradeEvents(BrokerSseDateOptions options, BrokerSseEventListener<TradeUpdateEventV2> listener) throws ApiException Opens the Broker trade events SSE stream.- Throws:
ApiException
-
subscribeToTradeEvents
public BrokerSseSubscription subscribeToTradeEvents(LocalDate since, LocalDate until, String sinceId, String untilId, BrokerSseEventListener<TradeUpdateEventV2> listener) throws ApiException Opens the Broker trade events SSE stream with explicit date cursor filters.- Throws:
ApiException
-
subscribeToAccountStatus
public BrokerSseSubscription subscribeToAccountStatus(BrokerSseIdentifiedLegacyDateOptions options, BrokerSseEventListener<AccountStatusEvent> listener) throws ApiException Opens the Broker account status SSE stream.- Throws:
ApiException
-
subscribeToAccountStatus
public BrokerSseSubscription subscribeToAccountStatus(LocalDate since, LocalDate until, Integer sinceId, Integer untilId, String sinceUlid, String untilUlid, String id, BrokerSseEventListener<AccountStatusEvent> listener) throws ApiException Opens the Broker account status SSE stream with explicit legacy cursor filters.- Throws:
ApiException
-
getAccountActivityEventAsync
public CompletableFuture<ActivityEventV2> getAccountActivityEventAsync(UUID accountId, String eventId) throws ApiException Fetches one previously observed Broker activity event through its single-event SSE endpoint.Keep synchronous continuations on the returned future short and non-blocking. Use an asynchronous continuation such as
thenApplyAsyncwith an application-owned executor for blocking work.- Throws:
ApiException
-
getAccountActivityEventAsync
public CompletableFuture<ActivityEventV2> getAccountActivityEventAsync(UUID accountId, String eventId, Duration timeout) throws ApiException Fetches one Broker activity event, failing if no event arrives beforetimeout.Keep synchronous continuations on the returned future short and non-blocking. Use an asynchronous continuation such as
thenApplyAsyncwith an application-owned executor for blocking work.- Throws:
ApiException
-