Examples of IMException


Examples of hudson.plugins.im.IMException

      groupChat = new MultiUserChat(this.connection, chat.getName());
      try {
        groupChat.join(this.groupChatNick, chat.getPassword());
      } catch (XMPPException e) {
        LOGGER.warning("Cannot join group chat '" + chat + "'. Exception:\n" + ExceptionHelper.dump(e));
        throw new IMException(e);
      } catch (SmackException e) {
                LOGGER.warning("Cannot join group chat '" + chat + "'. Exception:\n" + ExceptionHelper.dump(e));
                throw new IMException(e);
            }

      // get rid of old messages:
      while (groupChat.pollMessage() != null) {
      }
View Full Code Here

Examples of hudson.plugins.im.IMException

    @Override
    public synchronized IMConnection createConnection() throws IMException {
        releaseConnection();

        if (getDescriptor() == null) {
          throw new IMException("Descriptor not set");
        }
       
        IMConnection imConnection = new JabberIMConnection((JabberPublisherDescriptor)getDescriptor(),
            getAuthenticationHolder());
        if (imConnection.connect()) {
          return imConnection;
        }
        throw new IMException("Connection failed");
    }
View Full Code Here

Examples of hudson.plugins.im.IMException

    public void sendMessage(String msg) throws IMException {
        try {
            this.chat.sendMessage(msg);
        } catch (XMPPException e) {
            throw new IMException(e);
        } catch (SmackException.NotConnectedException e) {
            throw new IMException(e);
        }
    }
View Full Code Here

Examples of hudson.plugins.im.IMException

    public void sendMessage(String msg) throws IMException {
        try {
            this.chat.sendMessage(msg);
        } catch (XMPPException e) {
            throw new IMException(e);
        } catch (SmackException.NotConnectedException e ){
            throw new IMException(e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

            Method method = sessionClass.getMethod("login", String.class, String.class);
            method.invoke(session, userID, password);
            loggedIn = true;
            loginProcessed = true;
        } catch (ClassNotFoundException e) {
            throw new IMException(EXCEPTION);
        } catch (IllegalAccessException e) {
            throw new IMException(EXCEPTION);
        } catch (InstantiationException e) {
            throw new IMException(EXCEPTION);
        } catch (NoSuchMethodException e) {
            throw new IMException(EXCEPTION);
        } catch (Exception e) {
            Throwable throwable = e.getCause();
            if (throwable!= null && "ymsg.network.LoginRefusedException".equals(throwable.getClass().getName())) {
                loggedIn = false;
                loginProcessed = true;
                throw new IMException(throwable.getMessage());
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

        if (loginProcessed && loggedIn) {
            try {
                Method method = sessionClass.getMethod("sendMessage", String.class, String.class);
                method.invoke(session, to, message);
            } catch (NoSuchMethodException e) {
                throw new IMException(EXCEPTION);
            } catch (InvocationTargetException e) {
                throw new IMException(EXCEPTION);
            } catch (IllegalAccessException e) {
                throw new IMException(EXCEPTION);
            }
        } else {
            log.error("Got to Log in before a message can be sent.");
            throw new IMException("Got to Log in before a message can be sent.");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

                Method method = sessionClass.getMethod("logout");
                method.invoke(session);
                loginProcessed = false;
                loggedIn = false;
            } catch (NoSuchMethodException e) {
                throw new IMException(EXCEPTION);
            } catch (InvocationTargetException e) {
                throw new IMException(EXCEPTION);
            } catch (IllegalAccessException e) {
                throw new IMException(EXCEPTION);
            }
        } else {
            log.error("Cannot disconnect cause the connection is not made as yet");
            throw new IMException("Cannot disconnect cause the connection is not made as yet");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

                log.error(e);
            }
        } while (!loginProcessed);

        if (!loggedIn) {
            throw new IMException("Connection was not succesfull");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

        }
    }

    public void sendMessage(String to, String message) throws IMException {
        if (disconnectCalled) {
            throw new IMException("Unable to send message cause the IM connection is been " +
                    "disconnected");
        }
        if (loginProcessed && loggedIn) {
            ImConversation imConversation = aimConnection.getIcbmService()
                    .getImConversation(new Screenname(to));
            imConversation.open();
            imConversation.addConversationListener(new AimConversationListener());
            if (imConversation.canSendMessage()) {
                messageCount++;
                imConversation.sendMessage(new SimpleMessage(message));
            } else {
                log.error("Cound not send the message to: " + to);
                throw new IMException("Cound not send the message to: " + to);
            }
            imConversation.close();
        } else {
            log.error("Got to Log in before a message can be sent.");
            throw new IMException("Got to Log in before a message can be sent.");
        }
    }
View Full Code Here

Examples of org.wso2.carbon.mashup.imwrapper.core.IMException

            if (log.isDebugEnabled()) {
                log.debug("Connection disconnected");
            }
        } else {
            log.error("Cannot disconnect cause the connection is not made as yet");
            throw new IMException("Cannot disconnect cause the connection is not made as yet");
        }


    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.