Interface CDORemoteSessionManager
- All Superinterfaces:
org.eclipse.net4j.util.container.IContainer<CDORemoteSession>
,org.eclipse.net4j.util.event.INotifier
- All Known Subinterfaces:
InternalCDORemoteSessionManager
public interface CDORemoteSessionManager
extends org.eclipse.net4j.util.container.IContainer<CDORemoteSession>
Provides collaborative access to the
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:
- At least one
listener
is registered with this remote session manager. - At least one
topic
is subscribed with this remote session manager. Force subscription
istrue
.
events
to
registered
listeners:
-
IContainerEvent
withCDORemoteSession
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 datasent
from other sessions.
- Since:
- 2.0
- Author:
- Eike Stepper
- No Implement
- This interface is not intended to be implemented by clients.
- No Extend
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
A default adapter for all kinds ofremote session
related events.static interface
Anevent
that is fired by aremote session manager
after thesubscription mode
of thelocal session
changed.Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistable<E extends Object>, org.eclipse.net4j.util.container.IContainer.Persistence<E extends Object>
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2
-
Method Summary
Modifier and TypeMethodDescriptionReturns thelocal session
this CDORemoteSessionManager belongs to.Returns the set ofremote sessions
that are connected to the same repository as thelocal session
.Returns an array of the currently subscribedtopics
.boolean
Returnstrue
if this CDORemoteSessionManager shall be subscribed to changes in the set of remote sessions and deliverscustom data events
even if nolistener
is registered and notopic
is subscribed,false
otherwise.boolean
Returnstrue
if this CDORemoteSessionManager is subscribed to changes in the set of remote sessions and deliverscustom data events
,false
otherwise.sendMessage
(CDORemoteSessionMessage message, Collection<CDORemoteSession> recipients) Same assendMessage(CDORemoteSessionMessage, CDORemoteSession...)
but with a recipientscollection
.sendMessage
(CDORemoteSessionMessage message, CDORemoteSession... recipients) Sends a multicast message to the subscribed recipients.void
setForceSubscription
(boolean forceSubscription) Enables or disables subscription to changes in the set of remote sessions even if nolistener
is registered and notopic
is subscribed.subscribeTopic
(String id) Subscribes to the topic identified by the givenid
.Methods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmpty
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Method Details
-
getLocalSession
CDOSession getLocalSession()Returns thelocal session
this CDORemoteSessionManager belongs to. -
getRemoteSessions
CDORemoteSession[] getRemoteSessions()Returns the set ofremote sessions
that are connected to the same repository as thelocal session
. If this CDORemoteSessionManager itself issubscribed
the result is returned from a local cache for remote sessions, otherwise it is requested from the server each time this method is called. -
isSubscribed
boolean isSubscribed()Returnstrue
if this CDORemoteSessionManager is subscribed to changes in the set of remote sessions and deliverscustom data events
,false
otherwise. It is subscribed if at least one is true:- At least one
listener
is registered with this remote session manager. - At least one
topic
is subscribed with this remote session manager. Force subscription
istrue
.
- See Also:
-
INotifier.addListener(IListener)
subscribeTopic(String)
setForceSubscription(boolean)
- At least one
-
isForceSubscription
boolean isForceSubscription()Returnstrue
if this CDORemoteSessionManager shall be subscribed to changes in the set of remote sessions and deliverscustom data events
even if nolistener
is registered and notopic
is subscribed,false
otherwise.- See Also:
-
INotifier.addListener(IListener)
subscribeTopic(String)
setForceSubscription(boolean)
-
setForceSubscription
void setForceSubscription(boolean forceSubscription) Enables or disables subscription to changes in the set of remote sessions even if nolistener
is registered and notopic
is subscribed.- See Also:
-
INotifier.addListener(IListener)
subscribeTopic(String)
setForceSubscription(boolean)
-
sendMessage
Sends a multicast message to the subscribed recipients.- Returns:
- The set of
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! - Since:
- 3.0
-
sendMessage
Set<CDORemoteSession> sendMessage(CDORemoteSessionMessage message, Collection<CDORemoteSession> recipients) Same assendMessage(CDORemoteSessionMessage, CDORemoteSession...)
but with a recipientscollection
.- Since:
- 3.0
-
subscribeTopic
Subscribes to the topic identified by the givenid
.- Returns:
- The subscribed
topic
. - Since:
- 4.17
-
getSubscribedTopic
- Since:
- 4.19
-
getSubscribedTopics
CDORemoteTopic[] getSubscribedTopics()Returns an array of the currently subscribedtopics
.- Since:
- 4.17
-