JBoss Web 7.5.12.Final-redhat-1
org.apache.cometd.bayeux

Interface Bayeux

    • Method Detail

      • newClient

        Client newClient(String idprefix,
                       Listener listener)
        Creates a new server side client. This method is to be invoked by server side objects only. You cannot create a remote client by using this method. A client represents an entity that can subscribe to channels and publish and receive messages through these channels
        Parameters:
        idprefix - String - the prefix string for the id generated, can be null
        listener - Listener - a callback object to be called when messages are to be delivered to the new client
        Returns:
        Client - returns an implementation of the client interface.
      • getClient

        Client getClient(String clientid)
        retrieve a client based on an ID. Will return null if the client doesn't exist.
        Parameters:
        clientid - String
        Returns:
        Client-null if the client doesn't exist.returns the client if it does.
      • getClients

        List<Client> getClients()
        Returns a non modifiable list of all the clients that are currently active in this Bayeux session
        Returns:
        List - a list containing all clients. The List can not be modified.
      • hasClient

        boolean hasClient(String clientId)
        Returns true if a client with the given id exists.
        Same as executing getClient(id)!=null.
        Parameters:
        clientId - String
        Returns:
        boolean - true if the client exists
      • remove

        Client remove(Client client)
        Removes the client all together. This will unsubscribe the client to any channels it may be subscribed to and remove it from the list.
        Parameters:
        client - Client
        Returns:
        Client - returns the client that was removed, or null if no client was removed.
      • getChannel

        Channel getChannel(String channelId,
                         boolean create)
        Returns the channel for a given channel id. If the channel doesn't exist, and the create parameter is set to true, the channel will be created and added to the list of active channels.
        if create is set to false, and the channel doesn't exist, null will be returned.
        Parameters:
        channelId - String - the id of the channel to be retrieved or created
        create - boolean - true if the Bayeux impl should create the channel
        Returns:
        Channel - null if create is set to false and the channel doesn't exist, otherwise it returns a channel object.
      • getChannels

        List<Channel> getChannels()
        Returns a list of currently active channels in this Bayeux session.
        Returns:
        List
      • remove

        Channel remove(Channel channel)
        Removes a channel from the Bayeux object. This will also unsubscribe all the clients currently subscribed to the the channel.
        Parameters:
        channel - Channel - the channel to be removed
        Returns:
        Channel - returns the channel that was removed, or null if no channel was removed.
      • hasChannel

        boolean hasChannel(String channelId)
        returns true if a channel with the given channelId exists.
        Same as executing Bayeux.getChannel(channelId,false)!=null
        Parameters:
        channelId - String
        Returns:
        boolean - true if the channel exists.
      • newMessage

        Message newMessage(Client from)
        Creates a new message to be sent by a server side client.
        Returns:
        Message - returns a new Message object, that has a unique id.
      • getSecurityPolicy

        SecurityPolicy getSecurityPolicy()
        Returns the security policy associated with this Bayeux session
        Returns:
        SecurityPolicy
      • setSecurityPolicy

        void setSecurityPolicy(SecurityPolicy securityPolicy)
        Sets the security policy to be used in this Bayeux session
        Parameters:
        securityPolicy - SecurityPolicy
JBoss Web 7.5.12.Final-redhat-1

Copyright © 2015 JBoss by Red Hat. All rights reserved.