Class EXoContinuationBayeux

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.cometd.server.BayeuxServerImpl
org.mortbay.cometd.continuation.EXoContinuationBayeux
All Implemented Interfaces:
org.cometd.bayeux.Bayeux, org.cometd.bayeux.server.BayeuxServer, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.picocontainer.Disposable

public class EXoContinuationBayeux extends org.cometd.server.BayeuxServerImpl implements org.picocontainer.Disposable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.cometd.bayeux.Bayeux

    org.cometd.bayeux.Bayeux.BayeuxListener, org.cometd.bayeux.Bayeux.Validator

    Nested classes/interfaces inherited from interface org.cometd.bayeux.server.BayeuxServer

    org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener, org.cometd.bayeux.server.BayeuxServer.ChannelListener, org.cometd.bayeux.server.BayeuxServer.Extension, org.cometd.bayeux.server.BayeuxServer.SessionListener, org.cometd.bayeux.server.BayeuxServer.SubscriptionListener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendable

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.cometd.server.BayeuxServerImpl

    ALLOWED_TRANSPORTS_OPTION, BROADCAST_TO_PUBLISHER_OPTION, CONTEXT_ATTRIBUTE_NAME_OPTION, EXECUTOR_MAX_THREADS, SCHEDULER_THREADS, SWEEP_PERIOD_OPTION, SWEEP_THREADS_OPTION, TRANSPORTS_OPTION, VALIDATE_MESSAGE_FIELDS_OPTION

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.cometd.bayeux.server.BayeuxServer

    ATTRIBUTE

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    LEGEND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Deprecated.
     
     
    jakarta.servlet.ServletConfig
     
    long
     
     
    boolean
     
    boolean
     
    boolean
    isRelayed(org.cometd.bayeux.server.ServerSession sender)
     
    boolean
    isSubscribed(String eXoID, String clientID)
     
    org.cometd.bayeux.server.ServerSession
    void
    Relays to this node the messages published on the given channels on the other nodes of a cluster, as Oort does for the channels its configuration names.
    void
    onOort(Consumer<org.cometd.oort.Oort> action)
    Runs an action with this node's Oort once it is set, at once when it is set already: a service that starts before the CometD servlet reaches the other nodes of a cluster so, such as to learn when one leaves.
    void
    sendBroadcastMessage(String channel, Object data, String msgId)
    Publishes a message on a channel, even when no session of this node is subscribed to it: the subscribers of a pattern that matches the channel, such as the other nodes of a cluster that observe it, receive it too.
    void
    sendMessage(String eXoID, String channel, Object data, String id)
    Send data to a individual client.
    void
    setCloudIDSeparator(String cloudIDSeparator)
     
    void
     
    void
    setOort(org.cometd.oort.Oort oort)
     
    void
    setOortTrusted(boolean oortTrusted)
     
    void
    setServletConfig(jakarta.servlet.ServletConfig config)
     
    void
    setSeti(org.cometd.oort.Seti seti)
     
    void
    setTimeout(long timeout)
    Deprecated.

    Methods inherited from class org.cometd.server.BayeuxServerImpl

    addExtension, addListener, addServerSession, addTransport, asyncSweep, createChannelIfAbsent, createReply, doStart, doStop, dump, error, execute, extendOutgoing, extendReply, freeze, getAllowedTransports, getChannel, getChannels, getExecutor, getExtensions, getJSONContext, getKnownTransportNames, getLastSweepInfo, getListeners, getLongestSweepInfo, getName, getOption, getOption, getOption, getOptionNames, getOptions, getScheduler, getSecurityPolicy, getSession, getSessions, getSweepPeriod, getSweepThreads, getTransport, getTransports, handle, initializeJSONContext, initializeMetaChannels, initializeServerTransports, isBroadcastToPublisher, isDetailedDump, newChannelId, newLocalSession, newMessage, newMessage, newServerSession, publish, randomLong, removeExtension, removeListener, removeServerChannel, removeServerSession, removeSession, resolveLoop, schedule, setAllowedTransports, setAllowedTransports, setDetailedDump, setExecutor, setOption, setOptions, setScheduler, setSecurityPolicy, setSweepPeriod, setSweepThreads, setTransports, setTransports, sweep, unknownSession, validateMessage

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dump, dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable
  • Constructor Details

    • EXoContinuationBayeux

      public EXoContinuationBayeux()
      Default constructor.
  • Method Details

    • newRemoteClient

      public org.cometd.bayeux.server.ServerSession newRemoteClient()
    • setTimeout

      @Deprecated public void setTimeout(long timeout)
      Deprecated.
    • getTimeout

      public long getTimeout()
    • getCometdContextName

      public String getCometdContextName()
      Returns:
      context name of cometd webapp
    • setCometdContextName

      public void setCometdContextName(String context)
    • getUserToken

      public String getUserToken(String eXoId)
      Parameters:
      eXoId - the client id.
      Returns:
      token for client
    • getClientByEXoId

      @Deprecated public EXoContinuationClient getClientByEXoId(String eXoID)
      Deprecated.
      Parameters:
      eXoID - the id of client.
      Returns:
      client with eXoID
    • isSubscribed

      public boolean isSubscribed(String eXoID, String clientID)
    • isPresent

      public boolean isPresent(String eXoID)
      Parameters:
      eXoID - the id of the target client
      Returns:
      whether that client currently holds a CometD session. false when CometD is not initialized yet: seti is only assigned when the cometd servlet starts, so any caller reached before that — a listener firing during another addon's boot, for instance — must not blow up.
    • sendBroadcastMessage

      public void sendBroadcastMessage(String channel, Object data, String msgId)
      Publishes a message on a channel, even when no session of this node is subscribed to it: the subscribers of a pattern that matches the channel, such as the other nodes of a cluster that observe it, receive it too.
      Parameters:
      channel - the id of channel.
      data - the message
      msgId - the message id
    • sendMessage

      public void sendMessage(String eXoID, String channel, Object data, String id)
      Send data to a individual client. The data passed is sent to the client as the "data" member of a message with the given channel and id. The message is not published on the channel and is thus not broadcast to all channel subscribers. However to the target client, the message appears as if it was broadcast.

      Typcially this method is only required if a service method sends response(s) to channels other than the subscribed channel. If the response is to be sent to the subscribed channel, then the data can simply be returned from the subscription method.

      Parameters:
      eXoID - the id of target client
      channel - The id of channel the message is for
      data - The data of the message
      id - The id of the message (or null for a random id).
    • setSeti

      public void setSeti(org.cometd.oort.Seti seti)
    • setOort

      public void setOort(org.cometd.oort.Oort oort)
    • onOort

      public void onOort(Consumer<org.cometd.oort.Oort> action)
      Runs an action with this node's Oort once it is set, at once when it is set already: a service that starts before the CometD servlet reaches the other nodes of a cluster so, such as to learn when one leaves.
      Parameters:
      action - the action, given this node's Oort
    • observeChannel

      public void observeChannel(String channel)
      Relays to this node the messages published on the given channels on the other nodes of a cluster, as Oort does for the channels its configuration names. A channel a service publishes on with no session of this node's subscribed to it, such as a document's channel published on by the node that receives a third party's callback, reaches the users of the other nodes only so. May be called before Oort is set.
      Parameters:
      channel - a broadcast channel, or a pattern of them such as /a/b/**
    • isRelayed

      public boolean isRelayed(org.cometd.bayeux.server.ServerSession sender)
      Parameters:
      sender - the session that published a message
      Returns:
      true when the message was published on another node and relayed to this one by Oort: a handler acting on a client's message acts only on the node the client published it to, or it acts once per node of a cluster
    • setOortTrusted

      public void setOortTrusted(boolean oortTrusted)
      Parameters:
      oortTrusted - whether handshakes and sessions of the other nodes of the cluster are accepted
    • isOortTrusted

      public boolean isOortTrusted()
    • setCloudIDSeparator

      public void setCloudIDSeparator(String cloudIDSeparator)
    • getServletConfig

      public jakarta.servlet.ServletConfig getServletConfig()
    • setServletConfig

      public void setServletConfig(jakarta.servlet.ServletConfig config)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.picocontainer.Disposable
    • getConnectedUserIds

      public Set<String> getConnectedUserIds()
      Returns:
      the users connected to this node and, in a cluster, to the other nodes, as Seti knows them: a message sent to one of them with sendMessage(String, String, Object, String) reaches the node the user is connected to