當前位置: 首頁>>代碼示例>>Java>>正文


Java UnbindResp類代碼示例

本文整理匯總了Java中ie.omk.smpp.message.UnbindResp的典型用法代碼示例。如果您正苦於以下問題:Java UnbindResp類的具體用法?Java UnbindResp怎麽用?Java UnbindResp使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UnbindResp類屬於ie.omk.smpp.message包,在下文中一共展示了UnbindResp類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processRequest

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Override
public void processRequest(SmppConnectionHandler handler, SMPPPacket request) throws IOException {
    log.info("User " + handler.getUser().getName() + " unbinding from server");
    UnbindResp unbindResp = new UnbindResp(convertRequest(request));
    handler.sendResponse(unbindResp);
    getSmppConnectionPool().close(handler);
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:8,代碼來源:UnbindProcessor.java

示例2: testUnbind_Ok

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testUnbind_Ok() throws Exception {
    Unbind ubd = new Unbind();
    Connection source = mock(Connection.class);
    smppEventListener.unbind(source, ubd);
    verify(source, times(1)).unbind(any(UnbindResp.class));
    verify(smsSendersManager, times(1)).closeSender(same(channel));
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:9,代碼來源:SmppEventListenerTest.java

示例3: testUnbind_SMPPRuntimeException

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testUnbind_SMPPRuntimeException() throws Exception {
    Unbind ubd = new Unbind();
    Connection source = mock(Connection.class);
    doThrow(new SMPPRuntimeException()).when(source).unbind(any(UnbindResp.class));
    smppEventListener.unbind(source, ubd);
    verify(source, times(1)).unbind(any(UnbindResp.class));
    verify(smsSendersManager, times(1)).closeSender(same(channel));
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:10,代碼來源:SmppEventListenerTest.java

示例4: testUnbind_IOException

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testUnbind_IOException() throws Exception {
    Unbind ubd = new Unbind();
    Connection source = mock(Connection.class);
    doThrow(new IOException()).when(source).unbind(any(UnbindResp.class));
    smppEventListener.unbind(source, ubd);
    verify(source, times(1)).unbind(any(UnbindResp.class));
    verify(smsSendersManager, times(1)).closeSender(same(channel));
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:10,代碼來源:SmppEventListenerTest.java

示例5: testUnbind_SMPPException

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testUnbind_SMPPException() throws Exception {
    Unbind ubd = new Unbind();
    Connection source = mock(Connection.class);
    doThrow(new SMPPException()).when(source).unbind(any(UnbindResp.class));
    smppEventListener.unbind(source, ubd);
    verify(source, times(1)).unbind(any(UnbindResp.class));
    verify(smsSendersManager, times(1)).closeSender(same(channel));
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:10,代碼來源:SmppEventListenerTest.java

示例6: testToString_SMPPResponse

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testToString_SMPPResponse() {
    UnbindResp ur = new UnbindResp();
    ur.setMessageId("000100");
    ur.setMessageStatus(3);
    ur.setFinalDate(new GregorianCalendar(2012, 4, 5).getTime());
    String result = SmppPacketUtils.toString(ur);
    assertEquals("unbind_resp[MessageId: 000100; MessageStatus: 3; FinalDate: 5/5/12 0:0:0]", result);
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:10,代碼來源:SmppPacketUtilsTest.java

示例7: unbindResponse

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Override
public void unbindResponse(Connection source, UnbindResp ubr) {
    log.debug("UnbindResponse has been received:\n" + SmppPacketUtils.toString(ubr));
    smsSendersManager.closeSender(channel);
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:6,代碼來源:SmppEventListener.java

示例8: testUnbindResponse

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
@Test
public void testUnbindResponse() {
    smppEventListener.unbindResponse(null, new UnbindResp());
    verify(smsSendersManager, times(1)).closeSender(same(channel));
}
 
開發者ID:emamedov,項目名稱:smscenter,代碼行數:6,代碼來源:SmppEventListenerTest.java

示例9: packetReceived

import ie.omk.smpp.message.UnbindResp; //導入依賴的package包/類
public void packetReceived(Connection myConnection, SMPPPacket pak) {
    switch (pak.getCommandId()) {

    // Bind transmitter response. Check it's status for success...
    case SMPPPacket.BIND_RECEIVER_RESP:
        if (pak.getCommandStatus() != 0) {
            System.out.println("Error binding to the SMSC. Error = "
                    + pak.getCommandStatus());
        } else {
            this.start = System.currentTimeMillis();
            System.out.println("Successfully bound. Waiting for message"
                    + " delivery..");
            System.out.println("(Each dot printed is 500 deliver_sm's!)");
        }
        break;

    // Submit message response...
    case SMPPPacket.DELIVER_SM:
        if (pak.getCommandStatus() != 0) {
            System.out.println("Deliver SM with an error! "
                    + pak.getCommandStatus());

        } else {
            ++msgCount;
            if (showMsgs) {
                System.out.println(Integer.toString(pak.getSequenceNum())
                        + ": \"" + ((DeliverSM) pak).getMessageText()
                        + "\"");
            } else if ((msgCount % 500) == 0) {
                System.out.print("."); // Give some feedback
            }
        }
        break;

    // Unbind request received from server..
    case SMPPPacket.UNBIND:
        this.end = System.currentTimeMillis();
        System.out.println("\nSMSC has requested unbind! Responding..");
        try {
            UnbindResp ubr = new UnbindResp((Unbind) pak);
            myConnection.sendResponse(ubr);
        } catch (IOException x) {
            x.printStackTrace(System.err);
        } finally {
            endReport();
        }
        break;

    // Unbind response..
    case SMPPPacket.UNBIND_RESP:
        this.end = System.currentTimeMillis();
        System.out.println("\nUnbound.");
        endReport();
        break;

    default:
        System.out.println("\nUnexpected packet received! Id = "
                + Integer.toHexString(pak.getCommandId()));
    }
}
 
開發者ID:umermansoor,項目名稱:java-smpp-api,代碼行數:61,代碼來源:StressClient.java


注:本文中的ie.omk.smpp.message.UnbindResp類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。