Package org.jivesoftware.smack.filter

Examples of org.jivesoftware.smack.filter.ToContainsFilter


                }
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concerns us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here


                LOG.debug("Opening private chat to " + privateChat.getParticipant());
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concerns us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here

                LOG.info("Open private chat to: " + privateChat.getParticipant());
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concers us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here

                LOG.info("Open private chat to: " + privateChat.getParticipant());
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concers us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here

                }
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concerns us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here

    }

    @Override
    protected PacketFilter createFilter()
    {
        return new ToContainsFilter(pattern);
    }
View Full Code Here

        {
            conn = new XMPPConnection(transport.getServer());
            conn.login(transport.getUsername(), transport.getPassword(), getUri());

            conn.addPacketListener(new ChannelPacketListener(transport.getXFire(), this),
                                   new ToContainsFilter(transport.getUsername()));
        }
        catch (XMPPException e)
        {
            throw new XFireException("Couldn't open channel.", e);
        }
View Full Code Here

        xmppConnection.connect();
        xmppConnection.login(serverCredentials.getAccountName()
            , serverCredentials.getPassword()
            ,serverCredentials.getResource(),
            true);
        packetFilter = new ToContainsFilter("@gmail.com");
       
      } catch (XMPPException e1) {
        log.error("Error occured while connecting to Googletalk server.",e1);
        throw new AxisFault("Error occured while connecting to Googletalk server.");
     
View Full Code Here

            ,serverCredentials.getResource(),
            true);
        //packetFilter = new AndFilter(new PacketTypeFilter(Message.class),
        //    new FromContainsFilter(XMPPConstants.GOOGLETALK_FROM));
        //packetFilter = new FromContainsFilter(XMPPConstants.GOOGLETALK_FROM);
        packetFilter = new ToContainsFilter("@gmail.com");
       
      } catch (XMPPException e1) {
        log.error("Error occured while connecting to Googletalk server.",e1);
        throw new AxisFault("Error occured while connecting to Googletalk server.");
     
View Full Code Here

                LOG.debug("Opening private chat to " + privateChat.getParticipant());
            }
        } else {
            // add the presence packet listener to the connection so we only get packets that concerns us
            // we must add the listener before creating the muc
            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
            connection.addPacketListener(this, packetFilter);

            muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
            muc.addMessageListener(this);
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.filter.ToContainsFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.