Package org.jsmpp.bean

Examples of org.jsmpp.bean.Command


    /* (non-Javadoc)
     * @see org.jsmpp.PDUReader#readPDUHeader(java.io.DataInputStream)
     */
    public Command readPDUHeader(DataInputStream in)
            throws InvalidCommandLengthException, IOException {
        Command header = new Command();
        header.setCommandLength(in.readInt());

        if (header.getCommandLength() < 16) {
            // command length to short, read the left dump anyway
            byte[] dump = new byte[header.getCommandLength()];
            in.read(dump, 4, header.getCommandLength() - 4);

            throw new InvalidCommandLengthException("Command length "
                    + header.getCommandLength() + " is to short");
        }
        header.setCommandId(in.readInt());
        header.setCommandStatus(in.readInt());
        header.setSequenceNumber(in.readInt());
        return header;
    }
View Full Code Here


        } catch (InvalidResponseException e) {
            pendingResponse.remove(seqNum);
            throw e;
        }
       
        Command resp = pendingResp.getResponse();
        validateResponse(resp);
        return resp;
       
    }
View Full Code Here

            logger.info("PDUReaderWorker stop");
        }
       
        private void readPDU() {
            try {
                Command pduHeader = null;
                byte[] pdu = null;

                pduHeader = pduReader.readPDUHeader(in);
                pdu = pduReader.readPDU(in, pduHeader);
               
View Full Code Here

      logger.info("PDUReaderWorker stop");
    }
   
    private void readPDU() {
          try {
              Command pduHeader = null;
              byte[] pdu = null;
             
                pduHeader = pduReader.readPDUHeader(in);
                pdu = pduReader.readPDU(in, pduHeader);
             
View Full Code Here

        new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(timemillis);
                    pendingResponse.done(new Command());
                } catch (InterruptedException e) {
                }
            }
        }.start();
    }
View Full Code Here

       
        pduSender.sendGenericNack(out, SMPPConstant.STAT_ESME_RINVBNDSTS, 10);
       
       
        DataInputStream in = new DataInputStream(new ByteArrayInputStream(out.toByteArray()));
        Command header = pduReader.readPDUHeader(in);
        assertEquals(header.getCommandId(), SMPPConstant.CID_GENERIC_NACK, "Unexpected command_id");
       
        byte[] pdu = pduReader.readPDU(in, header);
        GenericNack nack = decomposer.genericNack(pdu);
        assertNotNull(nack);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jsmpp.PDUReader#readPDUHeader(java.io.DataInputStream)
     */
    public Command readPDUHeader(DataInputStream in)
            throws InvalidCommandLengthException, IOException {
        Command header = new Command();
        header.setCommandLength(in.readInt());

        if (header.getCommandLength() < 16) {
            // command length to short, read the left dump anyway
            byte[] dump = new byte[header.getCommandLength()];
            in.read(dump, 4, header.getCommandLength() - 4);

            throw new InvalidCommandLengthException("Command length "
                    + header.getCommandLength() + " is to short");
        }
        header.setCommandId(in.readInt());
        header.setCommandStatus(in.readInt());
        header.setSequenceNumber(in.readInt());
        return header;
    }
View Full Code Here

        } catch (InvalidResponseException e) {
            pendingResponse.remove(seqNum);
            throw e;
        }
       
        Command resp = pendingResp.getResponse();
        validateResponse(resp);
        return resp;
       
    }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.jsmpp.util.PDUDecomposer#header(byte[])
     */
    public Command header(byte[] b) {
        Command pdu = new Command();
        assignHeader(pdu, b);
        return pdu;
    }
View Full Code Here

      logger.info("PDUReaderWorker stop");
    }
   
    private void readPDU() {
          try {
              Command pduHeader = null;
              byte[] pdu = null;
             
                pduHeader = pduReader.readPDUHeader(in);
                pdu = pduReader.readPDU(in, pduHeader);
             
View Full Code Here

TOP

Related Classes of org.jsmpp.bean.Command

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.