Package org.jivesoftware.smackx.workgroup.ext.notes

Examples of org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes$Provider


                else if (listener instanceof JmsListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof JmsBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if (provider instanceof JmsJcaProvider) {
                        // Jms JCA provider defaults to true
                        final JmsJcaProvider jmsJcaProvider = (JmsJcaProvider)provider ;
                        if (!jmsJcaProvider.isSetTransacted() || jmsJcaProvider.getTransacted())
                            return true ;
                    } else if (provider instanceof JmsProviderType) {
                        JmsMessageFilter filter = ((JmsListener)listener).getJmsMessageFilter() ;
                        if (filter == null)
                            filter = ((JmsBus)bus).getJmsMessageFilter() ;
                        if ((filter != null) && filter.getTransacted())
                            return true ;
                    }
                } else if (listener instanceof SqlListener) {
                    final Bus bus = model.getBus(listener.getBusidref()) ;
                    if (!(bus instanceof SqlBus))
                        continue ;

                    final Provider provider = model.getProvider(bus) ;
                    if ((provider instanceof SqlProvider) && ((SqlProvider)provider).getTransacted())
                        return true ;
                }
            }
        }
View Full Code Here


    JmsListenerDocument.JmsListener jmsListener = (JmsListener) listeners.get(0);
    assertEquals ( false, jmsListener.getIsGateway() );
   
    JmsBusDocument.JmsBus jmsBus = (JmsBusDocument.JmsBus) model.getBus( jmsListener.getBusidref() );
    assertNotNull( "JmsBus element should exist", jmsBus );
    Provider provider = model.getProvider( jmsBus );
    assertTrue( provider instanceof JmsJcaProvider );
    return (JmsJcaProvider) provider;
  }
View Full Code Here

     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

View Full Code Here

     * @param sessionID the sessionID of the chat session.
     * @return the <code>ChatNote</code> associated with a given chat session.
     * @throws XMPPException if an error occurs while retrieving the ChatNote.
     */
    public ChatNotes getNote(String sessionID) throws XMPPException {
        ChatNotes request = new ChatNotes();
        request.setType(IQ.Type.GET);
        request.setTo(workgroupJID);
        request.setSessionID(sessionID);

        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
        connection.sendPacket(request);

        ChatNotes response = (ChatNotes)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }
        return response;

    }
View Full Code Here

     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

View Full Code Here

     * @param sessionID the sessionID of the chat session.
     * @return the <code>ChatNote</code> associated with a given chat session.
     * @throws XMPPException if an error occurs while retrieving the ChatNote.
     */
    public ChatNotes getNote(String sessionID) throws XMPPException {
        ChatNotes request = new ChatNotes();
        request.setType(IQ.Type.GET);
        request.setTo(workgroupJID);
        request.setSessionID(sessionID);

        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
        connection.sendPacket(request);

        ChatNotes response = (ChatNotes)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }
        return response;

    }
View Full Code Here

     */
    public void setNote(String sessionID, String note) throws XMPPException {
        note = ChatNotes.replace(note, "\n", "\\n");
        note = StringUtils.escapeForXML(note);

        ChatNotes notes = new ChatNotes();
        notes.setType(IQ.Type.SET);
        notes.setTo(workgroupJID);
        notes.setSessionID(sessionID);
        notes.setNotes(note);
        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(notes.getPacketID()));
        // Send the request
        connection.sendPacket(notes);

        IQ response = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

View Full Code Here

     * @param sessionID the sessionID of the chat session.
     * @return the <code>ChatNote</code> associated with a given chat session.
     * @throws XMPPException if an error occurs while retrieving the ChatNote.
     */
    public ChatNotes getNote(String sessionID) throws XMPPException {
        ChatNotes request = new ChatNotes();
        request.setType(IQ.Type.GET);
        request.setTo(workgroupJID);
        request.setSessionID(sessionID);

        PacketCollector collector = connection.createPacketCollector(new PacketIDFilter(request.getPacketID()));
        connection.sendPacket(request);

        ChatNotes response = (ChatNotes)collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

        // Cancel the collector.
        collector.cancel();
        if (response == null) {
            throw new XMPPException("No response from server.");
        }
        if (response.getError() != null) {
            throw new XMPPException(response.getError());
        }
        return response;

    }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.workgroup.ext.notes.ChatNotes$Provider

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.