Package org.openmim.mn

Examples of org.openmim.mn.MessagingNetworkException


  protected void serverErrorNotification(ErrorInfo ei, final String args, final Session ses, final PluginContext pctx)
  throws IOException, InterruptedException, MessagingNetworkException
  {
    //unhandled server error notifications close the connection
    MessagingNetworkException ex = Errors.createException(ei);
    close(ex.getMessage(), ex.getLogger(), ex.getEndUserReasonCode());
    throw Errors.createException(ei);
  }
View Full Code Here


  private static final Hashtable errors = new Hashtable(35);
 
  public static MessagingNetworkException createException(ErrorInfo ei)
  {
    return new MessagingNetworkException(ei.errorMessage, ei.mimExceptionLogger, ei.mimExceptionEndUserReasonCode);
  }
View Full Code Here

      this.waitForAck = b;
    }
   
    final void msgErrorReceived(int errCode)
    {
      fail(new MessagingNetworkException(
        "icq server reports: error sending message to "+dstLoginId+
        ", errorcode: "+HexUtil.toHexString0x(errCode)+".",
        MessagingNetworkException.CATEGORY_STILL_CONNECTED,
        MessagingNetworkException.ENDUSER_MESSAGING_SERVER_REPORTS_CANNOT_SEND_MESSAGE));
    }
