Examples of BindResp


Examples of ie.omk.smpp.message.BindResp

    connector.doStart();

    // open connection and bind
    Connection connection = connect(4444);

    BindResp bindResp = connection.bind(Connection.TRANSMITTER, "test", "test", null);
    Assert.assertNotNull(bindResp);
    Assert.assertEquals(bindResp.getCommandStatus(), Response.INVALID_SYSTEM_ID.getCommandStatus());

    connector.doStop();
  }
View Full Code Here

Examples of ie.omk.smpp.message.BindResp

    SmppServerConnector connector = new SmppServerConnector(configuration);
    connector.configure();
    connector.doStart();

    Connection connection = connect(4444);
    BindResp bindResp = connection.bind(Connection.TRANSMITTER, "test", "other", null);
    Assert.assertNotNull(bindResp);
    Assert.assertEquals(bindResp.getCommandStatus(), Response.INVALID_PASSWORD.getCommandStatus());

    connector.doStop();
  }
View Full Code Here

Examples of ie.omk.smpp.message.BindResp

    return connection;
  }

  private void bind(Connection connection, int type, String systemId, String password, String systemType) throws InvalidParameterValueException, AlreadyBoundException, VersionException, SMPPProtocolException, IllegalArgumentException, IOException {
    BindResp bindResp = connection.bind(Connection.TRANSMITTER, "test", "test", null);

    Assert.assertNotNull(bindResp);
    Assert.assertEquals(bindResp.getCommandStatus(), 0);
  }
View Full Code Here

Examples of ie.omk.smpp.message.BindResp

        connection.addObserver(messageListener);

        connection.bind(getConnectionType(configuration), configuration.getSystemId(), configuration.getPassword(), configuration.getSystemType(),
            getBindTON(), getBindNPI(), null);

        BindResp bindResp = messageListener.getBindResponse(configuration.getBindTimeout());
        if (bindResp == null || bindResp.getCommandStatus() != 0) {
          // close the link if no response
          if (link != null) {
            try { link.close(); } catch (Exception f) {}
          }
          throw new Exception("Bind Response failed: " + bindResp);
View Full Code Here

Examples of org.jsmpp.bean.BindResp

     
      BindCommandTask task = new BindCommandTask(pduSender(), bindType,
                systemId, password, systemType, interfaceVersion, addrTon,
                addrNpi, addressRange);
     
      BindResp resp = (BindResp)executeSendCommand(task, timeout);
    return resp.getSystemId();
  }
View Full Code Here

Examples of org.jsmpp.bean.BindResp

        BindCommandTask task = new BindCommandTask(pduSender(), bindType,
                systemId, password, systemType, interfaceVersion, addrTon,
                addrNpi, addressRange);

        BindResp resp = (BindResp)executeSendCommand(task, timeout);
        return new BindResult(resp.getSystemId(), resp.getOptionalParameters());
    }
View Full Code Here

Examples of org.jsmpp.bean.BindResp

        } catch (PDUStringException e) {
            fail("Failed composing bind response", e);
        }
       
        try {
            BindResp resp = decomposer.bindResp(b);
            assertEquals(resp.getCommandLength(), b.length);
            assertEquals(resp.getCommandId(), bindType.responseCommandId());
            assertEquals(resp.getCommandStatus(), SMPPConstant.STAT_ESME_ROK);
            assertEquals(resp.getSequenceNumber(), 1);
            assertEquals(resp.getSystemId(), systemId);
        } catch (PDUStringException e) {
            fail("Failed decomposing bind response", e);
        }
    }
View Full Code Here

Examples of org.jsmpp.bean.BindResp

     * (non-Javadoc)
     *
     * @see org.jsmpp.util.PDUDecomposer#bindResp(byte[])
     */
    public BindResp bindResp(byte[] b) throws PDUStringException {
        BindResp resp = new BindResp();
        SequentialBytesReader reader = new SequentialBytesReader(b);
        assignHeader(resp, reader);
        if (resp.getCommandLength() > 16 && resp.getCommandStatus() == 0) {
            resp.setSystemId(reader.readCString());
            StringValidator.validateString(resp.getSystemId(),
                    StringParameter.SYSTEM_ID);

            resp.setOptionalParameters(readOptionalParameters(reader));
        }
        return resp;
    }
View Full Code Here

Examples of org.jsmpp.bean.BindResp

        BindCommandTask task = new BindCommandTask(pduSender(), bindType,
                systemId, password, systemType, interfaceVersion, addrTon,
                addrNpi, addressRange);

        BindResp resp = (BindResp)executeSendCommand(task, timeout);
        return new BindResult(resp.getSystemId(), resp.getOptionalParameters());
    }
View Full Code Here

Examples of org.jsmpp.bean.BindResp

                logger.debug("Bind Response header ("
                        + pduHeader.getCommandLength() + ", "
                        + pduHeader.getCommandIdAsHex() + ", "
                        + IntUtil.toHexString(pduHeader.getCommandStatus())
                        + ", " + pduHeader.getSequenceNumber() + ")");
                BindResp resp = pduDecomposer.bindResp(pdu);
                pendingResp.done(resp);
            } catch (PDUStringException e) {
                String message = "Failed decomposing submit_sm_resp";
                logger.error(message, e);
                responseHandler.sendGenerickNack(e.getErrorCode(), pduHeader
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.