Package org.jivesoftware.openfire.session

Examples of org.jivesoftware.openfire.session.ClientSession


            // There is nothing to do here. Just return.
            return;
        }

        // Get the client session of the user that sent the IQ version response
        ClientSession session = sessionManager.getSession(iq.getFrom());
        if (session == null) {
            // Do nothing if the session no longer exists
            return;
        }
View Full Code Here


    }

    @Override
  public Packet doAction(Packet packet) throws PacketRejectedException {
        SessionManager sessionManager = SessionManager.getInstance();
        ClientSession clientSession = sessionManager.getSession(packet.getFrom());
        Packet rejectPacket;
        String pfFrom = JiveGlobals.getProperty("pf.From", "packetfilter");


        if (packet instanceof Message) {
            Message in = (Message) packet.createCopy();
            if (clientSession != null && in.getBody() != null) {

                in.setFrom(new JID(pfFrom));
                String rejectMessage = JiveGlobals.getProperty("pf.rejectMessage", "Your message was rejected by the packet filter");
                in.setBody(rejectMessage);
                in.setType(Message.Type.error);
                in.setTo(packet.getFrom());
                String rejectSubject = JiveGlobals.getProperty("pf.rejectSubject", "Rejected");
                in.setSubject(rejectSubject);
                clientSession.process(in);

            }

        } else if (packet instanceof Presence) {
            rejectPacket = new Presence();
View Full Code Here

TOP

Related Classes of org.jivesoftware.openfire.session.ClientSession

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.