View Full Code Here

      LoginIdUtil.checkValid_Ignorable(dstLoginId);
      dstLoginId = LoginIdUtil.normalize(dstLoginId);
      if (requireOnline)
        ASSERT_LOGGED_IN(MessagingNetworkException.ENDUSER_LOGIN_FIRST_CANNOT_PERFORM_ADD_TO_CONTACT_LIST_WHILE_OFFLINE);
      if (this.loginId.equals(dstLoginId))
        throw new MessagingNetworkException(
          "cannot add yourself to a contact list",
          MessagingNetworkException.CATEGORY_STILL_CONNECTED,
          MessagingNetworkException.ENDUSER_CANNOT_ADD_YOURSELF_TO_CONTACT_LIST);
      if (getContactListItem0(dstLoginId) != null)
      {
View Full Code Here

  public final void handleException(Throwable tr, String processName, PluginContext ctx, boolean rethrow, boolean skipShutdown)
  throws MessagingNetworkException
  {
    if (Defines.DEBUG && CAT.isEnabledFor(org.apache.log4j.Level.ERROR)) CAT.error("error while "+processName, tr);
    MessagingNetworkException ex;

    if (tr instanceof MessagingNetworkException)
    {
      ex = (MessagingNetworkException) tr;
    }
    else
    if (tr instanceof UnknownHostException)
      ex = new MessagingNetworkException(
        "DNS error resolving "+tr.getMessage(),
        MessagingNetworkException.CATEGORY_LOGGED_OFF_DUE_TO_NETWORK_ERROR,
        MessagingNetworkException.ENDUSER_LOGGED_OFF_DUE_TO_NETWORK_ERROR);
    else
    if (tr instanceof InterruptedIOException)
      ex = new MessagingNetworkException(
        "mim admin restarts the mim server.",
        MessagingNetworkException.CATEGORY_LOGGED_OFF_ON_BEHALF_OF_MESSAGING_PLUGIN_ADMIN,
        MessagingNetworkException.ENDUSER_LOGGED_OFF_ON_BEHALF_OF_MESSAGING_PLUGIN_ADMIN);
    else
    if (tr instanceof InterruptedException)
      ex = new MessagingNetworkException(
        "mim admin restarts the mim server.",
        MessagingNetworkException.CATEGORY_LOGGED_OFF_ON_BEHALF_OF_MESSAGING_PLUGIN_ADMIN,
        MessagingNetworkException.ENDUSER_LOGGED_OFF_ON_BEHALF_OF_MESSAGING_PLUGIN_ADMIN);
    else
    if (tr instanceof IOException)
      ex = new MessagingNetworkException(
        "I/O error: "+tr.getMessage(),
        MessagingNetworkException.CATEGORY_LOGGED_OFF_DUE_TO_NETWORK_ERROR,
        MessagingNetworkException.ENDUSER_LOGGED_OFF_DUE_TO_NETWORK_ERROR);
    else
    if (tr instanceof AssertException)
      ex = new MessagingNetworkException(
        "bug found: "+tr.getMessage(),
        MessagingNetworkException.CATEGORY_NOT_CATEGORIZED,
        MessagingNetworkException.ENDUSER_MIM_BUG);
    else
    if (tr instanceof ArrayIndexOutOfBoundsException)
      ex = new MessagingNetworkException(
        tr.toString(),
        MessagingNetworkException.CATEGORY_STILL_CONNECTED,
        MessagingNetworkException.ENDUSER_PROTOCOL_ERROR_NOT_LOGGED_OFF);
    else
      ex = new MessagingNetworkException(
        "unknown error: "+tr.getMessage(),
        MessagingNetworkException.CATEGORY_NOT_CATEGORIZED,
        MessagingNetworkException.ENDUSER_MIM_BUG_UNKNOWN_ERROR);

    if (ex.getLogger() != MessagingNetworkException.CATEGORY_STILL_CONNECTED)
    {
      setLastError(ex);
      if (!skipShutdown)
        shutdown(ctx, lastError.getLogger(), lastError.getMessage(), lastError.getEndUserReasonCode());
      if (rethrow)
        throw new MessagingNetworkException(
          "Error while " + processName + ": " + lastError.getMessage(),
          lastError.getLogger(),
          lastError.getEndUserReasonCode());
    }
    else
    {
      if (rethrow)
        throw new MessagingNetworkException(
          "Error while " + processName + ": " + ex.getMessage(),
          ex.getLogger(),
          ex.getEndUserReasonCode());
    }
  }
View Full Code Here

  void setLastError(String exceptionMessage, int reasonLogger, int endUserReasonCode)
  {
    synchronized (lastErrorLock)
    {
      if (lastError == null)
        lastError = new MessagingNetworkException(exceptionMessage, reasonLogger, endUserReasonCode);
    }
  }
View Full Code Here

  throws MessagingNetworkException
  {
    synchronized (lastErrorLock)
    {
      if (lastError == null)
        lastError = new MessagingNetworkException(exceptionMessage, reasonLogger, endUserReasonCode);
      throw new MessagingNetworkException(lastError.getMessage(), lastError.getLogger(), lastError.getEndUserReasonCode());
    }
  }
View Full Code Here

  throws MessagingNetworkException
  {
    synchronized (lastErrorLock)
    {
      if ((lastError) == null) Lang.ASSERT_NOT_NULL(lastError, "lastError");
      throw new MessagingNetworkException(lastError.getMessage(), lastError.getLogger(), lastError.getEndUserReasonCode());
    }
  }
View Full Code Here

    }
    catch (ArrayIndexOutOfBoundsException ex1)
    {
      log("login() finished (failed)");
      if (Defines.DEBUG && CAT.isEnabledFor(org.apache.log4j.Level.ERROR)) CAT.error("", ex1);
      handleException(new MessagingNetworkException(
        "unknown error: "+ex1,
        MessagingNetworkException.CATEGORY_NOT_CATEGORIZED,
        MessagingNetworkException.ENDUSER_MIM_BUG_UNKNOWN_ERROR), "login", ctx);
    }
    catch (Exception ex)
View Full Code Here

      LoginIdUtil.checkValid_Ignorable(dstLoginId);
      dstLoginId = LoginIdUtil.normalize(dstLoginId);
      ASSERT_LOGGED_IN(MessagingNetworkException.ENDUSER_LOGIN_FIRST_CANNOT_PERFORM_SEND_TEXT_MESSAGE_WHILE_OFFLINE);
      if ((text) == null) Lang.ASSERT_NOT_NULL(text, "text");
      if (this.loginId.equals(dstLoginId))
        throw new MessagingNetworkException(
          "cannot send msg to yourself",
          MessagingNetworkException.CATEGORY_STILL_CONNECTED,
          MessagingNetworkException.ENDUSER_PROTOCOL_ERROR_NOT_LOGGED_OFF);
/*
      //the following check is removed since:
View Full Code Here

TOP

Related Classes of org.openmim.mn.MessagingNetworkException

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.