Package com.volantis.mps.message

Examples of com.volantis.mps.message.MessageException


        String theMessage = message.getMessage();

        // Check the message length.
        if (theMessage.length() > 160) {
            throw new MessageException(
                    localizer.format("message-too-long",
                                       new Integer(theMessage.length())));
        }
       
        if(SMSCSupportsMulti) {
View Full Code Here


            // send the request
            request.assignSequenceNumber(false);
        } catch (Exception e) {
            final String messageKey = "message-submit-failure";
            LOGGER.warn(messageKey);
            throw new MessageException(localizer.format(messageKey), e);
        }

        int numberOfDestinations = message.getDestinationCount();
        final List failedRecipients = new LinkedList();
        // if we have multiple message destinations we need to send it
View Full Code Here

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Submit response " + response.debugString());
            }
            if (response.getCommandStatus() != Data.ESME_ROK) {
                throw new MessageException(
                    localizer.format("message-submit-failure"));
            }
        } catch (MessageException e) {
            // don't wrap MessageExceptions
            throw e;
        } catch (Exception e) {
            final String messageKey = "message-submit-failure";
            LOGGER.warn(messageKey);
            throw new MessageException(
                    localizer.format(messageKey), e);
        }
    }
View Full Code Here

                            int defaultValue) throws MessageException {
        final String tmp = (String)channelInfo.get(argumentName);
        int value;
        if (tmp == null) {
            if (required) {
                throw new MessageException(localizer.format(
                        "missing-channel-argument", argumentName));
            } else {
                value = defaultValue;
            }
        } else {
            try {
                value = Integer.parseInt(tmp);
            } catch (NumberFormatException nfe) {
                throw new MessageException(localizer.format(
                        "invalid-integer-channel-argument",
                        new Object[]{argumentName, tmp}));
            }
        }
        return value;
View Full Code Here

                    logger.debug( "Setting Base URI "
                                        + baseURI.toExternalForm() );
                }
                pipelineContext.pushBaseURI( baseURI.toExternalForm() );
            } catch( MalformedURLException e ) {
                throw new MessageException( e );
            }
            reader.parse( new InputSource( new StringReader( messageXML ) ) );

            MPSApplicationContext applicationContext =
                 (MPSApplicationContext)ContextInternals.getApplicationContext(
                                                               requestContext );

            applicationContext.getAssetMap();

            // set charset type for content
            String contentType = getContentTypeHeader(
                                        internalResponse.getContentType(),
                                        characterEncoding);


            rawMessage = new ProtocolIndependentMessage(
                    internalResponse.getResponseAsString(),
                    contentType,
                    applicationContext.getAssetMap(),
                    characterEncoding);
            rawMessage.setBaseURL( new URL( baseUrl ) );
            rawMessage.setMaxFileSize( applicationContext.getMaxFileSize() );
            rawMessage.setMaxMMSize( applicationContext.getMaxMMSize() );

            requestContext.release();
        } catch (SAXException se) {
            Exception cause = se.getException();
            // Check the root cause of the SAXException, as it may not be
            // logged correctly.
            if (cause != null) {
                logger.error("sax-exception-caught", cause);
            }
            throw new MessageException(
                    localizer.format("error-parsing-xdime"),
                    se);
        } catch (Throwable e) {
            throw new MessageException(e);
        }

        return rawMessage;
    }
View Full Code Here

                rawMessage.setMaxFileSize(
                                getMaxFileSizeFromHeaders( responseHeaders ) );
                rawMessage.setMaxMMSize(
                                getMaxMMSizeFromHeaders( responseHeaders ) );
            } else {
                throw new MessageException(
                        localizer.format( "mcs-server-unknown-error",
                        new Integer( responseHeaders.getErrorCode() ) ) );
            }
        } catch( Exception e ) {
            throw new MessageException( e );
        }
        return rawMessage;
    }
View Full Code Here

                }

            }
        }
        catch(Exception e) {
            throw new MessageException(e.getMessage());
        }

    }
View Full Code Here

                }
            }
        } catch (Exception e) {
            final String messageKey = "smsc-unbind-error";
            LOGGER.error(messageKey);
            throw new MessageException(
                    EXCEPTION_LOCALIZER.format(messageKey), e);
        }
    }
View Full Code Here

                        SMSCBindType);
            }
        } catch (Exception e) {
            final String messageKey = "smsc-bind-error";
            LOGGER.fatal(messageKey, e);
            throw new MessageException(
                    EXCEPTION_LOCALIZER.format(messageKey), e);
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.mps.message.MessageException

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.