Gravity.Listener| Constructor and Description |
|---|
GravityProxy() |
GravityProxy(javax.servlet.ServletContext servletContext) |
| Modifier and Type | Method and Description |
|---|---|
Channel |
findChannelByClientId(java.lang.String clientId)
Find the channel for a specified clientId
|
java.util.List<Channel> |
findConnectedChannelsByUser(java.lang.String name)
Find all channels for an authenticated user name
|
Channel |
findCurrentChannel(java.lang.String destination)
Current channel for the specified destination
|
java.util.List<Channel> |
getConnectedChannels()
Currently connected channels
|
java.util.List<Channel> |
getConnectedChannelsByDestination(java.lang.String destination)
Channels currently connected for a specified destination
|
java.util.Set<java.security.Principal> |
getConnectedUsers()
Currently connected authenticated users
|
java.util.Set<java.security.Principal> |
getConnectedUsersByDestination(java.lang.String destination)
Authenticated users currently connected for a specified destination
|
GraniteConfig |
getGraniteConfig()
Current Granite configuration
|
protected Gravity |
getGravity() |
GravityConfig |
getGravityConfig()
Current Gravity configuration
|
ServicesConfig |
getServicesConfig()
Current services configuration
|
Message |
handleMessage(Message message)
Handle a message using the configured service adapter
|
Message |
handleMessage(Message message,
boolean skipInterceptor)
Handle a message using the configured service adapter, optionally skipping interceptors
|
boolean |
isStarted()
State of the Gravity component
|
Message |
publishMessage(AsyncMessage message)
Publish a message to connected users from the default server channel
|
Message |
publishMessage(Channel fromChannel,
AsyncMessage message)
Publish a message to connected users from the specified user channel
|
void |
reconfigure(GravityConfig gravityConfig,
GraniteConfig graniteConfig)
Update the current configuration and restarts
|
void |
registerListener(Gravity.Listener listener)
Registers a listener which will be notified of channel events (connect/disconnect/subscription/unsubscription)
|
Message |
sendRequest(Channel fromChannel,
AsyncMessage message)
Send a server-to-client request, waiting synchronously for the response
|
void |
start()
Start the Gravity component
|
void |
stop()
Stop the Gravity component
|
void |
stop(boolean now)
Stop the Gravity component, optionally forcing immediate shutdown (without waiting for channel closing)
|
void |
unregisterListener(Gravity.Listener listener)
Unregisters a listener which will be notified of channel events (connect/disconnect/subscription/unsubscription)
|
public GravityProxy()
public GravityProxy(javax.servlet.ServletContext servletContext)
protected Gravity getGravity()
public GravityConfig getGravityConfig()
GravitygetGravityConfig in interface Gravitypublic ServicesConfig getServicesConfig()
GravitygetServicesConfig in interface Gravitypublic GraniteConfig getGraniteConfig()
GravitygetGraniteConfig in interface Gravitypublic boolean isStarted()
Gravitypublic void start()
throws java.lang.Exception
Gravitypublic void reconfigure(GravityConfig gravityConfig, GraniteConfig graniteConfig)
Gravityreconfigure in interface GravitygravityConfig - Gravity configgraniteConfig - Granite configpublic void stop()
throws java.lang.Exception
Gravitypublic void stop(boolean now)
throws java.lang.Exception
Gravitypublic java.util.List<Channel> getConnectedChannels()
GravitygetConnectedChannels in interface Gravitypublic java.util.Set<java.security.Principal> getConnectedUsers()
GravitygetConnectedUsers in interface Gravitypublic java.util.List<Channel> getConnectedChannelsByDestination(java.lang.String destination)
GravitygetConnectedChannelsByDestination in interface Gravitydestination - a destinationpublic java.util.Set<java.security.Principal> getConnectedUsersByDestination(java.lang.String destination)
GravitygetConnectedUsersByDestination in interface Gravitydestination - a destinationpublic java.util.List<Channel> findConnectedChannelsByUser(java.lang.String name)
GravityfindConnectedChannelsByUser in interface Gravityname - user namepublic Channel findChannelByClientId(java.lang.String clientId)
GravityfindChannelByClientId in interface GravityclientId - client idpublic Channel findCurrentChannel(java.lang.String destination)
GravityfindCurrentChannel in interface Gravitydestination - destinationpublic Message handleMessage(Message message)
GravityhandleMessage in interface Gravitymessage - messagepublic Message handleMessage(Message message, boolean skipInterceptor)
GravityhandleMessage in interface Gravitymessage - messageskipInterceptor - skip interceptorspublic Message publishMessage(AsyncMessage message)
GravitypublishMessage in interface Gravitymessage - message to publishpublic Message publishMessage(Channel fromChannel, AsyncMessage message)
GravitypublishMessage in interface GravityfromChannel - originating channelmessage - message to publishpublic Message sendRequest(Channel fromChannel, AsyncMessage message)
GravitysendRequest in interface GravityfromChannel - originating channelmessage - requestpublic void registerListener(Gravity.Listener listener)
GravityregisterListener in interface Gravitypublic void unregisterListener(Gravity.Listener listener)
GravityunregisterListener in interface Gravity