Package ie.omk.smpp.message

Examples of ie.omk.smpp.message.Bind


            int numberPlan,
            String addrRange)
    throws java.io.IOException, InvalidParameterValueException,
    IllegalArgumentException, AlreadyBoundException, VersionException,
    SMPPProtocolException {
        Bind bindReq = null;
        // Must be reset before newInstance is called.
        if (this.seqNumScheme != null) {
            this.seqNumScheme.reset();
        }
        if (!asyncComms) {
            // Ensure neither of the automatic reply settings are enabled.
            ackQryLinks = false;
            ackDeliverSm = false;
        }
        try {
            switch (type) {
            case TRANSMITTER:
                bindReq = (Bind) newInstance(SMPPPacket.BIND_TRANSMITTER);
                break;
            case RECEIVER:
                bindReq = (Bind) newInstance(SMPPPacket.BIND_RECEIVER);
                break;
            case TRANSCEIVER:
                if (this.interfaceVersion.isOlder(SMPPVersion.V34)) {
                    throw new VersionException(
                            "Cannot bind as transceiver in "
                            + interfaceVersion.toString());
                }
                bindReq = (Bind) newInstance(SMPPPacket.BIND_TRANSCEIVER);
                break;
            default:
                throw new IllegalArgumentException("No such connection type.");
            }
        } catch (BadCommandIDException x) {
            LOGGER.error("Internal error in the smppapi. Please inform the maintainer.", x);
        }

        connectionType = type;
        LOGGER.info("Binding to the SMSC as type " + type);

        bindReq.setVersion(interfaceVersion);
        bindReq.setSystemId(systemID);
        bindReq.setPassword(password);
        bindReq.setSystemType(systemType);
        bindReq.setAddressTon(typeOfNum);
        bindReq.setAddressNpi(numberPlan);
        bindReq.setAddressRange(addrRange);
        return (BindResp) sendRequestInternal(bindReq);
    }
View Full Code Here


            int numberPlan,
            String addrRange)
    throws java.io.IOException, InvalidParameterValueException,
    IllegalArgumentException, AlreadyBoundException, VersionException,
    SMPPProtocolException {
        Bind bindReq = null;

        try {
            switch (type) {
            case TRANSMITTER:
                bindReq = (Bind) newInstance(SMPPPacket.BIND_TRANSMITTER);
                break;
            case RECEIVER:
                bindReq = (Bind) newInstance(SMPPPacket.BIND_RECEIVER);
                break;
            case TRANSCEIVER:
                if (this.interfaceVersion.isOlder(SMPPVersion.V34)) {
                    throw new VersionException(
                            "Cannot bind as transceiver in "
                            + interfaceVersion.toString());
                }
                bindReq = (Bind) newInstance(SMPPPacket.BIND_TRANSCEIVER);
                break;
            default:
                throw new IllegalArgumentException("No such connection type.");
            }
        } catch (BadCommandIDException x) {
            LOGGER.error("Internal error in the smppapi. Please inform the maintainer.", x);
        }

        connectionType = type;
        LOGGER.info("Binding to the SMSC as type " + type);

        bindReq.setVersion(interfaceVersion);
        bindReq.setSystemId(systemID);
        bindReq.setPassword(password);
        bindReq.setSystemType(systemType);
        bindReq.setAddressTon(typeOfNum);
        bindReq.setAddressNpi(numberPlan);
        bindReq.setAddressRange(addrRange);
        return (BindResp) sendRequestInternal(bindReq);
    }
View Full Code Here

TOP

Related Classes of ie.omk.smpp.message.Bind

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.