public interface CDORemoteSessionManager extends IContainer<CDORemoteSession>
remote sessions
that are connected to the same
repository as the local session
. A CDORemoteSessionManager can be subscribed or
unsubscribed to changes in the set of remote sessions. It is subscribed if at least one is true:
listener
is registered with this remote session manager.
Force subscription
is true
.
events
to
registered
listeners:
IContainerEvent
with CDORemoteSession
as generic type argument to reflect opened or closed remote
sessions.
CDORemoteSessionEvent.SubscriptionChanged
to reflect the ability of the remote session to receive and
possibly handle remote messages from other sessions.
CDORemoteSessionEvent.MessageReceived
to deliver custom data
sent
from other sessions .
Modifier and Type | Interface and Description |
---|---|
static class |
CDORemoteSessionManager.EventAdapter
A default adapter for all kinds of
remote session related events. |
static interface |
CDORemoteSessionManager.LocalSubscriptionChangedEvent
An
event that is fired by a remote session manager after the
subscription mode of the
local session changed. |
IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>
Modifier and Type | Method and Description |
---|---|
CDOSession |
getLocalSession()
Returns the
local session this CDORemoteSessionManager belongs to. |
CDORemoteSession[] |
getRemoteSessions()
Returns the set of
remote sessions that are connected to the same repository as the
local session . |
boolean |
isForceSubscription()
Returns
true if this CDORemoteSessionManager shall be subscribed to changes in the set of remote
sessions and delivers custom data events even if no listener is
registered, false otherwise. |
boolean |
isSubscribed()
Returns
true if this CDORemoteSessionManager is subscribed to changes in the set of remote sessions
and delivers custom data events , false otherwise. |
Set<CDORemoteSession> |
sendMessage(CDORemoteSessionMessage message,
CDORemoteSession... recipients)
Sends a multicast message to the subscribed recipients.
|
Set<CDORemoteSession> |
sendMessage(CDORemoteSessionMessage message,
Collection<CDORemoteSession> recipients)
Same as
sendMessage(CDORemoteSessionMessage, CDORemoteSession...) but with a recipients collection . |
void |
setForceSubscription(boolean forceSubscription)
Enables or disables subscription to changes in the set of remote sessions even if no
listener is
registered. |
getElements, isEmpty
addListener, getListeners, hasListeners, removeListener
CDOSession getLocalSession()
local session
this CDORemoteSessionManager belongs to.CDORemoteSession[] getRemoteSessions()
remote sessions
that are connected to the same repository as the
local session
. If this CDORemoteSessionManager itself is subscribed
the result is returned from a local cache for remote sessions, otherwise it is requested from the
server each time this method is called.boolean isSubscribed()
true
if this CDORemoteSessionManager is subscribed to changes in the set of remote sessions
and delivers custom data events
, false
otherwise. It is subscribed if at least
one is true:
listener
is registered with this remote session manager.
Force subscription
is true
.
boolean isForceSubscription()
true
if this CDORemoteSessionManager shall be subscribed to changes in the set of remote
sessions and delivers custom data events
even if no listener
is
registered, false
otherwise.void setForceSubscription(boolean forceSubscription)
listener
is
registered.Set<CDORemoteSession> sendMessage(CDORemoteSessionMessage message, CDORemoteSession... recipients)
recipients
that the message has been forwarded to by the server.
Note: No assumption must be made on whether a recipient session received the message and was able to
handle it adequately!Set<CDORemoteSession> sendMessage(CDORemoteSessionMessage message, Collection<CDORemoteSession> recipients)
sendMessage(CDORemoteSessionMessage, CDORemoteSession...)
but with a recipients collection
.Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html