public class PusherEventService extends java.lang.Object implements IEventService
IEventService
utilizing Pusher channel events.IEventListener
Modifier and Type | Class and Description |
---|---|
static class |
PusherEventService.PusherEventServiceBuilder
Builder class for
PusherEventService . |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<EventListenerRegistration> |
listeners
The list of listener registrations.
|
Modifier and Type | Method and Description |
---|---|
static PusherEventService.PusherEventServiceBuilder |
builder()
Creates a builder for this class.
|
protected EventListenerRegistration.RegistrationListenerConfiguration |
configureListener(@NonNull IEventListener listener)
Configures a notification listener.
|
LoggerProvider |
getLoggerProvider() |
boolean |
isConnected()
Checks if this service is connected to the platform.
|
boolean |
isSubscribedToAsset(java.lang.String asset)
Determines if the channel is open for the specified asset.
|
boolean |
isSubscribedToPlayer(java.lang.String project,
java.lang.String player)
Determines if the channel is open for the specified player.
|
boolean |
isSubscribedToProject(java.lang.String project)
Determines if the channel is open for the specified project.
|
boolean |
isSubscribedToWallet(java.lang.String wallet)
Determines if the channel is open for the specified wallet address.
|
protected EventListenerRegistration |
register(@NonNull EventListenerRegistration.RegistrationListenerConfiguration configuration)
Registers a notification listener.
|
EventListenerRegistration |
registerListener(@NonNull IEventListener listener)
Registers a event listener and provides the registration object used for it.
|
EventListenerRegistration |
registerListenerExcludingTypes(@NonNull IEventListener listener,
EventType... types)
Registers a event listener with event types to ignore and provides the registration object used for it.
|
EventListenerRegistration |
registerListenerIncludingTypes(@NonNull IEventListener listener,
EventType... types)
Registers a event listener with event types to allow and provides the registration object used for it.
|
EventListenerRegistration |
registerListenerWithMatcher(@NonNull IEventListener listener,
IEventMatcher matcher)
Registers a event listener with an event matcher and provides the registration object used for it.
|
java.util.concurrent.Future<java.lang.Void> |
shutdown()
Shuts down this service.
|
java.util.concurrent.Future<java.lang.Void> |
start()
Starts this service.
|
java.util.concurrent.Future<java.lang.Void> |
start(IConnectionEventListener listener)
Starts this service with the provided connection listener.
|
java.util.concurrent.Future<java.lang.Void> |
start(Platform platform)
Starts this service with the provided platform details.
|
java.util.concurrent.Future<java.lang.Void> |
start(Platform platform,
IConnectionEventListener listener)
Starts this service with the provided platform details and connection listener.
|
void |
subscribeToAsset(java.lang.String asset)
Opens a channel for the specified asset, allowing listeners to receive events for that asset.
|
void |
subscribeToPlayer(java.lang.String project,
java.lang.String player)
Opens a channel for the specified player, allowing listeners to receive events for that player.
|
void |
subscribeToProject(java.lang.String project)
Opens a channel for the specified project, allowing listeners to receive events for that project.
|
void |
subscribeToWallet(java.lang.String wallet)
Opens a channel for the specified wallet address, allowing listeners to receive events for that wallet.
|
void |
unregisterListener(@NonNull IEventListener listener)
Unregisters a event listener.
|
void |
unsubscribeToAsset(java.lang.String asset)
Closes a channel for the specified asset, preventing listeners from receiving events for that asset.
|
void |
unsubscribeToPlayer(java.lang.String project,
java.lang.String player)
Closes a channel for the specified player, preventing listeners from receiving events for that player.
|
void |
unsubscribeToProject(java.lang.String project)
Closes a channel for the specified project, preventing listeners from receiving events for that project.
|
void |
unsubscribeToWallet(java.lang.String wallet)
Closes a channel for the specified wallet address, preventing listeners from receiving events for that wallet.
|
protected java.util.List<EventListenerRegistration> listeners
public java.util.concurrent.Future<java.lang.Void> start()
IEventService
start
in interface IEventService
public java.util.concurrent.Future<java.lang.Void> start(Platform platform)
IEventService
start
in interface IEventService
platform
- the platformpublic java.util.concurrent.Future<java.lang.Void> start(IConnectionEventListener listener)
IEventService
start
in interface IEventService
listener
- the listenerpublic java.util.concurrent.Future<java.lang.Void> start(Platform platform, IConnectionEventListener listener)
IEventService
start
in interface IEventService
platform
- the platformlistener
- the listenerpublic boolean isConnected()
IEventService
isConnected
in interface IEventService
public java.util.concurrent.Future<java.lang.Void> shutdown()
IEventService
shutdown
in interface IEventService
public EventListenerRegistration registerListener(@NonNull @NonNull IEventListener listener)
IEventService
registerListener
in interface IEventService
listener
- the listenerpublic EventListenerRegistration registerListenerWithMatcher(@NonNull @NonNull IEventListener listener, IEventMatcher matcher)
IEventService
registerListenerWithMatcher
in interface IEventService
listener
- the listenermatcher
- the event matcherpublic EventListenerRegistration registerListenerIncludingTypes(@NonNull @NonNull IEventListener listener, EventType... types)
IEventService
registerListenerIncludingTypes
in interface IEventService
listener
- the listenertypes
- the events to listen forpublic EventListenerRegistration registerListenerExcludingTypes(@NonNull @NonNull IEventListener listener, EventType... types)
IEventService
registerListenerExcludingTypes
in interface IEventService
listener
- the listenertypes
- the events to ignoreprotected EventListenerRegistration.RegistrationListenerConfiguration configureListener(@NonNull @NonNull IEventListener listener)
listener
- the listenerprotected EventListenerRegistration register(@NonNull @NonNull EventListenerRegistration.RegistrationListenerConfiguration configuration)
configuration
- the listener configurationpublic void unregisterListener(@NonNull @NonNull IEventListener listener)
IEventService
unregisterListener
in interface IEventService
listener
- the listenerpublic void subscribeToProject(java.lang.String project)
IEventService
subscribeToProject
in interface IEventService
project
- the project's UUIDpublic void unsubscribeToProject(java.lang.String project)
IEventService
unsubscribeToProject
in interface IEventService
project
- the project's UUIDpublic boolean isSubscribedToProject(java.lang.String project)
IEventService
isSubscribedToProject
in interface IEventService
project
- the project's UUIDpublic void subscribeToPlayer(java.lang.String project, java.lang.String player)
IEventService
subscribeToPlayer
in interface IEventService
project
- the UUID of the project the player is onplayer
- the player IDpublic void unsubscribeToPlayer(java.lang.String project, java.lang.String player)
IEventService
unsubscribeToPlayer
in interface IEventService
project
- the UUID of the project the player is onplayer
- the player IDpublic boolean isSubscribedToPlayer(java.lang.String project, java.lang.String player)
IEventService
isSubscribedToPlayer
in interface IEventService
project
- the UUID of the project the player is onplayer
- the player IDpublic void subscribeToAsset(java.lang.String asset)
IEventService
subscribeToAsset
in interface IEventService
asset
- the asset IDpublic void unsubscribeToAsset(java.lang.String asset)
IEventService
unsubscribeToAsset
in interface IEventService
asset
- the asset IDpublic boolean isSubscribedToAsset(java.lang.String asset)
IEventService
isSubscribedToAsset
in interface IEventService
asset
- the asset IDpublic void subscribeToWallet(java.lang.String wallet)
IEventService
subscribeToWallet
in interface IEventService
wallet
- the addresspublic void unsubscribeToWallet(java.lang.String wallet)
IEventService
unsubscribeToWallet
in interface IEventService
wallet
- the addresspublic boolean isSubscribedToWallet(java.lang.String wallet)
IEventService
isSubscribedToWallet
in interface IEventService
wallet
- the addresspublic static PusherEventService.PusherEventServiceBuilder builder()
public LoggerProvider getLoggerProvider()