• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UnbindResp类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ErrorKeys类代码示例发布时间:2022-05-16
下一篇:
Java Amok类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap