Package org.jsmpp.bean

Examples of org.jsmpp.bean.Alphabet


        super(session, config);
        this.charset = Charset.forName(config.getEncoding());
    }

    protected SmppSplitter createSplitter(Message message) {
        Alphabet alphabet = determineAlphabet(message);

        String body = message.getBody(String.class);

        SmppSplitter splitter;
        switch (alphabet) {
View Full Code Here


    protected final byte[] getShortMessage(Message message) {
        if (has8bitDataCoding(message)) {
            return message.getBody(byte[].class);
        } else {
            byte providedAlphabet = getProvidedAlphabet(message);
            Alphabet determinedAlphabet = determineAlphabet(message);
            Charset charset = determineCharset(providedAlphabet, determinedAlphabet.value());
            String body = message.getBody(String.class);
            return body.getBytes(charset);
        }
    }
View Full Code Here

    private Alphabet determineAlphabet(Message message) {
        String body = message.getBody(String.class);
        byte alphabet = getProvidedAlphabet(message);

        Alphabet alphabetObj;
        if (alphabet == SmppConstants.UNKNOWN_ALPHABET) {
            byte[] messageBytes = body.getBytes(charset);
            if (SmppUtils.isGsm0338Encodeable(messageBytes)) {
                alphabetObj = Alphabet.ALPHA_DEFAULT;
            } else {
View Full Code Here

      e.printStackTrace();
    }

    // configure variables acording to if message contains national
    // characters
    Alphabet alphabet = null;
    int maximumSingleMessageSize = 0;
    int maximumMultipartMessageSegmentSize = 0;
    byte[] byteSingleMessage = null;
    if (Gsm0338.isEncodeableInGsm0338(messageBody)) {
      byteSingleMessage = messageBody.getBytes();
View Full Code Here

      e.printStackTrace();
    }

    // configure variables acording to if message contains national
    // characters
    Alphabet alphabet = null;
    int maximumSingleMessageSize = 0;
    int maximumMultipartMessageSegmentSize = 0;
    byte[] byteSingleMessage = null;
    if (Gsm0338.isEncodeableInGsm0338(messageBody)) {
      byteSingleMessage = messageBody.getBytes();
View Full Code Here

  @Override
  public boolean sendMessage(OutboundMessage msg) throws TimeoutException,
      GatewayException, IOException, InterruptedException {
   
    Alphabet encoding=Alphabet.ALPHA_DEFAULT;
   
    switch (msg.getEncoding()){
    case ENC8BIT:
      encoding=Alphabet.ALPHA_8_BIT;
      break;
View Full Code Here

        super(session, config);
        this.charset = Charset.forName(config.getEncoding());
    }

    protected SmppSplitter createSplitter(Message message) {
        Alphabet alphabet = determineAlphabet(message);

        String body = message.getBody(String.class);

        SmppSplitter splitter;
        switch (alphabet) {
View Full Code Here

    protected final byte[] getShortMessage(Message message) {
        if (has8bitDataCoding(message)) {
            return message.getBody(byte[].class);
        } else {
            byte providedAlphabet = getProvidedAlphabet(message);
            Alphabet determinedAlphabet = determineAlphabet(message);
            Charset charset = determineCharset(providedAlphabet, determinedAlphabet.value());
            String body = message.getBody(String.class);
            return body.getBytes(charset);
        }
    }
View Full Code Here

    private Alphabet determineAlphabet(Message message) {
        String body = message.getBody(String.class);
        byte alphabet = getProvidedAlphabet(message);

        Alphabet alphabetObj;
        if (alphabet == SmppConstants.UNKNOWN_ALPHABET) {
            byte[] messageBytes = body.getBytes(charset);
            if (SmppUtils.isGsm0338Encodeable(messageBytes)) {
                alphabetObj = Alphabet.ALPHA_DEFAULT;
            } else {
View Full Code Here

    protected SubmitSm[] createSubmitSm(Exchange exchange) {
        String body = exchange.getIn().getBody(String.class);

        byte providedAlphabet = getProvidedAlphabet(exchange);
        Alphabet determinedAlphabet = determineAlphabet(exchange);
        Charset charset = determineCharset(providedAlphabet, determinedAlphabet.value());
        byte[] shortMessage = body.getBytes(charset);
       
        SubmitSm template = createSubmitSmTemplate(exchange);
        SmppSplitter splitter = createSplitter(exchange);
        byte[][] segments = splitter.split(shortMessage);
View Full Code Here

TOP

Related Classes of org.jsmpp.bean.Alphabet

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.